Vergleich portal.php - 1.8.0 - 1.8.4

  Keine Änderungen   Hinzugefügt   Modifiziert   Entfernt
Zeile 51Zeile 51

// Fetch the current URL
$portal_url = get_current_location();


// Fetch the current URL
$portal_url = get_current_location();

 
$file_name = strtok(my_strtolower(basename($portal_url)), '?');





add_breadcrumb($lang->nav_portal, "portal.php");

add_breadcrumb($lang->nav_portal, $file_name);


$plugins->run_hooks("portal_start");



$plugins->run_hooks("portal_start");




$tunviewwhere = $unviewwhere = '';

// get forums user cannot view
$unviewable = get_unviewable_forums(true);
if($unviewable)
{
$unviewwhere = " AND fid NOT IN ($unviewable)";
$tunviewwhere = " AND t.fid NOT IN ($unviewable)";

// get forums user cannot view
$unviewable = get_unviewable_forums(true);
if($unviewable)
{
$unviewwhere = " AND fid NOT IN ($unviewable)";
$tunviewwhere = " AND t.fid NOT IN ($unviewable)";

}
else
{
$unviewwhere = '';
}


}






// get inactive forums
$inactive = get_inactive_forums();
if($inactive)
{

// get inactive forums
$inactive = get_inactive_forums();
if($inactive)
{

	$inactivewhere = " AND fid NOT IN ($inactive)";
$tinactivewhere = " AND t.fid NOT IN ($inactive)";
}
else
{
$inactivewhere = '';

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





}

$welcome = '';

}

$welcome = '';

Zeile 88Zeile 81
	if($mybb->user['uid'] != 0)
{
// Get number of new posts, threads, announcements

	if($mybb->user['uid'] != 0)
{
// Get number of new posts, threads, announcements

		$query = $db->simple_select("posts", "COUNT(pid) AS newposts", "visible=1 AND dateline>'".$mybb->user['lastvisit']."'{$unviewwhere}{$inactivewhere}");

		$query = $db->simple_select("posts", "COUNT(pid) AS newposts", "visible=1 AND dateline>'".$mybb->user['lastvisit']."'{$unviewwhere}");

		$newposts = $db->fetch_field($query, "newposts");
if($newposts)
{
// If there aren't any new posts, there is no point in wasting two more queries

		$newposts = $db->fetch_field($query, "newposts");
if($newposts)
{
// If there aren't any new posts, there is no point in wasting two more queries

			$query = $db->simple_select("threads", "COUNT(tid) AS newthreads", "visible=1 AND dateline>'".$mybb->user['lastvisit']."'{$unviewwhere}{$inactivewhere}");

			$query = $db->simple_select("threads", "COUNT(tid) AS newthreads", "visible=1 AND dateline>'".$mybb->user['lastvisit']."'{$unviewwhere}");

			$newthreads = $db->fetch_field($query, "newthreads");

$newann = 0;

			$newthreads = $db->fetch_field($query, "newthreads");

$newann = 0;

Zeile 112Zeile 105
						unset($fid);

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

						unset($fid);

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





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

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

Zeile 126Zeile 119
			$newposts = 0;
$newthreads = 0;
$newann = 0;

			$newposts = 0;
$newthreads = 0;
$newann = 0;

		}

		}


// Make the text
if($newann == 1)


// Make the text
if($newann == 1)

Zeile 241Zeile 234
	$guestcount = $membercount = $botcount = $anoncount = 0;
$onlinemembers = '';
$doneusers = array();

	$guestcount = $membercount = $botcount = $anoncount = 0;
$onlinemembers = '';
$doneusers = array();

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

		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)

Zeile 274Zeile 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 295Zeile 288
					eval("\$onlinemembers .= \"".$templates->get("portal_whosonline_memberbit", 1, 0)."\";");
$comma = $lang->comma;
}

					eval("\$onlinemembers .= \"".$templates->get("portal_whosonline_memberbit", 1, 0)."\";");
$comma = $lang->comma;
}

			}
}
}


			}
}
}


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

// If we can see invisible users add them to the count

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

