Vergleich showthread.php - 1.4.1 - 1.4.5

  Keine Änderungen   Hinzugefügt   Modifiziert   Entfernt
Zeile 6Zeile 6
 * Website: http://www.mybboard.net
* License: http://www.mybboard.net/about/license
*

 * Website: http://www.mybboard.net
* License: http://www.mybboard.net/about/license
*

 * $Id: showthread.php 4081 2008-08-08 01:47:02Z Tikitiki $

 * $Id: showthread.php 4351 2009-04-17 02:37:21Z Tikitiki $

 */

define("IN_MYBB", 1);

 */

define("IN_MYBB", 1);

Zeile 16Zeile 16
$templatelist .= ",multipage_prevpage,multipage_nextpage,multipage_page_current,multipage_page,multipage_start,multipage_end,multipage";
$templatelist .= ",postbit_editedby,showthread_similarthreads,showthread_similarthreads_bit,postbit_iplogged_show,postbit_iplogged_hiden,showthread_quickreply";
$templatelist .= ",forumjump_advanced,forumjump_special,forumjump_bit,showthread_multipage,postbit_reputation,postbit_quickdelete,postbit_attachments,thumbnails_thumbnail,postbit_attachments_attachment,postbit_attachments_thumbnails,postbit_attachments_images_image,postbit_attachments_images,postbit_posturl";

$templatelist .= ",multipage_prevpage,multipage_nextpage,multipage_page_current,multipage_page,multipage_start,multipage_end,multipage";
$templatelist .= ",postbit_editedby,showthread_similarthreads,showthread_similarthreads_bit,postbit_iplogged_show,postbit_iplogged_hiden,showthread_quickreply";
$templatelist .= ",forumjump_advanced,forumjump_special,forumjump_bit,showthread_multipage,postbit_reputation,postbit_quickdelete,postbit_attachments,thumbnails_thumbnail,postbit_attachments_attachment,postbit_attachments_thumbnails,postbit_attachments_images_image,postbit_attachments_images,postbit_posturl";

$templatelist .= ",postbit_inlinecheck,showthread_inlinemoderation,postbit_attachments_thumbnails_thumbnail,postbit_quickquote,postbit_qqmessage,postbit_seperator,postbit_groupimage,postbit_multiquote,showthread_search,postbit_warn,postbit_warninglevel,showthread_moderationoptions_custom_tool,showthread_moderationoptions_custom,showthread_inlinemoderation_custom_tool,showthread_inlinemoderation_custom,postbit_classic,showthread_classic_header";

$templatelist .= ",postbit_inlinecheck,showthread_inlinemoderation,postbit_attachments_thumbnails_thumbnail,postbit_quickquote,postbit_qqmessage,postbit_seperator,postbit_groupimage,postbit_multiquote,showthread_search,postbit_warn,postbit_warninglevel,showthread_moderationoptions_custom_tool,showthread_moderationoptions_custom,showthread_inlinemoderation_custom_tool,showthread_inlinemoderation_custom,postbit_classic,showthread_classic_header,showthread_poll_resultbit,showthread_poll_results";


require_once "./global.php";
require_once MYBB_ROOT."inc/functions_post.php";


require_once "./global.php";
require_once MYBB_ROOT."inc/functions_post.php";

Zeile 118Zeile 118
	$query = $db->simple_select("threadsread", "dateline", "uid='{$mybb->user['uid']}' AND tid='{$thread['tid']}'");
$thread_read = $db->fetch_field($query, "dateline");


	$query = $db->simple_select("threadsread", "dateline", "uid='{$mybb->user['uid']}' AND tid='{$thread['tid']}'");
$thread_read = $db->fetch_field($query, "dateline");


	// Get forum read date
$forumread = my_get_array_cookie("forumread", $fid);

