Vergleich portal.php - 1.8.16 - 1.8.33

  Keine Änderungen   Hinzugefügt   Modifiziert   Entfernt
Zeile 217Zeile 217
	eval("\$search = \"".$templates->get("portal_search")."\";");
}


	eval("\$search = \"".$templates->get("portal_search")."\";");
}


 
$onlinecount = null;

$whosonline = '';
// Get the online users
if($mybb->settings['portal_showwol'] != 0 && $mybb->usergroup['canviewonline'] != 0)

$whosonline = '';
// Get the online users
if($mybb->settings['portal_showwol'] != 0 && $mybb->usergroup['canviewonline'] != 0)

Zeile 234Zeile 235

$timesearch = TIME_NOW - $mybb->settings['wolcutoff'];
$guestcount = $membercount = $botcount = $anoncount = 0;


$timesearch = TIME_NOW - $mybb->settings['wolcutoff'];
$guestcount = $membercount = $botcount = $anoncount = 0;

	$onlinemembers = $onlinebots = $comma = '';
$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))

	// 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']));


		// 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 && $spiders[$botkey])
{
// The user is a search bot.
$onlinebots .= $comma.format_name($spiders[$botkey]['name'], $spiders[$botkey]['usergroup']);
$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 276Zeile 271
				if($user['invisible'] == 1)
{
++$anoncount;

				if($user['invisible'] == 1)
{
++$anoncount;

				}

				}


if($user['invisible'] == 1)
{
$invisiblemark = "*";


if($user['invisible'] == 1)
{
$invisiblemark = "*";

				}

				}

				else
{
$invisiblemark = '';

				else
{
$invisiblemark = '';

Zeile 291Zeile 286
				{
$user['username'] = format_name(htmlspecialchars_uni($user['username']), $user['usergroup'], $user['displaygroup']);
$user['profilelink'] = get_profile_link($user['uid']);

				{
$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)."\";");


				}

				}

			}
}
}

if(trim($onlinebots) == "" || trim($onlinemembers) == "")
{
$comma = "";
}




























			}
}
elseif(my_strpos($user['sid'], 'bot=') !== false && $spiders[$botkey] && $mybb->settings['woldisplayspiders'] == 1)
{
// 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
{

	else
{

		$comma = $lang->comma;

		$onlinemembers = "";

	}

	}


$onlinemembers = $onlinebots.$comma.$onlinemembers;

 

$onlinecount = $membercount + $guestcount + $botcount;



$onlinecount = $membercount + $guestcount + $botcount;


Zeile 325Zeile 344

// Most users online
$mostonline = $cache->read("mostonline");


// Most users online
$mostonline = $cache->read("mostonline");

	if($onlinecount > $mostonline['numusers'])

	if($onlinecount !== null && $onlinecount > $mostonline['numusers'])

	{
$time = TIME_NOW;
$mostonline['numusers'] = $onlinecount;

	{
$time = TIME_NOW;
$mostonline['numusers'] = $onlinecount;

Zeile 407Zeile 426
		}
$thread['subject'] = htmlspecialchars_uni($thread['subject']);
$thread['fullsubject'] = htmlspecialchars_uni($thread['fullsubject']);

		}
$thread['subject'] = htmlspecialchars_uni($thread['subject']);
$thread['fullsubject'] = htmlspecialchars_uni($thread['fullsubject']);





		$thread['threadlink'] = get_thread_link($thread['tid']);
$thread['lastpostlink'] = get_thread_link($thread['tid'], 0, "lastpost");
$thread['forumlink'] = get_forum_link($thread['fid']);
$thread['forumname'] = $forum_cache[$thread['fid']]['name'];
eval("\$threadlist .= \"".$templates->get("portal_latestthreads_thread")."\";");
$altbg = alt_trow();

		$thread['threadlink'] = get_thread_link($thread['tid']);
$thread['lastpostlink'] = get_thread_link($thread['tid'], 0, "lastpost");
$thread['forumlink'] = get_forum_link($thread['fid']);
$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

	if($threadlist)
{
// Show the table only if there are threads

Zeile 444Zeile 463
			$announcementsfids = implode(',', $fid_array);

$annfidswhere = " AND t.fid IN ($announcementsfids)";

			$announcementsfids = implode(',', $fid_array);

$annfidswhere = " AND t.fid IN ($announcementsfids)";

		}
}


		}
}


	// And get them!
foreach($forum_cache as $fid => $f)
{

	// And get them!
foreach($forum_cache as $fid => $f)
{

Zeile 458Zeile 477

$query = $db->simple_select("threads t", "COUNT(t.tid) AS threads", "t.visible='1'{$annfidswhere}{$tunviewwhere} AND t.closed NOT LIKE 'moved|%'", array('limit' => 1));
$announcementcount = $db->fetch_field($query, "threads");


$query = $db->simple_select("threads t", "COUNT(t.tid) AS threads", "t.visible='1'{$annfidswhere}{$tunviewwhere} AND t.closed NOT LIKE 'moved|%'", array('limit' => 1));
$announcementcount = $db->fetch_field($query, "threads");





	$numannouncements = (int)$mybb->settings['portal_numannouncements'];
if(!$numannouncements)
{

	$numannouncements = (int)$mybb->settings['portal_numannouncements'];
if(!$numannouncements)
{

Zeile 561Zeile 580
			$announcement['forumname'] = $forum_cache[$announcement['fid']]['name'];
$announcement['username'] = htmlspecialchars_uni($announcement['username']);
if(!$announcement['uid'] && !$announcement['threadusername'])

			$announcement['forumname'] = $forum_cache[$announcement['fid']]['name'];
$announcement['username'] = htmlspecialchars_uni($announcement['username']);
if(!$announcement['uid'] && !$announcement['threadusername'])

			{

			{

				$announcement['threadusername'] = htmlspecialchars_uni($lang->guest);
}
else

				$announcement['threadusername'] = htmlspecialchars_uni($lang->guest);
}
else

Zeile 632Zeile 651
				$parser_options['allow_smilies'] = 0;
}


				$parser_options['allow_smilies'] = 0;
}


			if($mybb->user['showimages'] != 1 && $mybb->user['uid'] != 0 || $mybb->settings['guestimages'] != 1 && $mybb->user['uid'] == 0)

			if($mybb->user['uid'] != 0 && $mybb->user['showimages'] != 1 || $mybb->settings['guestimages'] != 1 && $mybb->user['uid'] == 0)

			{
$parser_options['allow_imgcode'] = 0;
}


			{
$parser_options['allow_imgcode'] = 0;
}


			if($mybb->user['showvideos'] != 1 && $mybb->user['uid'] != 0 || $mybb->settings['guestvideos'] != 1 && $mybb->user['uid'] == 0)

			if($mybb->user['uid'] != 0 && $mybb->user['showvideos'] != 1 || $mybb->settings['guestvideos'] != 1 && $mybb->user['uid'] == 0)

			{
$parser_options['allow_videocode'] = 0;
}

			{
$parser_options['allow_videocode'] = 0;
}

Zeile 666Zeile 685
							$isimage = false;
}
$attachment['icon'] = get_attachment_icon($ext);

							$isimage = false;
}
$attachment['icon'] = get_attachment_icon($ext);

 
						if(!$attachment['dateuploaded'])
{
$attachment['dateuploaded'] = $announcement['dateline'];
}
$attachdate = my_date('normal', $attachment['dateuploaded']);

						// Support for [attachment=id] code
if(stripos($message, "[attachment=".$attachment['aid']."]") !== false)
{

						// Support for [attachment=id] code
if(stripos($message, "[attachment=".$attachment['aid']."]") !== false)
{