$count = $read['replies'] + 1; } if ($count % $db_readperpage == 0) { $numofpage = $count / $db_readperpage; } else { $numofpage = floor($count / $db_readperpage) + 1; } if ($page > $numofpage) { $page = $numofpage; } Update_ol(); $readdb = array(); if ($page == 1) { $readdb[] = $read; } $pages = PageDiv($count, $page, $numofpage, "{$DIR}t{$tid}"); //更新帖子点击 if ($db_hits_store == 0) { pwQuery::update('pw_threads', 'tid=:tid', array($tid), null, array(PW_EXPR => array('hits=hits+1'))); } elseif ($db_hits_store == 1) { $db->update('UPDATE pw_hits_threads SET hits=hits+1 WHERE tid=' . S::sqlEscape($tid)); } elseif ($db_hits_store == 2) { pwCache::writeover(D_P . 'data/bbscache/hits.txt', $tid . "\t", 'ab'); } if ($read['replies'] > 0) { if ($openIndex) { $start_limit = (int) ($page - 1) * $db_readperpage - 1; $start_limit < 0 && ($start_limit = 0); $end = $start_limit + $db_readperpage; $sql_floor = " AND f.floor > " . $start_limit . " AND f.floor <= " . $end . " "; $query = $db->query("SELECT f.pid FROM pw_postsfloor f WHERE f.tid = " . S::sqlEscape($tid) . " {$sql_floor} ORDER BY f.floor");
bbsSeoSettings('thread', $_seo, $foruminfo['name']); if ($groupid != 3 && !$foruminfo['allowvisit'] && !admincheck($foruminfo['forumadmin'], $foruminfo['fupadmin'], $windid)) { forum_creditcheck(); } if ($groupid != 3 && $foruminfo['forumsell'] && !admincheck($foruminfo['forumadmin'], $foruminfo['fupadmin'], $windid)) { forum_sell($fid); } $db_perpage = 100; $db_maxpage && $page > $db_maxpage && ($page = $db_maxpage); (!is_numeric($page) || $page < 1) && ($page = 1); if ($page > 1) { $start_limit = ($page - 1) * $db_perpage; } else { $start_limit = 0; $page = 1; } $startid = $start_limit + 1; $count = $foruminfo['topic']; $numofpage = ceil($count / $db_perpage); if ($numofpage && $page > $numofpage) { $page = $numofpage; } $pages = PageDiv($count, $page, $numofpage, "{$DIR}f{$fid}", $db_maxpage); $threaddb = array(); $query = $db->query("SELECT * FROM pw_threads WHERE fid=" . S::sqlEscape($fid) . " AND topped<=3 AND ifcheck='1' ORDER BY specialsort DESC, lastpost DESC" . S::sqlLimit($start_limit, $db_perpage)); while ($thread = $db->fetch_array($query)) { $threaddb[] = $thread; } $db->free_result($query); require_once PrintEot('simple_header'); require_once PrintEot('simple_thread');