// If we can see invisible users add them to the count

Zeile 351Zeile 344
	}

$query = $db->query("

	}

$query = $db->query("

		SELECT t.tid, t.fid, t.uid, t.lastpost, t.lastposteruid, t.lastposter, t.subject, u.username

		SELECT t.tid, t.fid, t.uid, t.lastpost, t.lastposteruid, t.lastposter, t.subject, t.replies, t.views, u.username

		FROM ".TABLE_PREFIX."threads t
LEFT JOIN ".TABLE_PREFIX."users u ON (u.uid=t.uid)

		FROM ".TABLE_PREFIX."threads t
LEFT JOIN ".TABLE_PREFIX."users u ON (u.uid=t.uid)

		WHERE 1=1 {$excludeforums}{$tunviewwhere}{$tinactivewhere} AND t.visible='1' AND t.closed NOT LIKE 'moved|%'

		WHERE 1=1 {$excludeforums}{$tunviewwhere} AND t.visible='1' AND t.closed NOT LIKE 'moved|%'

		ORDER BY t.lastpost DESC
LIMIT 0, ".$mybb->settings['portal_showdiscussionsnum']
);

		ORDER BY t.lastpost DESC
LIMIT 0, ".$mybb->settings['portal_showdiscussionsnum']
);

Zeile 363Zeile 356
		$forumpermissions[$thread['fid']] = forum_permissions($thread['fid']);

// Make sure we can view this thread

		$forumpermissions[$thread['fid']] = forum_permissions($thread['fid']);

// Make sure we can view this thread

		if($forumpermissions[$thread['fid']]['canview'] == 0 || $forumpermissions[$thread['fid']]['canviewthreads'] == 0 || (isset($forumpermissions[$thread['fid']]['canonlyviewownthreads']) && $forumpermissions[$thread['fid']]['canonlyviewownthreads'] == 1 && $thread['uid'] != $mybb->user['uid']))

		if(isset($forumpermissions[$thread['fid']]['canonlyviewownthreads']) && $forumpermissions[$thread['fid']]['canonlyviewownthreads'] == 1 && $thread['uid'] != $mybb->user['uid'])

		{
continue;
}

		{
continue;
}

Zeile 388Zeile 381
		$thread['subject'] = htmlspecialchars_uni($parser->parse_badwords($thread['subject']));
$thread['threadlink'] = get_thread_link($thread['tid']);
$thread['lastpostlink'] = get_thread_link($thread['tid'], 0, "lastpost");

		$thread['subject'] = htmlspecialchars_uni($parser->parse_badwords($thread['subject']));
$thread['threadlink'] = get_thread_link($thread['tid']);
$thread['lastpostlink'] = get_thread_link($thread['tid'], 0, "lastpost");

		$thread['forumlink'] = get_thread_link($thread['fid']);

		$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['forumname'] = $forum_cache[$thread['fid']]['name'];
eval("\$threadlist .= \"".$templates->get("portal_latestthreads_thread")."\";");
$altbg = alt_trow();

Zeile 421Zeile 414

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



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


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

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

		}
}


		}
}


Zeile 443Zeile 436
		$numannouncements = 10; // Default back to 10
}


		$numannouncements = 10; // Default back to 10
}


	$page = $mybb->get_input('page', 1);

	$page = $mybb->get_input('page', MyBB::INPUT_INT);

	$pages = $announcementcount / $numannouncements;
$pages = ceil($pages);


	$pages = $announcementcount / $numannouncements;
$pages = ceil($pages);


Zeile 462Zeile 455
		$page = 1;
}


		$page = 1;
}


	$multipage = multipage($announcementcount, $numannouncements, $page, 'portal.php');

	$multipage = multipage($announcementcount, $numannouncements, $page, $file_name);


$pids = '';
$tids = '';


$pids = '';
$tids = '';

