Vergleich showthread.php - 1.6.4 - 1.6.5

  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: showthread.php 5473 2011-06-23 11:12:10Z Tomm $

 * $Id: showthread.php 5639 2011-10-26 09:16:47Z Tomm $

 */

define("IN_MYBB", 1);

 */

define("IN_MYBB", 1);

Zeile 122Zeile 122

// Forumdisplay cache
$forum_stats = $cache->read("forumsdisplay");


// Forumdisplay cache
$forum_stats = $cache->read("forumsdisplay");

 

if(!is_array($forum_stats))
{
// Attempt to rebuild it?
$forum_stats = $cache->read("forumdisplay", true);

if(!is_array($forum_stats))
{
$forum_stats = array();
}
}


$breadcrumb_multipage = array();
if($mybb->settings['showforumpagesbreadcrumb'])


$breadcrumb_multipage = array();
if($mybb->settings['showforumpagesbreadcrumb'])

Zeile 146Zeile 157
	if($forumpermissions['canonlyviewownthreads'] == 1)
{
$uid_only = " AND uid = '".$mybb->user['uid']."'";

	if($forumpermissions['canonlyviewownthreads'] == 1)
{
$uid_only = " AND uid = '".$mybb->user['uid']."'";


$query = $db->simple_select("threads", "COUNT(tid) AS threads", "fid = '$fid' $visibleonly $uid_only", array('limit' => 1));
$threadcount = $db->fetch_field($query, "threads");
}



$query = $db->simple_select("threads", "COUNT(tid) AS threads", "fid = '$fid' $visibleonly $uid_only", array('limit' => 1));
$threadcount = $db->fetch_field($query, "threads");
}


	// If we have 0 threads double check there aren't any "moved" threads
if($threadcount == 0)
{

	// If we have 0 threads double check there aren't any "moved" threads
if($threadcount == 0)
{

Zeile 219Zeile 230
		{
$forum_read = $read_cutoff;
}

		{
$forum_read = $read_cutoff;
}

	}

	}

	else

	else

	{

	{

		$forum_read = intval(my_get_array_cookie("forumread", $fid));
}


		$forum_read = intval(my_get_array_cookie("forumread", $fid));
}


Zeile 233Zeile 244
			if($thread_read)
{
$lastread = $thread_read;

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

			}
else

			}
else

			{
// Set $lastread to zero to make sure 'lastpost' is invoked in the last IF
$lastread = 0;

			{
// Set $lastread to zero to make sure 'lastpost' is invoked in the last IF
$lastread = 0;

Zeile 261Zeile 272
   }

// Next, find the proper pid to link to.

   }

// Next, find the proper pid to link to.

	$options = array(

	$options = array(

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

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

Zeile 348Zeile 359
		"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");
header("Location: ".htmlspecialchars_decode(get_post_link($pid, $nextthread['tid']))."#pid{$pid}");
exit;


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

}

// Jump to the next oldest posts.

}

// Jump to the next oldest posts.

Zeile 397Zeile 408
if($mybb->input['action'] == "thread")
{
if($thread['firstpost'] == 0)

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

	{

	{

		update_first_post($tid);
}


		update_first_post($tid);
}


Zeile 441Zeile 452
		$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)
{
$poll['totvotes'] = $poll['totvotes'] + $votesarray[$i-1];

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

Zeile 470Zeile 481
			{
$optionbg = "trow2";
$votestar = "*";

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

			}

			}

			else

			else

			{

			{

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

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

Zeile 483Zeile 494
				if(intval($votes) == "0")
{
$percent = "0";

				if(intval($votes) == "0")
{
$percent = "0";

				}
else

				}
else

				{
$percent = number_format($votes / $poll['totvotes'] * 100, 2);
}

				{
$percent = number_format($votes / $poll['totvotes'] * 100, 2);
}

Zeile 499Zeile 510
					eval("\$polloptions .= \"".$templates->get("showthread_poll_option_multiple")."\";");
}
else

					eval("\$polloptions .= \"".$templates->get("showthread_poll_option_multiple")."\";");
}
else

				{

				{

					eval("\$polloptions .= \"".$templates->get("showthread_poll_option")."\";");
}
}

					eval("\$polloptions .= \"".$templates->get("showthread_poll_option")."\";");
}
}

		}


		}


		// If there are any votes at all, all votes together will be 100%; if there are no votes, all votes together will be 0%.
if($poll['totvotes'])

		// If there are any votes at all, all votes together will be 100%; if there are no votes, all votes together will be 0%.
if($poll['totvotes'])

		{

		{

			$totpercent = "100%";

			$totpercent = "100%";

		}

		}

		else
{
$totpercent = "0%";

		else
{
$totpercent = "0%";

		}


		}


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

