} foreach($postrow_cache as $postrow) { $parser_options = array( "allow_html" => $forum['allowhtml'], "allow_mycode" => $forum['allowmycode'], "allow_smilies" => $forum['allowsmilies'], "allow_imgcode" => $forum['allowimgcode'], "allow_videocode" => $forum['allowvideocode'], "me_username" => $postrow['username'], "shorten_urls" => 0, "filter_badwords" => 1 ); if($postrow['smilieoff'] == 1) { $parser_options['allow_smilies'] = 0; } if($mybb->user['uid'] != 0 && $mybb->user['showimages'] != 1 || $mybb->settings['guestimages'] != 1 && $mybb->user['uid'] == 0) { $parser_options['allow_imgcode'] = 0; } if($mybb->user['uid'] != 0 && $mybb->user['showvideos'] != 1 || $mybb->settings['guestvideos'] != 1 && $mybb->user['uid'] == 0) { $parser_options['allow_videocode'] = 0; } if($postrow['userusername']) { $postrow['username'] = $postrow['userusername']; } $postrow['username'] = htmlspecialchars_uni($postrow['username']); $postrow['subject'] = htmlspecialchars_uni($parser->parse_badwords($postrow['subject'])); $postrow['date'] = my_date($mybb->settings['dateformat'], $postrow['dateline'], null, 0); $postrow['profilelink'] = build_profile_link($postrow['username'], $postrow['uid']); $postrow['message'] = $parser->parse_message($postrow['message'], $parser_options); if($mybb->settings['enableattachments'] == 1 && !empty($attachcache[$postrow['pid']]) && $thread['attachmentcount'] > 0 || is_moderator($fid, 'caneditposts')) { get_post_attachments($postrow['pid'], $postrow); } $plugins->run_hooks("printthread_post"); eval("\$postrows .= \"".$templates->get("printthread_post")."\";"); } $plugins->run_hooks("printthread_end"); eval("\$printable = \"".$templates->get("printthread")."\";"); output_page($printable); /** * @param int $pid * @param string $depth * * @return string */ function makeprintablenav($pid=0, $depth="--") { global $mybb, $db, $pforumcache, $fid, $forum, $lang, $templates; if(!is_array($pforumcache)) { $parlist = build_parent_list($fid, "fid", "OR", $forum['parentlist']); $query = $db->simple_select("forums", "name, fid, pid", "$parlist", array('order_by' => 'pid, disporder')); while($forumnav = $db->fetch_array($query)) { $pforumcache[$forumnav['pid']][$forumnav['fid']] = $forumnav; } unset($forumnav); } $forums = ''; if(is_array($pforumcache[$pid])) { foreach($pforumcache[$pid] as $key => $forumnav) { $forumnav['link'] = get_forum_link($forumnav['fid']); eval("\$forums .= \"".$templates->get("printthread_nav")."\";"); if(!empty($pforumcache[$forumnav['fid']])) { $newdepth = $depth."-"; $forums .= makeprintablenav($forumnav['fid'], $newdepth); } } } return $forums; } /** * Output multipage navigation. * * @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) { global $lang, $templates; $multipage = ""; if($count > $perpage) { $pages = $count / $perpage; $pages = ceil($pages); $mppage = null; for($page = 1; $page <= $pages; ++$page) { if($page == $current_page) { eval("\$mppage .= \"".$templates->get("printthread_multipage_page_current")."\";"); } else { eval("\$mppage .= \"".$templates->get("printthread_multipage_page")."\";"); } } eval("\$multipage = \"".$templates->get("printthread_multipage")."\";"); } return $multipage; }