Vergleich showthread.php - 1.4.1 - 1.4.16

  Keine Änderungen   Hinzugefügt   Modifiziert   Entfernt
Zeile 1Zeile 1
<?php
/**
* MyBB 1.4

<?php
/**
* MyBB 1.4

 * Copyright � 2008 MyBB Group, All Rights Reserved

 * Copyright © 2008 MyBB Group, All Rights Reserved

 *
* 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 5379 2011-02-21 11:06:42Z Tomm $

 */

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 = intval(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)

Zeile 141Zeile 149
			}
}
}

			}
}
}

 
	

	if(!$lastread)

	if(!$lastread)

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

	{
$readcookie = $threadread = intval(my_get_array_cookie("threadread", $thread['tid']));
if($readcookie > $forum_read)
{

			$lastread = $readcookie;

			$lastread = $readcookie;

		}

		}

		else
{

		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 160Zeile 170
		"order_by" => "dateline",
"order_dir" => "asc"
);

		"order_by" => "dateline",
"order_dir" => "asc"
);

 

$lastread = intval($lastread);

	$query = $db->simple_select("posts", "pid", "tid='{$tid}' AND dateline > '{$lastread}'", $options);
$newpost = $db->fetch_array($query);
if($newpost['pid'])

	$query = $db->simple_select("posts", "pid", "tid='{$tid}' AND dateline > '{$lastread}'", $options);
$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 211
		$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;

}

}


// Jump to the next newest posts.
if($mybb->input['action'] == "nextnewest")


// Jump to the next newest posts.
if($mybb->input['action'] == "nextnewest")

Zeile 210Zeile 222
		"limit_start" => 0,
"limit" => 1,
"order_by" => "lastpost"

		"limit_start" => 0,
"limit" => 1,
"order_by" => "lastpost"

	);

	);

	$query = $db->simple_select('threads', '*', "fid={$thread['fid']} AND lastpost > {$thread['lastpost']} AND visible=1 AND closed NOT LIKE 'moved|%'", $options);
$nextthread = $db->fetch_array($query);


	$query = $db->simple_select('threads', '*', "fid={$thread['fid']} AND lastpost > {$thread['lastpost']} AND visible=1 AND closed NOT LIKE 'moved|%'", $options);
$nextthread = $db->fetch_array($query);


Zeile 218Zeile 230
	if(!$nextthread['tid'])
{
error($lang->error_nonextnewest);

	if(!$nextthread['tid'])
{
error($lang->error_nonextnewest);

	}
$options = array(

	}
$options = array(

		"limit_start" => 0,
"limit" => 1,
"order_by" => "dateline",
"order_dir" => "desc"
);
$query = $db->simple_select('posts', 'pid', "tid='{$nextthread['tid']}'", $options);

		"limit_start" => 0,
"limit" => 1,
"order_by" => "dateline",
"order_dir" => "desc"
);
$query = $db->simple_select('posts', 'pid', "tid='{$nextthread['tid']}'", $options);


// Redirect to the proper page.
$pid = $db->fetch_field($query, "pid");
header("Location:".htmlspecialchars_decode(get_post_link($pid, $nextthread['tid']))."#pid{$pid}");


// Redirect to the proper page.
$pid = $db->fetch_field($query, "pid");
header("Location: ".htmlspecialchars_decode(get_post_link($pid, $nextthread['tid']))."#pid{$pid}");

}

// Jump to the next oldest posts.
if($mybb->input['action'] == "nextoldest")

}

// Jump to the next oldest posts.
if($mybb->input['action'] == "nextoldest")

