Vergleich forumdisplay.php - 1.4.2 - 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 4151 2008-08-26 04:39:31Z 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 258Zeile 266
	if($inviscount && $mybb->usergroup['canviewwolinvis'] != 1 && ($inviscount != 1 && $mybb->user['invisible'] != 1))
{
$invisonline = $lang->sprintf($lang->users_browsing_forum_invis, $inviscount);

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

}

// How many pages are there?

}

// How many pages are there?

Zeile 494Zeile 507
$end = $start + $perpage;
$lower = $start + 1;
$upper = $end;

$end = $start + $perpage;
$lower = $start + 1;
$upper = $end;





if($upper > $threadcount)
{
$upper = $threadcount;

if($upper > $threadcount)
{
$upper = $threadcount;

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'])
{
$new_class = ' class="subject_new"';
$folder = "newfolder";

while($announcement = $db->fetch_array($query))
{
if($announcement['startdate'] > $mybb->user['lastvisit'])
{
$new_class = ' class="subject_new"';
$folder = "newfolder";

	}

	}

	else
{
$new_class = '';

	else
{
$new_class = '';

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


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

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

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

}

$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")
{
$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
{
$tids[$thread['tid']] = $thread['tid'];
if($moved_threads[$tid])
{
unset($moved_threads[$tid]);
}
}
}




}

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

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))
{
$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
{
$tids[$thread['tid']] = $thread['tid'];
if($moved_threads[$tid])
{
unset($moved_threads[$tid]);
}
}
}
}
else
{
$tids = $threadcache = null;
}


if($tids)
{
$tids = implode(",", $tids);

if($tids)
{
$tids = implode(",", $tids);

Zeile 753Zeile 747

$read_cutoff = TIME_NOW-$mybb->settings['threadreadcut']*60*60*24;
if($forum_read == 0 || $forum_read < $read_cutoff)


$read_cutoff = TIME_NOW-$mybb->settings['threadreadcut']*60*60*24;
if($forum_read == 0 || $forum_read < $read_cutoff)

	{

	{

		$forum_read = $read_cutoff;
}
}

		$forum_read = $read_cutoff;
}
}

Zeile 783Zeile 777
		}

$folder = '';

		}

$folder = '';

		$prefix = '';


		$prefix = '';


		$thread['author'] = $thread['uid'];
if(!$thread['username'])
{
$thread['username'] = $thread['threadusername'];
$thread['profilelink'] = $thread['threadusername'];

		$thread['author'] = $thread['uid'];
if(!$thread['username'])
{
$thread['username'] = $thread['threadusername'];
$thread['profilelink'] = $thread['threadusername'];

		}

		}

		else
{
$thread['profilelink'] = build_profile_link($thread['username'], $thread['uid']);

		else
{
$thread['profilelink'] = build_profile_link($thread['username'], $thread['uid']);

Zeile 800Zeile 794
		$thread['subject'] = htmlspecialchars_uni($thread['subject']);

if($thread['icon'] > 0 && $icon_cache[$thread['icon']])

		$thread['subject'] = htmlspecialchars_uni($thread['subject']);

if($thread['icon'] > 0 && $icon_cache[$thread['icon']])

		{

		{

			$icon = $icon_cache[$thread['icon']];
$icon = "<img src=\"{$icon['path']}\" alt=\"{$icon['name']}\" />";
}

			$icon = $icon_cache[$thread['icon']];
$icon = "<img src=\"{$icon['path']}\" alt=\"{$icon['name']}\" />";
}

Zeile 831Zeile 825
		if($foruminfo['allowtratings'] != 0)
{
if($moved[0] == "moved")

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

			{

			{

				$rating = "<td class=\"{$bgcolor}\" style=\"text-align: center;\">-</td>";
}
else
{

				$rating = "<td class=\"{$bgcolor}\" style=\"text-align: center;\">-</td>";
}
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 = '';

Zeile 848Zeile 842

$ratingvotesav = $lang->sprintf($lang->rating_votes_average, $thread['numratings'], $thread['averagerating']);
eval("\$rating = \"".$templates->get("forumdisplay_thread_rating")."\";");


$ratingvotesav = $lang->sprintf($lang->rating_votes_average, $thread['numratings'], $thread['averagerating']);
eval("\$rating = \"".$templates->get("forumdisplay_thread_rating")."\";");

			}
}

			}
}


$thread['pages'] = 0;
$thread['multipage'] = '';


$thread['pages'] = 0;
$thread['multipage'] = '';

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

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

			}


			}


			for($i = 1; $i <= $pagesstop; ++$i)
{
$page_link = get_thread_link($thread['tid'], $i);

			for($i = 1; $i <= $pagesstop; ++$i)
{
$page_link = get_thread_link($thread['tid'], $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'])));