Zeile 558Zeile 569

}
else


}
else

	{

	{

		$pollbox = "";
}


		$pollbox = "";
}


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

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

		}

		}

	}

// Create the admin tools dropdown box.

	}

// Create the admin tools dropdown box.

Zeile 597Zeile 608
		if($pollbox)
{
$adminpolloptions = "<option value=\"deletepoll\">".$lang->delete_poll."</option>";

		if($pollbox)
{
$adminpolloptions = "<option value=\"deletepoll\">".$lang->delete_poll."</option>";

		}

		}

		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

		}
else

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

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

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

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

		}

if($thread['num_ratings'])
{

		}

if($thread['numratings'])
{

			// At least >someone< has rated this thread, was it me?
// Check if we have already voted on this thread - it won't show hover effect then.
$query = $db->simple_select("threadratings", "uid", "tid='{$tid}' AND uid='{$mybb->user['uid']}'");

			// At least >someone< has rated this thread, was it me?
// Check if we have already voted on this thread - it won't show hover effect then.
$query = $db->simple_select("threadratings", "uid", "tid='{$tid}' AND uid='{$mybb->user['uid']}'");

Zeile 698Zeile 709
		{
$ignored_users[$uid] = 1;
}

		{
$ignored_users[$uid] = 1;
}

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

 
	}

// Which thread mode is our user using by default?

	}

// Which thread mode is our user using by default?

Zeile 842Zeile 835
			else
{
$page = intval($result / $perpage) + 1;

			else
{
$page = intval($result / $perpage) + 1;

			}
}

			}
}

		// Recount replies if user is a moderator to take into account unapproved posts.
if($ismod)
{
$query = $db->simple_select("posts p", "COUNT(*) AS replies", "p.tid='$tid' $visible");
$thread['replies'] = $db->fetch_field($query, 'replies')-1;

		// Recount replies if user is a moderator to take into account unapproved posts.
if($ismod)
{
$query = $db->simple_select("posts p", "COUNT(*) AS replies", "p.tid='$tid' $visible");
$thread['replies'] = $db->fetch_field($query, 'replies')-1;

		}

		}

		$postcount = intval($thread['replies'])+1;
$pages = $postcount / $perpage;
$pages = ceil($pages);

		$postcount = intval($thread['replies'])+1;
$pages = $postcount / $perpage;
$pages = ceil($pages);

Zeile 879Zeile 872
        $highlight = "";
$threadmode = "";
if($mybb->settings['seourls'] == "yes" || ($mybb->settings['seourls'] == "auto" && $_SERVER['SEO_SUPPORT'] == 1))

        $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'])
{
$highlight = "?highlight=".urlencode($mybb->input['highlight']);
}

if($defaultmode != "linear")

			{

			{

	            if($mybb->input['highlight'])
{
$threadmode = "&amp;mode=linear";

	            if($mybb->input['highlight'])
{
$threadmode = "&amp;mode=linear";

Zeile 899Zeile 892
        }
else
{

        }
else
{

            if($mybb->input['highlight'])
{
$highlight = "&amp;highlight=".urlencode($mybb->input['highlight']);
}











			if($mybb->input['highlight'])
{
if(is_array($mybb->input['highlight']))
{
foreach($mybb->input['highlight'] as $highlight_word)
{
$highlight .= "&amp;highlight[]=".urlencode($highlight_word);
}
}
else
{
$highlight = "&amp;highlight=".urlencode($mybb->input['highlight']);
}
}

            
if($defaultmode != "linear")
{

            
if($defaultmode != "linear")
{

Zeile 1072Zeile 1075
		$last_pid = $db->fetch_field($query, "pid");

// Show captcha image for guests if enabled

		$last_pid = $db->fetch_field($query, "pid");

// Show captcha image for guests if enabled

		if($mybb->settings['captchaimage'] == 1 && function_exists("imagepng") && !$mybb->user['uid'])

		if($mybb->settings['captchaimage'] && !$mybb->user['uid'])

		{

		{

			$randomstr = random_str(5);
$imagehash = md5(random_str(12));
$imagearray = array(
"imagehash" => $imagehash,
"imagestring" => $randomstr,
"dateline" => TIME_NOW
);
$db->insert_query("captcha", $imagearray);
eval("\$captcha = \"".$templates->get("post_captcha")."\";");

			require_once MYBB_ROOT.'inc/class_captcha.php';
$post_captcha = new captcha(true, "post_captcha");

if($post_captcha->html)
{
$captcha = $post_captcha->html;
}



		}
if($mybb->user['signature'])
{

		}
if($mybb->user['signature'])
{