Vergleich forumdisplay.php - 1.4.9 - 1.4.11

  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 4322 2009-02-21 23:00:49Z Tikitiki $

 * $Id: forumdisplay.php 4536 2009-11-25 06:34:47Z RyanGordon $

 */

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 291Zeile 294
	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";

}

$bgcolor = "trow1";

Zeile 309Zeile 312
	$inlinecookie = "inlinemod_forum".$fid;
$visibleonly = " AND (visible='1' OR visible='0')";
$tvisibleonly = " AND (t.visible='1' OR t.visible='0')";

	$inlinecookie = "inlinemod_forum".$fid;
$visibleonly = " AND (visible='1' OR visible='0')";
$tvisibleonly = " AND (t.visible='1' OR t.visible='0')";

}

}

else
{
$inlinemod = '';

else
{
$inlinemod = '';

Zeile 336Zeile 339
	if($mybb->user['daysprune'])
{
$datecut = $mybb->user['daysprune'];

	if($mybb->user['daysprune'])
{
$datecut = $mybb->user['daysprune'];

	}

	}

	else
{
// If the forum has a non-default date cut, use it.

	else
{
// If the forum has a non-default date cut, use it.

Zeile 345Zeile 348
			$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 364Zeile 367
{
$datecutsql = '';
$datecutsql2 = '';

{
$datecutsql = '';
$datecutsql2 = '';

}


}


// Pick the sort order.
if(!isset($mybb->input['order']) && !empty($foruminfo['defaultsortorder']))
{

// Pick the sort order.
if(!isset($mybb->input['order']) && !empty($foruminfo['defaultsortorder']))
{

Zeile 375Zeile 378
$mybb->input['order'] = htmlspecialchars($mybb->input['order']);

switch(my_strtolower($mybb->input['order']))

$mybb->input['order'] = htmlspecialchars($mybb->input['order']);

switch(my_strtolower($mybb->input['order']))

{

{

	case "asc":
$sortordernow = "asc";
$ordersel['asc'] = "selected=\"selected\"";

	case "asc":
$sortordernow = "asc";
$ordersel['asc'] = "selected=\"selected\"";

Zeile 394Zeile 397
if(!isset($mybb->input['sortby']) && !empty($foruminfo['defaultsortby']))
{
$mybb->input['sortby'] = $foruminfo['defaultsortby'];

if(!isset($mybb->input['sortby']) && !empty($foruminfo['defaultsortby']))
{
$mybb->input['sortby'] = $foruminfo['defaultsortby'];

}


}


$t = "t.";

$sortby = htmlspecialchars($mybb->input['sortby']);

$t = "t.";

$sortby = htmlspecialchars($mybb->input['sortby']);

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

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

		break;

		break;

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

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

		break;

		break;

	case "views":
$sortfield = "views";

	case "views":
$sortfield = "views";

		break;

		break;

	case "starter":
$sortfield = "username";

	case "starter":
$sortfield = "username";

		break;

		break;

	case "rating":
$t = "";
$sortfield = "averagerating";

	case "rating":
$t = "";
$sortfield = "averagerating";

Zeile 440Zeile 443
	$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")."\";");





$threadcount = 0;

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

$threadcount = 0;

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

Zeile 467Zeile 470
			$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'];


if(intval($mybb->input['page']) > 0)
{


if(intval($mybb->input['page']) > 0)
{

Zeile 494Zeile 497
{
$start = 0;
$page = 1;

{
$start = 0;
$page = 1;

}


}


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

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

Zeile 514Zeile 517
	{
$q = "?";
$and = '';

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

	}

	}

	else

	else

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

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

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

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

		$q = '';

		$q = '';

		$and = "&";
}


		$and = "&";
}


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

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

	}

	}

	
if($datecut > 0 && $datecut != 9999)
{

	
if($datecut > 0 && $datecut != 9999)
{

Zeile 552Zeile 555
	switch($db->type)
{
case "pgsql":

	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 620Zeile 601
	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 686Zeile 668
	");
while($thread = $db->fetch_array($query))
{

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

		$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