// If last visit is greater than forum read, change forum read date
if($mybb->user['lastvisit'] > $forumread)

	if($mybb->settings['threadreadcut'] > 0 && $mybb->user['uid'])





	{

	{

		$forumread = $mybb->user['lastvisit'];












		$query = $db->simple_select("forumsread", "dateline", "fid='{$fid}' AND uid='{$mybb->user['uid']}'");
$forum_read = $db->fetch_field($query, "dateline");

$read_cutoff = TIME_NOW-$mybb->settings['threadreadcut']*60*60*24;
if($forum_read == 0 || $forum_read < $read_cutoff)
{
$forum_read = $read_cutoff;
}
}
else
{
$forum_read = my_get_array_cookie("forumread", $fid);

	}

	}

	if($mybb->settings['threadreadcut'] > 0 && $mybb->user['uid'] && $thread['lastpost'] > $forumread)


	
if($mybb->settings['threadreadcut'] > 0 && $mybb->user['uid'] && $thread['lastpost'] > $forum_read)

	{
$cutoff = TIME_NOW-$mybb->settings['threadreadcut']*60*60*24;
if($thread['lastpost'] > $cutoff)

	{
$cutoff = TIME_NOW-$mybb->settings['threadreadcut']*60*60*24;
if($thread['lastpost'] > $cutoff)

		{

		{

			if($thread_read)
{
$lastread = $thread_read;

			if($thread_read)
{
$lastread = $thread_read;

			}

			}

			else
{
$lastread = 1;
}

			else
{
$lastread = 1;
}

		}
}


		}
}


	if(!$lastread)
{
$readcookie = $threadread = my_get_array_cookie("threadread", $thread['tid']);

	if(!$lastread)
{
$readcookie = $threadread = my_get_array_cookie("threadread", $thread['tid']);

		if($readcookie > $forumread)
{

		if($readcookie > $forum_read)
{

			$lastread = $readcookie;
}
else
{

			$lastread = $readcookie;
}
else
{

			$lastread = $forumread;

			$lastread = $forum_read;

		}
}

		}
}

 
	

	// Next, find the proper pid to link to.
$options = array(
"limit_start" => 0,

	// Next, find the proper pid to link to.
$options = array(
"limit_start" => 0,

Zeile 164Zeile 174
	$newpost = $db->fetch_array($query);
if($newpost['pid'])
{

	$newpost = $db->fetch_array($query);
if($newpost['pid'])
{

		header("Location:".htmlspecialchars_decode(get_post_link($newpost['pid'], $tid))."#pid{$newpost['pid']}");

		header("Location: ".htmlspecialchars_decode(get_post_link($newpost['pid'], $tid))."#pid{$newpost['pid']}");

	}
else
{

	}
else
{

Zeile 199Zeile 209
		$query = $db->simple_select('posts', 'pid', "tid={$tid}", $options);
$pid = $db->fetch_field($query, "pid");
}

		$query = $db->simple_select('posts', 'pid', "tid={$tid}", $options);
$pid = $db->fetch_field($query, "pid");
}

	header("Location:".htmlspecialchars_decode(get_post_link($pid, $tid))."#pid{$pid}");

	header("Location: ".htmlspecialchars_decode(get_post_link($pid, $tid))."#pid{$pid}");

	exit;
}


	exit;
}


Zeile 229Zeile 239

// Redirect to the proper page.
$pid = $db->fetch_field($query, "pid");


// Redirect to the proper page.
$pid = $db->fetch_field($query, "pid");

	header("Location:".htmlspecialchars_decode(get_post_link($pid, $nextthread['tid']))."#pid{$pid}");

	header("Location: ".htmlspecialchars_decode(get_post_link($pid, $nextthread['tid']))."#pid{$pid}");

}

// Jump to the next oldest posts.

}

// Jump to the next oldest posts.

Zeile 259Zeile 269

// Redirect to the proper page.
$pid = $db->fetch_field($query, "pid");


// Redirect to the proper page.
$pid = $db->fetch_field($query, "pid");

	header("Location:".htmlspecialchars_decode(get_post_link($pid, $nextthread['tid']))."#pid{$pid}");

	header("Location: ".htmlspecialchars_decode(get_post_link($pid, $nextthread['tid']))."#pid{$pid}");

}

