Vergleich portal.php - 1.8.10 - 1.8.38

  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 233Zeile 234
	}

$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))
{

	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 && $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'])
{
++$membercount;

$doneusers[$user['uid']] = $user['time'];

		{
if(empty($doneusers[$user['uid']]) || $doneusers[$user['uid']] < $user['time'])
{
++$membercount;

$doneusers[$user['uid']] = $user['time'];





				// If the user is logged in anonymously, update the count for that.
if($user['invisible'] == 1)
{
++$anoncount;

				// If the user is logged in anonymously, update the count for that.
if($user['invisible'] == 1)
{
++$anoncount;

				}

				}


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


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

				}

				}

				else
{
$invisiblemark = '';

				else
{
$invisiblemark = '';

Zeile 288Zeile 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)."\";");


				}

				}

			}
}
}






































			}
}
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
{
$onlinemembers = "";
}


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

// If we can see invisible users add them to the count
if($mybb->usergroup['canviewwolinvis'] == 1)

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

// If we can see invisible users add them to the count
if($mybb->usergroup['canviewwolinvis'] == 1)

	{

	{

		$onlinecount += $anoncount;
}

// If we can't see invisible users but the user is an invisible user incriment the count by one
if($mybb->usergroup['canviewwolinvis'] != 1 && isset($mybb->user['invisible']) && $mybb->user['invisible'] == 1)

		$onlinecount += $anoncount;
}

// If we can't see invisible users but the user is an invisible user incriment the count by one
if($mybb->usergroup['canviewwolinvis'] != 1 && isset($mybb->user['invisible']) && $mybb->user['invisible'] == 1)

	{

	{

		++$onlinecount;
}

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

		++$onlinecount;
}

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

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

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

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

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

Zeile 324Zeile 357
	if($onlinecount == 1)
{
$lang->online_users = $lang->online_user;

	if($onlinecount == 1)
{
$lang->online_users = $lang->online_user;

	}

	}

	else
{
$lang->online_users = $lang->sprintf($lang->online_users, $onlinecount);

	else
{
$lang->online_users = $lang->sprintf($lang->online_users, $onlinecount);

Zeile 342Zeile 375

$excludeforums = '';
if(!empty($mybb->settings['portal_excludediscussion']))


$excludeforums = '';
if(!empty($mybb->settings['portal_excludediscussion']))

	{

	{

		$excludeforums = "AND t.fid NOT IN ({$mybb->settings['portal_excludediscussion']})";
}


		$excludeforums = "AND t.fid NOT IN ({$mybb->settings['portal_excludediscussion']})";
}


Zeile 357Zeile 390
	while($thread = $db->fetch_array($query))
{
$forumpermissions[$thread['fid']] = forum_permissions($thread['fid']);

	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'])
{

		// Make sure we can view this thread
if(isset($forumpermissions[$thread['fid']]['canonlyviewownthreads']) && $forumpermissions[$thread['fid']]['canonlyviewownthreads'] == 1 && $thread['uid'] != $mybb->user['uid'])
{

Zeile 365Zeile 398
		}

$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 377Zeile 417
		else
{
$lastposterlink = build_profile_link($lastposter, $thread['lastposteruid']);

		else
{
$lastposterlink = build_profile_link($lastposter, $thread['lastposteruid']);

		}



		}

$thread['subject'] = $thread['fullsubject'] = $parser->parse_badwords($thread['subject']);

		if(my_strlen($thread['subject']) > 25)
{
$thread['subject'] = my_substr($thread['subject'], 0, 25) . "...";
}

		if(my_strlen($thread['subject']) > 25)
{
$thread['subject'] = my_substr($thread['subject'], 0, 25) . "...";
}

		$thread['subject'] = htmlspecialchars_uni($parser->parse_badwords($thread['subject']));



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

Zeile 438Zeile 482
	if(!$numannouncements)
{
$numannouncements = 10; // Default back to 10

	if(!$numannouncements)
{
$numannouncements = 10; // Default back to 10

	}


	}


	$page = $mybb->get_input('page', MyBB::INPUT_INT);
$pages = $announcementcount / $numannouncements;
$pages = ceil($pages);

	$page = $mybb->get_input('page', MyBB::INPUT_INT);
$pages = $announcementcount / $numannouncements;
$pages = ceil($pages);

Zeile 534Zeile 578
			$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)
{
$profilelink = $announcement['threadusername'];


if($announcement['uid'] == 0)
{
$profilelink = $announcement['threadusername'];

			}
else

			}
else

			{
$profilelink = build_profile_link($announcement['username'], $announcement['uid']);
}

if(!$announcement['username'])

			{
$profilelink = build_profile_link($announcement['username'], $announcement['uid']);
}

if(!$announcement['username'])

			{

			{

				$announcement['username'] = $announcement['threadusername'];
}
$announcement['subject'] = htmlspecialchars_uni($parser->parse_badwords($announcement['subject']));

				$announcement['username'] = $announcement['threadusername'];
}
$announcement['subject'] = htmlspecialchars_uni($parser->parse_badwords($announcement['subject']));

Zeile 559Zeile 609
				$icon['path'] = htmlspecialchars_uni($icon['path']);
$icon['name'] = htmlspecialchars_uni($icon['name']);
eval("\$icon = \"".$templates->get("portal_announcement_icon")."\";");

				$icon['path'] = htmlspecialchars_uni($icon['path']);
$icon['name'] = htmlspecialchars_uni($icon['name']);
eval("\$icon = \"".$templates->get("portal_announcement_icon")."\";");

			}
else

			}
else

			{
$icon = "&nbsp;";
}

			{
$icon = "&nbsp;";
}

Zeile 584Zeile 634
			if($mybb->user['uid'] > 0 && $mybb->usergroup['cansendemail'] == 1)
{
eval("\$senditem = \"".$templates->get("portal_announcement_send_item")."\";");

			if($mybb->user['uid'] > 0 && $mybb->usergroup['cansendemail'] == 1)
{
eval("\$senditem = \"".$templates->get("portal_announcement_send_item")."\";");

			}

			}


$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'],

Zeile 597Zeile 647
				"filter_badwords" => 1
);
if($announcement['smilieoff'] == 1)

				"filter_badwords" => 1
);
if($announcement['smilieoff'] == 1)

			{

			{

				$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 629Zeile 679
						if($ext == "jpeg" || $ext == "gif" || $ext == "bmp" || $ext == "png" || $ext == "jpg")
{
$isimage = true;

						if($ext == "jpeg" || $ext == "gif" || $ext == "bmp" || $ext == "png" || $ext == "jpg")
{
$isimage = true;

						}

						}

						else

						else

						{

						{

							$isimage = false;

							$isimage = false;

						}

						}

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

						$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)
{

Zeile 661Zeile 716
								eval("\$post['thumblist'] .= \"".$templates->get("postbit_attachments_thumbnails_thumbnail")."\";");
if($tcount == 5)
{

								eval("\$post['thumblist'] .= \"".$templates->get("postbit_attachments_thumbnails_thumbnail")."\";");
if($tcount == 5)
{

									$thumblist .= "<br />";

									$post['thumblist'] .= "<br />";

									$tcount = 0;
}
++$tcount;

									$tcount = 0;
}
++$tcount;