Zeile 23 | Zeile 23 |
---|
$plugins->run_hooks("printthread_start");
|
$plugins->run_hooks("printthread_start");
|
$thread = get_thread($mybb->get_input('tid', 1));
| $thread = get_thread($mybb->get_input('tid', MyBB::INPUT_INT));
|
if(!$thread) { error($lang->error_invalidthread); }
|
if(!$thread) { error($lang->error_invalidthread); }
|
| $plugins->run_hooks("printthread_start");
|
$thread['threadprefix'] = $thread['displaystyle'] = ''; if($thread['prefix'])
| $thread['threadprefix'] = $thread['displaystyle'] = ''; if($thread['prefix'])
|
Zeile 39 | Zeile 41 |
---|
$thread['threadprefix'] = $threadprefix['prefix']; $thread['displaystyle'] = $threadprefix['displaystyle']; }
|
$thread['threadprefix'] = $threadprefix['prefix']; $thread['displaystyle'] = $threadprefix['displaystyle']; }
|
}
$thread['subject'] = htmlspecialchars_uni($parser->parse_badwords($thread['subject']));
| }
$thread['subject'] = htmlspecialchars_uni($parser->parse_badwords($thread['subject']));
|
$fid = $thread['fid']; $tid = $thread['tid'];
// Is the currently logged in user a moderator of this forum?
|
$fid = $thread['fid']; $tid = $thread['tid'];
// Is the currently logged in user a moderator of this forum?
|
if(is_moderator($fid)) { $ismod = true; } else { $ismod = false; }
| $ismod = is_moderator($fid);
|
// Make sure we are looking at a real thread here. if(($thread['visible'] != 1 && $ismod == false) || ($thread['visible'] > 1 && $ismod == true))
| // Make sure we are looking at a real thread here. if(($thread['visible'] != 1 && $ismod == false) || ($thread['visible'] > 1 && $ismod == true))
|
Zeile 81 | Zeile 76 |
---|
$forumpermissions = forum_permissions($forum['fid']);
if($forum['type'] != "f")
|
$forumpermissions = forum_permissions($forum['fid']);
if($forum['type'] != "f")
|
{
| {
|
error($lang->error_invalidforum);
|
error($lang->error_invalidforum);
|
}
| }
|
if($forumpermissions['canview'] == 0 || $forumpermissions['canviewthreads'] == 0 || (isset($forumpermissions['canonlyviewownthreads']) && $forumpermissions['canonlyviewownthreads'] != 0 && $thread['uid'] != $mybb->user['uid'])) { error_no_permission();
| if($forumpermissions['canview'] == 0 || $forumpermissions['canviewthreads'] == 0 || (isset($forumpermissions['canonlyviewownthreads']) && $forumpermissions['canonlyviewownthreads'] != 0 && $thread['uid'] != $mybb->user['uid'])) { error_no_permission();
|
Zeile 92 | Zeile 87 |
---|
// Check if this forum is password protected and we have a valid password check_forum_password($forum['fid']);
|
// Check if this forum is password protected and we have a valid password check_forum_password($forum['fid']);
|
$page = $mybb->get_input('page', 1);
| $page = $mybb->get_input('page', MyBB::INPUT_INT);
|
// Paginate this thread if(!$mybb->settings['postsperpage'] || (int)$mybb->settings['postsperpage'] < 1) {
| // Paginate this thread if(!$mybb->settings['postsperpage'] || (int)$mybb->settings['postsperpage'] < 1) {
|
Zeile 104 | Zeile 99 |
---|
$pages = ceil($postcount/$perpage);
if($page > $pages)
|
$pages = ceil($postcount/$perpage);
if($page > $pages)
|
{ $page = 1; }
| { $page = 1; }
|
if($page > 0)
|
if($page > 0)
|
{
| {
|
$start = ($page-1) * $perpage;
|
$start = ($page-1) * $perpage;
|
} else
| } else
|
{ $start = 0; $page = 1;
|
{ $start = 0; $page = 1;
|
}
| }
|
if($postcount > $perpage)
|
if($postcount > $perpage)
|
{
| {
|
$multipage = printthread_multipage($postcount, $perpage, $page, "printthread.php?tid={$tid}"); } else { $multipage = '';
|
$multipage = printthread_multipage($postcount, $perpage, $page, "printthread.php?tid={$tid}"); } else { $multipage = '';
|
}
$thread['threadlink'] = get_thread_link($tid);
| }
$thread['threadlink'] = get_thread_link($tid);
|
$postrows = ''; if(is_moderator($forum['fid'], "canviewunapprove")) {
|
$postrows = ''; if(is_moderator($forum['fid'], "canviewunapprove")) {
|
$visible = "AND (p.visible='0' OR p.visible='1')";
| $visible = "AND (p.visible='0' OR p.visible='1')";
|
} else {
|
} else {
|
$visible = "AND p.visible='1'";
| $visible = "AND p.visible='1'";
|
} $query = $db->query("
|
} $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
| 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
|
LIMIT {$start}, {$perpage} "); while($postrow = $db->fetch_array($query))
| LIMIT {$start}, {$perpage} "); while($postrow = $db->fetch_array($query))
|
Zeile 177 | Zeile 172 |
---|
if($mybb->user['showvideos'] != 1 && $mybb->user['uid'] != 0 || $mybb->settings['guestvideos'] != 1 && $mybb->user['uid'] == 0) { $parser_options['allow_videocode'] = 0;
|
if($mybb->user['showvideos'] != 1 && $mybb->user['uid'] != 0 || $mybb->settings['guestvideos'] != 1 && $mybb->user['uid'] == 0) { $parser_options['allow_videocode'] = 0;
|
}
| }
|
$postrow['message'] = $parser->parse_message($postrow['message'], $parser_options); $plugins->run_hooks("printthread_post"); eval("\$postrows .= \"".$templates->get("printthread_post")."\";"); }
$plugins->run_hooks("printthread_end");
|
$postrow['message'] = $parser->parse_message($postrow['message'], $parser_options); $plugins->run_hooks("printthread_post"); eval("\$postrows .= \"".$templates->get("printthread_post")."\";"); }
$plugins->run_hooks("printthread_end");
|
|
|
eval("\$printable = \"".$templates->get("printthread")."\";"); output_page($printable);
|
eval("\$printable = \"".$templates->get("printthread")."\";"); output_page($printable);
|
function makeprintablenav($pid="0", $depth="--")
| /** * @param int $pid * @param string $depth * * @return string */ function makeprintablenav($pid=0, $depth="--")
|
{ global $mybb, $db, $pforumcache, $fid, $forum, $lang; if(!is_array($pforumcache))
| { global $mybb, $db, $pforumcache, $fid, $forum, $lang; if(!is_array($pforumcache))
|
Zeile 221 | Zeile 222 |
---|
/** * Output multipage navigation. *
|
/** * Output multipage navigation. *
|
* @param int The total number of items. * @param int The items per page. * @param int The current page. * @param string The URL base.
| * @param int $count The total number of items. * @param int $perpage The items per page. * @param int $current_page The current page. * @param string $url The URL base. * * @return string
|
*/ function printthread_multipage($count, $perpage, $current_page, $url) {
| */ function printthread_multipage($count, $perpage, $current_page, $url) {
|