Vergleich portal.php - 1.8.5 - 1.8.37

  Keine Änderungen   Hinzugefügt   Modifiziert   Entfernt
Zeile 31Zeile 31
	}
}


	}
}


$templatelist = "portal,portal_welcome_membertext,portal_stats,portal_search,portal_whosonline_memberbit,portal_whosonline,portal_latestthreads_thread,portal_latestthreads,portal_announcement_numcomments_no,portal_announcement,portal_welcome";
$templatelist .= ",portal_welcome_guesttext,postbit_attachments_thumbnails_thumbnail,postbit_attachments_images_image,postbit_attachments_attachment,postbit_attachments_thumbnails,postbit_attachments_images,postbit_attachments,portal_pms";
$templatelist .= ",multipage,multipage_end,multipage_jump_page,multipage_nextpage,multipage_page,multipage_page_current,multipage_page_link_current,multipage_prevpage,multipage_start,portal_announcement_send_item,portal_announcement_icon,portal_announcement_avatar,portal_announcement_numcomments";


$templatelist = "portal,portal_welcome_membertext,portal_stats,portal_search,portal_whosonline_memberbit,portal_whosonline,portal_latestthreads_thread,portal_latestthreads,portal_announcement_numcomments_no";
$templatelist .= ",postbit_attachments_thumbnails_thumbnail,postbit_attachments_images_image,postbit_attachments_attachment,postbit_attachments_thumbnails,postbit_attachments_images,postbit_attachments";
$templatelist .= ",multipage,multipage_end,multipage_jump_page,multipage_nextpage,multipage_page,multipage_page_current,multipage_page_link_current,multipage_prevpage,multipage_start,portal_announcement_send_item";
$templatelist .= ",portal_stats_nobody,portal_announcement_avatar,portal_announcement_numcomments,portal_announcement_icon,portal_pms,portal_welcome,portal_announcement,portal_welcome_guesttext";


require_once $change_dir."/global.php";
require_once MYBB_ROOT."inc/functions_post.php";


require_once $change_dir."/global.php";
require_once MYBB_ROOT."inc/functions_post.php";

Zeile 73Zeile 74
	$unviewwhere .= " AND fid NOT IN ($inactive)";
$tunviewwhere .= " AND t.fid NOT IN ($inactive)";
}

	$unviewwhere .= " AND fid NOT IN ($inactive)";
$tunviewwhere .= " AND t.fid NOT IN ($inactive)";
}

 

$mybb->user['username'] = htmlspecialchars_uni($mybb->user['username']);


$welcome = '';
// If user is known, welcome them


$welcome = '';
// If user is known, welcome them

Zeile 198Zeile 201
	$stats['numusers'] = my_number_format($stats['numusers']);
if(!$stats['lastusername'])
{

	$stats['numusers'] = my_number_format($stats['numusers']);
if(!$stats['lastusername'])
{

		$newestmember = "<strong>" . $lang->nobody . "</strong>";

		eval("\$newestmember = \"".$templates->get("portal_stats_nobody")."\";");

	}
else
{

	}
else
{

Zeile 214Zeile 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 230Zeile 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))
{

// 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 279Zeile 280
				else
{
$invisiblemark = '';

				else
{
$invisiblemark = '';

				}

				}


if(($user['invisible'] == 1 && ($mybb->usergroup['canviewwolinvis'] == 1 || $user['uid'] == $mybb->user['uid'])) || $user['invisible'] != 1)
{


if(($user['invisible'] == 1 && ($mybb->usergroup['canviewwolinvis'] == 1 || $user['uid'] == $mybb->user['uid'])) || $user['invisible'] != 1)
{

					$user['username'] = format_name($user['username'], $user['usergroup'], $user['displaygroup']);

					$user['username'] = format_name(htmlspecialchars_uni($user['username']), $user['usergroup'], $user['displaygroup']);

					$user['profilelink'] = get_profile_link($user['uid']);

					$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;

	}

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

Zeile 308Zeile 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 362Zeile 398
		}

$lastpostdate = my_date('relative', $thread['lastpost']);

		}

$lastpostdate = my_date('relative', $thread['lastpost']);

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

// Don't link to guest's profiles (they have no profile).
if($thread['lastposteruid'] == 0)
{

		$thread['replies'] = my_number_format($thread['replies']);
$thread['views'] = my_number_format($thread['views']);

// Don't link to guest's profiles (they have no profile).
if($thread['lastposteruid'] == 0)
{

			$lastposterlink = $thread['lastposter'];

			$lastposterlink = $lastposter;

		}
else
{

		}
else
{

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

			$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 387Zeile 435
		$altbg = alt_trow();
}
if($threadlist)

		$altbg = alt_trow();
}
if($threadlist)

	{

	{

		// Show the table only if there are threads
eval("\$latestthreads = \"".$templates->get("portal_latestthreads")."\";");
}

		// Show the table only if there are threads
eval("\$latestthreads = \"".$templates->get("portal_latestthreads")."\";");
}

Zeile 426Zeile 474
			$forum[$fid] = $f;
}
}

			$forum[$fid] = $f;
}
}

	



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


Zeile 493Zeile 541
			// Now lets fetch all of the attachments for these posts
$query = $db->simple_select("attachments", "*", $pids);
while($attachment = $db->fetch_array($query))

			// Now lets fetch all of the attachments for these posts
$query = $db->simple_select("attachments", "*", $pids);
while($attachment = $db->fetch_array($query))

			{

			{

				$attachcache[$attachment['pid']][$attachment['aid']] = $attachment;
}
}

				$attachcache[$attachment['pid']][$attachment['aid']] = $attachment;
}
}

Zeile 503Zeile 551
			foreach($forum as $fid => $forumrow)
{
$forumpermissions[$fid] = forum_permissions($fid);

			foreach($forum as $fid => $forumrow)
{
$forumpermissions[$fid] = forum_permissions($fid);

			}

			}

		}

$icon_cache = $cache->read("posticons");

		}

$icon_cache = $cache->read("posticons");

Zeile 522Zeile 570
			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 530Zeile 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)
{


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

Zeile 585Zeile 639
			$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 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 631Zeile 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)
{

Zeile 657Zeile 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;