XHnTfǶ<5~3j۠Bl֎Xx{@ɷE1aӕ%AtH 8\cC_YnM6XEo_h)=IQ5^L N5<Јxh;Ll/;mnT矽:N/L [~k<{`~ph ^nF91 &@) D;1[[:NNjGFJ]lx{%hRN\8SFt[.^B-9J$rU Nҡz$B^b8ﺤ'{iY9NcM{o4w*dJS\3F#t6L-2X HÖv.hc˫ }*lIUg->load("printthread"); $plugins->run_hooks("printthread_start"); $query = $db->query(" SELECT t.*, p.prefix AS threadprefix, p.displaystyle FROM ".TABLE_PREFIX."threads t LEFT JOIN ".TABLE_PREFIX."threadprefixes p ON (p.pid=t.prefix) WHERE t.tid='".intval($mybb->input['tid'])."' AND t.closed NOT LIKE 'moved|%' "); $thread = $db->fetch_array($query); $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? if(is_moderator($fid)) { $ismod = true; } else { $ismod = false; } // Make sure we are looking at a real thread here. if(!$tid || ($thread['visible'] == 0 && $ismod == false) || ($thread['visible'] > 1 && $ismod == true)) { error($lang->error_invalidthread); } // Get forum info $forum = get_forum($fid); if(!$forum) { error($lang->error_invalidforum); } $breadcrumb = makeprintablenav(); $parentsexp = explode(",", $forum['parentlist']); $numparents = count($parentsexp); $tdepth = "-"; for($i = 0; $i < $numparents; ++$i) { $tdepth .= "-"; } $forumpermissions = forum_permissions($forum['fid']); if($forum['type'] != "f") { error($lang->error_invalidforum); } if($forumpermissions['canview'] == 0 || $forumpermissions['canviewthreads'] == 0) { error_no_permission(); } // Check if this forum is password protected and we have a valid password check_forum_password($forum['fid']); $page = intval($mybb->input['page']); // Paginate this thread $perpage = $mybb->settings['postsperpage']; $postcount = intval($thread['replies'])+1; $pages = ceil($postcount/$perpage); if($page > $pages) { $page = 1; } if($page > 0) { $start = ($page-1) * $perpage; } else { $start = 0; $page = 1; } if($postcount > $perpage) { $multipage = printthread_multipage($postcount, $perpage, $page, "printthread.php?tid={$tid}"); } $thread['threadlink'] = get_thread_link($tid); $postrows = ''; if(is_moderator($forum['fid'])) { $visible = "AND (p.visible='0' OR p.visible='1')"; } else { $visible = "AND p.visible='1'"; } $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 LIMIT {$start}, {$perpage} "); while($postrow = $db->fetch_array($query)) { if($postrow['userusername']) { $postrow['username'] = $postrow['userusername']; } $postrow['subject'] = htmlspecialchars_uni($parser->parse_badwords($postrow['subject'])); $postrow['date'] = my_date($mybb->settings['dateformat'], $postrow['dateline']); $postrow['time'] = my_date($mybb->settings['timeformat'], $postrow['dateline']); $postrow['profilelink'] = build_profile_link($postrow['username'], $postrow['uid']); $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; } $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); function makeprintablenav($pid="0", $depth="--") { global $db, $pforumcache, $fid, $forum, $lang; 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); } if(is_array($pforumcache[$pid])) { foreach($pforumcache[$pid] as $key => $foru%4 v[$8aaadiؤMS!wHjRޥ .ԧjU7 ͔J dep.1f$Rá9ix1C/*czV,$5cgqFBZd5\#X#D{}|eM@:`F3xg^ȝSj%Ҹ%pܯ_ ! 5bu^R%k*GLOxng'f&>!`]LZVBJ QRƕTРOG*!,~/ca 6 >OPKi^:][}bG5 NQ~.瞄G}(W :c)4碞xR `ܭ| nHЅ_1@A8 qWE-!z!Q(p$O1W7p9b;wEpOxLJ24?sp@}ȗg^!n'gE% {>r9BL)=T^l.cwf 2|Ub`ΞQbx#dO0t RW8 P Rr?:=`Aw0-j?t `Gu+0 Ӛ`6 -f*ѐ6}0L!؊xn)΋5c@11F)K̜>Fm8$9@댶R)7F}B5!f>oN|VvJtؾ&z^71v{t}⍚E֝.9%b-g0SM? 8rΉ%b葇r䘻]Dž@sAˇoq3;ԉ/%j,]O?kRh&)gXwkk+.)}zwrzx~>)