Vergleich forumdisplay.php - 1.6.0 - 1.6.9

  Keine Änderungen   Hinzugefügt   Modifiziert   Entfernt
Zeile 6Zeile 6
 * Website: http://mybb.com
* License: http://mybb.com/about/license
*

 * Website: http://mybb.com
* License: http://mybb.com/about/license
*

 * $Id: forumdisplay.php 5016 2010-06-12 00:24:02Z RyanGordon $

 * $Id$

 */

define("IN_MYBB", 1);

 */

define("IN_MYBB", 1);

Zeile 16Zeile 16
$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";

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

$templatelist .= ",forumdisplay_usersbrowsing_guests,forumdisplay_usersbrowsing_user,forumdisplay_usersbrowsing,forumdisplay_inlinemoderation,forumdisplay_thread_modbit,forumdisplay_inlinemoderation_col";

$templatelist .= ",forumdisplay_usersbrowsing_guests,forumdisplay_usersbrowsing_user,forumdisplay_usersbrowsing,forumdisplay_inlinemoderation,forumdisplay_thread_modbit,forumdisplay_inlinemoderation_col,forumdisplay_inlinemoderation_selectall";

$templatelist .= ",forumdisplay_announcements_announcement,forumdisplay_announcements,forumdisplay_threads_sep,forumbit_depth3_statusicon,forumbit_depth3,forumdisplay_sticky_sep,forumdisplay_thread_attachment_count,forumdisplay_threadlist_inlineedit_js,forumdisplay_rssdiscovery,forumdisplay_announcement_rating,forumdisplay_announcements_announcement_modbit,forumdisplay_rules,forumdisplay_rules_link,forumdisplay_thread_gotounread,forumdisplay_nothreads,forumdisplay_inlinemoderation_custom_tool,forumdisplay_inlinemoderation_custom";
require_once "./global.php";
require_once MYBB_ROOT."inc/functions_post.php";

$templatelist .= ",forumdisplay_announcements_announcement,forumdisplay_announcements,forumdisplay_threads_sep,forumbit_depth3_statusicon,forumbit_depth3,forumdisplay_sticky_sep,forumdisplay_thread_attachment_count,forumdisplay_threadlist_inlineedit_js,forumdisplay_rssdiscovery,forumdisplay_announcement_rating,forumdisplay_announcements_announcement_modbit,forumdisplay_rules,forumdisplay_rules_link,forumdisplay_thread_gotounread,forumdisplay_nothreads,forumdisplay_inlinemoderation_custom_tool,forumdisplay_inlinemoderation_custom";
require_once "./global.php";
require_once MYBB_ROOT."inc/functions_post.php";

Zeile 83Zeile 83

if($mybb->user['uid'] == 0)
{


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']);








	// Cookie'd forum read time
$forumsread = my_unserialize($mybb->cookies['mybb']['forumread']);

if(is_array($forumsread) && empty($forumsread))
{
if($mybb->cookies['mybb']['readallforums'])
{
$forumsread[$fid] = $mybb->cookies['mybb']['lastvisit'];
}
else
{
$forumsread = array();
}
}

$query = $db->simple_select("forums", "*", "active != 0", array("order_by" => "pid, disporder"));

}
else
{

}
else
{

	// Build a forum cache.

	// Build a forum cache from the database

	$query = $db->query("
SELECT f.*, fr.dateline AS lastread
FROM ".TABLE_PREFIX."forums f

	$query = $db->query("
SELECT f.*, fr.dateline AS lastread
FROM ".TABLE_PREFIX."forums f

Zeile 104Zeile 111
		ORDER BY pid, disporder
");
}

		ORDER BY pid, disporder
");
}

 


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

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

	if($mybb->user['uid'] == 0)

	if($mybb->user['uid'] == 0 && $forumsread[$forum['fid']])

	{

	{

		if($forumsread[$forum['fid']])
{
$forum['lastread'] = $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 159Zeile 165
if($foruminfo['type'] == "f" && $foruminfo['open'] != 0)
{
eval("\$newthread = \"".$templates->get("forumdisplay_newthread")."\";");

if($foruminfo['type'] == "f" && $foruminfo['open'] != 0)
{
eval("\$newthread = \"".$templates->get("forumdisplay_newthread")."\";");

}


}


if($fpermissions['cansearch'] != 0 && $foruminfo['type'] == "f")

if($fpermissions['cansearch'] != 0 && $foruminfo['type'] == "f")

{

{

	eval("\$searchforum = \"".$templates->get("forumdisplay_searchforum")."\";");

	eval("\$searchforum = \"".$templates->get("forumdisplay_searchforum")."\";");

 
}

// Gather forum stats
$has_announcements = $has_modtools = false;
$forum_stats = $cache->read("forumsdisplay");

if(is_array($forum_stats))
{
if($forum_stats[-1]['modtools'] || $forum_stats[$fid]['modtools'])
{
// Mod tools are specific to forums, not parents
$has_modtools = true;
}

if($forum_stats[-1]['announcements'] || $forum_stats[$fid]['announcements'])
{
// Global or forum-specific announcements
$has_announcements = true;
}

}

$done_moderators = array(
"users" => array(),
"groups" => array()
);

}

$done_moderators = array(
"users" => array(),
"groups" => array()
);

 


$moderators = '';
$parentlistexploded = explode(",", $parentlist);

$moderators = '';
$parentlistexploded = explode(",", $parentlist);

 


foreach($parentlistexploded as $mfid)
{
// This forum has moderators

foreach($parentlistexploded as $mfid)
{
// This forum has moderators

Zeile 197Zeile 224
					{
continue;
}

					{
continue;
}

					$moderators .= "{$comma}<a href=\"".get_profile_link($moderator['id'])."\">".htmlspecialchars_uni($moderator['username'])."</a>";

					$moderators .= "{$comma}<a href=\"".get_profile_link($moderator['id'])."\">".format_name(htmlspecialchars_uni($moderator['username']), $moderator['usergroup'], $moderator['displaygroup'])."</a>";

					$done_moderators['users'][] = $moderator['id'];
}
$comma = $lang->comma;
}
}

					$done_moderators['users'][] = $moderator['id'];
}
$comma = $lang->comma;
}
}

 
	}

