Vergleich forumdisplay.php - 1.6.10 - 1.6.14

  Keine Änderungen   Hinzugefügt   Modifiziert   Entfernt
Zeile 12Zeile 12
define("IN_MYBB", 1);
define('THIS_SCRIPT', 'forumdisplay.php');


define("IN_MYBB", 1);
define('THIS_SCRIPT', 'forumdisplay.php');


$templatelist = "forumdisplay,forumdisplay_thread,forumbit_depth1_cat,forumbit_depth1_forum,forumbit_depth2_cat,forumbit_depth2_forum,forumdisplay_subforums,forumdisplay_threadlist,forumdisplay_moderatedby,forumdisplay_newthread,forumdisplay_searchforum,forumdisplay_orderarrow,forumdisplay_thread_rating,forumdisplay_threadlist_rating,forumdisplay_threadlist_sortrating,forumbit_moderators,forumbit_subforums,forumbit_depth2_forum_lastpost";

$templatelist = "forumdisplay,forumdisplay_thread,forumbit_depth1_cat,forumbit_depth2_cat,forumbit_depth2_forum,forumdisplay_subforums,forumdisplay_threadlist,forumdisplay_moderatedby,forumdisplay_newthread,forumdisplay_searchforum,forumdisplay_orderarrow,forumdisplay_thread_rating,forumdisplay_threadlist_rating,forumdisplay_threadlist_sortrating,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 .= ",multipage_prevpage,multipage_nextpage,multipage_page_current,multipage_page,multipage_start,multipage_end,multipage";
$templatelist .= ",forumjump_advanced,forumjump_special,forumjump_bit,forumdisplay_password_wrongpass,forumdisplay_password";

$templatelist .= ",forumbit_depth1_forum_lastpost,forumdisplay_thread_multipage_page,forumdisplay_thread_multipage,forumdisplay_thread_multipage_more";
$templatelist .= ",multipage_prevpage,multipage_nextpage,multipage_page_current,multipage_page,multipage_start,multipage_end,multipage";
$templatelist .= ",forumjump_advanced,forumjump_special,forumjump_bit,forumdisplay_password_wrongpass,forumdisplay_password";

