Vergleich forumdisplay.php - 1.4.1 - 1.4.2

  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 4151 2008-08-26 04:39:31Z 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 263Zeile 285

$foruminfo['rules'] = $parser->parse_message($foruminfo['rules'], $rules_parser);
if($foruminfo['rulestype'] == 1)


$foruminfo['rules'] = $parser->parse_message($foruminfo['rules'], $rules_parser);
if($foruminfo['rulestype'] == 1)

	{

	{

		eval("\$rules = \"".$templates->get("forumdisplay_rules")."\";");

		eval("\$rules = \"".$templates->get("forumdisplay_rules")."\";");

	}

	}

	else if($foruminfo['rulestype'] == 2)
{
eval("\$rules = \"".$templates->get("forumdisplay_rules_link")."\";");

	else if($foruminfo['rulestype'] == 2)
{
eval("\$rules = \"".$templates->get("forumdisplay_rules_link")."\";");

	}
}


	}
}


$bgcolor = "trow1";

// Set here to fetch only approved topics (and then below for a moderator we change this).

$bgcolor = "trow1";

// Set here to fetch only approved topics (and then below for a moderator we change this).

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 322Zeile 344
		{
$datecut = $foruminfo['defaultdatecut'];
}

		{
$datecut = $foruminfo['defaultdatecut'];
}

	}

	}

}
// If there was a manual date cut override, use it.
else

}
// If there was a manual date cut override, use it.
else

Zeile 337Zeile 359
	$checkdate = TIME_NOW - ($datecut * 86400);
$datecutsql = "AND (lastpost >= '$checkdate' OR sticky = '1')";
$datecutsql2 = "AND (t.lastpost >= '$checkdate' OR t.sticky = '1')";

	$checkdate = TIME_NOW - ($datecut * 86400);
$datecutsql = "AND (lastpost >= '$checkdate' OR sticky = '1')";
$datecutsql2 = "AND (t.lastpost >= '$checkdate' OR t.sticky = '1')";

}

}

else
{
$datecutsql = '';

else
{
$datecutsql = '';

Zeile 359Zeile 381
        $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\"";
$oppsort = $lang->asc;
$oppsortnext = "asc";
break;

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

}


}


// Sort by which field?
if(!isset($mybb->input['sortby']) && !empty($foruminfo['defaultsortby']))
{

// Sort by which field?
if(!isset($mybb->input['sortby']) && !empty($foruminfo['defaultsortby']))
{

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

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

		break;

		break;

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

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

Zeile 404Zeile 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 440Zeile 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 461Zeile 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 482Zeile 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 511Zeile 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 536Zeile 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 546Zeile 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 559Zeile 583
}
else
{

}
else
{

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

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

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