Vergleich forumdisplay.php - 1.4.0 - 1.4.4

  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 4020 2008-07-15 22:03:34Z Tikitiki $

 * $Id: forumdisplay.php 4276 2008-11-23 03:01:33Z Tikitiki $

 */

define("IN_MYBB", 1);

 */

define("IN_MYBB", 1);

 
define('THIS_SCRIPT', 'forumdisplay.php');


$templatelist = "forumdisplay,forumdisplay_thread,breadcrumb_bit,forumbit_depth1_cat,forumbit_depth1_forum,forumbit_depth2_cat,forumbit_depth2_forum,forumdisplay_subforums,forumdisplay_threadlist,forumdisplay_moderatedby_moderator,forumdisplay_moderatedby,forumdisplay_newthread,forumdisplay_searchforum,forumdisplay_orderarrow,forumdisplay_thread_rating,forumdisplay_announcement,forumdisplay_threadlist_rating,forumdisplay_threadlist_sortrating,forumdisplay_subforums_modcolumn,forumbit_moderators,forumbit_subforums,forumbit_depth2_forum_lastpost";
$templatelist .= ",forumbit_depth1_forum_lastpost,forumdisplay_thread_multipage_page,forumdisplay_thread_multipage,forumdisplay_thread_multipage_more";


$templatelist = "forumdisplay,forumdisplay_thread,breadcrumb_bit,forumbit_depth1_cat,forumbit_depth1_forum,forumbit_depth2_cat,forumbit_depth2_forum,forumdisplay_subforums,forumdisplay_threadlist,forumdisplay_moderatedby_moderator,forumdisplay_moderatedby,forumdisplay_newthread,forumdisplay_searchforum,forumdisplay_orderarrow,forumdisplay_thread_rating,forumdisplay_announcement,forumdisplay_threadlist_rating,forumdisplay_threadlist_sortrating,forumdisplay_subforums_modcolumn,forumbit_moderators,forumbit_subforums,forumbit_depth2_forum_lastpost";
$templatelist .= ",forumbit_depth1_forum_lastpost,forumdisplay_thread_multipage_page,forumdisplay_thread_multipage,forumdisplay_thread_multipage_more";

Zeile 77Zeile 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 201Zeile 224
				$doneusers[$user['uid']] = $user['time'];
++$membercount;
if($user['invisible'] == 1)

				$doneusers[$user['uid']] = $user['time'];
++$membercount;
if($user['invisible'] == 1)

				{

				{

					$invisiblemark = "*";
++$inviscount;
}

					$invisiblemark = "*";
++$inviscount;
}

Zeile 237Zeile 260
		$invisonline = $lang->sprintf($lang->users_browsing_forum_invis, $inviscount);
}


		$invisonline = $lang->sprintf($lang->users_browsing_forum_invis, $inviscount);
}


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

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

	{
$onlinesep2 = ", ";
}

	{
$onlinesep2 = ", ";
}

Zeile 380Zeile 403
{
case "subject":
$sortfield = "subject";

{
case "subject":
$sortfield = "subject";

		break;

		break;

	case "replies":
$sortfield = "replies";
break;

	case "replies":
$sortfield = "replies";
break;

Zeile 403Zeile 426
		$sortfield = "lastpost";
$mybb->input['sortby'] = "lastpost";
break;

		$sortfield = "lastpost";
$mybb->input['sortby'] = "lastpost";
break;

}

}


$sortsel[$mybb->input['sortby']] = "selected=\"selected\"";



$sortsel[$mybb->input['sortby']] = "selected=\"selected\"";


Zeile 439Zeile 462
	{
$query = $db->simple_select("threads", "COUNT(tid) AS threads", "fid = '$fid' $visibleonly", array('limit' => 1));
$threadcount = $db->fetch_field($query, "threads");

	{
$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'])
{
$mybb->settings['threadsperpage'] = 20;


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

}

}


$perpage = $mybb->settings['threadsperpage'];



$perpage = $mybb->settings['threadsperpage'];


Zeile 460Zeile 483
	{
$start = 0;
$page = 1;

	{
$start = 0;
$page = 1;

	}
}

	}
}

else
{
$start = 0;
$page = 1;

else
{
$start = 0;
$page = 1;

}


}


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

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

Zeile 481Zeile 504
if($mybb->input['sortby'] || $mybb->input['order'] || $mybb->input['datecut']) // Ugly URL
{
$page_url = str_replace("{fid}", $fid, FORUM_URL_PAGED);

if($mybb->input['sortby'] || $mybb->input['order'] || $mybb->input['datecut']) // Ugly URL
{
$page_url = str_replace("{fid}", $fid, FORUM_URL_PAGED);

	

	

	if($mybb->settings['seourls'] == "yes" || ($mybb->settings['seourls'] == "auto" && $_SERVER['SEO_SUPPORT'] == 1))

	if($mybb->settings['seourls'] == "yes" || ($mybb->settings['seourls'] == "auto" && $_SERVER['SEO_SUPPORT'] == 1))

	{

	{

		$q = "?";
$and = '';
}
else

		$q = "?";
$and = '';
}
else

	{
$q = '';
$and = "&";
}

	{
$q = '';
$and = "&";
}

	
if($sortby != "lastpost")
{
$page_url .= "{$q}{$and}sortby={$sortby}";

	
if($sortby != "lastpost")
{
$page_url .= "{$q}{$and}sortby={$sortby}";

		$q = '';
$and = "&";
}

		$q = '';
$and = "&";
}

	
if($sortordernow != "desc")
{

	
if($sortordernow != "desc")
{

Zeile 510Zeile 533
	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);

Zeile 535Zeile 558
			while($thread = $db->fetch_array($query))
{
if($thread['totalratings'] == 0)

			while($thread = $db->fetch_array($query))
{
if($thread['totalratings'] == 0)

				{

				{

					$rating = 0;
}
else

					$rating = 0;
}
else

Zeile 545Zeile 568

$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 558Zeile 583
}
else
{

}
else
{

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

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

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

Zeile 806Zeile 836
			}
else
{

			}
else
{

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

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

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

$not_rated = '';

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

$not_rated = '';