{
$options = array(
"limit" => 1,
"limit_start" => 0,
"order_by" => "lastpost",

{
$options = array(
"limit" => 1,
"limit_start" => 0,
"order_by" => "lastpost",

		"order_dir" => "desc"
);
$query = $db->simple_select("threads", "*", "fid=".$thread['fid']." AND lastpost < ".$thread['lastpost']." AND visible=1 AND closed NOT LIKE 'moved|%'", $options);

		"order_dir" => "desc"
);
$query = $db->simple_select("threads", "*", "fid=".$thread['fid']." AND lastpost < ".$thread['lastpost']." AND visible=1 AND closed NOT LIKE 'moved|%'", $options);

Zeile 256Zeile 268
		"order_dir" => "desc"
);
$query = $db->simple_select("posts", "pid", "tid='".$nextthread['tid']."'", $options);

		"order_dir" => "desc"
);
$query = $db->simple_select("posts", "pid", "tid='".$nextthread['tid']."'", $options);





	// 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'])
{
$pid = $mybb->input['pid'];
}


if($mybb->input['pid'])
{
$pid = $mybb->input['pid'];
}





$plugins->run_hooks("showthread_start");

// Show the entire thread (taking into account pagination).

$plugins->run_hooks("showthread_start");

// Show the entire thread (taking into account pagination).

Zeile 275Zeile 287
	if($thread['firstpost'] == 0)
{
update_first_post($tid);

	if($thread['firstpost'] == 0)
{
update_first_post($tid);

	}

	}

	
// Does this thread have a poll?
if($thread['poll'])

	
// Does this thread have a poll?
if($thread['poll'])

Zeile 301Zeile 313
			$query = $db->simple_select("pollvotes", "*", "uid='".$mybb->user['uid']."' AND pid='".$poll['pid']."'");
while($votecheck = $db->fetch_array($query))
{

			$query = $db->simple_select("pollvotes", "*", "uid='".$mybb->user['uid']."' AND pid='".$poll['pid']."'");
while($votecheck = $db->fetch_array($query))
{

				$alreadyvoted = 1;

				$alreadyvoted = 1;

				$votedfor[$votecheck['voteoption']] = 1;
}
}

				$votedfor[$votecheck['voteoption']] = 1;
}
}

Zeile 317Zeile 329
		$poll['question'] = htmlspecialchars_uni($poll['question']);
$polloptions = '';
$totalvotes = 0;

		$poll['question'] = htmlspecialchars_uni($poll['question']);
$polloptions = '';
$totalvotes = 0;


for($i = 1; $i <= $poll['numoptions']; ++$i)


for($i = 1; $i <= $poll['numoptions']; ++$i)

		{
$poll['totvotes'] = $poll['totvotes'] + $votesarray[$i-1];
}

		{
$poll['totvotes'] = $poll['totvotes'] + $votesarray[$i-1];
}

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

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

			}
else
{

			}
else
{

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

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

Zeile 397Zeile 409
		}
else
{

		}
else
{

			$edit_poll = "| <a href=\"polls.php?action=editpoll&amp;pid={$poll['pid']}\">{$lang->edit_poll}</a>";

			$edit_poll = " | <a href=\"polls.php?action=editpoll&amp;pid={$poll['pid']}\">{$lang->edit_poll}</a>";

		}

// Decide what poll status to show depending on the status of the poll and whether or not the user voted already.

		}

// Decide what poll status to show depending on the status of the poll and whether or not the user voted already.

Zeile 520Zeile 532
		}
else
{

		}
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 565Zeile 577
		}
}


		}
}


	// Which thread mode is our user using?
if(!isset($mybb->input['mode']))

	// Which thread mode is our user using by default?
if(!empty($mybb->user['threadmode']))

	{

	{

		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';
}




		$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']))
{
$mybb->input['mode'] = $defaultmode;

	}

// Threaded or linear display?

	}

// Threaded or linear display?

Zeile 717Zeile 732
			$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")."\";");

Zeile 888Zeile 938
		{
$postoptionschecked['emailnotify'] = 'checked="checked"';
}

		{
$postoptionschecked['emailnotify'] = 'checked="checked"';
}

	    mt_srand((double) microtime() * 1000000);
$posthash = md5($mybb->user['uid'].mt_rand());

	    $posthash = md5($mybb->user['uid'].random_str());


		
eval("\$quickreply = \"".$templates->get("showthread_quickreply")."\";");
}

		
eval("\$quickreply = \"".$templates->get("showthread_quickreply")."\";");
}