Vergleich forumdisplay.php - 1.6.6 - 1.6.8

  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 5655 2011-11-27 00:10:00Z Tomm $

 * $Id: forumdisplay.php 5787 2012-04-19 13:30:23Z Tomm $

 */

define("IN_MYBB", 1);

 */

define("IN_MYBB", 1);

Zeile 84Zeile 84
if($mybb->user['uid'] == 0)
{
// Cookie'd forum read time

if($mybb->user['uid'] == 0)
{
// Cookie'd forum read time

	$forumsread = unserialize($mybb->cookies['mybb']['forumread']);

if(!is_array($forumsread))

	$forumsread = my_unserialize($mybb->cookies['mybb']['forumread']);

if(is_array($forumsread) && empty($forumsread))

 	{
if($mybb->cookies['mybb']['readallforums'])
{

 	{
if($mybb->cookies['mybb']['readallforums'])
{

Zeile 120Zeile 120
	}

$fcache[$forum['pid']][$forum['disporder']][$forum['fid']] = $forum;

	}

$fcache[$forum['pid']][$forum['disporder']][$forum['fid']] = $forum;

}


}


// Get the forum moderators if the setting is enabled.
if($mybb->settings['modlist'] != 0)
{

// Get the forum moderators if the setting is enabled.
if($mybb->settings['modlist'] != 0)
{

Zeile 170Zeile 170
if($fpermissions['cansearch'] != 0 && $foruminfo['type'] == "f")
{
eval("\$searchforum = \"".$templates->get("forumdisplay_searchforum")."\";");

if($fpermissions['cansearch'] != 0 && $foruminfo['type'] == "f")
{
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 191Zeile 212
				if($moderator['isgroup'])
{
if(in_array($moderator['id'], $done_moderators['groups']))

				if($moderator['isgroup'])
{
if(in_array($moderator['id'], $done_moderators['groups']))

					{

					{

						continue;
}
$moderators .= $comma.htmlspecialchars_uni($moderator['title']);

						continue;
}
$moderators .= $comma.htmlspecialchars_uni($moderator['title']);

Zeile 209Zeile 230
				$comma = $lang->comma;
}
}

				$comma = $lang->comma;
}
}

 
	}

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

	}
}
$comma = '';

// If we have a moderators list, load the template
if($moderators)

	}
}
$comma = '';

// If we have a moderators list, load the template
if($moderators)

{

{

	eval("\$moderatedby = \"".$templates->get("forumdisplay_moderatedby")."\";");

	eval("\$moderatedby = \"".$templates->get("forumdisplay_moderatedby")."\";");

}

}