if($forum_stats[$mfid]['announcements'])
{
$has_announcements = true;

	}
}
$comma = '';

	}
}
$comma = '';

Zeile 307Zeile 339
	);

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

	);

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

	if($foruminfo['rulestype'] == 1)

	if($foruminfo['rulestype'] == 1 || $foruminfo['rulestype'] == 3)

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

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

Zeile 346Zeile 378
else
{
$can_edit_titles = 0;

else
{
$can_edit_titles = 0;

}

unset($rating);


}

unset($rating);


// Pick out some sorting options.
// First, the date cut for the threads.
$datecut = 0;

// Pick out some sorting options.
// First, the date cut for the threads.
$datecut = 0;

Zeile 429Zeile 461
		break;
case "replies":
$sortfield = "replies";

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

		break;

		break;

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

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

Zeile 461Zeile 493
else
{
$string = "&amp;";

else
{
$string = "&amp;";

}

}


// Are we viewing a specific page?
if(isset($mybb->input['page']) && is_numeric($mybb->input['page']))


// Are we viewing a specific page?
if(isset($mybb->input['page']) && is_numeric($mybb->input['page']))

{

{

	$sorturl = get_forum_link($fid, $mybb->input['page']).$string."datecut=$datecut";

	$sorturl = get_forum_link($fid, $mybb->input['page']).$string."datecut=$datecut";

}

}

else
{
$sorturl = get_forum_link($fid).$string."datecut=$datecut";

else
{
$sorturl = get_forum_link($fid).$string."datecut=$datecut";

Zeile 477Zeile 509
$threadcount = 0;
$useronly = $tuseronly = "";
if($fpermissions['canonlyviewownthreads'] == 1)

$threadcount = 0;
$useronly = $tuseronly = "";
if($fpermissions['canonlyviewownthreads'] == 1)

{

{

	$useronly = "AND uid={$mybb->user['uid']}";
$tuseronly = "AND t.uid={$mybb->user['uid']}";
}

	$useronly = "AND uid={$mybb->user['uid']}";
$tuseronly = "AND t.uid={$mybb->user['uid']}";
}

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

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

	}
else
{

	}
else
{

		$query = $db->simple_select("forums", "threads, unapprovedthreads", "fid = '{$fid}'", array('limit' => 1));
$forum_threads = $db->fetch_array($query);
$threadcount = $forum_threads['threads'];

		$query = $db->simple_select("forums", "threads, unapprovedthreads", "fid = '{$fid}'", array('limit' => 1));
$forum_threads = $db->fetch_array($query);
$threadcount = $forum_threads['threads'];

Zeile 507Zeile 539
			$query = $db->simple_select("threads", "COUNT(tid) AS threads", "fid = '$fid' $useronly $visibleonly", array('limit' => 1));
$threadcount = $db->fetch_field($query, "threads");
}

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

	}

	}

}

