Vergleich portal.php - 1.8.1 - 1.8.5

  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)
{
$lang->new_announcements = $lang->new_announcement;


// Make the text
if($newann == 1)
{
$lang->new_announcements = $lang->new_announcement;

		}
else
{

		}
else
{

			$lang->new_announcements = $lang->sprintf($lang->new_announcements, $newann);
}
if($newthreads == 1)
{
$lang->new_threads = $lang->new_thread;

			$lang->new_announcements = $lang->sprintf($lang->new_announcements, $newann);
}
if($newthreads == 1)
{
$lang->new_threads = $lang->new_thread;

		}

		}

		else
{
$lang->new_threads = $lang->sprintf($lang->new_threads, $newthreads);

		else
{
$lang->new_threads = $lang->sprintf($lang->new_threads, $newthreads);

Zeile 154Zeile 147
			$lang->new_posts = $lang->sprintf($lang->new_posts, $newposts);
}
eval("\$welcometext = \"".$templates->get("portal_welcome_membertext")."\";");

			$lang->new_posts = $lang->sprintf($lang->new_posts, $newposts);
}
eval("\$welcometext = \"".$templates->get("portal_welcome_membertext")."\";");





	}
else
{

	}
else
{

Zeile 184Zeile 177
$pms = '';
// Private messages box
if($mybb->settings['portal_showpms'] != 0)

$pms = '';
// Private messages box
if($mybb->settings['portal_showpms'] != 0)

{

{

	if($mybb->user['uid'] != 0 && $mybb->user['receivepms'] != 0 && $mybb->usergroup['canusepms'] != 0 && $mybb->settings['enablepms'] != 0)
{
$messages['pms_total'] = $mybb->user['pms_total'];

	if($mybb->user['uid'] != 0 && $mybb->user['receivepms'] != 0 && $mybb->usergroup['canusepms'] != 0 && $mybb->settings['enablepms'] != 0)
{
$messages['pms_total'] = $mybb->user['pms_total'];

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;

			}
}
}

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


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


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

Zeile 354Zeile 347
		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)

		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)

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