Vergleich showthread.php - 1.2.0 - 1.2.11

  Keine Änderungen   Hinzugefügt   Modifiziert   Entfernt
Zeile 3Zeile 3
 * MyBB 1.2
* Copyright � 2006 MyBB Group, All Rights Reserved
*

 * MyBB 1.2
* Copyright � 2006 MyBB Group, All Rights Reserved
*

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

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

 *

 *

 * $Id: showthread.php 2164 2006-08-30 06:17:49Z chris $

 * $Id: showthread.php 3478 2007-11-15 04:11:36Z 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 67Zeile 73
// Build the navigation.
build_forum_breadcrumb($fid);
add_breadcrumb($thread['subject'], "showthread.php?tid=$tid");

// Build the navigation.
build_forum_breadcrumb($fid);
add_breadcrumb($thread['subject'], "showthread.php?tid=$tid");





// Does the thread belong to a valid forum?
$forum = get_forum($fid);
if(!$forum || $forum['type'] != "f")

// Does the thread belong to a valid forum?
$forum = get_forum($fid);
if(!$forum || $forum['type'] != "f")

Zeile 83Zeile 89
	error_no_permission();
}


	error_no_permission();
}


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

// Check if this forum is password protected and we have a valid password
check_forum_password($forum['fid']);


// If there is no specific action, we must be looking at the thread.
if(!$mybb->input['action'])
{
$mybb->input['action'] = "thread";


// If there is no specific action, we must be looking at the 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 100Zeile 106
		$query = $db->query("
SELECT p.pid
FROM ".TABLE_PREFIX."posts p, ".TABLE_PREFIX."threads t

		$query = $db->query("
SELECT p.pid
FROM ".TABLE_PREFIX."posts p, ".TABLE_PREFIX."threads t

			WHERE t.fid='".$thread[fid]."' AND t.closed NOT LIKE 'moved|%' AND p.tid=t.tid

			WHERE t.fid='".$thread['fid']."' AND t.closed NOT LIKE 'moved|%' AND p.tid=t.tid

			ORDER BY p.dateline DESC
LIMIT 0, 1
");

			ORDER BY p.dateline DESC
LIMIT 0, 1
");

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,

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

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

		"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);
$nextthread = $db->fetch_array($query);


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


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





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

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

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 214Zeile 220
	{
$readcookie = $threadread = my_get_array_cookie("threadread", $thread['tid']);
if($readcookie > $forumread)

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

		{

		{

			$lastread = $readcookie;
}
else

			$lastread = $readcookie;
}
else

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

	}






	}
}

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

}

$plugins->run_hooks("showthread_start");

}

$plugins->run_hooks("showthread_start");

Zeile 289Zeile 300
		$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 320

$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 393
			{
$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 402Zeile 415
	}

// Create the forum jump dropdown box.

	}

// Create the forum jump dropdown box.

	$forumjump = build_forum_jump("", $fid, 1);




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


// Mark this thread read for the currently logged in user.
if($mybb->settings['threadreadcut'] && ($mybb->user['uid'] != 0))


