Vergleich forumdisplay.php - 1.8.0 - 1.8.5

  Keine Änderungen   Hinzugefügt   Modifiziert   Entfernt
Zeile 36Zeile 36

$plugins->run_hooks("forumdisplay_start");



$plugins->run_hooks("forumdisplay_start");


$fid = $mybb->get_input('fid', 1);

$fid = $mybb->get_input('fid', MyBB::INPUT_INT);

if($fid < 0)
{
switch($fid)

if($fid < 0)
{
switch($fid)

Zeile 329Zeile 329
		$guestsonline = $lang->sprintf($lang->users_browsing_forum_guests, $guestcount);
}


		$guestsonline = $lang->sprintf($lang->users_browsing_forum_guests, $guestcount);
}


	$onlinesep = '';
if($guestcount && $onlinemembers)

	$invisonline = '';
if($mybb->user['invisible'] == 1)

	{

	{

		$onlinesep = $lang->comma;
}

$invisonline = '';
if($inviscount && $mybb->usergroup['canviewwolinvis'] != 1 && ($inviscount != 1 && $mybb->user['invisible'] != 1))

		// the user was counted as invisible user --> correct the inviscount
$inviscount -= 1;
}
if($inviscount && $mybb->usergroup['canviewwolinvis'] != 1)


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

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

	}









	} 


$onlinesep = '';
if($invisonline != '' && $onlinemembers)
{
$onlinesep = $lang->comma;
}


	$onlinesep2 = '';

	$onlinesep2 = '';

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

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

	{
$onlinesep2 = $lang->comma;
}

eval("\$usersbrowsing = \"".$templates->get("forumdisplay_usersbrowsing")."\";");

	{
$onlinesep2 = $lang->comma;
}

eval("\$usersbrowsing = \"".$templates->get("forumdisplay_usersbrowsing")."\";");

}

}


// Do we have any forum rules to show for this forum?
$forumrules = '';


// Do we have any forum rules to show for this forum?
$forumrules = '';

Zeile 430Zeile 436

// Pick out some sorting options.
// First, the date cut for the threads.


// Pick out some sorting options.
// First, the date cut for the threads.

$datecut = 0;

$datecut = 9999;

if(empty($mybb->input['datecut']))
{
// If the user manually set a date cut, use it.

if(empty($mybb->input['datecut']))
{
// If the user manually set a date cut, use it.

	if(isset($mybb->user['daysprune']))

	if(!empty($mybb->user['daysprune']))

	{
$datecut = $mybb->user['daysprune'];
}

	{
$datecut = $mybb->user['daysprune'];
}

Zeile 448Zeile 454
	}
}
// If there was a manual date cut override, use it.

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

else
{
$datecut = $mybb->get_input('datecut', 1);
}

$datecut = (int)$datecut;
$datecutsel[$datecut] = "selected=\"selected\"";
if($datecut > 0 && $datecut != 9999)

else
{
$datecut = $mybb->get_input('datecut', MyBB::INPUT_INT);
}

$datecutsel[(int)$datecut] = ' selected="selected"';
if($datecut > 0 && $datecut != 9999)


{
$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

else

{

{

	$datecutsql = '';
$datecutsql2 = '';
}

// Sort by thread prefix

	$datecutsql = '';
$datecutsql2 = '';
}

// Sort by thread prefix

$tprefix = $mybb->get_input('prefix', 1);

$tprefix = $mybb->get_input('prefix', MyBB::INPUT_INT);

if($tprefix > 0)
{

if($tprefix > 0)
{

	$prefixsql = "AND prefix='{$tprefix}'";
$prefixsql2 = "AND t.prefix='{$tprefix}'";











	$prefixsql = "AND prefix = {$tprefix}";
$prefixsql2 = "AND t.prefix = {$tprefix}";
}
else if($tprefix == -1)
{
$prefixsql = "AND prefix = 0";
$prefixsql2 = "AND t.prefix = 0";
}
else if($tprefix == -2)
{
$prefixsql = "AND prefix != 0";
$prefixsql2 = "AND t.prefix != 0";

}
else
{

}
else
{

	$prefixsql = '';
$prefixsql2 = '';

	$prefixsql = $prefixsql2 = '';


}

// Pick the sort order.

}

// Pick the sort order.

Zeile 496Zeile 510
{
case "asc":
$sortordernow = "asc";

{
case "asc":
$sortordernow = "asc";

        $ordersel['asc'] = "selected=\"selected\"";

        $ordersel['asc'] = ' selected="selected"';

		$oppsort = $lang->desc;
$oppsortnext = "desc";
break;
default:
$sortordernow = "desc";

		$oppsort = $lang->desc;
$oppsortnext = "desc";
break;
default:
$sortordernow = "desc";

		$ordersel['desc'] = "selected=\"selected\"";

		$ordersel['desc'] = ' selected="selected"';

        $oppsort = $lang->asc;
$oppsortnext = "asc";
break;

        $oppsort = $lang->asc;
$oppsortnext = "asc";
break;

Zeile 553Zeile 567
}

$sortsel['rating'] = ''; // Needs to be initialized in order to speed-up things. Fixes #2031

}

$sortsel['rating'] = ''; // Needs to be initialized in order to speed-up things. Fixes #2031

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

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


// Pick the right string to join the sort URL
if($mybb->seo_support == true)


// Pick the right string to join the sort URL
if($mybb->seo_support == true)

Zeile 566Zeile 580
}

// Are we viewing a specific page?

}

// Are we viewing a specific page?

$mybb->input['page'] = $mybb->get_input('page', 1);