else
{
$moderatedby = '';

else
{
$moderatedby = '';

Zeile 225Zeile 251

// Get the users browsing this forum.
if($mybb->settings['browsingthisforum'] != 0)


// Get the users browsing this forum.
if($mybb->settings['browsingthisforum'] != 0)

{

{

	$timecut = TIME_NOW - $mybb->settings['wolcutoff'];

$comma = '';

	$timecut = TIME_NOW - $mybb->settings['wolcutoff'];

$comma = '';

Zeile 243Zeile 269
	while($user = $db->fetch_array($query))
{
if($user['uid'] == 0)

	while($user = $db->fetch_array($query))
{
if($user['uid'] == 0)

		{

		{

			++$guestcount;
}
else

			++$guestcount;
}
else

Zeile 260Zeile 286
				else
{
$invisiblemark = '';

				else
{
$invisiblemark = '';

				}

				}

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

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

Zeile 294Zeile 320
		$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 = '';
if($foruminfo['rulestype'] != 0 && $foruminfo['rules'])

// Do we have any forum rules to show for this forum?
$forumrules = '';
if($foruminfo['rulestype'] != 0 && $foruminfo['rules'])

Zeile 313Zeile 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 331Zeile 357

// Check if the active user is a moderator and get the inline moderation tools.
if(is_moderator($fid))


// Check if the active user is a moderator and get the inline moderation tools.
if(is_moderator($fid))

{

{

	eval("\$inlinemodcol = \"".$templates->get("forumdisplay_inlinemoderation_col")."\";");
$ismod = true;
$inlinecount = "0";
$inlinecookie = "inlinemod_forum".$fid;
$visibleonly = " AND (visible='1' OR visible='0')";
$tvisibleonly = " AND (t.visible='1' OR t.visible='0')";

	eval("\$inlinemodcol = \"".$templates->get("forumdisplay_inlinemoderation_col")."\";");
$ismod = true;
$inlinecount = "0";
$inlinecookie = "inlinemod_forum".$fid;
$visibleonly = " AND (visible='1' OR visible='0')";
$tvisibleonly = " AND (t.visible='1' OR t.visible='0')";

}

}

else

else

{

{

	$inlinemod = '';
$ismod = false;
}

	$inlinemod = '';
$ismod = false;
}

Zeile 348Zeile 374
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
{
$can_edit_titles = 0;
}

else
{
$can_edit_titles = 0;
}





unset($rating);

// Pick out some sorting options.

unset($rating);

// Pick out some sorting options.

Zeile 365Zeile 391
	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 592Zeile 618
}
$multipage = multipage($threadcount, $perpage, $page, $page_url);


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


Zeile 628Zeile 654
}

// Get Announcements

}

// Get Announcements

$forum_stats = $cache->read("forumsdisplay");

if(!is_array($forum_stats))
{
$forum_stats = $cache->read("forumdisplay", true);
}

$parentlist_exp = explode(',', $parentlist);
if(is_array($forum_stats) && ($forum_stats[-1]['announcements'] || array_intersect_key(array_flip($parentlist_exp), $forum_stats)))

if($has_announcements == true)









{
$limit = '';
$announcements = '';

{
$limit = '';
$announcements = '';

Zeile 659Zeile 677
	$cookie = array();
if(isset($mybb->cookies['mybb']['announcements']))
{

	$cookie = array();
if(isset($mybb->cookies['mybb']['announcements']))
{

		$cookie = unserialize(stripslashes($mybb->cookies['mybb']['announcements']));

		$cookie = my_unserialize(stripslashes($mybb->cookies['mybb']['announcements']));

	}

$bgcolor = alt_trow(true); // Reset the trow colors

	}

$bgcolor = alt_trow(true); // Reset the trow colors

Zeile 689Zeile 707
		$posttime = my_date($mybb->settings['timeformat'], $announcement['startdate']);
$announcement['profilelink'] = build_profile_link($announcement['username'], $announcement['uid']);


		$posttime = my_date($mybb->settings['timeformat'], $announcement['startdate']);
$announcement['profilelink'] = build_profile_link($announcement['username'], $announcement['uid']);


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

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

		{
eval("\$rating = \"".$templates->get("forumdisplay_announcement_rating")."\";");
$lpbackground = "trow2";

		{
eval("\$rating = \"".$templates->get("forumdisplay_announcement_rating")."\";");
$lpbackground = "trow2";

Zeile 776Zeile 794
		}
}


		}
}


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

	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

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

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

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

		}
}
}
else
{

		}
}
}
else
{

	$threadcache = $tids = null;
}


	$threadcache = $tids = null;
}


