Vergleich forumdisplay.php - 1.6.4 - 1.6.7

  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 5480 2011-07-04 21:29:44Z huji $

 * $Id: forumdisplay.php 5765 2012-03-27 09:52:45Z 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 154Zeile 154
{
header("Location: {$foruminfo['linkto']}");
exit;

{
header("Location: {$foruminfo['linkto']}");
exit;

}


}


// Make forum jump...
if($mybb->settings['enableforumjump'] != 0)
{
$forumjump = build_forum_jump("", $fid, 1);

// Make forum jump...
if($mybb->settings['enableforumjump'] != 0)
{
$forumjump = build_forum_jump("", $fid, 1);

}


}


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

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

{

{

	eval("\$newthread = \"".$templates->get("forumdisplay_newthread")."\";");

	eval("\$newthread = \"".$templates->get("forumdisplay_newthread")."\";");

}

}


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 209Zeile 230
				$comma = $lang->comma;
}
}

				$comma = $lang->comma;
}
}

 
	}

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

	}
}
$comma = '';

	}
}
$comma = '';

Zeile 221Zeile 247
else
{
$moderatedby = '';

else
{
$moderatedby = '';

}


}


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

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

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 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($forum_stats[-1]['announcements'] || $forum_stats[$fid]['announcements'])

if($has_announcements == true)


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

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

Zeile 647Zeile 672
		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
");

 

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


$bgcolor = alt_trow(true); // Reset the trow colors
while($announcement = $db->fetch_array($query))
{

		if($announcement['startdate'] > $mybb->user['lastvisit'])

		if($announcement['startdate'] > $mybb->user['lastvisit'] && !$cookie[$announcement['aid']])

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

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

		}

		}

		else

		else

		{

		{

			$new_class = ' class="subject_old"';
$folder = "folder";

			$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['announcementlink'] = get_announcement_link($announcement['aid']);

Zeile 668Zeile 706
		$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']);

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


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

		}

		}

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

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

	



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

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

Zeile 688Zeile 726
		{
$modann = '';
}

		{
$modann = '';
}

	



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

if($announcements)

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

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

	}
}


	}
}


Zeile 746Zeile 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 772Zeile 820
	$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")."\";");

}

}


if($tids)
{


if($tids)
{

Zeile 917Zeile 965
		}

$rating = '';

		}

$rating = '';

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

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

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

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

Zeile 1041Zeile 1089
			else
{
$last_read = $read_cutoff;

			else
{
$last_read = $read_cutoff;

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

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

		}

if($forum_read > $last_read)

		}

if($forum_read > $last_read)

Zeile 1061Zeile 1109
			$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

		}
else

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

		{
$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'])

		{

		{

			$folder .= "hot";
$folder_label .= $lang->icon_hot;
}

			$folder .= "hot";
$folder_label .= $lang->icon_hot;
}

Zeile 1078Zeile 1126
		{
$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 1094Zeile 1142
		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 = "";
}
$load_inline_edit_js = 1;

			$inline_edit_class = "";
}
$load_inline_edit_js = 1;

Zeile 1129Zeile 1177
			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 1163Zeile 1211
	$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 1178Zeile 1226
			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")."\";");
}
}