if($mybb->input['pid'])

}

if($mybb->input['pid'])

Zeile 345Zeile 355
			{
$optionbg = "trow2";
$votestar = "*";

			{
$optionbg = "trow2";
$votestar = "*";

			}
else
{

			}
else
{

				$optionbg = "trow1";
$votestar = "";
}

				$optionbg = "trow1";
$votestar = "";
}

Zeile 356Zeile 366
			if($alreadyvoted || $showresults)
{
if(intval($votes) == "0")

			if($alreadyvoted || $showresults)
{
if(intval($votes) == "0")

				{

				{

					$percent = "0";
}
else

					$percent = "0";
}
else

Zeile 392Zeile 402

// Check if user is allowed to edit posts; if so, show "edit poll" link.
if(!is_moderator($fid, 'caneditposts'))


// Check if user is allowed to edit posts; if so, show "edit poll" link.
if(!is_moderator($fid, 'caneditposts'))

		{

		{

			$edit_poll = '';
}
else

			$edit_poll = '';
}
else

Zeile 419Zeile 429
		{
$publicnote = '&nbsp;';
if($poll['public'] == 1)

		{
$publicnote = '&nbsp;';
if($poll['public'] == 1)

			{

			{

				$publicnote = $lang->public_note;
}
eval("\$pollbox = \"".$templates->get("showthread_poll")."\";");
$plugins->run_hooks("showthread_poll");

				$publicnote = $lang->public_note;
}
eval("\$pollbox = \"".$templates->get("showthread_poll")."\";");
$plugins->run_hooks("showthread_poll");

		}

}
else

		}

}
else

	{
$pollbox = "";
}

	{
$pollbox = "";
}

Zeile 436Zeile 446
	if($mybb->settings['enableforumjump'] != 0)
{
$forumjump = build_forum_jump("", $fid, 1);

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

	}

	}

	
// Fetch some links
$next_oldest_link = get_thread_link($tid, 0, "nextoldest");

	
// Fetch some links
$next_oldest_link = get_thread_link($tid, 0, "nextoldest");

Zeile 471Zeile 481
		if($thread['visible'] != 1)
{
$approveunapprovethread = "<option value=\"approvethread\">".$lang->approve_thread."</option>";

		if($thread['visible'] != 1)
{
$approveunapprovethread = "<option value=\"approvethread\">".$lang->approve_thread."</option>";

		}

		}

		else
{
$approveunapprovethread = "<option value=\"unapprovethread\">".$lang->unapprove_thread."</option>";

		else
{
$approveunapprovethread = "<option value=\"unapprovethread\">".$lang->unapprove_thread."</option>";

Zeile 489Zeile 499
		$inlinecount = "0";
$inlinecookie = "inlinemod_thread".$tid;
$plugins->run_hooks("showthread_ismod");

		$inlinecount = "0";
$inlinecookie = "inlinemod_thread".$tid;
$plugins->run_hooks("showthread_ismod");

	}
else
{

	}
else
{

		$modoptions = "&nbsp;";
$inlinemod = "";
}

		$modoptions = "&nbsp;";
$inlinemod = "";
}

Zeile 500Zeile 510
	if($mybb->settings['delayedthreadviews'] == 1)
{
$db->shutdown_query("INSERT INTO ".TABLE_PREFIX."threadviews (tid) VALUES('{$tid}')");

	if($mybb->settings['delayedthreadviews'] == 1)
{
$db->shutdown_query("INSERT INTO ".TABLE_PREFIX."threadviews (tid) VALUES('{$tid}')");

	}
else

	}
else

	{
$db->shutdown_query("UPDATE ".TABLE_PREFIX."threads SET views=views+1 WHERE tid='{$tid}'");
}

	{
$db->shutdown_query("UPDATE ".TABLE_PREFIX."threads SET views=views+1 WHERE tid='{$tid}'");
}

Zeile 510Zeile 520
	// Work out the thread rating for this thread.