Zeile 820Zeile 838
			$post['tid'] = $moved_threads[$post['tid']];
}
if($threadcache[$post['tid']])

			$post['tid'] = $moved_threads[$post['tid']];
}
if($threadcache[$post['tid']])

		{

		{

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

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

Zeile 859Zeile 877
	$forum_read = my_get_array_cookie("forumread", $fid);

if($mybb->cookies['mybb']['readallforums'] && !$forum_read)

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

if($mybb->cookies['mybb']['readallforums'] && !$forum_read)

	{

	{

		$forum_read = $mybb->cookies['mybb']['lastvisit'];

		$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 947Zeile 975
		}

$rating = '';

		}

$rating = '';

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

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

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

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

Zeile 976Zeile 1004
		$morelink = '';
$thread['posts'] = $thread['replies'] + 1;


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


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

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

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






		{
$thread['posts'] += $thread['unapprovedposts'];
}

		{
$thread['posts'] += $thread['unapprovedposts'];
}

Zeile 990Zeile 1013
		{
$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)
{
$pagesstop = 4;


if($thread['pages'] > $mybb->settings['maxmultipagelinks'])
{
$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 1015Zeile 1038
			$threadpages = '';
$morelink = '';
$thread['multipage'] = '';

			$threadpages = '';
$morelink = '';
$thread['multipage'] = '';

		}

		}


if($ismod)
{


if($ismod)
{

Zeile 1071Zeile 1094
			else
{
$last_read = $read_cutoff;

			else
{
$last_read = $read_cutoff;

			}
}
else

			}
}
else

		{
$last_read = my_get_array_cookie("threadread", $thread['tid']);

		{
$last_read = my_get_array_cookie("threadread", $thread['tid']);

		}

		}


if($forum_read > $last_read)
{


if($forum_read > $last_read)
{

Zeile 1091Zeile 1114
			$thread['newpostlink'] = get_thread_link($thread['tid'], 0, "newpost");
eval("\$gotounread = \"".$templates->get("forumdisplay_thread_gotounread")."\";");
$unreadpost = 1;

			$thread['newpostlink'] = get_thread_link($thread['tid'], 0, "newpost");
eval("\$gotounread = \"".$templates->get("forumdisplay_thread_gotounread")."\";");
$unreadpost = 1;

		}

		}

		else
{
$folder_label .= $lang->icon_no_new;
$new_class = "subject_old";

		else
{
$folder_label .= $lang->icon_no_new;
$new_class = "subject_old";

		}

		}


if($thread['replies'] >= $mybb->settings['hottopic'] || $thread['views'] >= $mybb->settings['hottopicviews'])
{


if($thread['replies'] >= $mybb->settings['hottopic'] || $thread['views'] >= $mybb->settings['hottopicviews'])
{

Zeile 1108Zeile 1131
		{
$folder .= "lock";
$folder_label .= $lang->icon_lock;

		{
$folder .= "lock";
$folder_label .= $lang->icon_lock;

		}


		}


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

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

		{

		{

			$folder = "move";
$gotounread = '';

			$folder = "move";
$gotounread = '';

		}

$folder .= "folder";

		}

$folder .= "folder";


$inline_edit_tid = $thread['tid'];



$inline_edit_tid = $thread['tid'];


Zeile 1124Zeile 1147
		if(($thread['uid'] == $mybb->user['uid'] && $thread['closed'] != 1 && $mybb->user['uid'] != 0 && $can_edit_titles == 1) || $ismod == true)
{
$inline_edit_class = "subject_editable";

		if(($thread['uid'] == $mybb->user['uid'] && $thread['closed'] != 1 && $mybb->user['uid'] != 0 && $can_edit_titles == 1) || $ismod == true)
{
$inline_edit_class = "subject_editable";

		}
else

		}
else

		{
$inline_edit_class = "";
}

		{
$inline_edit_class = "";
}

Zeile 1140Zeile 1163
		if($lastposteruid == 0)
{
$lastposterlink = $lastposter;

		if($lastposteruid == 0)
{
$lastposterlink = $lastposter;

		}
else
{

		}
else
{

			$lastposterlink = build_profile_link($lastposter, $lastposteruid);
}

			$lastposterlink = build_profile_link($lastposter, $lastposteruid);
}





		$thread['replies'] = my_number_format($thread['replies']);
$thread['views'] = my_number_format($thread['views']);


		$thread['replies'] = my_number_format($thread['replies']);
$thread['views'] = my_number_format($thread['views']);


Zeile 1159Zeile 1182
			else
{
$unapproved_posts_count = $lang->sprintf($lang->thread_unapproved_post_count, 1);

			else
{
$unapproved_posts_count = $lang->sprintf($lang->thread_unapproved_post_count, 1);

			}


			}


			$unapproved_posts = " <span title=\"{$unapproved_posts_count}\">(".my_number_format($thread['unapprovedposts']).")</span>";
}
else

			$unapproved_posts = " <span title=\"{$unapproved_posts_count}\">(".my_number_format($thread['unapprovedposts']).")</span>";
}
else

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

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

		if($forum_stats[-1]['modtools'] || $forum_stats[$fid]['modtools'])

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

		{
switch($db->type)
{

		{
switch($db->type)
{

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

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

 
			}

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

			}
}

			}
}

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






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

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