Vergleich forumdisplay.php - 1.4.4 - 1.4.16

  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 4276 2008-11-23 03:01:33Z Tikitiki $

 * $Id: forumdisplay.php 5379 2011-02-21 11:06:42Z Tomm $

 */

define("IN_MYBB", 1);

 */

define("IN_MYBB", 1);

Zeile 69Zeile 69
$currentitem = $fid;
build_forum_breadcrumb($fid);
$parentlist = $foruminfo['parentlist'];

$currentitem = $fid;
build_forum_breadcrumb($fid);
$parentlist = $foruminfo['parentlist'];

 

// To validate, turn & to & but keep unicode support
$foruminfo['name'] = preg_replace("#&(?!\#[0-9]+;)#si", "&", $foruminfo['name']);


$forumpermissions = forum_permissions();
$fpermissions = $forumpermissions[$fid];


$forumpermissions = forum_permissions();
$fpermissions = $forumpermissions[$fid];

Zeile 85Zeile 88
		SELECT *
FROM ".TABLE_PREFIX."forums
WHERE active != 0

		SELECT *
FROM ".TABLE_PREFIX."forums
WHERE active != 0

		ORDER BY pid, disporder

		ORDER BY pid, disporder

	");

$forumsread = unserialize($mybb->cookies['mybb']['forumread']);

	");

$forumsread = unserialize($mybb->cookies['mybb']['forumread']);

 

