Zeile 233 | Zeile 233 |
---|
}
$timesearch = TIME_NOW - $mybb->settings['wolcutoff'];
|
}
$timesearch = TIME_NOW - $mybb->settings['wolcutoff'];
|
$comma = '';
| |
$guestcount = $membercount = $botcount = $anoncount = 0;
|
$guestcount = $membercount = $botcount = $anoncount = 0;
|
$onlinemembers = ''; $doneusers = array();
| $doneusers = $onlinemembers = $onlinebots = array();
$query = $db->simple_select("sessions", "COUNT(DISTINCT ip) AS guestcount", "uid = 0 AND time > $timesearch"); $guestcount = $db->fetch_field($query, "guestcount");
|
$query = $db->query("
|
$query = $db->query("
|
SELECT s.sid, s.ip, s.uid, s.time, s.location, u.username, u.invisible, u.usergroup, u.displaygroup FROM ".TABLE_PREFIX."sessions s LEFT JOIN ".TABLE_PREFIX."users u ON (s.uid=u.uid) WHERE s.time>'$timesearch'
| SELECT s.sid, s.ip, s.uid, s.time, s.location, u.username, u.invisible, u.usergroup, u.displaygroup FROM ".TABLE_PREFIX."sessions s LEFT JOIN ".TABLE_PREFIX."users u ON (s.uid=u.uid) WHERE (s.uid != 0 OR SUBSTR(s.sid,4,1) = '=') AND s.time > $timesearch
|
ORDER BY {$order_by}, {$order_by2} ");
|
ORDER BY {$order_by}, {$order_by2} ");
|
| // Fetch spiders $spiders = $cache->read('spiders');
|
while($user = $db->fetch_array($query)) {
// Create a key to test if this user is a search bot. $botkey = my_strtolower(str_replace("bot=", '', $user['sid']));
|
while($user = $db->fetch_array($query)) {
// Create a key to test if this user is a search bot. $botkey = my_strtolower(str_replace("bot=", '', $user['sid']));
|
if($user['uid'] == "0") { ++$guestcount; } elseif(my_strpos($user['sid'], "bot=") !== false && $session->bots[$botkey]) { // The user is a search bot. $onlinemembers .= $comma.format_name($session->bots[$botkey], $session->botgroup); $comma = $lang->comma; ++$botcount; } else
| if($user['uid'] > 0)
|
{ if(empty($doneusers[$user['uid']]) || $doneusers[$user['uid']] < $user['time']) {
| { if(empty($doneusers[$user['uid']]) || $doneusers[$user['uid']] < $user['time']) {
|
Zeile 270 | Zeile 267 |
---|
$doneusers[$user['uid']] = $user['time'];
// If the user is logged in anonymously, update the count for that.
|
$doneusers[$user['uid']] = $user['time'];
// If the user is logged in anonymously, update the count for that.
|
if($user['invisible'] == 1) {
| if($user['invisible'] == 1) {
|
++$anoncount; }
| ++$anoncount; }
|
Zeile 280 | Zeile 277 |
---|
$invisiblemark = "*"; } else
|
$invisiblemark = "*"; } else
|
{
| {
|
$invisiblemark = '';
|
$invisiblemark = '';
|
}
| }
|
if(($user['invisible'] == 1 && ($mybb->usergroup['canviewwolinvis'] == 1 || $user['uid'] == $mybb->user['uid'])) || $user['invisible'] != 1) { $user['username'] = format_name(htmlspecialchars_uni($user['username']), $user['usergroup'], $user['displaygroup']); $user['profilelink'] = get_profile_link($user['uid']);
|
if(($user['invisible'] == 1 && ($mybb->usergroup['canviewwolinvis'] == 1 || $user['uid'] == $mybb->user['uid'])) || $user['invisible'] != 1) { $user['username'] = format_name(htmlspecialchars_uni($user['username']), $user['usergroup'], $user['displaygroup']); $user['profilelink'] = get_profile_link($user['uid']);
|
eval("\$onlinemembers .= \"".$templates->get("portal_whosonline_memberbit", 1, 0)."\";"); $comma = $lang->comma;
| eval("\$onlinemembers[] = \"".$templates->get("portal_whosonline_memberbit", 1, 0)."\";");
|
} } }
|
} } }
|
| elseif(my_strpos($user['sid'], 'bot=') !== false && $spiders[$botkey]) { // The user is a search bot. if($mybb->settings['wolorder'] == 'username') { $key = $spiders[$botkey]['name']; } else { $key = $user['time']; }
$onlinebots[$key] = format_name($spiders[$botkey]['name'], $spiders[$botkey]['usergroup']); ++$botcount; } }
if($mybb->settings['wolorder'] == 'activity') { // activity ordering is DESC, username is ASC krsort($onlinebots); } else { ksort($onlinebots); }
$onlinemembers = array_merge($onlinebots, $onlinemembers); if(!empty($onlinemembers)) { $comma = $lang->comma." "; $onlinemembers = implode($comma, $onlinemembers); } else { $onlinemembers = "";
|
}
$onlinecount = $membercount + $guestcount + $botcount;
| }
$onlinecount = $membercount + $guestcount + $botcount;
|
Zeile 355 | Zeile 387 |
---|
LIMIT 0, ".$mybb->settings['portal_showdiscussionsnum'] ); while($thread = $db->fetch_array($query))
|
LIMIT 0, ".$mybb->settings['portal_showdiscussionsnum'] ); while($thread = $db->fetch_array($query))
|
{
| {
|
$forumpermissions[$thread['fid']] = forum_permissions($thread['fid']);
// Make sure we can view this thread if(isset($forumpermissions[$thread['fid']]['canonlyviewownthreads']) && $forumpermissions[$thread['fid']]['canonlyviewownthreads'] == 1 && $thread['uid'] != $mybb->user['uid'])
|
$forumpermissions[$thread['fid']] = forum_permissions($thread['fid']);
// Make sure we can view this thread if(isset($forumpermissions[$thread['fid']]['canonlyviewownthreads']) && $forumpermissions[$thread['fid']]['canonlyviewownthreads'] == 1 && $thread['uid'] != $mybb->user['uid'])
|
{
| {
|
continue;
|
continue;
|
}
| }
|
$lastpostdate = my_date('relative', $thread['lastpost']);
|
$lastpostdate = my_date('relative', $thread['lastpost']);
|
$lastposter = htmlspecialchars_uni($thread['lastposter']);
| if(!$thread['lastposteruid'] && !$thread['lastposter']) { $lastposter = htmlspecialchars_uni($lang->guest); } else { $lastposter = htmlspecialchars_uni($thread['lastposter']); }
|
$thread['replies'] = my_number_format($thread['replies']); $thread['views'] = my_number_format($thread['views']);
| $thread['replies'] = my_number_format($thread['replies']); $thread['views'] = my_number_format($thread['views']);
|
Zeile 375 | Zeile 414 |
---|
$lastposterlink = $lastposter; } else
|
$lastposterlink = $lastposter; } else
|
{
| {
|
$lastposterlink = build_profile_link($lastposter, $thread['lastposteruid']); }
| $lastposterlink = build_profile_link($lastposter, $thread['lastposteruid']); }
|
Zeile 393 | Zeile 432 |
---|
$thread['forumname'] = $forum_cache[$thread['fid']]['name']; eval("\$threadlist .= \"".$templates->get("portal_latestthreads_thread")."\";"); $altbg = alt_trow();
|
$thread['forumname'] = $forum_cache[$thread['fid']]['name']; eval("\$threadlist .= \"".$templates->get("portal_latestthreads_thread")."\";"); $altbg = alt_trow();
|
}
| }
|
if($threadlist) { // Show the table only if there are threads eval("\$latestthreads = \"".$templates->get("portal_latestthreads")."\";");
|
if($threadlist) { // Show the table only if there are threads eval("\$latestthreads = \"".$templates->get("portal_latestthreads")."\";");
|
}
| }
|
}
$announcements = '';
| }
$announcements = '';
|
Zeile 421 | Zeile 460 |
---|
unset($fid);
$announcementsfids = implode(',', $fid_array);
|
unset($fid);
$announcementsfids = implode(',', $fid_array);
|
|
|
$annfidswhere = " AND t.fid IN ($announcementsfids)"; } }
| $annfidswhere = " AND t.fid IN ($announcementsfids)"; } }
|
Zeile 430 | Zeile 469 |
---|
foreach($forum_cache as $fid => $f) { if(empty($fid_array) || (is_array($fid_array) && in_array($fid, $fid_array)))
|
foreach($forum_cache as $fid => $f) { if(empty($fid_array) || (is_array($fid_array) && in_array($fid, $fid_array)))
|
{
| {
|
$forum[$fid] = $f; } }
| $forum[$fid] = $f; } }
|
Zeile 503 | Zeile 542 |
---|
while($attachment = $db->fetch_array($query)) { $attachcache[$attachment['pid']][$attachment['aid']] = $attachment;
|
while($attachment = $db->fetch_array($query)) { $attachcache[$attachment['pid']][$attachment['aid']] = $attachment;
|
}
| }
|
}
if(is_array($forum))
| }
if(is_array($forum))
|
Zeile 530 | Zeile 569 |
---|
if(isset($forumpermissions[$announcement['fid']]['canonlyviewownthreads']) && $forumpermissions[$announcement['fid']]['canonlyviewownthreads'] == 1 && $announcement['uid'] != $mybb->user['uid']) { continue;
|
if(isset($forumpermissions[$announcement['fid']]['canonlyviewownthreads']) && $forumpermissions[$announcement['fid']]['canonlyviewownthreads'] == 1 && $announcement['uid'] != $mybb->user['uid']) { continue;
|
}
| }
|
$announcement['message'] = $posts[$announcement['tid']]['message']; $announcement['pid'] = $posts[$announcement['tid']]['pid'];
| $announcement['message'] = $posts[$announcement['tid']]['message']; $announcement['pid'] = $posts[$announcement['tid']]['pid'];
|
Zeile 538 | Zeile 577 |
---|
$announcement['threadlink'] = get_thread_link($announcement['tid']); $announcement['forumlink'] = get_forum_link($announcement['fid']); $announcement['forumname'] = $forum_cache[$announcement['fid']]['name'];
|
$announcement['threadlink'] = get_thread_link($announcement['tid']); $announcement['forumlink'] = get_forum_link($announcement['fid']); $announcement['forumname'] = $forum_cache[$announcement['fid']]['name'];
|
| |
$announcement['username'] = htmlspecialchars_uni($announcement['username']);
|
$announcement['username'] = htmlspecialchars_uni($announcement['username']);
|
$announcement['threadusername'] = htmlspecialchars_uni($announcement['threadusername']);
| if(!$announcement['uid'] && !$announcement['threadusername']) { $announcement['threadusername'] = htmlspecialchars_uni($lang->guest); } else { $announcement['threadusername'] = htmlspecialchars_uni($announcement['threadusername']); }
|
if($announcement['uid'] == 0) {
| if($announcement['uid'] == 0) {
|
Zeile 593 | Zeile 638 |
---|
$plugins->run_hooks("portal_announcement");
$parser_options = array(
|
$plugins->run_hooks("portal_announcement");
$parser_options = array(
|
"allow_html" => $forum[$announcement['fid']]['allowhtml'],
| "allow_html" => $mybb->settings['announcementshtml'] && $forum[$announcement['fid']]['allowhtml'],
|
"allow_mycode" => $forum[$announcement['fid']]['allowmycode'], "allow_smilies" => $forum[$announcement['fid']]['allowsmilies'], "allow_imgcode" => $forum[$announcement['fid']]['allowimgcode'],
| "allow_mycode" => $forum[$announcement['fid']]['allowmycode'], "allow_smilies" => $forum[$announcement['fid']]['allowsmilies'], "allow_imgcode" => $forum[$announcement['fid']]['allowimgcode'],
|