Zeile 478Zeile 471
		LIMIT {$start}, {$numannouncements}"
);
while($getid = $db->fetch_array($query))

		LIMIT {$start}, {$numannouncements}"
);
while($getid = $db->fetch_array($query))

	{

	{

		$attachmentcount[$getid['tid']] = $getid['attachmentcount'];
foreach($attachmentcount as $tid => $attach_count)
{
if($attach_count > 0)
{
$pids .= ",'{$getid['pid']}'";

		$attachmentcount[$getid['tid']] = $getid['attachmentcount'];
foreach($attachmentcount as $tid => $attach_count)
{
if($attach_count > 0)
{
$pids .= ",'{$getid['pid']}'";

			}

			}


$posts[$getid['tid']] = $getid;
}


$posts[$getid['tid']] = $getid;
}

Zeile 506Zeile 499
		}

if(is_array($forum))

		}

if(is_array($forum))

		{

		{

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

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

Zeile 519Zeile 512
			SELECT t.*, t.username AS threadusername, u.username, u.avatar, u.avatardimensions
FROM ".TABLE_PREFIX."threads t
LEFT JOIN ".TABLE_PREFIX."users u ON (u.uid = t.uid)

			SELECT t.*, t.username AS threadusername, u.username, u.avatar, u.avatardimensions
FROM ".TABLE_PREFIX."threads t
LEFT JOIN ".TABLE_PREFIX."users u ON (u.uid = t.uid)

			WHERE t.tid IN (0{$tids}){$annfidswhere} AND t.visible='1' AND t.closed NOT LIKE 'moved|%'

			WHERE t.tid IN (0{$tids}){$annfidswhere}{$tunviewwhere} AND t.visible='1' AND t.closed NOT LIKE 'moved|%'

			ORDER BY t.dateline DESC
LIMIT 0, {$numannouncements}"
);
while($announcement = $db->fetch_array($query))
{
// Make sure we can view this announcement

			ORDER BY t.dateline DESC
LIMIT 0, {$numannouncements}"
);
while($announcement = $db->fetch_array($query))
{
// Make sure we can view this announcement

			if($forumpermissions[$announcement['fid']]['canview'] == 0 || $forumpermissions[$announcement['fid']]['canviewthreads'] == 0 || (isset($forumpermissions[$announcement['fid']]['canonlyviewownthreads']) && $forumpermissions[$announcement['fid']]['canonlyviewownthreads'] == 1 && $announcement['uid'] != $mybb->user['uid']))

			if(isset($forumpermissions[$announcement['fid']]['canonlyviewownthreads']) && $forumpermissions[$announcement['fid']]['canonlyviewownthreads'] == 1 && $announcement['uid'] != $mybb->user['uid'])

			{
continue;
}

			{
continue;
}

Zeile 537Zeile 530
			$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['threadusername'] = htmlspecialchars_uni($announcement['threadusername']);


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


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

				$profilelink = htmlspecialchars_uni($announcement['threadusername']);

				$profilelink = $announcement['threadusername'];

			}
else
{

			}
else
{

Zeile 556Zeile 552
			{
$icon = $icon_cache[$announcement['icon']];
$icon['path'] = str_replace("{theme}", $theme['imgdir'], $icon['path']);

			{
$icon = $icon_cache[$announcement['icon']];
$icon['path'] = str_replace("{theme}", $theme['imgdir'], $icon['path']);

 
				$icon['path'] = htmlspecialchars_uni($icon['path']);
$icon['name'] = htmlspecialchars_uni($icon['name']);

				eval("\$icon = \"".$templates->get("portal_announcement_icon")."\";");
}
else

				eval("\$icon = \"".$templates->get("portal_announcement_icon")."\";");
}
else

Zeile 563Zeile 561
				$icon = " ";
}


				$icon = " ";
}


			$useravatar = format_avatar(htmlspecialchars_uni($announcement['avatar']), $announcement['avatardimensions']);

			$useravatar = format_avatar($announcement['avatar'], $announcement['avatardimensions']);

			eval("\$avatar = \"".$templates->get("portal_announcement_avatar")."\";");

$anndate = my_date('relative', $announcement['dateline']);

			eval("\$avatar = \"".$templates->get("portal_announcement_avatar")."\";");

$anndate = my_date('relative', $announcement['dateline']);