Vergleich showthread.php - 1.2.1 - 1.2.4

  Keine Änderungen   Hinzugefügt   Modifiziert   Entfernt
Zeile 6Zeile 6
 * Website: http://www.mybboard.com
* License: http://www.mybboard.com/eula.html
*

 * Website: http://www.mybboard.com
* License: http://www.mybboard.com/eula.html
*

 * $Id: showthread.php 2263 2006-09-26 09:24:25Z chris $

 * $Id: showthread.php 2542 2006-12-19 23:43:47Z Tikitiki $

 */

define("IN_MYBB", 1);

 */

define("IN_MYBB", 1);

Zeile 33Zeile 33
	);
$query = $db->simple_select(TABLE_PREFIX."posts", "tid", "pid=".$mybb->input['pid'], $options);
$post = $db->fetch_array($query);

	);
$query = $db->simple_select(TABLE_PREFIX."posts", "tid", "pid=".$mybb->input['pid'], $options);
$post = $db->fetch_array($query);

 
	$pid = $mybb->input['pid'];

	$mybb->input['tid'] = $post['tid'];
}


	$mybb->input['tid'] = $post['tid'];
}


Zeile 45Zeile 46
$thread['subject'] = htmlspecialchars_uni($parser->parse_badwords($thread['subject']));
$tid = $thread['tid'];
$fid = $thread['fid'];

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

 

if(!$thread['username'])
{
$thread['username'] = $lang->guest;
}


// Is the currently logged in user a moderator of this forum?
if(is_moderator($fid) == "yes")


// Is the currently logged in user a moderator of this forum?
if(is_moderator($fid) == "yes")

Zeile 79Zeile 85
$forumpermissions = forum_permissions($forum['fid']);

if($forumpermissions['canview'] != "yes" || $forumpermissions['canviewthreads'] != "yes")

$forumpermissions = forum_permissions($forum['fid']);

if($forumpermissions['canview'] != "yes" || $forumpermissions['canviewthreads'] != "yes")

{

{

	error_no_permission();
}

	error_no_permission();
}





// Check that this forum is not password protected.
check_forum_password($forum['fid'], $forum['password']);


// Check that this forum is not password protected.
check_forum_password($forum['fid'], $forum['password']);


Zeile 90Zeile 96
if(!$mybb->input['action'])
{
$mybb->input['action'] = "thread";

if(!$mybb->input['action'])
{
$mybb->input['action'] = "thread";

}

}


// Jump to the last post.
if($mybb->input['action'] == "lastpost")


// Jump to the last post.
if($mybb->input['action'] == "lastpost")

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

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

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

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

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

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

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

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

	}
$options = array(
"limit_start" => 0,
"limit" => 1,
"order_by" => "dateline",
"order_dir" => "desc"

	}
$options = array(
"limit_start" => 0,
"limit" => 1,
"order_by" => "dateline",
"order_dir" => "desc"

	);
$query = $db->simple_select(TABLE_PREFIX.'posts', 'pid', "tid={$nextthread['tid']}");


	);
$query = $db->simple_select(TABLE_PREFIX.'posts', 'pid', "tid={$nextthread['tid']}");


Zeile 152Zeile 158

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

{
$options = array(
"limit" => 1,

		"limit_start" => 0,
"order_by" => "lastpost",
"order_dir" => "desc"

		"limit_start" => 0,
"order_by" => "lastpost",
"order_dir" => "desc"

Zeile 166Zeile 172
	if(!$nextthread['tid'])
{
error($lang->error_nonextoldest);

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

	}

	}

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

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

Zeile 203Zeile 209
			if($thread_read)
{
$lastread = $thread_read;

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

			}

			}

			else
{
$lastread = 1;

			else
{
$lastread = 1;

Zeile 229Zeile 235
		"order_by" => "dateline",
"order_dir" => "asc"
);

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

	$query = $db->simple_select(TABLE_PREFIX."posts", "pid", "tid=".$tid." AND dateline > '{$lastread}'");

	$query = $db->simple_select(TABLE_PREFIX."posts", "pid", "tid=".$tid." AND dateline > '{$lastread}'", $options);

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

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

Zeile 238Zeile 244
	else
{
header("Location:showthread.php?action=lastpost&tid={$tid}");

	else
{
header("Location:showthread.php?action=lastpost&tid={$tid}");

	}
}


	}
}


$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 289Zeile 295
		$votesarray = explode("||~|~||", $poll['votes']);
$poll['question'] = htmlspecialchars_uni($poll['question']);
$polloptions = '';

		$votesarray = explode("||~|~||", $poll['votes']);
$poll['question'] = htmlspecialchars_uni($poll['question']);
$polloptions = '';

 
		$totalvotes = 0;


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


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

Zeile 308Zeile 315

$option = $parser->parse_message($optionsarray[$i-1], $parser_options);
$votes = $votesarray[$i-1];


$option = $parser->parse_message($optionsarray[$i-1], $parser_options);
$votes = $votesarray[$i-1];

 
			$totalvotes += $votes;

			$number = $i;

// Mark the option the user voted for.

			$number = $i;

// Mark the option the user voted for.

Zeile 380Zeile 388
			{
$pollstatus = $lang->poll_closed;
}

			{
$pollstatus = $lang->poll_closed;
}

			$lang->total_votes = sprintf($lang->total_votes, $poll['numvotes']);

			$lang->total_votes = sprintf($lang->total_votes, $totalvotes);

			eval("\$pollbox = \"".$templates->get("showthread_poll_results")."\";");