// How many pages are there?

}

// How many pages are there?

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

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

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

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

	{

	{

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

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

	}

	}

	else

	else

	{
$q = '';

	{
$q = '';

		$and = "&";
}

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

		$and = "&";
}

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

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


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


	if($sortordernow != "desc")

	if($sortordernow != "desc")

	{

	{

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

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

	}

	}

	

	

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

	if($datecut > 0)

	{
$page_url .= "{$q}{$and}datecut={$datecut}";
}
}
else

	{
$page_url .= "{$q}{$and}datecut={$datecut}";
}
}
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);


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


if($mybb->settings['allowthreadratings'] != 0 && $foruminfo['allowtratings'] != 0 && $fpermissions['canviewthreads'] != 0)

{
$lang->load("ratethread");

{
$lang->load("ratethread");

 


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

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

Zeile 597Zeile 630
		default:
$ratingadd = "(t.totalratings/t.numratings) AS averagerating, ";
}

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

 


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

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

	$select_voting = "\nLEFT JOIN ".TABLE_PREFIX."threadratings r ON(r.tid=t.tid AND r.uid='{$mybb->user['uid']}')";
$select_rating_user = "r.uid AS rated, ";

 
}
else
{

}
else
{

Zeile 622Zeile 654
}

// Get Announcements

}

// Get Announcements

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

if($has_announcements == true)



