Zeile 6 | Zeile 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 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")
| // Is the currently logged in user a moderator of this forum? if(is_moderator($fid) == "yes")
|
Zeile 79 | Zeile 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 90 | Zeile 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 124 | Zeile 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 136 | Zeile 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 152 | Zeile 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 166 | Zeile 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 203 | Zeile 209 |
---|
if($thread_read) { $lastread = $thread_read;
|
if($thread_read) { $lastread = $thread_read;
|
}
| }
|
else { $lastread = 1;
| else { $lastread = 1;
|
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 238 | Zeile 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 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 437 | Zeile 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 484 | Zeile 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 535 | Zeile 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 567 | Zeile 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 596 | Zeile 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 633 | Zeile 640 |
---|
}
if($page > $pages)
|
}
if($page > $pages)
|
{ $page = 1; }
| { $page = 1; }
|
if($page) {
| if($page) {
|
Zeile 813 | Zeile 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 821 | Zeile 829 |
---|
{ $indentsize = 0; }
|
{ $indentsize = 0; }
|
|
|
++$indent; if(is_array($tree[$replyto])) {
| ++$indent; if(is_array($tree[$replyto])) {
|
Zeile 829 | Zeile 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 849 | Zeile 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);
|