本文整理汇总了PHP中chatBoxSession函数的典型用法代码示例。如果您正苦于以下问题:PHP chatBoxSession函数的具体用法?PHP chatBoxSession怎么用?PHP chatBoxSession使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了chatBoxSession函数的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: startChatSession
function startChatSession()
{
$items = '';
if (!empty($_SESSION['openChatBoxes'])) {
foreach ($_SESSION['openChatBoxes'] as $chatbox => $void) {
$items .= chatBoxSession($chatbox);
}
}
if ($items != '') {
$items = substr($items, 0, -1);
}
header('Content-type: application/json');
?>
{
"username": "<?php
echo $_SESSION['username'];
?>
",
"items": [
<?php
echo $items;
?>
]
}
<?php
exit(0);
}
示例2: startChatSession
function startChatSession()
{
$items = '';
if (!empty($_SESSION['openChatBoxes'])) {
foreach ($_SESSION['openChatBoxes'] as $chatbox => $void) {
$items .= chatBoxSession($chatbox);
}
}
if ($items != '') {
$items = substr($items, 0, -1);
}
/*
$suser=$_SESSION['user_id'];
$sc=mysql_query("select _user from dsb_user_profiles where _user='$su'");
while($row_sc=mysql_fetch_array($sc))
{
$_SESSION['current_chat__user']=$row_sc['_user'];
}*/
?>
{
"_user": "<?php
echo $_SESSION['user_id'];
?>
",
"items": [
<?php
echo $items;
?>
]
}
<?php
exit(0);
}
示例3: startChatSession
function startChatSession()
{
global $dbmain;
$items = '';
if (!empty($_SESSION['openChatBoxes'])) {
foreach ($_SESSION['openChatBoxes'] as $chatbox => $void) {
$items .= chatBoxSession($chatbox);
}
}
if ($items != '') {
$items = substr($items, 0, -1);
}
$typec = getTypeC();
$nombre_chat = getNombreChat();
$sql = sqlite_query($dbmain, "INSERT OR REPLACE INTO tbchat_session values ('" . md5($nombre_chat) . "','" . $nombre_chat . "','" . $typec . "','" . strtotime("now") . "')");
header('Content-type: application/json');
?>
{
"id_chat": "<?php
echo md5($nombre_chat);
?>
",
"username": "<?php
echo $nombre_chat;
?>
",
"items": [
<?php
echo $items;
?>
]
}
<?php
exit(0);
}
示例4: startChatSession
function startChatSession() {
global $xoopsUser;
$items = '';
if (!empty($_SESSION['openChatBoxes'])) {
foreach ($_SESSION['openChatBoxes'] as $chatbox => $void) {
$items .= chatBoxSession($chatbox);
}
}
if ($items != '') {
$items = substr($items, 0, -1);
}
$user=$xoopsUser->uname();
$avatar =$xoopsUser->getVar('user_avatar');
if ($avatar!='blank.gif') {
$avatarURL = XOOPS_URL."/uploads/".$avatar;
} else {
$avatarURL = XOOPS_URL."/modules/xim/images/default_avatar.png";
}
$message = <<<EOD
{"username":"$user","avatar":"$avatarURL","items":[
$items]}
EOD;
header('Content-type: application/json');
print($message);
exit(0);
}