// Mark this thread read for the currently logged in user.
if($mybb->settings['threadreadcut'] && ($mybb->user['uid'] != 0))

	{

	{

		// For registered users, store the information in the database.
$db->shutdown_query("
REPLACE INTO ".TABLE_PREFIX."threadsread
SET tid='$tid', uid='".$mybb->user['uid']."', dateline='".time()."'
");

		// For registered users, store the information in the database.
$db->shutdown_query("
REPLACE INTO ".TABLE_PREFIX."threadsread
SET tid='$tid', uid='".$mybb->user['uid']."', dateline='".time()."'
");

	}

	}

	else
{
// For guests, store the information in a cookie.
my_set_array_cookie("threadread", $tid, time());
}

	else
{
// For guests, store the information in a cookie.
my_set_array_cookie("threadread", $tid, time());
}





	// If the forum is not open, show closed newreply button unless the user is a moderator of this forum.
if($forum['open'] != "no")
{

	// If the forum is not open, show closed newreply button unless the user is a moderator of this forum.
if($forum['open'] != "no")
{

Zeile 428Zeile 444
		if($thread['closed'] == "yes")
{
eval("\$newreply = \"".$templates->get("showthread_newreply_closed")."\";");

		if($thread['closed'] == "yes")
{
eval("\$newreply = \"".$templates->get("showthread_newreply_closed")."\";");

		}
else

		}
else

		{
eval("\$newreply = \"".$templates->get("showthread_newreply")."\";");

		{
eval("\$newreply = \"".$templates->get("showthread_newreply")."\";");

		}
}

		}
}


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


// Create the admin tools dropdown box.
if($ismod == true)
{
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)

Zeile 473Zeile 489
	// Decide whether or not to include signatures.
if($forumpermissions['canpostreplys'] != "no" && ($thread['closed'] != "yes" || is_moderator($fid) == "yes") && $mybb->settings['quickreply'] != "off" && $mybb->user['showquickreply'] != "no" && $forum['open'] != "no")
{

	// Decide whether or not to include signatures.
if($forumpermissions['canpostreplys'] != "no" && ($thread['closed'] != "yes" || is_moderator($fid) == "yes") && $mybb->settings['quickreply'] != "off" && $mybb->user['showquickreply'] != "no" && $forum['open'] != "no")
{

 
		// Show captcha image for guests if enabled
if($mybb->settings['captchaimage'] == "on" && function_exists("imagepng") && !$mybb->user['uid'])
{
$randomstr = random_str(5);
$imagehash = md5($randomstr);
$imagearray = array(
"imagehash" => $imagehash,
"imagestring" => $randomstr,
"dateline" => time()
);
$db->insert_query(TABLE_PREFIX."captcha", $imagearray);
eval("\$captcha = \"".$templates->get("post_captcha")."\";");
}

		if($mybb->user['signature'])
{
$postoptionschecked['signature'] = "checked";

		if($mybb->user['signature'])
{
$postoptionschecked['signature'] = "checked";

Zeile 555Zeile 584
		// Is there actually a pid to display?
if(!$showpost['pid'])
{

		// Is there actually a pid to display?
if(!$showpost['pid'])
{

			error($lang->invalidpost);

			error($lang->error_invalidpost);

		}

// Get the attachments for this post.

		}

// Get the attachments for this post.

Zeile 567Zeile 596

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


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

			SELECT u.*, u.username AS userusername, 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
");
while($post = $db->fetch_array($query))
{
if(!$postsdone[$post['pid']])
{
$tree[$post['replyto']][$post['pid']] = $post;
if($post['pid'] == $mybb->input['pid'] || ($isfirst && !$mybb->input['pid']))
{
$isfirst = 0;
}
$postsdone[$post['pid']] = 1;
}
}

            SELECT p.username, p.uid, p.pid, p.replyto, p.subject, p.dateline
FROM ".TABLE_PREFIX."posts p
WHERE p.tid='$tid'
$visible
ORDER BY p.dateline
");
while($post = $db->fetch_array($query))
{
if(!$postsdone[$post['pid']])
{
if($post['pid'] == $mybb->input['pid'] || ($isfirst && !$mybb->input['pid']))
{
$isfirst = 0;
}
$tree[$post['replyto']][$post['pid']] = $post;
$postsdone[$post['pid']] = 1;
}
}


		$threadedbits = buildtree();
$posts = build_postbit($showpost);
eval("\$threadexbox = \"".$templates->get("showthread_threadedbox")."\";");

		$threadedbits = buildtree();
$posts = build_postbit($showpost);
eval("\$threadexbox = \"".$templates->get("showthread_threadedbox")."\";");

Zeile 735Zeile 763
			{
$similar_thread['username'] = $similar_thread['threadusername'];
$similar_thread['profilelink'] = $similar_thread['threadusername'];

			{
$similar_thread['username'] = $similar_thread['threadusername'];
$similar_thread['profilelink'] = $similar_thread['threadusername'];

			}

			}

			else
{
$similar_thread['profilelink'] = build_profile_link($similar_thread['username'], $similar_thread['uid']);
}
$similar_thread['subject'] = $parser->parse_badwords($similar_thread['subject']);
$similar_thread['subject'] = htmlspecialchars_uni($similar_thread['subject']);

			else
{
$similar_thread['profilelink'] = build_profile_link($similar_thread['username'], $similar_thread['uid']);
}
$similar_thread['subject'] = $parser->parse_badwords($similar_thread['subject']);
$similar_thread['subject'] = htmlspecialchars_uni($similar_thread['subject']);





			$lastpostdate = my_date($mybb->settings['dateformat'], $similar_thread['lastpost']);
$lastposttime = my_date($mybb->settings['timeformat'], $similar_thread['lastpost']);
$lastposter = $similar_thread['lastposter'];
$lastposteruid = $similar_thread['lastposteruid'];

			$lastpostdate = my_date($mybb->settings['dateformat'], $similar_thread['lastpost']);
$lastposttime = my_date($mybb->settings['timeformat'], $similar_thread['lastpost']);
$lastposter = $similar_thread['lastposter'];
$lastposteruid = $similar_thread['lastposteruid'];





			// Don't link to guest's profiles (they have no profile).
if($lastposteruid == 0)
{

			// Don't link to guest's profiles (they have no profile).
if($lastposteruid == 0)
{

Zeile 813Zeile 841
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 850
	{
$indentsize = 0;
}

	{
$indentsize = 0;
}

 
	

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

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

Zeile 829Zeile 859
			$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 875
			{
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);