Zeile 298Zeile 298
				{
$invisiblemark = '';
}

				{
$invisiblemark = '';
}

				



				if($user['invisible'] != 1 || $mybb->usergroup['canviewwolinvis'] == 1 || $user['uid'] == $mybb->user['uid'])
{
$user['username'] = format_name($user['username'], $user['usergroup'], $user['displaygroup']);

				if($user['invisible'] != 1 || $mybb->usergroup['canviewwolinvis'] == 1 || $user['uid'] == $mybb->user['uid'])
{
$user['username'] = format_name($user['username'], $user['usergroup'], $user['displaygroup']);

Zeile 321Zeile 321
	{
$onlinesep = $lang->comma;
}

	{
$onlinesep = $lang->comma;
}

	



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

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

Zeile 344Zeile 344
	{
$foruminfo['rulestitle'] = $lang->sprintf($lang->forum_rules, $foruminfo['name']);
}

	{
$foruminfo['rulestitle'] = $lang->sprintf($lang->forum_rules, $foruminfo['name']);
}

	



	$rules_parser = array(
"allow_html" => 1,
"allow_mycode" => 1,

	$rules_parser = array(
"allow_html" => 1,
"allow_mycode" => 1,

Zeile 360Zeile 360
	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 388Zeile 388
if(is_moderator($fid, "caneditposts") || $fpermissions['caneditposts'] == 1)
{
$can_edit_titles = 1;

if(is_moderator($fid, "caneditposts") || $fpermissions['caneditposts'] == 1)
{
$can_edit_titles = 1;

}
else
{

}
else
{

	$can_edit_titles = 0;
}


	$can_edit_titles = 0;
}


Zeile 405Zeile 405
	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 419Zeile 419
else
{
$datecut = intval($mybb->input['datecut']);

else
{
$datecut = intval($mybb->input['datecut']);

}

}


$datecut = intval($datecut);
$datecutsel[$datecut] = "selected=\"selected\"";


$datecut = intval($datecut);
$datecutsel[$datecut] = "selected=\"selected\"";

Zeile 537Zeile 537
}

// Needs to be initialized in order to speed-up things. Fixes #2031

}

// Needs to be initialized in order to speed-up things. Fixes #2031

$orderarrow = array('rating'=>'', 'subject'=>'', 'starter'=>'', 'replies'=>'', 'views'=>''); 

$orderarrow = array('rating'=>'', 'subject'=>'', 'starter'=>'', 'replies'=>'', 'views'=>'');

eval("\$orderarrow['$sortby'] = \"".$templates->get("forumdisplay_orderarrow")."\";");

$threadcount = 0;

eval("\$orderarrow['$sortby'] = \"".$templates->get("forumdisplay_orderarrow")."\";");

$threadcount = 0;

Zeile 550Zeile 550

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


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

	



	// How many posts are there?
if($datecut > 0 || isset($fpermissions['canonlyviewownthreads']) && $fpermissions['canonlyviewownthreads'] == 1)
{

	// How many posts are there?
if($datecut > 0 || isset($fpermissions['canonlyviewownthreads']) && $fpermissions['canonlyviewownthreads'] == 1)
{

Zeile 566Zeile 566
		{
$threadcount += $forum_threads['unapprovedthreads'];
}

		{
$threadcount += $forum_threads['unapprovedthreads'];
}

		



		// If we have 0 threads double check there aren't any "moved" threads
if($threadcount == 0)
{

		// If we have 0 threads double check there aren't any "moved" threads
if($threadcount == 0)
{

Zeile 578Zeile 578

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


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

{

{

	$mybb->settings['threadsperpage'] = 20;
}


	$mybb->settings['threadsperpage'] = 20;
}


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

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





if($upper > $threadcount)

if($upper > $threadcount)

{

{

	$upper = $threadcount;
}

	$upper = $threadcount;
}





// Assemble page URL
if($mybb->input['sortby'] || $mybb->input['order'] || $mybb->input['datecut']) // Ugly URL

// Assemble page URL
if($mybb->input['sortby'] || $mybb->input['order'] || $mybb->input['datecut']) // Ugly URL

{	

{

	$page_url = str_replace("{fid}", $fid, FORUM_URL_PAGED);

	$page_url = str_replace("{fid}", $fid, FORUM_URL_PAGED);

	



	if($mybb->settings['seourls'] == "yes" || ($mybb->settings['seourls'] == "auto" && isset($_SERVER['SEO_SUPPORT']) && $_SERVER['SEO_SUPPORT'] == 1))
{
$q = "?";
$and = '';

	if($mybb->settings['seourls'] == "yes" || ($mybb->settings['seourls'] == "auto" && isset($_SERVER['SEO_SUPPORT']) && $_SERVER['SEO_SUPPORT'] == 1))
{
$q = "?";
$and = '';

	}

	}

	else

	else

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


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


	if((!empty($foruminfo['defaultsortby']) && $sortby != $foruminfo['defaultsortby']) || (empty($foruminfo['defaultsortby']) && $sortby != "lastpost"))
{
$page_url .= "{$q}{$and}sortby={$sortby}";
$q = '';
$and = "&";
}

	if((!empty($foruminfo['defaultsortby']) && $sortby != $foruminfo['defaultsortby']) || (empty($foruminfo['defaultsortby']) && $sortby != "lastpost"))
{
$page_url .= "{$q}{$and}sortby={$sortby}";
$q = '';
$and = "&";
}

	



	if($sortordernow != "desc")
{
$page_url .= "{$q}{$and}order={$sortordernow}";
$q = '';
$and = "&";
}

	if($sortordernow != "desc")
{
$page_url .= "{$q}{$and}order={$sortordernow}";
$q = '';
$and = "&";
}

	



	if($datecut > 0)
{
$page_url .= "{$q}{$and}datecut={$datecut}";

	if($datecut > 0)
{
$page_url .= "{$q}{$and}datecut={$datecut}";

Zeile 663Zeile 663
			break;
default:
$ratingadd = "(t.totalratings/t.numratings) AS averagerating, ";

			break;
default:
$ratingadd = "(t.totalratings/t.numratings) AS averagerating, ";

	}

	}


$lpbackground = "trow2";
eval("\$ratingcol = \"".$templates->get("forumdisplay_threadlist_rating")."\";");


$lpbackground = "trow2";
eval("\$ratingcol = \"".$templates->get("forumdisplay_threadlist_rating")."\";");

Zeile 693Zeile 693
	$limit = '';
$announcements = '';
if($mybb->settings['announcementlimit'])

	$limit = '';
$announcements = '';
if($mybb->settings['announcementlimit'])

	{

	{

		$limit = "LIMIT 0, ".$mybb->settings['announcementlimit'];
}


		$limit = "LIMIT 0, ".$mybb->settings['announcementlimit'];
}


Zeile 722Zeile 722
		{
$new_class = ' class="subject_new"';
$folder = "newfolder";

		{
$new_class = ' class="subject_new"';
$folder = "newfolder";

		}

		}

		else
{
$new_class = ' class="subject_old"';

		else
{
$new_class = ' class="subject_old"';

Zeile 751Zeile 751
		{
$rating = '';
$lpbackground = "trow1";

		{
$rating = '';
$lpbackground = "trow1";

		}


		}


		if($ismod)
{
eval("\$modann = \"".$templates->get("forumdisplay_announcements_announcement_modbit")."\";");

		if($ismod)
{
eval("\$modann = \"".$templates->get("forumdisplay_announcements_announcement_modbit")."\";");

Zeile 781Zeile 781
	else if(!empty($cookie))
{
my_setcookie("mybb[announcements]", addslashes(serialize($cookie)), -1);

	else if(!empty($cookie))
{
my_setcookie("mybb[announcements]", addslashes(serialize($cookie)), -1);

	}

	}

}
else
{

}
else
{

Zeile 806Zeile 806
	$ratings = false;
$moved_threads = array();
while($thread = $db->fetch_array($query))

	$ratings = false;
$moved_threads = array();
while($thread = $db->fetch_array($query))

	{		

	{

		$threadcache[$thread['tid']] = $thread;

if($thread['numratings'] > 0 && $ratings == false)

		$threadcache[$thread['tid']] = $thread;

if($thread['numratings'] > 0 && $ratings == false)

Zeile 819Zeile 819
		{
$tid = substr($thread['closed'], 6);
if(!$tids[$tid])

		{
$tid = substr($thread['closed'], 6);
if(!$tids[$tid])

			{

			{

				$moved_threads[$tid] = $thread['tid'];
$tids[$thread['tid']] = $tid;
}

				$moved_threads[$tid] = $thread['tid'];
$tids[$thread['tid']] = $tid;
}

Zeile 835Zeile 835
		}
}


		}
}


	if($mybb->settings['allowthreadratings'] != 0 && $foruminfo['allowtratings'] != 0 && $mybb->user['uid'] && !empty($tids) && $ratings == true)

	if($mybb->settings['allowthreadratings'] != 0 && $foruminfo['allowtratings'] != 0 && $mybb->user['uid'] && !empty($threadcache) && $ratings == true)

	{
// Check if we've rated threads on this page
// Guests get the pleasure of not being ID'd, but will be checked when they try and rate

	{
// Check if we've rated threads on this page
// Guests get the pleasure of not being ID'd, but will be checked when they try and rate

		$imp = implode(",", $tids);

		$imp = implode(",", array_keys($threadcache));

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

while($rating = $db->fetch_array($query))
{
$threadcache[$rating['tid']]['rated'] = 1;

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

while($rating = $db->fetch_array($query))
{
$threadcache[$rating['tid']]['rated'] = 1;

		}
}

		}
}

}

// If user has moderation tools available, prepare the Select All feature

}

// If user has moderation tools available, prepare the Select All feature

$num_results = $db->num_rows($query);
if(is_moderator($fid) && $num_results > 0)

if(is_moderator($fid) && $threadcount > $perpage)


{

{

	$lang->page_selected = $lang->sprintf($lang->page_selected, intval($num_results));

	$lang->page_selected = $lang->sprintf($lang->page_selected, count($threadcache));

	$lang->select_all = $lang->sprintf($lang->select_all, intval($threadcount));
$lang->all_selected = $lang->sprintf($lang->all_selected, intval($threadcount));
eval("\$selectall = \"".$templates->get("forumdisplay_inlinemoderation_selectall")."\";");

	$lang->select_all = $lang->sprintf($lang->select_all, intval($threadcount));
$lang->all_selected = $lang->sprintf($lang->all_selected, intval($threadcount));
eval("\$selectall = \"".$templates->get("forumdisplay_inlinemoderation_selectall")."\";");

Zeile 873Zeile 872
		if(!empty($moved_threads[$post['tid']]))
{
$post['tid'] = $moved_threads[$post['tid']];

		if(!empty($moved_threads[$post['tid']]))
{
$post['tid'] = $moved_threads[$post['tid']];

		}

		}

		if($threadcache[$post['tid']])

		if($threadcache[$post['tid']])

		{

		{

			$threadcache[$post['tid']]['doticon'] = 1;
}
}

			$threadcache[$post['tid']]['doticon'] = 1;
}
}

Zeile 884Zeile 883
// Read threads
if($mybb->user['uid'] && $mybb->settings['threadreadcut'] > 0 && !empty($threadcache))
{

// Read threads
if($mybb->user['uid'] && $mybb->settings['threadreadcut'] > 0 && !empty($threadcache))
{

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

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

	while($readthread = $db->fetch_array($query))
{

	while($readthread = $db->fetch_array($query))
{

		if(!empty($moved_threads[$readthread['tid']])) 
{
$readthread['tid'] = $moved_threads[$readthread['tid']];

		if(!empty($moved_threads[$readthread['tid']]))
{
$readthread['tid'] = $moved_threads[$readthread['tid']];

	 	}
if($threadcache[$readthread['tid']])
{

	 	}
if($threadcache[$readthread['tid']])
{

	 		$threadcache[$readthread['tid']]['lastread'] = $readthread['dateline']; 

	 		$threadcache[$readthread['tid']]['lastread'] = $readthread['dateline'];

		}
}
}

		}
}
}

Zeile 926Zeile 925
{
if(!$mybb->settings['maxmultipagelinks'])
{

{
if(!$mybb->settings['maxmultipagelinks'])
{

		$mybb->settings['maxmultipagelinks'] = 5;		

		$mybb->settings['maxmultipagelinks'] = 5;

	}

if(!$mybb->settings['postsperpage'])

	}

if(!$mybb->settings['postsperpage'])

Zeile 948Zeile 947
		{
$bgcolor = alt_trow();
}

		{
$bgcolor = alt_trow();
}

		



		if($thread['sticky'] == 1)

		if($thread['sticky'] == 1)

		{

		{

			$thread_type_class = " forumdisplay_sticky";
}
else

			$thread_type_class = " forumdisplay_sticky";
}
else

Zeile 959Zeile 958
		}

$folder = '';

		}

$folder = '';

		$prefix = '';

		$prefix = '';


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


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

Zeile 971Zeile 970
		{
$thread['profilelink'] = build_profile_link($thread['username'], $thread['uid']);
}

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

		



		// If this thread has a prefix, insert a space between prefix and subject
$thread['threadprefix'] = $threadprefix = '';
if($thread['prefix'] != 0)

		// If this thread has a prefix, insert a space between prefix and subject
$thread['threadprefix'] = $threadprefix = '';
if($thread['prefix'] != 0)

Zeile 991Zeile 990
		else
{
$icon = " ";

		else
{
$icon = " ";

		}

		}


$prefix = '';
if($thread['poll'])


$prefix = '';
if($thread['poll'])

Zeile 1032Zeile 1031

$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['pages'] = 0;

Zeile 1269Zeile 1268
			{
eval("\$customthreadtools .= \"".$templates->get("forumdisplay_inlinemoderation_custom_tool")."\";");
}

			{
eval("\$customthreadtools .= \"".$templates->get("forumdisplay_inlinemoderation_custom_tool")."\";");
}

			



			if($customthreadtools)
{
eval("\$customthreadtools = \"".$templates->get("forumdisplay_inlinemoderation_custom")."\";");

			if($customthreadtools)
{
eval("\$customthreadtools = \"".$templates->get("forumdisplay_inlinemoderation_custom")."\";");