«Project JJ»

PHPEND; $user = CheckAnyLogin($_REQUEST['userid'], $_REQUEST['chatid']); $output .= << PHPEND; $cat = ''; if ($_REQUEST['cat']) $cat = "&cat={$_REQUEST['cat']}"; $output .= '#, "; $output .= 'A-E, "; $output .= 'F-K, "; $output .= 'L-P, "; $output .= 'R-V, "; $output .= 'W-Z, "; $output .= <<All
{$GLOBALS['strings']['menu']['searchterms']}
PHPEND; $rez = SQL_Query("SELECT id,shortdesc FROM {$GLOBALS['sql_prefix']}categories ORDER BY ordering ASC", NULL); $num = SQL_NumRows($rez); if ($num > 0) { $output .= '
'.$GLOBALS['strings']['menu']['category'].'

({$GLOBALS['strings']['menu']['search_advanced']})

{$GLOBALS['strings']['menu']['quickpanel']}
PHPEND; //$user = CheckAnyLogin(); if ($user) { $output .= <<
PHPEND; if (empty($user['parent'])) $user['parent'] = 0; $mcnt = 0; $rez = SQL_Query("SELECT count(*) as mcnt FROM {$GLOBALS['sql_prefix']}messages WHERE (recipient={$user['id']} OR recipient={$user['parent']}) AND status='unread'", $rez); $mcnt = SQL_FetchAssoc($rez); $mcnt = $mcnt['mcnt']+0; $msgs = array(); $rez = SQL_SingleQuery("SELECT id,topic FROM {$GLOBALS['sql_prefix']}messages WHERE (recipient={$user['id']} OR recipient={$user['parent']}) AND status='unread' ORDER BY posttime DESC LIMIT 5", $rez); $num = SQL_NumRows($rez); for($i=0;$i<$num;$i++) { $row = SQL_FetchAssoc($rez, $i); $row['topic'] = UTF8Entities(TruncateString($row['topic'], $GLOBALS['menu_cutoff_at'])); $msgs[] = $row; } SQL_FreeResult($rez); $recent = array(); if ($_SESSION['storage']['recent']['last'] < time()-300) { $rez = SQL_SingleQuery("SELECT chats.path as path, chats.title as title FROM {$GLOBALS['sql_prefix']}userrecent as recent JOIN {$GLOBALS['sql_prefix']}chats as chats ON recent.chat=chats.id WHERE (recent.userid={$user['id']} OR recent.userid={$user['parent']}) ORDER BY recent.stamp DESC LIMIT 5", NULL); $num = SQL_NumRows($rez); for($i=0;$i<$num;$i++) { $row = SQL_FetchAssoc($rez, $i); $row['title'] = UTF8Entities(TruncateString($row['title'], $GLOBALS['menu_cutoff_at'])); $recent[] = $row; } SQL_FreeResult($rez); $_SESSION['storage']['recent']['data'] = $recent; $_SESSION['storage']['recent']['last'] = time(); } else { $recent = $_SESSION['storage']['recent']['data']; } $books = array(); if ($_SESSION['storage']['bookmark']['last'] < time()-300) { $rez = SQL_SingleQuery("SELECT chats.path as path, chats.title as title FROM {$GLOBALS['sql_prefix']}userbook as books JOIN {$GLOBALS['sql_prefix']}chats as chats ON books.chat=chats.id WHERE (books.userid={$user['id']} OR books.userid={$user['parent']}) ORDER BY books.rating DESC LIMIT 5", NULL); $num = SQL_NumRows($rez); for($i=0;$i<$num;$i++) { $row = SQL_FetchAssoc($rez, $i); $row['title'] = UTF8Entities(TruncateString($row['title'], $GLOBALS['menu_cutoff_at'])); $books[] = $row; } SQL_FreeResult($rez); $_SESSION['storage']['bookmark']['data'] = $books; $_SESSION['storage']['bookmark']['last'] = time(); } else { $books = $_SESSION['storage']['bookmark']['data']; } $friends = array(); if ($_SESSION['storage']['friends']['last'] < time()-300) { $rez = SQL_SingleQuery("SELECT DISTINCT flist.name,flist.id FROM (SELECT users.username as name,users.id as id FROM ({$GLOBALS['sql_prefix']}userfriends as friends JOIN {$GLOBALS['sql_prefix']}users as users ON ((friends.friend=users.id OR friends.friend=users.parent) AND (users.prefs IS NULL OR users.prefs NOT LIKE '%f%'))) JOIN {$GLOBALS['sql_prefix']}online as online ON (users.id=online.uid OR users.parent=online.uid) WHERE (friends.userid={$user['id']} OR friends.userid={$user['parent']}) ORDER BY online.utime DESC) as flist LIMIT 5", NULL); $num = SQL_NumRows($rez); for($i=0;$i<$num;$i++) { $row = SQL_FetchAssoc($rez, $i); $row['name'] = UTF8Entities(TruncateString($row['name'], $GLOBALS['menu_cutoff_at'])); $friends[] = $row; } SQL_FreeResult($rez); $_SESSION['storage']['friends']['data'] = $friends; $_SESSION['storage']['friends']['last'] = time(); } else { $friends = $_SESSION['storage']['friends']['data']; } $output .= " Messages:
"; if (empty($msgs)) { $output .= '  - None
'; } else { foreach($msgs as $msg) $output .= "  - {$msg['topic']}
"; if ($mcnt > 5) { $mcnt -= 5; $output .= '  - ...'.$mcnt.' more...
'; } } $output .= " Bookmarks:
"; if (empty($books)) { $output .= '  - None
'; } else { foreach($books as $chat) $output .= "  - {$chat['title']}
"; } $output .= " Friends:
"; if (empty($friends)) { $output .= '  - None
'; } else { foreach($friends as $friend) $output .= "  - {$friend['name']}
"; } $output .= " Recent Chats:
"; if (empty($recent)) { $output .= '  - None
'; } else { foreach($recent as $chat) $output .= "  - {$chat['title']}
"; } $output .= <<
Log out PHPEND; } else { $output .= <<
Name:

Password:


Auto:

Register
PHPEND; // } $output .= << PHPEND; return $output; } function DisplayRightMenu() { $output = ''; $user = CheckAnyLogin($_REQUEST['userid'], $_REQUEST['chatid']); // $loc = UTF8Entities($_SERVER['QUERY_STRING']); $output .= << ¿ Help ?

PHPEND; if ($user) { if (empty($_REQUEST['s']) || ($_REQUEST['s'] == 'user')) { $dname = UTF8Entities(TruncateString($user['username'], 13)); $output .= <<User CPanel
{$dname}


PHPEND; } if ($_REQUEST['s'] == 'chat') { //  - Set New
$output .= <<Chat CPanel


PHPEND; } if ($_REQUEST['s'] == 'image') { $output .= <<Image Server

 Browse
 - All
 - User
 - Chat
 Upload
 Manage
 - All
 - User
 - Chat

PHPEND; } $chats = array(); if ($_SESSION['storage']['chats']['last'] < time()-300) { $chats = GetChatsOwnedBy(); $_SESSION['storage']['chats']['data'] = $chats; $_SESSION['storage']['chats']['last'] = time(); } else { $chats = $_SESSION['storage']['chats']['data']; } if (!empty($chats)) { $output .= <<Your Chats
Click to manage

PHPEND; foreach($chats as $key => $chat) { $chat['title'] = UTF8Entities(TruncateString($chat['title'], $GLOBALS['menu_cutoff_at'])); $output .= " {$chat['title']}
"; } $output .= <<
PHPEND; } $names = GetNamesOwnedBy(); foreach($names as $key => $val) { $names[$key]['username'] = UTF8Entities(TruncateString($names[$key]['username'], $GLOBALS['menu_cutoff_at'])); } if (!empty($names)) { $output .= <<Your Names
Click to manage

PHPEND; foreach($names as $key => $name) { $output .= " {$name['username']}
"; } $output .= <<
PHPEND; } } $output .= <<Links

PHPEND; return $output; } ?>