Vergleich forumdisplay.php - 1.4.1 - 1.4.8

  Keine Änderungen   Hinzugefügt   Modifiziert   Entfernt
Zeile 6Zeile 6
 * Website: http://www.mybboard.net
* License: http://www.mybboard.net/about/license
*

 * Website: http://www.mybboard.net
* License: http://www.mybboard.net/about/license
*

 * $Id: forumdisplay.php 4081 2008-08-08 01:47:02Z Tikitiki $

 * $Id: forumdisplay.php 4322 2009-02-21 23:00:49Z Tikitiki $

 */

define("IN_MYBB", 1);

 */

define("IN_MYBB", 1);

Zeile 78Zeile 78
	error_no_permission();
}


	error_no_permission();
}


// Build a forum cache.
$query = $db->query("
SELECT f.*, fr.dateline AS lastread
FROM ".TABLE_PREFIX."forums f
LEFT JOIN ".TABLE_PREFIX."forumsread fr ON (fr.fid=f.fid AND fr.uid='{$mybb->user['uid']}')
WHERE f.active != 0
ORDER BY pid, disporder
");
















if($mybb->user['uid'] == 0)
{
// Build a forum cache.
$query = $db->query("
SELECT *
FROM ".TABLE_PREFIX."forums
WHERE active != 0
ORDER BY pid, disporder
");

$forumsread = unserialize($mybb->cookies['mybb']['forumread']);
}
else
{
// Build a forum cache.
$query = $db->query("
SELECT f.*, fr.dateline AS lastread
FROM ".TABLE_PREFIX."forums f
LEFT JOIN ".TABLE_PREFIX."forumsread fr ON (fr.fid=f.fid AND fr.uid='{$mybb->user['uid']}')
WHERE f.active != 0
ORDER BY pid, disporder
");
}

while($forum = $db->fetch_array($query))
{

while($forum = $db->fetch_array($query))
{

 
	if($mybb->user['uid'] == 0)
{
if($forumsread[$forum['fid']])
{
$forum['lastread'] = $forumsread[$forum['fid']];
}
}

	$fcache[$forum['pid']][$forum['disporder']][$forum['fid']] = $forum;
}


	$fcache[$forum['pid']][$forum['disporder']][$forum['fid']] = $forum;
}


Zeile 101Zeile 123
if($mybb->settings['subforumsindex'] != 0)
{
$showdepth = 3;

if($mybb->settings['subforumsindex'] != 0)
{
$showdepth = 3;

}

}

else
{
$showdepth = 2;

else
{
$showdepth = 2;

Zeile 118Zeile 140

// Password protected forums
check_forum_password($foruminfo['fid']);


// Password protected forums
check_forum_password($foruminfo['fid']);





if($foruminfo['linkto'])
{
header("Location: {$foruminfo['linkto']}");

if($foruminfo['linkto'])
{
header("Location: {$foruminfo['linkto']}");

Zeile 127Zeile 149

// Make forum jump...
if($mybb->settings['enableforumjump'] != 0)


// Make forum jump...
if($mybb->settings['enableforumjump'] != 0)

{

{

	$forumjump = build_forum_jump("", $fid, 1);
}


	$forumjump = build_forum_jump("", $fid, 1);
}


Zeile 153Zeile 175
		foreach($moderatorcache[$mfid] as $moderator)
{
if(in_array($moderator['uid'], $done_moderators))

		foreach($moderatorcache[$mfid] as $moderator)
{
if(in_array($moderator['uid'], $done_moderators))

			{

			{

				continue;
}


				continue;
}


Zeile 171Zeile 193
{
eval("\$moderatedby = \"".$templates->get("forumdisplay_moderatedby")."\";");
}

{
eval("\$moderatedby = \"".$templates->get("forumdisplay_moderatedby")."\";");
}





// Get the users browsing this forum.
if($mybb->settings['browsingthisforum'] != 0)
{

// Get the users browsing this forum.
if($mybb->settings['browsingthisforum'] != 0)
{

Zeile 223Zeile 245
	}

if($guestcount)

	}

if($guestcount)

	{

	{

		$guestsonline = $lang->sprintf($lang->users_browsing_forum_guests, $guestcount);

		$guestsonline = $lang->sprintf($lang->users_browsing_forum_guests, $guestcount);

	}


	}


	if($guestcount && $onlinemembers)
{
$onlinesep = ", ";

	if($guestcount && $onlinemembers)
{
$onlinesep = ", ";

	}


	}


	$invisonline = '';
if($inviscount && $mybb->usergroup['canviewwolinvis'] != 1 && ($inviscount != 1 && $mybb->user['invisible'] != 1))
{
$invisonline = $lang->sprintf($lang->users_browsing_forum_invis, $inviscount);
}


	$invisonline = '';
if($inviscount && $mybb->usergroup['canviewwolinvis'] != 1 && ($inviscount != 1 && $mybb->user['invisible'] != 1))
{
$invisonline = $lang->sprintf($lang->users_browsing_forum_invis, $inviscount);
}


	if($invisonline != '' && $guestcount)

	if($invisonline != '' && ($guestcount || $onlinemembers))

	{
$onlinesep2 = ", ";
}

	{
$onlinesep2 = ", ";
}

Zeile 292Zeile 314
{
$inlinemod = '';
$ismod = false;

{
$inlinemod = '';
$ismod = false;

}


}


if(is_moderator($fid, "caneditposts") || $fpermissions['caneditposts'] == 1)
{
$can_edit_titles = 1;

if(is_moderator($fid, "caneditposts") || $fpermissions['caneditposts'] == 1)
{
$can_edit_titles = 1;

Zeile 419Zeile 441
}
eval("\$orderarrow['$sortby'] = \"".$templates->get("forumdisplay_orderarrow")."\";");


}
eval("\$orderarrow['$sortby'] = \"".$templates->get("forumdisplay_orderarrow")."\";");


// How many posts are there?
if($datecut > 0)


$threadcount = 0;

if($fpermissions['canviewthreads'] != 0)

{

{

	$query = $db->simple_select("threads", "COUNT(tid) AS threads", "fid = '$fid' $visibleonly $datecutsql");
$threadcount = $db->fetch_field($query, "threads");
}
else
{
$query = $db->simple_select("forums", "threads, unapprovedthreads", "fid = '{$fid}'", array('limit' => 1));
$forum_threads = $db->fetch_array($query);
$threadcount = $forum_threads['threads'];
if($ismod == true)
{
$threadcount += $forum_threads['unapprovedthreads'];
}

// If we have 0 threads double check there aren't any "moved" threads
if($threadcount == 0)

	// How many posts are there?
if($datecut > 0)














	{

	{

		$query = $db->simple_select("threads", "COUNT(tid) AS threads", "fid = '$fid' $visibleonly", array('limit' => 1));

		$query = $db->simple_select("threads", "COUNT(tid) AS threads", "fid = '$fid' $visibleonly $datecutsql");

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

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

 
	}
else
{
$query = $db->simple_select("forums", "threads, unapprovedthreads", "fid = '{$fid}'", array('limit' => 1));
$forum_threads = $db->fetch_array($query);
$threadcount = $forum_threads['threads'];
if($ismod == true)
{
$threadcount += $forum_threads['unapprovedthreads'];
}

// If we have 0 threads double check there aren't any "moved" threads
if($threadcount == 0)
{
$query = $db->simple_select("threads", "COUNT(tid) AS threads", "fid = '$fid' $visibleonly", array('limit' => 1));
$threadcount = $db->fetch_field($query, "threads");
}

	}
}

// How many pages are there?
if(!$mybb->settings['threadsperpage'])

	}
}

// How many pages are there?
if(!$mybb->settings['threadsperpage'])

{

{

	$mybb->settings['threadsperpage'] = 20;
}


	$mybb->settings['threadsperpage'] = 20;
}


Zeile 461Zeile 488
	{
$start = 0;
$page = 1;

	{
$start = 0;
$page = 1;

	}

	}

}
else
{

}
else
{

Zeile 502Zeile 529
	}

if($sortordernow != "desc")

	}

if($sortordernow != "desc")

	{

	{

		$page_url .= "{$q}{$and}order={$sortordernow}";
$q = '';
$and = "&";

		$page_url .= "{$q}{$and}order={$sortordernow}";
$q = '';
$and = "&";

	}

	}

	
if($datecut > 0 && $datecut != 9999)
{
$page_url .= "{$q}{$and}datecut={$datecut}";

	
if($datecut > 0 && $datecut != 9999)
{
$page_url .= "{$q}{$and}datecut={$datecut}";

	}
}
else
{

	}
}
else
{

	$page_url = str_replace("{fid}", $fid, FORUM_URL_PAGED);
}
$multipage = multipage($threadcount, $perpage, $page, $page_url);


	$page_url = str_replace("{fid}", $fid, FORUM_URL_PAGED);
}
$multipage = multipage($threadcount, $perpage, $page, $page_url);


if($foruminfo['allowtratings'] != 0)

if($foruminfo['allowtratings'] != 0 && $fpermissions['canviewthreads'] != 0)

{
$lang->load("ratethread");
switch($db->type)

{
$lang->load("ratethread");
switch($db->type)

Zeile 546Zeile 573

$avaragerating[$thread['tid']] = $rating;
}


$avaragerating[$thread['tid']] = $rating;
}

 
			$t = "t.";
$sortfield = "lastpost";

			break;
default:
$ratingadd = "(t.totalratings/t.numratings) AS averagerating, ";

			break;
default:
$ratingadd = "(t.totalratings/t.numratings) AS averagerating, ";

Zeile 559Zeile 588
}
else
{

}
else
{

 
	if($sortfield == "averagerating")
{
$t = "t.";
$sortfield = "lastpost";
}

	$ratingadd = '';
$lpbackground = "trow1";
$colspan = "6";

	$ratingadd = '';
$lpbackground = "trow1";
$colspan = "6";

Zeile 639Zeile 673

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



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


// Start Getting Threads
$query = $db->query("
SELECT t.*, {$ratingadd}{$select_rating_user}t.username AS threadusername, u.username
FROM ".TABLE_PREFIX."threads t
LEFT JOIN ".TABLE_PREFIX."users u ON (u.uid = t.uid){$select_voting}
WHERE t.fid='$fid' $tvisibleonly $datecutsql2
ORDER BY t.sticky DESC, {$t}{$sortfield} $sortordernow $sortfield2
LIMIT $start, $perpage
");
while($thread = $db->fetch_array($query))

if($fpermissions['canviewthreads'] != 0)










{

{

	if($db->type == "pgsql")










	// Start Getting Threads
$query = $db->query("
SELECT t.*, {$ratingadd}{$select_rating_user}t.username AS threadusername, u.username
FROM ".TABLE_PREFIX."threads t
LEFT JOIN ".TABLE_PREFIX."users u ON (u.uid = t.uid){$select_voting}
WHERE t.fid='$fid' $tvisibleonly $datecutsql2
ORDER BY t.sticky DESC, {$t}{$sortfield} $sortordernow $sortfield2
LIMIT $start, $perpage
");
while($thread = $db->fetch_array($query))

	{

	{

		$thread['averagerating'] = $averagerating[$thread['tid']];
}

$threadcache[$thread['tid']] = $thread;

		if($db->type == "pgsql")
{
$thread['averagerating'] = $averagerating[$thread['tid']];
}





	// If this is a moved thread - set the tid for participation marking and thread read marking to that of the moved thread
if(substr($thread['closed'], 0, 5) == "moved")
{
$tid = substr($thread['closed'], 6);
if(!$tids[$tid])










		$threadcache[$thread['tid']] = $thread;

// If this is a moved thread - set the tid for participation marking and thread read marking to that of the moved thread
if(substr($thread['closed'], 0, 5) == "moved")
{
$tid = substr($thread['closed'], 6);
if(!$tids[$tid])
{
$moved_threads[$tid] = $thread['tid'];
$tids[$thread['tid']] = $tid;
}
}
// Otherwise - set it to the plain thread ID
else

		{

		{

			$moved_threads[$tid] = $thread['tid'];
$tids[$thread['tid']] = $tid;
}
}
// Otherwise - set it to the plain thread ID
else
{
$tids[$thread['tid']] = $thread['tid'];
if($moved_threads[$tid])
{
unset($moved_threads[$tid]);

			$tids[$thread['tid']] = $thread['tid'];
if($moved_threads[$tid])
{
unset($moved_threads[$tid]);
}







		}
}

		}
}

 
}
else
{
$tids = $threadcache = null;

}

if($tids)

}

if($tids)

Zeile 807Zeile 848
			}
else
{

			}
else
{

				$thread['averagerating'] = intval(round($thread['averagerating'], 2));
$thread['width'] = $thread['averagerating']*20;

				$thread['averagerating'] = floatval(round($thread['averagerating'], 2));
$thread['width'] = intval(round($thread['averagerating']))*20;

				$thread['numratings'] = intval($thread['numratings']);

$not_rated = '';

				$thread['numratings'] = intval($thread['numratings']);

$not_rated = '';