if(!is_array($forumsread))
{
$forumsread = array();
}

}
else
{

}
else
{

Zeile 117Zeile 125
if($mybb->settings['modlist'] != 0)
{
$moderatorcache = $cache->read("moderators");

if($mybb->settings['modlist'] != 0)
{
$moderatorcache = $cache->read("moderators");

}

}


$bgcolor = "trow1";
if($mybb->settings['subforumsindex'] != 0)


$bgcolor = "trow1";
if($mybb->settings['subforumsindex'] != 0)

Zeile 149Zeile 157

// 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 196Zeile 204

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


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

{

{

	$timecut = TIME_NOW - $mybb->settings['wolcutoff'];

$comma = '';

	$timecut = TIME_NOW - $mybb->settings['wolcutoff'];

$comma = '';

Zeile 212Zeile 220
		ORDER BY u.username ASC, s.time DESC
");
while($user = $db->fetch_array($query))

		ORDER BY u.username ASC, s.time DESC
");
while($user = $db->fetch_array($query))

	{

	{

		if($user['uid'] == 0)
{
++$guestcount;

		if($user['uid'] == 0)
{
++$guestcount;

Zeile 292Zeile 300
	{
eval("\$rules = \"".$templates->get("forumdisplay_rules_link")."\";");
}

	{
eval("\$rules = \"".$templates->get("forumdisplay_rules_link")."\";");
}

}

}


$bgcolor = "trow1";



$bgcolor = "trow1";


Zeile 323Zeile 331
else
{
$can_edit_titles = 0;

else
{
$can_edit_titles = 0;

}

}


unset($rating);



unset($rating);


Zeile 381Zeile 389
        $ordersel['asc'] = "selected=\"selected\"";
$oppsort = $lang->desc;
$oppsortnext = "desc";

        $ordersel['asc'] = "selected=\"selected\"";
$oppsort = $lang->desc;
$oppsortnext = "desc";

		break;

		break;

	default:
$sortordernow = "desc";
$ordersel['desc'] = "selected=\"selected\"";

	default:
$sortordernow = "desc";
$ordersel['desc'] = "selected=\"selected\"";

Zeile 440Zeile 448
	$sorturl = "forumdisplay.php?fid=$fid&datecut=$datecut";
}
eval("\$orderarrow['$sortby'] = \"".$templates->get("forumdisplay_orderarrow")."\";");

	$sorturl = "forumdisplay.php?fid=$fid&datecut=$datecut";
}
eval("\$orderarrow['$sortby'] = \"".$templates->get("forumdisplay_orderarrow")."\";");


// How many posts are there?
if($datecut > 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)
{
$query = $db->simple_select("threads", "COUNT(tid) AS threads", "fid = '$fid' $visibleonly", array('limit' => 1));
$threadcount = $db->fetch_field($query, "threads");







$threadcount = 0;

if($fpermissions['canviewthreads'] != 0)
{
// How many posts are there?
if($datecut > 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)
{
$query = $db->simple_select("threads", "COUNT(tid) AS threads", "fid = '$fid' $visibleonly", array('limit' => 1));
$threadcount = $db->fetch_field($query, "threads");
}

	}
}


	}
}


Zeile 509Zeile 522
	{
$q = "?";
$and = '';

	{
$q = "?";
$and = '';

	}

	}

	else
{
$q = '';

	else
{
$q = '';

Zeile 540Zeile 553
	$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)
{
case "pgsql":

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

			$ratingadd = '';
$query = $db->query("
SELECT t.numratings, t.totalratings, t.tid
FROM ".TABLE_PREFIX."threads t
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($thread['totalratings'] == 0)
{
$rating = 0;
}
else
{
$rating = $thread['totalratings'] / $thread['numratings'];
}

$avaragerating[$thread['tid']] = $rating;
}
$t = "t.";
$sortfield = "lastpost";

			$ratingadd = "CASE WHEN t.numratings=0 THEN 0 ELSE t.totalratings/t.numratings::numeric END AS averagerating, ";























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

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

Zeile 604Zeile 595
if($mybb->settings['announcementlimit'])
{
$limit = "LIMIT 0, ".$mybb->settings['announcementlimit'];

if($mybb->settings['announcementlimit'])
{
$limit = "LIMIT 0, ".$mybb->settings['announcementlimit'];

}


}


$sql = build_parent_list($fid, "fid", "OR", $parentlist);
$time = TIME_NOW;
$query = $db->query("

$sql = build_parent_list($fid, "fid", "OR", $parentlist);
$time = TIME_NOW;
$query = $db->query("

Zeile 615Zeile 606
	WHERE a.startdate<='$time' AND (a.enddate>='$time' OR a.enddate='0') AND ($sql OR fid='-1')
ORDER BY a.startdate DESC $limit
");

	WHERE a.startdate<='$time' AND (a.enddate>='$time' OR a.enddate='0') AND ($sql OR fid='-1')
ORDER BY a.startdate DESC $limit
");

 
$bgcolor = alt_trow(true); // Reset the trow colours

while($announcement = $db->fetch_array($query))
{
if($announcement['startdate'] > $mybb->user['lastvisit'])

while($announcement = $db->fetch_array($query))
{
if($announcement['startdate'] > $mybb->user['lastvisit'])

Zeile 634Zeile 626
	$postdate = my_date($mybb->settings['dateformat'], $announcement['startdate']);
$posttime = my_date($mybb->settings['timeformat'], $announcement['startdate']);
$announcement['profilelink'] = build_profile_link($announcement['username'], $announcement['uid']);

	$postdate = my_date($mybb->settings['dateformat'], $announcement['startdate']);
$posttime = my_date($mybb->settings['timeformat'], $announcement['startdate']);
$announcement['profilelink'] = build_profile_link($announcement['username'], $announcement['uid']);

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

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

		eval("\$rating = \"".$templates->get("forumdisplay_announcement_rating")."\";");
$lpbackground = "trow2";

		eval("\$rating = \"".$templates->get("forumdisplay_announcement_rating")."\";");
$lpbackground = "trow2";

	}

	}

	else
{
$rating = '';
$lpbackground = "trow1";

	else
{
$rating = '';
$lpbackground = "trow1";

	}


	}


	if($ismod)
{
eval("\$modann = \"".$templates->get("forumdisplay_announcements_announcement_modbit")."\";");

	if($ismod)
{
eval("\$modann = \"".$templates->get("forumdisplay_announcements_announcement_modbit")."\";");

Zeile 664Zeile 656
{
eval("\$announcementlist = \"".$templates->get("forumdisplay_announcements")."\";");
$shownormalsep = true;

{
eval("\$announcementlist = \"".$templates->get("forumdisplay_announcements")."\";");
$shownormalsep = true;

}


}


$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($db->type == "pgsql")
{
$thread['averagerating'] = $averagerating[$thread['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")

if($fpermissions['canviewthreads'] != 0)
{
// 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))









	{

	{

		$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 837Zeile 831
			else
{
$thread['averagerating'] = floatval(round($thread['averagerating'], 2));

			else
{
$thread['averagerating'] = floatval(round($thread['averagerating'], 2));

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

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

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

$not_rated = '';

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

$not_rated = '';

Zeile 881Zeile 875
			else
{
$pagesstop = $thread['pages'];

			else
{
$pagesstop = $thread['pages'];

			}

			}


for($i = 1; $i <= $pagesstop; ++$i)
{


for($i = 1; $i <= $pagesstop; ++$i)
{

Zeile 1135Zeile 1129
	if($load_inline_edit_js == 1)
{
eval("\$inline_edit_js = \"".$templates->get("forumdisplay_threadlist_inlineedit_js")."\";");

	if($load_inline_edit_js == 1)
{
eval("\$inline_edit_js = \"".$templates->get("forumdisplay_threadlist_inlineedit_js")."\";");

 
	}

$post_code_string = '';
if($mybb->user['uid'])
{
$post_code_string = "&my_post_key=".$mybb->post_code;

	}

$lang->rss_discovery_forum = $lang->sprintf($lang->rss_discovery_forum, htmlspecialchars_uni(strip_tags($foruminfo['name'])));

	}

$lang->rss_discovery_forum = $lang->sprintf($lang->rss_discovery_forum, htmlspecialchars_uni(strip_tags($foruminfo['name'])));