{

{

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

$sql = build_parent_list($fid, "fid", "OR", $parentlist);
$time = TIME_NOW;
$query = $db->query("
SELECT a.*, u.username
FROM ".TABLE_PREFIX."announcements a
LEFT JOIN ".TABLE_PREFIX."users u ON (u.uid=a.uid)
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 colors
while($announcement = $db->fetch_array($query))
{
if($announcement['startdate'] > $mybb->user['lastvisit'])
{
$new_class = ' class="subject_new"';
$folder = "newfolder";
}
else
{
$new_class = ' class="subject_old"';
$folder = "folder";
}

$announcement['announcementlink'] = get_announcement_link($announcement['aid']);
$announcement['subject'] = $parser->parse_badwords($announcement['subject']);
$announcement['subject'] = htmlspecialchars_uni($announcement['subject']);
$postdate = my_date($mybb->settings['dateformat'], $announcement['startdate']);
$posttime = my_date($mybb->settings['timeformat'], $announcement['startdate']);
$announcement['profilelink'] = build_profile_link($announcement['username'], $announcement['uid']);

if($foruminfo['allowtratings'] != 0 && $fpermissions['canviewthreads'] != 0)
{
eval("\$rating = \"".$templates->get("forumdisplay_announcement_rating")."\";");
$lpbackground = "trow2";
}
else
{
$rating = '';
$lpbackground = "trow1";
}

if($ismod)

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











































	{

	{

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






















































































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

$sql = build_parent_list($fid, "fid", "OR", $parentlist);
$time = TIME_NOW;
$query = $db->query("
SELECT a.*, u.username
FROM ".TABLE_PREFIX."announcements a
LEFT JOIN ".TABLE_PREFIX."users u ON (u.uid=a.uid)
WHERE a.startdate<='$time' AND (a.enddate>='$time' OR a.enddate='0') AND ($sql OR fid='-1')
ORDER BY a.startdate DESC $limit
");

// See if this announcement has been read in our announcement array
$cookie = array();
if(isset($mybb->cookies['mybb']['announcements']))
{
$cookie = my_unserialize(stripslashes($mybb->cookies['mybb']['announcements']));
}

$bgcolor = alt_trow(true); // Reset the trow colors
while($announcement = $db->fetch_array($query))
{
if($announcement['startdate'] > $mybb->user['lastvisit'] && !$cookie[$announcement['aid']])
{
$new_class = ' class="subject_new"';
$folder = "newfolder";
}
else
{
$new_class = ' class="subject_old"';
$folder = "folder";
}

// Mmm, eat those announcement cookies if they're older than our last visit
if($cookie[$announcement['aid']] < $mybb->user['lastvisit'])
{
unset($cookie[$announcement['aid']]);
}

$announcement['announcementlink'] = get_announcement_link($announcement['aid']);
$announcement['subject'] = $parser->parse_badwords($announcement['subject']);
$announcement['subject'] = htmlspecialchars_uni($announcement['subject']);
$postdate = my_date($mybb->settings['dateformat'], $announcement['startdate']);
$posttime = my_date($mybb->settings['timeformat'], $announcement['startdate']);
$announcement['profilelink'] = build_profile_link($announcement['username'], $announcement['uid']);

if($mybb->settings['allowthreadratings'] != 0 && $foruminfo['allowtratings'] != 0 && $fpermissions['canviewthreads'] != 0)
{
eval("\$rating = \"".$templates->get("forumdisplay_announcement_rating")."\";");
$lpbackground = "trow2";
}
else
{
$rating = '';
$lpbackground = "trow1";
}

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

$plugins->run_hooks("forumdisplay_announcement");
eval("\$announcements .= \"".$templates->get("forumdisplay_announcements_announcement")."\";");
$bgcolor = alt_trow();
}

if($announcements)
{
eval("\$announcementlist = \"".$templates->get("forumdisplay_announcements")."\";");
$shownormalsep = true;
}

if(empty($cookie))
{
// Clean up cookie crumbs
my_setcookie('mybb[announcements]', 0, (TIME_NOW - (60*60*24*365)));
}
else if(!empty($cookie))
{
my_setcookie("mybb[announcements]", addslashes(serialize($cookie)), -1);

	}

	}

	else
{
$modann = '';
}

$plugins->run_hooks("forumdisplay_announcement");
eval("\$announcements .= \"".$templates->get("forumdisplay_announcements_announcement")."\";");
$bgcolor = alt_trow();

 
}

}


if($announcements)
{
eval("\$announcementlist = \"".$templates->get("forumdisplay_announcements")."\";");
$shownormalsep = true;
}

$icon_cache = $cache->read("posticons");



$icon_cache = $cache->read("posticons");








if($fpermissions['canviewthreads'] != 0)
{
// Start Getting Threads
$query = $db->query("

if($fpermissions['canviewthreads'] != 0)
{
// Start Getting Threads
$query = $db->query("

		SELECT t.*, p.displaystyle AS threadprefix, {$ratingadd}{$select_rating_user}t.username AS threadusername, u.username

		SELECT t.*, {$ratingadd}t.username AS threadusername, u.username

		FROM ".TABLE_PREFIX."threads t

		FROM ".TABLE_PREFIX."threads t

		LEFT JOIN ".TABLE_PREFIX."users u ON (u.uid = t.uid){$select_voting}
LEFT JOIN ".TABLE_PREFIX."threadprefixes p ON (p.pid = t.prefix)

		LEFT JOIN ".TABLE_PREFIX."users u ON (u.uid = t.uid)


		WHERE t.fid='$fid' $tuseronly $tvisibleonly $datecutsql2
ORDER BY t.sticky DESC, {$t}{$sortfield} $sortordernow $sortfield2
LIMIT $start, $perpage
");

		WHERE t.fid='$fid' $tuseronly $tvisibleonly $datecutsql2
ORDER BY t.sticky DESC, {$t}{$sortfield} $sortordernow $sortfield2
LIMIT $start, $perpage
");

 

$ratings = false;

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

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

 

if($thread['numratings'] > 0 && $ratings == false)
{
$ratings = true; // Looks for ratings in the forum
}


// If this is a moved thread - set the tid for participation marking and thread read marking to that of the moved thread
if(substr($thread['closed'], 0, 5) == "moved")


// If this is a moved thread - set the tid for participation marking and thread read marking to that of the moved thread
if(substr($thread['closed'], 0, 5) == "moved")

		{

		{

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

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

Zeile 726Zeile 791
			{
unset($moved_threads[$tid]);
}

			{
unset($moved_threads[$tid]);
}

 
		}
}

if($mybb->settings['allowthreadratings'] != 0 && $foruminfo['allowtratings'] != 0 && $mybb->user['uid'] && $tids && $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
$imp = implode(",", $tids);
$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;

		}
}
}

		}
}
}

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

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

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

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

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

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

Zeile 797Zeile 875
else
{
$forum_read = my_get_array_cookie("forumread", $fid);

else
{
$forum_read = my_get_array_cookie("forumread", $fid);

 

if($mybb->cookies['mybb']['readallforums'] && !$forum_read)
{
$forum_read = $mybb->cookies['mybb']['lastvisit'];
}

}

}





$unreadpost = 0;
$threads = '';
$load_inline_edit_js = 0;
if(is_array($threadcache))
{

$unreadpost = 0;
$threads = '';
$load_inline_edit_js = 0;
if(is_array($threadcache))
{

 
	if(!$mybb->settings['maxmultipagelinks'])
{
$mybb->settings['maxmultipagelinks'] = 5;
}

if(!$mybb->settings['postsperpage'])
{
$mybb->settings['postperpage'] = 20;
}


	foreach($threadcache as $thread)
{
$plugins->run_hooks("forumdisplay_thread");

	foreach($threadcache as $thread)
{
$plugins->run_hooks("forumdisplay_thread");

Zeile 822Zeile 915
		if($thread['sticky'] == 1)
{
$thread_type_class = " forumdisplay_sticky";

		if($thread['sticky'] == 1)
{
$thread_type_class = " forumdisplay_sticky";

		}
else
{

		}
else
{

			$thread_type_class = " forumdisplay_regular";
}


			$thread_type_class = " forumdisplay_regular";
}


Zeile 837Zeile 930
			$thread['username'] = $thread['threadusername'];
$thread['profilelink'] = $thread['threadusername'];
}

			$thread['username'] = $thread['threadusername'];
$thread['profilelink'] = $thread['threadusername'];
}

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

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

		
// If this thread has a prefix, insert a space between prefix and subject

		
// If this thread has a prefix, insert a space between prefix and subject

 
		$threadprefix = '';

		if($thread['prefix'] != 0)
{

		if($thread['prefix'] != 0)
{

			$thread['threadprefix'] .= '&nbsp;';


			$threadprefix = build_prefixes($thread['prefix']);
$thread['threadprefix'] = $threadprefix['displaystyle'].'&nbsp;';

		}

$thread['subject'] = $parser->parse_badwords($thread['subject']);
$thread['subject'] = htmlspecialchars_uni($thread['subject']);

if($thread['icon'] > 0 && $icon_cache[$thread['icon']])

		}

$thread['subject'] = $parser->parse_badwords($thread['subject']);
$thread['subject'] = htmlspecialchars_uni($thread['subject']);

if($thread['icon'] > 0 && $icon_cache[$thread['icon']])

		{

		{

			$icon = $icon_cache[$thread['icon']];
$icon = "<img src=\"{$icon['path']}\" alt=\"{$icon['name']}\" />";

			$icon = $icon_cache[$thread['icon']];
$icon = "<img src=\"{$icon['path']}\" alt=\"{$icon['name']}\" />";

		}

		}

		else
{
$icon = "&nbsp;";

		else
{
$icon = "&nbsp;";

		}


		}


		$prefix = '';
if($thread['poll'])
{
$prefix = $lang->poll_prefix;

		$prefix = '';
if($thread['poll'])
{
$prefix = $lang->poll_prefix;

		}


		}


		if($thread['sticky'] == "1" && !$donestickysep)
{
eval("\$threads .= \"".$templates->get("forumdisplay_sticky_sep")."\";");

		if($thread['sticky'] == "1" && !$donestickysep)
{
eval("\$threads .= \"".$templates->get("forumdisplay_sticky_sep")."\";");

Zeile 880Zeile 975
		}

$rating = '';

		}

$rating = '';

		if($foruminfo['allowtratings'] != 0)

		if($mybb->settings['allowthreadratings'] != 0 && $foruminfo['allowtratings'] != 0)

		{
if($moved[0] == "moved")
{

		{
if($moved[0] == "moved")
{

Zeile 908Zeile 1003
		$threadpages = '';
$morelink = '';
$thread['posts'] = $thread['replies'] + 1;

		$threadpages = '';
$morelink = '';
$thread['posts'] = $thread['replies'] + 1;


if(!$mybb->settings['postsperpage'])
{
$mybb->settings['postperpage'] = 20;
}

 

if($thread['unapprovedposts'] > 0 && $ismod)
{


if($thread['unapprovedposts'] > 0 && $ismod)
{

Zeile 924Zeile 1014
			$thread['pages'] = $thread['posts'] / $mybb->settings['postsperpage'];
$thread['pages'] = ceil($thread['pages']);


			$thread['pages'] = $thread['posts'] / $mybb->settings['postsperpage'];
$thread['pages'] = ceil($thread['pages']);


			if($thread['pages'] > 5)

			if($thread['pages'] > $mybb->settings['maxmultipagelinks'])

			{

			{

				$pagesstop = 4;

				$pagesstop = $mybb->settings['maxmultipagelinks'] - 1;

				$page_link = get_thread_link($thread['tid'], $thread['pages']);
eval("\$morelink = \"".$templates->get("forumdisplay_thread_multipage_more")."\";");
}

				$page_link = get_thread_link($thread['tid'], $thread['pages']);
eval("\$morelink = \"".$templates->get("forumdisplay_thread_multipage_more")."\";");
}

Zeile 1126Zeile 1216
	$customthreadtools = '';
if($ismod)
{

	$customthreadtools = '';
if($ismod)
{

		switch($db->type)

		if(is_moderator($fid, "canusecustomtools") && $has_modtools == true)

		{

		{

			case "pgsql":
case "sqlite":
$query = $db->simple_select("modtools", 'tid, name', "(','||forums||',' LIKE '%,$fid,%' OR ','||forums||',' LIKE '%,-1,%' OR forums='') AND type = 't'");
break;
default:
$query = $db->simple_select("modtools", 'tid, name', "(CONCAT(',',forums,',') LIKE '%,$fid,%' OR CONCAT(',',forums,',') LIKE '%,-1,%' OR forums='') AND type = 't'");
}
while($tool = $db->fetch_array($query))
{
eval("\$customthreadtools .= \"".$templates->get("forumdisplay_inlinemoderation_custom_tool")."\";");
}

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





			switch($db->type)
{
case "pgsql":
case "sqlite":
$query = $db->simple_select("modtools", 'tid, name', "(','||forums||',' LIKE '%,$fid,%' OR ','||forums||',' LIKE '%,-1,%' OR forums='') AND type = 't'");
break;
default:
$query = $db->simple_select("modtools", 'tid, name', "(CONCAT(',',forums,',') LIKE '%,$fid,%' OR CONCAT(',',forums,',') LIKE '%,-1,%' OR forums='') AND type = 't'");
}

while($tool = $db->fetch_array($query))
{
eval("\$customthreadtools .= \"".$templates->get("forumdisplay_inlinemoderation_custom_tool")."\";");
}

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

		}

		}

 


		eval("\$inlinemod = \"".$templates->get("forumdisplay_inlinemoderation")."\";");
}
}

// If there are no unread threads in this forum and no unread child forums - mark it as read
require_once MYBB_ROOT."inc/functions_indicators.php";

		eval("\$inlinemod = \"".$templates->get("forumdisplay_inlinemoderation")."\";");
}
}

// If there are no unread threads in this forum and no unread child forums - mark it as read
require_once MYBB_ROOT."inc/functions_indicators.php";

if(fetch_unread_count($fid) == 0 && $unread_forums == 0)




$unread_threads = fetch_unread_count($fid);
if($unread_threads !== false && $unread_threads == 0 && $unread_forums == 0)

{
mark_forum_read($fid);

{
mark_forum_read($fid);

}



}



// Subscription status

// Subscription status

$query = $db->simple_select("forumsubscriptions", "fid", "fid='".$fid."' AND uid='{$mybb->user['uid']}'", array('limit' => 1));
if($db->fetch_field($query, 'fid'))



$add_remove_subscription = 'add';
$add_remove_subscription_text = $lang->subscribe_forum;

if($mybb->user['uid'])

{

{

	$add_remove_subscription = 'remove';
$add_remove_subscription_text = $lang->unsubscribe_forum;






	$query = $db->simple_select("forumsubscriptions", "fid", "fid='".$fid."' AND uid='{$mybb->user['uid']}'", array('limit' => 1));

if($db->fetch_field($query, 'fid'))
{
$add_remove_subscription = 'remove';
$add_remove_subscription_text = $lang->unsubscribe_forum;
}

}

}

else
{
$add_remove_subscription = 'add';
$add_remove_subscription_text = $lang->subscribe_forum;
}


 

// Is this a real forum with threads?
if($foruminfo['type'] != "c")


// Is this a real forum with threads?
if($foruminfo['type'] != "c")

Zeile 1186Zeile 1283
	if($load_inline_edit_js == 1)
{
eval("\$inline_edit_js = \"".$templates->get("forumdisplay_threadlist_inlineedit_js")."\";");

	if($load_inline_edit_js == 1)
{
eval("\$inline_edit_js = \"".$templates->get("forumdisplay_threadlist_inlineedit_js")."\";");

 
	}

$post_code_string = '';
if($mybb->user['uid'])
{
$post_code_string = "&amp;my_post_key=".$mybb->post_code;

	}

$lang->rss_discovery_forum = $lang->sprintf($lang->rss_discovery_forum, htmlspecialchars_uni(strip_tags($foruminfo['name'])));

	}

$lang->rss_discovery_forum = $lang->sprintf($lang->rss_discovery_forum, htmlspecialchars_uni(strip_tags($foruminfo['name'])));