$rating = '';
if($forum['allowtratings'] != 0)

	// Work out the thread rating for this thread.
$rating = '';
if($forum['allowtratings'] != 0)

	{

	{

		$lang->load("ratethread");
if($thread['numratings'] <= 0)
{

		$lang->load("ratethread");
if($thread['numratings'] <= 0)
{

Zeile 519Zeile 529
			$thread['numratings'] = 0;
}
else

			$thread['numratings'] = 0;
}
else

		{
$thread['averagerating'] = intval(round($thread['totalratings']/$thread['numratings'], 2));
$thread['width'] = $thread['averagerating']*20;

		{
$thread['averagerating'] = floatval(round($thread['totalratings']/$thread['numratings'], 2));
$thread['width'] = intval(round($thread['averagerating']))*20;

			$thread['numratings'] = intval($thread['numratings']);
}


			$thread['numratings'] = intval($thread['numratings']);
}


Zeile 557Zeile 567
	// Fetch the ignore list for the current user if they have one
$ignored_users = array();
if($mybb->user['uid'] > 0 && $mybb->user['ignorelist'] != "")

	// Fetch the ignore list for the current user if they have one
$ignored_users = array();
if($mybb->user['uid'] > 0 && $mybb->user['ignorelist'] != "")

	{

	{

		$ignore_list = explode(',', $mybb->user['ignorelist']);
foreach($ignore_list as $uid)
{

		$ignore_list = explode(',', $mybb->user['ignorelist']);
foreach($ignore_list as $uid)
{

Zeile 565Zeile 575
		}
}


		}
}


	// Which thread mode is our user using?















	// Which thread mode is our user using by default?
if(!empty($mybb->user['threadmode']))
{
$defaultmode = $mybb->user['threadmode'];
}
else if($mybb->settings['threadusenetstyle'] == 1)
{
$defaultmode = 'threaded';
}
else
{
$defaultmode = 'linear';
}

// If mode is unset, set the default mode

	if(!isset($mybb->input['mode']))

	if(!isset($mybb->input['mode']))

	{
if(!empty($mybb->user['threadmode'])) // Take user's default preference first (if there is one) and run with it
{
$mybb->input['mode'] = $mybb->user['threadmode'];
}
else if($mybb->settings['threadusenetstyle'] == 1)
{
$mybb->input['mode'] = 'threaded';
}
else
{
$mybb->input['mode'] = 'linear';
}

	{
$mybb->input['mode'] = $defaultmode;












	}

// Threaded or linear display?

	}

// Threaded or linear display?

Zeile 717Zeile 730
			$page = 1;
}
$upper = $start+$perpage;

			$page = 1;
}
$upper = $start+$perpage;

 
		
// Work out if we have terms to highlight
$highlight = "";
$threadmode = "";
if($mybb->settings['seourls'] == "yes" || ($mybb->settings['seourls'] == "auto" && $_SERVER['SEO_SUPPORT'] == 1))
{
if($mybb->input['highlight'])
{
$highlight = "?highlight=".urlencode($mybb->input['highlight']);
}

if($defaultmode != "linear")
{
if($mybb->input['highlight'])
{
$threadmode = "&amp;mode=linear";
}
else
{
$threadmode = "?mode=linear";
}
}
}
else
{
if($mybb->input['highlight'])
{
$highlight = "&amp;highlight=".urlencode($mybb->input['highlight']);
}

if($defaultmode != "linear")
{
$threadmode = "&amp;mode=linear";
}
}





		$multipage = multipage($postcount, $perpage, $page, str_replace("{tid}", $tid, THREAD_URL_PAGED));

        $multipage = multipage($postcount, $perpage, $page, str_replace("{tid}", $tid, THREAD_URL_PAGED.$highlight.$threadmode)); 

		if($postcount > $perpage)
{
eval("\$threadpages = \"".$templates->get("showthread_multipage")."\";");

		if($postcount > $perpage)
{
eval("\$threadpages = \"".$templates->get("showthread_multipage")."\";");