YENİ WEB SAYFAMIZA 5.SANİYE İÇİNDE AKTARILACAKSINIZ

LÜTFEN BEKLEYİNİZ...

YENİ ADRESİMİZ

www.devrekfatih.net

) { foreach ($deletedparents AS $dpostid => $dparentid) { if (is_array($ipostarray[$dpostid])) { foreach ($ipostarray[$dpostid] AS $temppostid) { $postparent[$temppostid] = $dparentid; $ipostarray[$dparentid][] = $temppostid; $postarray[$temppostid]['parentid'] = $dparentid; } unset($ipostarray[$dpostid]); } if ($curpostparent == $dpostid) { $curpostparent = $dparentid; } } } unset($post, $listposts, $deletedparents); if ($thread['attach']) { $postattach = array(); $attachments = $db->query_read(" SELECT dateline, thumbnail_dateline,filename, filesize, visible, attachmentid, counter, postid, IF(thumbnail_filesize > 0, 1, 0) AS hasthumbnail, thumbnail_filesize, attachmenttype.thumbnail AS build_thumbnail, attachmenttype.newwindow FROM " . TABLE_PREFIX . "attachment LEFT JOIN " . TABLE_PREFIX . "attachmenttype AS attachmenttype USING (extension) WHERE postid IN (-1$ids) "); while ($attachment = $db->fetch_array($attachments)) { if (!$attachment['build_thumbnail']) { $attachment['hasthumbnail'] = false; } $postattach["$attachment[postid]"]["$attachment[attachmentid]"] = $attachment; } } // get list of usernames from post list $userjs = ''; foreach ($userarray AS $userid => $username) { if ($userid) { $userjs .= "pu[$userid] = \"$username\";\n"; } } unset($userarray, $userid, $username); $parent_postids = fetch_post_parentlist($curpostid); if (!$parent_postids) { $currentdepth = 0; } else { $currentdepth = sizeof(explode(',', $parent_postids)); } sort_threaded_posts(); if (empty($curpostid)) { eval(standard_error(fetch_error('invalidid', $vbphrase['post'], $vbulletin->options['contactuslink']))); } if ($threadedmode == 2) // hybrid display mode { $numhybrids = sizeof($hybridposts); if ($vbulletin->GPC['pagenumber'] < 1) { $vbulletin->GPC['pagenumber'] = 1; } $startat = ($vbulletin->GPC['pagenumber'] - 1) * $perpage; if ($startat > $numhybrids) { $vbulletin->GPC['pagenumber'] = 1; $startat = 0; } $endat = $startat + $perpage; for ($i = $startat; $i < $endat; $i++) { if (isset($hybridposts["$i"])) { if (!isset($FIRSTPOSTID)) { $FIRSTPOSTID = $hybridposts["$i"]; } $cache_postids .= ",$hybridposts[$i]"; $LASTPOSTID = $hybridposts["$i"]; } } $pagenav = construct_page_nav($vbulletin->GPC['pagenumber'], $perpage, $numhybrids, 'showthread.php?' . $vbulletin->session->vars['sessionurl'] . 'p=' . $vbulletin->GPC['postid'], "" . (!empty($vbulletin->GPC['perpage']) ? "&pp=$perpage" : "") . "$highlightwords" ); } else // threaded display mode { $FIRSTPOSTID = $curpostid; $LASTPOSTID = $curpostid; // sort out which posts to cache: if (!$vbulletin->options['threaded_maxcache']) { $vbulletin->options['threaded_maxcache'] = 999999; } // cache $vbulletin->options['threaded_maxcache'] posts // take 0.25 from above $curpostid // and take 0.75 below if (sizeof($postorder) <= $vbulletin->options['threaded_maxcache']) // cache all, thread is too small! { $startat = 0; } else { if (($curpostidkey + ($vbulletin->options['threaded_maxcache'] * 0.75)) > sizeof($postorder)) { $startat = sizeof($postorder) - $vbulletin->options['threaded_maxcache']; } else if (($curpostidkey - ($vbulletin->options['threaded_maxcache'] * 0.25)) < 0) { $startat = 0; } else { $startat = intval($curpostidkey - ($vbulletin->options['threaded_maxcache'] * 0.25)); } } unset($curpostidkey); foreach ($postorder AS $postkey => $postid) { if ($postkey > ($startat + $vbulletin->options['threaded_maxcache'])) // got enough entries now { break; } if ($postkey >= $startat AND empty($morereplies["$postid"])) { $cache_postids .= ',' . $postid; } } // get next/previous posts for each post in the list // key: NAVJS[postid][0] = prev post, [1] = next post $NAVJS = array(); $prevpostid = 0; foreach ($postorder AS $postid) { $NAVJS["$postid"][0] = $prevpostid; $NAVJS["$prevpostid"][1] = $postid; $prevpostid = $postid; } $NAVJS["$toppostid"][0] = $postid; //prev button for first post $NAVJS["$postid"][1] = $toppostid; //next button for last post $navjs = ''; foreach ($NAVJS AS $postid => $info) { $navjs .= "pn[$postid] = \"$info[0],$info[1]\";\n"; } } unset($ipostarray, $postparent, $postorder, $NAVJS, $postid, $info, $prevpostid, $postkey); $cache_postids = substr($cache_postids, 1); if (empty($cache_postids)) { // umm... something weird happened. Just prevent an error. eval(standard_error(fetch_error('invalidid', $vbphrase['post'], $vbulletin->options['contactuslink']))); } $hook_query_fields = $hook_query_joins = $hook_query_where = ''; ($hook = vBulletinHook::fetch_hook('showthread_query')) ? eval($hook) : false; $cacheposts = $db->query_read(" SELECT post.*, post.username AS postusername, post.ipaddress AS ip, IF(post.visible = 2, 1, 0) AS isdeleted, user.*, userfield.*, usertextfield.*, " . iif($forum['allowicons'], 'icon.title as icontitle, icon.iconpath,') . " " . iif($vbulletin->options['avatarenabled'], 'avatar.avatarpath, NOT ISNULL(customavatar.userid) AS hascustomavatar, customavatar.dateline AS avatardateline,') . " " . ((can_moderate($thread['forumid'], 'canmoderateposts') OR can_moderate($thread['forumid'], 'candeleteposts')) ? 'spamlog.postid AS spamlog_postid,' : '') . " " . iif($deljoin, "deletionlog.userid AS del_userid, deletionlog.username AS del_username, deletionlog.reason AS del_reason,") . " editlog.userid AS edit_userid, editlog.username AS edit_username, editlog.dateline AS edit_dateline, editlog.reason AS edit_reason, editlog.hashistory, postparsed.pagetext_html, postparsed.hasimages, sigparsed.signatureparsed, sigparsed.hasimages AS sighasimages, sigpic.userid AS sigpic, sigpic.dateline AS sigpicdateline, sigpic.width AS sigpicwidth, sigpic.height AS sigpicheight, IF(displaygroupid=0, user.usergroupid, displaygroupid) AS displaygroupid, infractiongroupid " . iif(!($permissions['genericpermissions'] & $vbulletin->bf_ugp_genericpermissions['canseehiddencustomfields']), $vbulletin->profilefield['hidden']) . " $hook_query_fields FROM " . TABLE_PREFIX . "post AS post LEFT JOIN " . TABLE_PREFIX . "user AS user ON(user.userid = post.userid) LEFT JOIN " . TABLE_PREFIX . "userfield AS userfield ON(userfield.userid = user.userid) LEFT JOIN " . TABLE_PREFIX . "usertextfield AS usertextfield ON(usertextfield.userid = user.userid) " . iif($forum['allowicons'], "LEFT JOIN " . TABLE_PREFIX . "icon AS icon ON(icon.iconid = post.iconid)") . " " . iif($vbulletin->options['avatarenabled'], "LEFT JOIN " . TABLE_PREFIX . "avatar AS avatar ON(avatar.avatarid = user.avatarid) LEFT JOIN " . TABLE_PREFIX . "customavatar AS customavatar ON(customavatar.userid = user.userid)") . " " . ((can_moderate($thread['forumid'], 'canmoderateposts') OR can_moderate($thread['forumid'], 'candeleteposts')) ? "LEFT JOIN " . TABLE_PREFIX . "spamlog AS spamlog ON(spamlog.postid = post.postid)" : '') . " $deljoin LEFT JOIN " . TABLE_PREFIX . "editlog AS editlog ON(editlog.postid = post.postid) LEFT JOIN " . TABLE_PREFIX . "postparsed AS postparsed ON(postparsed.postid = post.postid AND postparsed.styleid = " . intval(STYLEID) . " AND postparsed.languageid = " . intval(LANGUAGEID) . ") LEFT JOIN " . TABLE_PREFIX . "sigparsed AS sigparsed ON(sigparsed.userid = user.userid AND sigparsed.styleid = " . intval(STYLEID) . " AND sigparsed.languageid = " . intval(LANGUAGEID) . ") LEFT JOIN " . TABLE_PREFIX . "sigpic AS sigpic ON(sigpic.userid = post.userid) $hook_query_joins WHERE post.postid IN (" . $cache_postids . ") $hook_query_where "); // re-initialise the $postarray variable $postarray = array(); while ($post = $db->fetch_array($cacheposts)) { $postarray["$post[postid]"] = $post; } if (!($forumperms & $vbulletin->bf_ugp_forumpermissions['cangetattachment'])) { $vbulletin->options['viewattachedimages'] = 0; $vbulletin->options['attachthumbs'] = 0; } // init $postcount = 0; $postbits = ''; $saveparsed = ''; $jspostbits = ''; $postbit_factory =& new vB_Postbit_Factory(); $postbit_factory->registry =& $vbulletin; $postbit_factory->forum =& $foruminfo; $postbit_factory->thread =& $thread; $postbit_factory->cache = array(); $postbit_factory->bbcode_parser =& new vB_BbCodeParser($vbulletin, fetch_tag_list()); foreach (explode(',', $cache_postids) AS $id) { // get the post from the post array if (!isset($postarray["$id"])) { continue; } $post = $postarray["$id"]; if ($tachyuser = in_coventry($post['userid']) AND !can_moderate($thread['forumid'])) { continue; } if ($tachyuser) { $fetchtype = 'post_global_ignore'; } else if ($ignore["$post[userid]"]) { $fetchtype = 'post_ignore'; } else if ($post['visible'] == 2) #OR ($thread['visible'] == 2 AND $postcount == 0)) { $fetchtype = 'post_deleted'; } else { $fetchtype = 'post'; } ($hook = vBulletinHook::fetch_hook('showthread_postbit_create')) ? eval($hook) : false; $postbit_obj =& $postbit_factory->fetch_postbit($fetchtype); if ($fetchtype == 'post') { $postbit_obj->highlight =& $replacewords; } $postbit_obj->cachable = $post_cachable; $post['postcount'] = ++$postcount; $post['attachments'] =& $postattach["$post[postid]"]; $parsed_postcache = array('text' => '', 'images' => 1); $bgclass = 'alt2'; if ($threadedmode == 2) // hybrid display mode { $postbits .= $postbit_obj->construct_postbit($post); } else // threaded display mode { $postbit = $postbit_obj->construct_postbit($post); if ($curpostid == $post['postid']) { $curpostdateline = $post['dateline']; $curpostbit = $postbit; } $postbit = preg_replace('##i', "<\\/scr' + 'ipt>", addslashes_js($postbit)); $jspostbits .= "pd[$post[postid]] = '$postbit';\n"; } // end threaded mode if ($post_cachable AND $post['pagetext_html'] == '') { if (!empty($saveparsed)) { $saveparsed .= ','; } $saveparsed .= "($post[postid], " . intval($thread['lastpost']) . ', ' . intval($postbit_obj->post_cache['has_images']) . ", '" . $db->escape_string($postbit_obj->post_cache['text']) . "'," . intval(STYLEID) . ", " . intval(LANGUAGEID) . ")"; } if (!empty($postbit_obj->sig_cache) AND $post['userid']) { if (!empty($save_parsed_sigs)) { $save_parsed_sigs .= ','; } $save_parsed_sigs .= "($post[userid], " . intval(STYLEID) . ", " . intval(LANGUAGEID) . ", '" . $db->escape_string($postbit_obj->sig_cache['text']) . "', " . intval($postbit_obj->sig_cache['has_images']) . ")"; } if ($post['dateline'] > $displayed_dateline) { $displayed_dateline = $post['dateline']; if ($displayed_dateline <= $threadview) { $updatethreadcookie = true; } } } // end while ($post) $db->free_result($cacheposts); if ($threadedmode == 1) { $postbits = $curpostbit; } if (!preg_match('#[^0-9]#', $stylevar['outertablewidth'])) { $postlistwidth = $stylevar['outertablewidth'] - 2 * ($stylevar['spacersize'] + $stylevar['cellpadding'] + $stylevar['cellspacing'] + 3); $postlistwidth .= 'px'; } else { $postlistwidth = $stylevar['outertablewidth']; } if ($postlistwidth) { if (is_browser('ie')) { $show['postlistwidth'] = true; } else if (!preg_match('#[^0-9]#', $stylevar['outertablewidth'])) { $show['postlistwidth'] = true; } } eval('$threadlist = "' . fetch_template('showthread_list') . '";'); unset($curpostbit, $post, $cacheposts, $parsed_postcache, $postbit); } ################################################################################ ########################## END LINEAR / THREADED ############################### ################################################################################ $effective_lastpost = max($displayed_dateline, $thread['lastpost']); // ********************************************************************************* //set thread last view if ($thread['pollid'] AND $vbulletin->options['updatelastpost'] AND ($displayed_dateline == $thread['lastpost'] OR $threadview == $thread['lastpost']) AND $pollinfo['lastvote'] > $thread['lastpost']) { $displayed_dateline = $pollinfo['lastvote']; } if ((!$vbulletin->GPC['posted'] OR $updatethreadcookie) AND $displayed_dateline AND $displayed_dateline > $threadview) { mark_thread_read($threadinfo, $foruminfo, $vbulletin->userinfo['userid'], $displayed_dateline); } if ($db->explain) { $pageendtime = microtime(); $starttime = explode(' ', $pagestarttime); $endtime = explode(' ', $pageendtime); $aftertime = $endtime[0] - $starttime[0] + $endtime[1] - $starttime[1]; echo "Time after parsing all posts: $aftertime\n"; if (function_exists('memory_get_usage')) { echo "Memory After: " . number_format((memory_get_usage() / 1024)) . 'KB' . " \n"; } echo "\n
\n\n"; } // ********************************************************************************* // save parsed post HTML if (!empty($saveparsed)) { $db->shutdown_query(" REPLACE INTO " . TABLE_PREFIX . "postparsed (postid, dateline, hasimages, pagetext_html, styleid, languageid) VALUES $saveparsed "); unset($saveparsed); } if (!empty($save_parsed_sigs)) { $db->shutdown_query(" REPLACE INTO " . TABLE_PREFIX . "sigparsed (userid, styleid, languageid, signatureparsed, hasimages) VALUES $save_parsed_sigs "); unset($save_parsed_sigs); } // ********************************************************************************* // prepare tags $show['tag_box'] = false; if ($vbulletin->options['threadtagging']) { $tag_list = fetch_tagbits($thread); if (!$foruminfo['allowposting']) { // forum closed - tags can't be added, so only show edit if have tags $show['manage_tag'] = ($thread['taglist'] AND can_moderate($thread['forumid'], 'caneditthreads')); } else if (!$thread['open'] AND !can_moderate($thread['forumid'], 'canopenclose')) { // thread is closed and can't be opened by this person; $show['manage_tag'] = can_moderate($thread['forumid'], 'caneditthreads'); } else { $show['manage_tag'] = ( (($forumperms & $vbulletin->bf_ugp_forumpermissions['cantagown']) AND $thread['postuserid'] == $vbulletin->userinfo['userid']) OR ($forumperms & $vbulletin->bf_ugp_forumpermissions['cantagothers']) OR (($forumperms & $vbulletin->bf_ugp_forumpermissions['candeletetagown']) AND $thread['postuserid'] == $vbulletin->userinfo['userid']) OR can_moderate($thread['forumid'], 'caneditthreads') ); } $show['tag_box'] = ($show['manage_tag'] OR $thread['taglist']); } // ********************************************************************************* // Get users browsing this thread if (($vbulletin->options['showthreadusers'] == 1 OR $vbulletin->options['showthreadusers'] == 2 OR ($vbulletin->options['showthreadusers'] > 2 AND $vbulletin->userinfo['userid'])) AND !$show['search_engine']) { $datecut = TIMENOW - $vbulletin->options['cookietimeout']; $browsers = ''; $show['activeusers'] = iif(!$show['search_engine'], true, false); // Don't put the inthread value in the WHERE clause as it might not be the newest location! $threadusers = $db->query_read_slave(" SELECT user.username, user.usergroupid, user.membergroupids, session.userid, session.inthread, session.lastactivity, IF(user.displaygroupid = 0, user.usergroupid, user.displaygroupid) AS displaygroupid, infractiongroupid, IF(user.options & " . $vbulletin->bf_misc_useroptions['invisible'] . ", 1, 0) AS invisible FROM " . TABLE_PREFIX . "session AS session LEFT JOIN " . TABLE_PREFIX . "user AS user ON(user.userid = session.userid) WHERE session.lastactivity > $datecut ORDER BY " . iif($vbulletin->options['showthreadusers'] == 1 OR $vbulletin->options['showthreadusers'] == 3, " username ASC,") . " lastactivity DESC "); $numberguest = 0; $numberregistered = 0; $doneuser = array(); if ($vbulletin->userinfo['userid']) // fakes the user being in this thread { $loggedin = array( 'userid' => $vbulletin->userinfo['userid'], 'username' => $vbulletin->userinfo['username'], 'invisible' => $vbulletin->userinfo['invisible'], 'invisiblemark' => $vbulletin->userinfo['invisiblemark'], 'inthread' => $threadinfo['threadid'], 'lastactivity' => TIMENOW, 'musername' => $vbulletin->userinfo['musername'], ); $numberregistered = 1; $numbervisible = 1; fetch_online_status($loggedin); $show['comma_leader'] = false; eval('$activeusers = "' . fetch_template('forumdisplay_loggedinuser') . '";'); $doneuser["{$vbulletin->userinfo['userid']}"] = 1; } // this requires the query to have lastactivity ordered by DESC so that the latest location will be the first encountered. while ($loggedin = $db->fetch_array($threadusers)) { if (empty($doneuser["$loggedin[userid]"])) { if ($loggedin['inthread'] == $threadinfo['threadid']) { if ($loggedin['userid'] == 0) // Guest { $numberguest++; } else { fetch_musername($loggedin); $numberregistered++; ($hook = vBulletinHook::fetch_hook('showthread_loggedinuser')) ? eval($hook) : false; if (fetch_online_status($loggedin)) { $show['comma_leader'] = ($activeusers != ''); eval('$activeusers .= "' . fetch_template('forumdisplay_loggedinuser') . '";'); } } } if ($loggedin['userid']) { $doneuser["$loggedin[userid]"] = 1; } } } if (!$vbulletin->userinfo['userid']) { $numberguest = ($numberguest == 0) ? 1 : $numberguest; if ($numberregistered == 0) { $activeusers = ' '; } } $totalonline = $numberregistered + $numberguest; $db->free_result($threadusers); unset($userinfos, $userid, $userinfo, $loggedin, $threadusers, $datecut); } // ********************************************************************************* // get similar threads if ($vbulletin->options['showsimilarthreads'] AND $thread['similar']) { // don't show similar threads from coventry if ($coventry = fetch_coventry('string')) { $globalignore = "AND thread.postuserid NOT IN ($coventry)"; } else { $globalignore = ''; } $hook_query_fields = $hook_query_joins = $hook_query_where = ''; ($hook = vBulletinHook::fetch_hook('showthread_similarthread_query')) ? eval($hook) : false; if ($vbulletin->userinfo['userid'] AND in_coventry($vbulletin->userinfo['userid'], true)) { $tachyselect = " IF(tachythreadpost.userid IS NULL, thread.lastpost, tachythreadpost.lastpost) AS lastpost, IF(tachythreadcounter.userid IS NULL, thread.replycount, thread.replycount + tachythreadcounter.replycount) AS replycount "; $tachyjoin = " LEFT JOIN " . TABLE_PREFIX . "tachythreadpost AS tachythreadpost ON (tachythreadpost.threadid = thread.threadid AND tachythreadpost.userid = " . $vbulletin->userinfo['userid'] . ") LEFT JOIN " . TABLE_PREFIX . "tachythreadcounter AS tachythreadcounter ON (tachythreadcounter.threadid = thread.threadid AND tachythreadcounter.userid = " . $vbulletin->userinfo['userid'] . ") "; } else { $tachyselect = "thread.lastpost, thread.replycount"; $tachyjoin = ""; } $simthrds = $db->query_read_slave(" SELECT thread.threadid, thread.forumid, thread.title, thread.prefixid, thread.taglist, postusername, postuserid, $tachyselect, forum.title AS forumtitle " . iif($vbulletin->options['threadpreview'], ",post.pagetext AS preview") . " " . iif($vbulletin->options['threadsubscribed'] AND $vbulletin->userinfo['userid'], ", NOT ISNULL(subscribethread.subscribethreadid) AS issubscribed") . " $hook_query_fields FROM " . TABLE_PREFIX . "thread AS thread INNER JOIN " . TABLE_PREFIX . "forum AS forum ON (forum.forumid = thread.forumid) " . iif($vbulletin->options['threadpreview'], "LEFT JOIN " . TABLE_PREFIX . "post AS post ON (post.postid = thread.firstpostid)") . " " . iif($vbulletin->options['threadsubscribed'] AND $vbulletin->userinfo['userid'], " LEFT JOIN " . TABLE_PREFIX . "subscribethread AS subscribethread ON (subscribethread.threadid = thread.threadid AND subscribethread.userid = " . $vbulletin->userinfo['userid'] . " AND canview = 1)") . " $hook_query_joins $tachyjoin WHERE thread.threadid IN ($thread[similar]) AND thread.visible = 1 " . iif (($permissions['adminpermissions'] & $vbulletin->bf_ugp_adminpermissions['cancontrolpanel']) OR ($permissions['adminpermissions'] & $vbulletin->bf_ugp_adminpermissions['ismoderator']) OR can_moderate($forumid), '', "AND forum.password = ''") . " $globalignore $hook_query_where ORDER BY lastpost DESC "); $similarthreadbits = ''; $forum_active_cache = array(); while ($simthread = $db->fetch_array($simthrds)) { if (!isset($forum_active_cache["$simthread[forumid]"])) { $current_forum = $vbulletin->forumcache["$simthread[forumid]"]; while (!empty($current_forum)) { if (!($current_forum['options'] & $vbulletin->bf_misc_forumoptions['active'])) { // all children of this forum should be hidden now $forum_children = explode(',', trim($current_forum['childlist'])); foreach ($forum_children AS $forumid) { if ($forumid == '-1') { continue; } $forum_active_cache["$forumid"] = false; } break; } $forum_active_cache["$current_forum[forumid]"] = true; $current_forum = $vbulletin->forumcache["$current_forum[parentid]"]; } } if (!$forum_active_cache["$simthread[forumid]"]) { continue; } $fperms = fetch_permissions($simthread['forumid']); if (($fperms & $vbulletin->bf_ugp_forumpermissions['canview']) AND (($fperms & $vbulletin->bf_ugp_forumpermissions['canviewothers']) OR ($vbulletin->userinfo['userid'] != 0 AND $simthread['postuserid'] == $vbulletin->userinfo['userid'])) ) { // format thread preview if there is one if ($ignore["$simthread[postuserid]"]) { $simthread['preview'] = ''; } else if (isset($simthread['preview']) AND $vbulletin->options['threadpreview'] > 0) { $simthread['preview'] = strip_quotes($simthread['preview']); $simthread['preview'] = htmlspecialchars_uni(fetch_trimmed_title(strip_bbcode($simthread['preview'], false, true), $vbulletin->options['threadpreview'])); } $simthread['lastreplydate'] = vbdate($vbulletin->options['dateformat'], $simthread['lastpost'], true); $simthread['lastreplytime'] = vbdate($vbulletin->options['timeformat'], $simthread['lastpost']); if ($simthread['prefixid']) { $simthread['prefix_plain_html'] = htmlspecialchars_uni($vbphrase["prefix_$simthread[prefixid]_title_plain"]); $simthread['prefix_rich'] = $vbphrase["prefix_$simthread[prefixid]_title_rich"]; } else { $simthread['prefix_plain_html'] = ''; $simthread['prefix_rich'] = ''; } $simthread['title'] = fetch_censored_text($simthread['title']); ($hook = vBulletinHook::fetch_hook('showthread_similarthreadbit')) ? eval($hook) : false; eval('$similarthreadbits .= "' . fetch_template('showthread_similarthreadbit') . '";'); } } if ($similarthreadbits) { eval('$similarthreads = "' . fetch_template('showthread_similarthreads') . '";'); } else { $similarthreads = ''; } unset($similarthreadbits); } else { $similarthreads = ''; } // ********************************************************************************* // build quick reply if appropriate if ($show['quickreply']) { require_once(DIR . '/includes/functions_editor.php'); $show['wysiwyg'] = ($forum['allowbbcode'] ? is_wysiwyg_compatible() : 0); $istyles_js = construct_editor_styles_js(); // set show signature hidden field $showsig = iif($vbulletin->userinfo['signature'], 1, 0); // set quick reply initial id if ($threadedmode == 1) { $qrpostid = $curpostid; $show['qr_require_click'] = 0; } else if ($vbulletin->options['quickreply'] == 2) { $qrpostid = 0; $show['qr_require_click'] = 1; } else { $qrpostid = 'who cares'; $show['qr_require_click'] = 0; } $editorid = construct_edit_toolbar('', 0, $foruminfo['forumid'], ($foruminfo['allowsmilies'] ? 1 : 0), 1, false, 'qr'); $messagearea = " $messagearea "; if (is_browser('mozilla') AND $show['wysiwyg'] == 2) { // Mozilla WYSIWYG can't have the QR collapse button, // so remove that and force QR to be expanded $show['quickreply_collapse'] = false; unset( $vbcollapse["collapseobj_quickreply"], $vbcollapse["collapseimg_quickreply"], $vbcollapse["collapsecel_quickreply"] ); } else { $show['quickreply_collapse'] = true; } } else if ($show['ajax_js']) { require_once(DIR . '/includes/functions_editor.php'); $vBeditJs = construct_editor_js_arrays(); // check that $editor_css has been built if (!isset($GLOBALS['editor_css'])) { eval('$GLOBALS[\'editor_css\'] = "' . fetch_template('editor_css') . '";'); $GLOBALS['headinclude'] .= "\n" . $GLOBALS['editor_css']; } eval('$vBeditTemplate[\'clientscript\'] = "' . fetch_template('editor_clientscript') . '";'); } $show['quickedit'] = ($vbulletin->options['quickedit'] AND !$show['threadedmode']); // ############################################################################# // make a displayable version of the thread notes if (!empty($thread['notes'])) { $thread['notes'] = str_replace('. ', ".\\n", $thread['notes']); $shownotes = true; } else { $shownotes = false; } // ############################################################################# // display admin options if appropriate $show['deleteposts'] = can_moderate($threadinfo['forumid'], 'candeleteposts') ? true : false; $show['editthread'] = can_moderate($threadinfo['forumid'], 'caneditthreads') ? true : false; $show['movethread'] = (can_moderate($threadinfo['forumid'], 'canmanagethreads') OR ($forumperms & $vbulletin->bf_ugp_forumpermissions['canmove'] AND $threadinfo['postuserid'] == $vbulletin->userinfo['userid'])) ? true : false; $show['openclose'] = (can_moderate($threadinfo['forumid'], 'canopenclose') OR ($forumperms & $vbulletin->bf_ugp_forumpermissions['canopenclose'] AND $threadinfo['postuserid'] == $vbulletin->userinfo['userid'])) ? true : false; $show['deletethread'] = (($threadinfo['visible'] != 2 AND can_moderate($threadinfo['forumid'], 'candeleteposts')) OR can_moderate($threadinfo['forumid'], 'canremoveposts') OR ($forumperms & $vbulletin->bf_ugp_forumpermissions['candeletepost'] AND $forumperms & $vbulletin->bf_ugp_forumpermissions['candeletethread'] AND $vbulletin->userinfo['userid'] == $threadinfo['postuserid'] AND ($vbulletin->options['edittimelimit'] == 0 OR $threadinfo['dateline'] > (TIMENOW - ($vbulletin->options['edittimelimit'] * 60))))) ? true : false; $show['adminoptions'] = ($show['editpoll'] OR $show['movethread'] OR $show['deleteposts'] OR $show['editthread'] OR $show['managethread'] OR $show['openclose'] OR $show['deletethread']) ? true : false; // ############################################################################# // Setup Add Poll Conditional if (($vbulletin->userinfo['userid'] != $threadinfo['postuserid'] AND !can_moderate($foruminfo['forumid'], 'caneditpoll')) OR !($forumperms & $vbulletin->bf_ugp_forumpermissions['canpostnew']) OR !($forumperms & $vbulletin->bf_ugp_forumpermissions['canpostpoll']) OR $threadinfo['pollid'] OR (!can_moderate($foruminfo['forumid'], 'caneditpoll') AND $vbulletin->options['addpolltimeout'] AND TIMENOW - ($vbulletin->options['addpolltimeout'] * 60) > $threadinfo['dateline'])) { $show['addpoll'] = false; } else { $show['addpoll'] = true; } // ############################################################################# // show forum rules construct_forum_rules($forum, $forumperms); // ############################################################################# // build social bookmarking links $guestuser = array( 'userid' => 0, 'usergroupid' => 0, ); cache_permissions($guestuser); $bookmarksites = ''; if ( $vbulletin->options['socialbookmarks'] AND is_array($vbulletin->bookmarksitecache) AND !empty($vbulletin->bookmarksitecache) AND $guestuser['permissions']['forumpermissions'] & $vbulletin->bf_ugp_forumpermissions['canview'] AND $guestuser['forumpermissions']["$foruminfo[forumid]"] & $vbulletin->bf_ugp_forumpermissions['canview'] AND $guestuser['forumpermissions']["$foruminfo[forumid]"] & $vbulletin->bf_ugp_forumpermissions['canviewthreads'] AND ($guestuser['forumpermissions']["$foruminfo[forumid]"] & $vbulletin->bf_ugp_forumpermissions['canviewothers'] OR $threadinfo['postuserid'] == 0) ) { foreach($vbulletin->bookmarksitecache AS $bookmarksite) { $bookmarksite['link'] = str_replace( array('{URL}', '{TITLE}'), array(urlencode($vbulletin->options['bburl'] . '/showthread.php?t=' . $thread['threadid']), urlencode($thread['title'])), $bookmarksite['url'] ); ($hook = vBulletinHook::fetch_hook('showthread_bookmarkbit')) ? eval($hook) : false; eval('$bookmarksites .= "' . fetch_template('showthread_bookmarksite') . '";'); } } // ############################################################################# // draw navbar $navbits = array(); $parentlist = array_reverse(explode(',', substr($forum['parentlist'], 0, -3))); foreach ($parentlist AS $forumID) { $forumTitle = $vbulletin->forumcache["$forumID"]['title']; $navbits['forumdisplay.php?' . $vbulletin->session->vars['sessionurl'] . "f=$forumID"] = $forumTitle; } $navbits[''] = $thread['prefix_rich'] . ' ' . $thread['title']; $navbits = construct_navbits($navbits); eval('$navbar = "' . fetch_template('navbar') . '";'); // ############################################################################# // setup $show variables $show['lightbox'] = ($vbulletin->options['lightboxenabled'] AND $vbulletin->options['usepopups']); $show['search'] = (!$show['search_engine'] AND $forumperms & $vbulletin->bf_ugp_forumpermissions['cansearch'] AND $vbulletin->options['enablesearches'] AND ($vbulletin->userinfo['userid'] OR !$vbulletin->options['hvcheck_search'] OR !$vbulletin->options['hv_type'])); $show['subscribed'] = iif($threadinfo['issubscribed'], true, false); $show['threadrating'] = iif($forum['allowratings'] AND $forumperms & $vbulletin->bf_ugp_forumpermissions['canthreadrate'], true, false); $show['ratethread'] = iif($show['threadrating'] AND (!$threadinfo['vote'] OR $vbulletin->options['votechange']), true, false); $show['closethread'] = iif($threadinfo['open'], true, false); $show['unstick'] = iif($threadinfo['sticky'], true, false); $show['reputation'] = ($vbulletin->options['reputationenable'] AND $vbulletin->userinfo['userid'] AND $vbulletin->userinfo['permissions']['genericoptions'] & $vbulletin->bf_ugp_genericoptions['isn