Zeile 3 | Zeile 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 2263 2006-09-26 09:24:25Z chris $
| * $Id: showthread.php 3053 2007-05-12 19:07:18Z Tikitiki $
|
*/
define("IN_MYBB", 1);
| */
define("IN_MYBB", 1);
|
Zeile 33 | Zeile 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 45 | Zeile 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") { $ismod = true;
|
// Is the currently logged in user a moderator of this forum? if(is_moderator($fid) == "yes") { $ismod = true;
|
}
| }
|
else { $ismod = false;
| else { $ismod = false;
|
Zeile 58 | Zeile 64 |
---|
// Make sure we are looking at a real thread here. if(!$thread['tid'] || ($thread['visible'] == 0 && $ismod == false) || ($thread['visible'] > 1 && $ismod == true))
|
// Make sure we are looking at a real thread here. if(!$thread['tid'] || ($thread['visible'] == 0 && $ismod == false) || ($thread['visible'] > 1 && $ismod == true))
|
{
| {
|
error($lang->error_invalidthread); }
| error($lang->error_invalidthread); }
|
Zeile 107 | Zeile 113 |
---|
$pid = $db->fetch_field($query, "pid"); } else
|
$pid = $db->fetch_field($query, "pid"); } else
|
{
| {
|
$options = array( 'order_by' => 'dateline', 'order_dir' => 'desc',
| $options = array( 'order_by' => 'dateline', 'order_dir' => 'desc',
|
Zeile 120 | Zeile 126 |
---|
header("Location:showthread.php?tid={$tid}&pid={$pid}#pid{$pid}"); exit; }
|
header("Location:showthread.php?tid={$tid}&pid={$pid}#pid{$pid}"); exit; }
|
|
|
// Jump to the next newest posts. if($mybb->input['action'] == "nextnewest") {
| // Jump to the next newest posts. if($mybb->input['action'] == "nextnewest") {
|
Zeile 144 | Zeile 150 |
---|
"order_dir" => "desc" ); $query = $db->simple_select(TABLE_PREFIX.'posts', 'pid', "tid={$nextthread['tid']}");
|
"order_dir" => "desc" ); $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 229 | Zeile 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 289 | Zeile 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 308 | Zeile 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 380 | Zeile 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 441 | Zeile 449 |
---|
if($pollbox) { $adminpolloptions = "<option value=\"deletepoll\">".$lang->delete_poll."</option>";
|
if($pollbox) { $adminpolloptions = "<option value=\"deletepoll\">".$lang->delete_poll."</option>";
|
}
| }
|
if($thread['visible'] != 1)
|
if($thread['visible'] != 1)
|
{
| {
|
$approveunapprovethread = "<option value=\"approvethread\">".$lang->approve_thread."</option>"; } else
|
$approveunapprovethread = "<option value=\"approvethread\">".$lang->approve_thread."</option>"; } else
|
{
| {
|
$approveunapprovethread = "<option value=\"unapprovethread\">".$lang->unapprove_thread."</option>"; } if($thread['closed'] == "yes") { $closelinkch = "checked";
|
$approveunapprovethread = "<option value=\"unapprovethread\">".$lang->unapprove_thread."</option>"; } if($thread['closed'] == "yes") { $closelinkch = "checked";
|
}
| }
|
if($thread['sticky']) { $stickch = "checked";
| if($thread['sticky']) { $stickch = "checked";
|
Zeile 463 | Zeile 471 |
---|
$inlinecount = "0"; $inlinecookie = "inlinemod_thread".$tid; $plugins->run_hooks("showthread_ismod");
|
$inlinecount = "0"; $inlinecookie = "inlinemod_thread".$tid; $plugins->run_hooks("showthread_ismod");
|
} else {
| } else {
|
$adminoptions = " "; $inlinemod = ""; }
// 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")
|
$adminoptions = " "; $inlinemod = ""; }
// 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")
|
{ if($mybb->user['signature']) {
| { // 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";
|
$postoptionschecked['signature'] = "checked";
|
}
| }
|
if($mybb->user['emailnotify'] == "yes") { $postoptionschecked['emailnotify'] = "checked";
| if($mybb->user['emailnotify'] == "yes") { $postoptionschecked['emailnotify'] = "checked";
|
Zeile 484 | Zeile 505 |
---|
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 535 | Zeile 556 |
---|
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 LEFT JOIN ".TABLE_PREFIX."users u ON (u.uid=p.uid)
| } $query = $db->query(" SELECT u.*, u.username AS userusername, p.*, f.*, eu.username AS editusername FROM ".TABLE_PREFIX."posts p LEFT JOIN ".TABLE_PREFIX."users u ON (u.uid=p.uid)
|
LEFT JOIN ".TABLE_PREFIX."userfields f ON (f.ufid=u.uid) LEFT JOIN ".TABLE_PREFIX."users eu ON (eu.uid=p.edituid) WHERE p.tid='$tid' $visible $where
| LEFT JOIN ".TABLE_PREFIX."userfields f ON (f.ufid=u.uid) LEFT JOIN ".TABLE_PREFIX."users eu ON (eu.uid=p.edituid) WHERE p.tid='$tid' $visible $where
|
Zeile 563 | Zeile 584 |
---|
while($attachment = $db->fetch_array($query)) { $attachcache[$attachment['pid']][$attachment['aid']] = $attachment;
|
while($attachment = $db->fetch_array($query)) { $attachcache[$attachment['pid']][$attachment['aid']] = $attachment;
|
}
| }
|
// 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 616 | Zeile 636 |
---|
{ $page = intval($result / $perpage) + 1; }
|
{ $page = intval($result / $perpage) + 1; }
|
}
| }
|
// Recount replies if user is a moderator to take into account unapproved posts. if($ismod) {
| // Recount replies if user is a moderator to take into account unapproved posts. if($ismod) {
|
Zeile 628 | Zeile 648 |
---|
$pages = ceil($pages);
if($mybb->input['page'] == "last")
|
$pages = ceil($pages);
if($mybb->input['page'] == "last")
|
{
| {
|
$page = $pages;
|
$page = $pages;
|
}
| }
|
if($page > $pages)
|
if($page > $pages)
|
{
| {
|
$page = 1; }
if($page) { $start = ($page-1) * $perpage;
|
$page = 1; }
if($page) { $start = ($page-1) * $perpage;
|
}
| }
|
else { $start = 0;
| else { $start = 0;
|
Zeile 813 | Zeile 833 |
---|
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 821 | Zeile 842 |
---|
{ $indentsize = 0; }
|
{ $indentsize = 0; }
|
|
|
++$indent; if(is_array($tree[$replyto])) {
| ++$indent; if(is_array($tree[$replyto])) {
|
Zeile 829 | Zeile 851 |
---|
$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 849 | Zeile 867 |
---|
{ 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);
|