$plugins->run_hooks("showthread_poll_results");
}

			eval("\$pollbox = \"".$templates->get("showthread_poll_results")."\";");
$plugins->run_hooks("showthread_poll_results");
}

Zeile 437Zeile 445

// Create the admin tools dropdown box.
if($ismod == true)


// Create the admin tools dropdown box.
if($ismod == true)

	{

	{

		if($pollbox)

		if($pollbox)

		{

		{

			$adminpolloptions = "<option value=\"deletepoll\">".$lang->delete_poll."</option>";
}
if($thread['visible'] != 1)

			$adminpolloptions = "<option value=\"deletepoll\">".$lang->delete_poll."</option>";
}
if($thread['visible'] != 1)

		{

		{

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

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

		}

		}

		if($thread['closed'] == "yes")
{
$closelinkch = "checked";

		if($thread['closed'] == "yes")
{
$closelinkch = "checked";

Zeile 484Zeile 492
	    mt_srand ((double) microtime() * 1000000);
$posthash = md5($mybb->user['uid'].mt_rand());
eval("\$quickreply = \"".$templates->get("showthread_quickreply")."\";");

	    mt_srand ((double) microtime() * 1000000);
$posthash = md5($mybb->user['uid'].mt_rand());
eval("\$quickreply = \"".$templates->get("showthread_quickreply")."\";");

	}
else

	}
else

	{
$quickreply = "";
}

	{
$quickreply = "";
}

Zeile 535Zeile 543
		else
{
$where = " ORDER BY dateline ASC LIMIT 0, 1";

		else
{
$where = " ORDER BY dateline ASC LIMIT 0, 1";

		}

		}

		$query = $db->query("
SELECT u.*, u.username AS userusername, p.*, f.*, eu.username AS editusername
FROM ".TABLE_PREFIX."posts p

		$query = $db->query("
SELECT u.*, u.username AS userusername, p.*, f.*, eu.username AS editusername
FROM ".TABLE_PREFIX."posts p

Zeile 567Zeile 575

// Build the threaded post display tree.
$query = $db->query("


// Build the threaded post display tree.
$query = $db->query("

            SELECT u.username, u.username AS userusername, p.pid, p.replyto, p.subject, p.dateline

            SELECT p.username, p.uid, p.pid, p.replyto, p.subject, p.dateline

            FROM ".TABLE_PREFIX."posts p

            FROM ".TABLE_PREFIX."posts p

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

 
            WHERE p.tid='$tid' 
$visible
ORDER BY p.dateline

            WHERE p.tid='$tid' 
$visible
ORDER BY p.dateline

Zeile 596Zeile 603
		// Figure out if we need to display multiple pages.
$perpage = $mybb->settings['postsperpage'];
if($mybb->input['page'] != "last")

		// Figure out if we need to display multiple pages.
$perpage = $mybb->settings['postsperpage'];
if($mybb->input['page'] != "last")

		{

		{

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

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

Zeile 633Zeile 640
		}

if($page > $pages)

		}

if($page > $pages)

		{
$page = 1;
}

		{
$page = 1;
}


if($page)
{


if($page)
{

Zeile 813Zeile 820
function buildtree($replyto="0", $indent="0")
{
global $tree, $mybb, $theme, $mybb, $pid, $tid, $templates, $parser;

function buildtree($replyto="0", $indent="0")
{
global $tree, $mybb, $theme, $mybb, $pid, $tid, $templates, $parser;

 
	

	if($indent)
{
$indentsize = 13 * $indent;

	if($indent)
{
$indentsize = 13 * $indent;

Zeile 821Zeile 829
	{
$indentsize = 0;
}

	{
$indentsize = 0;
}

 
	

	++$indent;
if(is_array($tree[$replyto]))
{

	++$indent;
if(is_array($tree[$replyto]))
{

Zeile 829Zeile 838
			$postdate = my_date($mybb->settings['dateformat'], $post['dateline']);
$posttime = my_date($mybb->settings['timeformat'], $post['dateline']);
$post['subject'] = htmlspecialchars_uni($parser->parse_badwords($post['subject']));

			$postdate = my_date($mybb->settings['dateformat'], $post['dateline']);
$posttime = my_date($mybb->settings['timeformat'], $post['dateline']);
$post['subject'] = htmlspecialchars_uni($parser->parse_badwords($post['subject']));

 
			

			if(!$post['subject'])
{
$post['subject'] = "[".$lang->no_subject."]";
}

			if(!$post['subject'])
{
$post['subject'] = "[".$lang->no_subject."]";
}

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

			
$post['profilelink'] = build_profile_link($post['username'], $post['uid']);







			if($mybb->input['pid'] == $post['pid'])
{
eval("\$posts .= \"".$templates->get("showthread_threaded_bitactive")."\";");

			if($mybb->input['pid'] == $post['pid'])
{
eval("\$posts .= \"".$templates->get("showthread_threaded_bitactive")."\";");

Zeile 849Zeile 854
			{
eval("\$posts .= \"".$templates->get("showthread_threaded_bit")."\";");
}

			{
eval("\$posts .= \"".$templates->get("showthread_threaded_bit")."\";");
}

 
			

			if($tree[$post['pid']])
{
$posts .= buildtree($post['pid'], $indent);

			if($tree[$post['pid']])
{
$posts .= buildtree($post['pid'], $indent);