$mybb->input['page'] = $mybb->get_input('page', MyBB::INPUT_INT);

if($mybb->input['page'] > 1)
{
$sorturl = get_forum_link($fid, $mybb->input['page']).$string."datecut=$datecut&amp;prefix=$tprefix";

if($mybb->input['page'] > 1)
{
$sorturl = get_forum_link($fid, $mybb->input['page']).$string."datecut=$datecut&amp;prefix=$tprefix";

Zeile 589Zeile 603
if($fpermissions['canviewthreads'] != 0)
{
// How many posts are there?

if($fpermissions['canviewthreads'] != 0)
{
// How many posts are there?

	if($datecut > 0 || isset($fpermissions['canonlyviewownthreads']) && $fpermissions['canonlyviewownthreads'] == 1)

	if(($datecut > 0 && $datecut != 9999) || isset($fpermissions['canonlyviewownthreads']) && $fpermissions['canonlyviewownthreads'] == 1)

	{
$query = $db->simple_select("threads", "COUNT(tid) AS threads", "fid = '$fid' $useronly $visibleonly $datecutsql $prefixsql");
$threadcount = $db->fetch_field($query, "threads");

	{
$query = $db->simple_select("threads", "COUNT(tid) AS threads", "fid = '$fid' $useronly $visibleonly $datecutsql $prefixsql");
$threadcount = $db->fetch_field($query, "threads");

Zeile 678Zeile 692
		$and = "&";
}


		$and = "&";
}


	if($datecut > 0)

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

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


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


	if($tprefix > 0)

	if($tprefix != 0)

	{
$page_url .= "{$q}{$and}prefix={$tprefix}";
}

	{
$page_url .= "{$q}{$and}prefix={$tprefix}";
}

Zeile 824Zeile 838
	}
else if(!empty($cookie))
{

	}
else if(!empty($cookie))
{

		my_setcookie("mybb[announcements]", addslashes(serialize($cookie)), -1);

		my_setcookie("mybb[announcements]", addslashes(my_serialize($cookie)), -1);

	}
}
else

	}
}
else

Zeile 913Zeile 927
// Check participation by the current user in any of these threads - for 'dot' folder icons
if($mybb->settings['dotfolders'] != 0 && $mybb->user['uid'] && !empty($threadcache))
{

// Check participation by the current user in any of these threads - for 'dot' folder icons
if($mybb->settings['dotfolders'] != 0 && $mybb->user['uid'] && !empty($threadcache))
{

	$query = $db->simple_select("posts", "tid,uid", "uid='{$mybb->user['uid']}' AND tid IN ({$tids}) {$visibleonly}");

	$query = $db->simple_select("posts", "DISTINCT tid,uid", "uid='{$mybb->user['uid']}' AND tid IN ({$tids}) {$visibleonly}");

	while($post = $db->fetch_array($query))
{
if(!empty($moved_threads[$post['tid']]))

	while($post = $db->fetch_array($query))
{
if(!empty($moved_threads[$post['tid']]))

Zeile 1039Zeile 1053
		{
$icon = $icon_cache[$thread['icon']];
$icon['path'] = str_replace("{theme}", $theme['imgdir'], $icon['path']);

		{
$icon = $icon_cache[$thread['icon']];
$icon['path'] = str_replace("{theme}", $theme['imgdir'], $icon['path']);

 
			$icon['path'] = htmlspecialchars_uni($icon['path']);
$icon['name'] = htmlspecialchars_uni($icon['name']);

			eval("\$icon = \"".$templates->get("forumdisplay_thread_icon")."\";");
}
else

			eval("\$icon = \"".$templates->get("forumdisplay_thread_icon")."\";");
}
else

Zeile 1320Zeile 1336
						$gid = (int)$gid;
$gidswhere .= " OR ','||groups||',' LIKE '%,{$gid},%'";
}

						$gid = (int)$gid;
$gidswhere .= " OR ','||groups||',' LIKE '%,{$gid},%'";
}

					$query = $db->simple_select("modtools", 'tid, name', "(','||forums||',' LIKE '%,$fid,%' OR ','||forums||',' LIKE '%,-1,%' OR forums='') AND (groups=''{$gidswhere}) AND type = 't'");

					$query = $db->simple_select("modtools", 'tid, name', "(','||forums||',' LIKE '%,$fid,%' OR ','||forums||',' LIKE '%,-1,%' OR forums='') AND (groups='' OR ','||groups||',' LIKE '%,-1,%'{$gidswhere}) AND type = 't'");

					break;
default:
foreach($gids as $gid)

					break;
default:
foreach($gids as $gid)

Zeile 1328Zeile 1344
						$gid = (int)$gid;
$gidswhere .= " OR CONCAT(',',groups,',') LIKE '%,{$gid},%'";
}

						$gid = (int)$gid;
$gidswhere .= " OR CONCAT(',',groups,',') LIKE '%,{$gid},%'";
}

					$query = $db->simple_select("modtools", 'tid, name', "(CONCAT(',',forums,',') LIKE '%,$fid,%' OR CONCAT(',',forums,',') LIKE '%,-1,%' OR forums='') AND (groups=''{$gidswhere}) AND type = 't'");

					$query = $db->simple_select("modtools", 'tid, name', "(CONCAT(',',forums,',') LIKE '%,$fid,%' OR CONCAT(',',forums,',') LIKE '%,-1,%' OR forums='') AND (groups='' OR CONCAT(',',groups,',') LIKE '%,-1,%'{$gidswhere}) AND type = 't'");

					break;
}


					break;
}