$fid = $rt['fid']; $openIndex = getstatus($rt['tpcstatus'], 2); #高楼是否开启 forumcheck($fid, 'read'); InitGP(array('page')); $page == 'e' && ($page = 65535); $per = 5; (int) $page < 1 && ($page = 1); if ($openIndex) { $count = $db->get_value("SELECT COUNT(*) FROM pw_postsfloor WHERE tid =" . pwEscape($rt['tid'])) . " LIMIT 1"; } else { $count = $rt['replies']; } $totle = ceil($count / $per); $totle == 0 ? $page = 1 : ($page > $totle ? $page = $totle : ''); $pages = wap_numofpage($page, $totle, "read.php?tid={$tid}&"); $rt['subject'] = str_replace(' ', '', wap_cv($rt['subject'])); if ($page == 1) { $rt['content'] = strip_tags($rt['content']); $rt['content'] = substrs($rt['content'], $db_waplimit); $rt['content'] = wap_cv($rt['content']); $rt['content'] = wap_code($rt['content']); $rt['postdate'] = get_date($rt['postdate']); $rt['author'] = $rt['anonymous'] ? $db_anonymousname : $rt['author']; $rt['author'] = wap_cv($rt['author']); } $satrt = ($page - 1) * $per; $id = $satrt; $limit = pwLimit($satrt, $per); $posts = ''; $pw_posts = GetPtable($rt['ptable']);
<?php require_once 'wap_global.php'; $listdb = array(); if ($fid) { InitGP(array('page')); $per = 10; $fm = $db->get_one("SELECT topic FROM pw_forumdata WHERE fid=" . pwEscape($fid)); $db_maxpage && $page > $db_maxpage && ($page = $db_maxpage); (!is_numeric($page) || $page < 1) && ($page = 1); $totle = ceil($fm['topic'] / $per); $totle == 0 ? $page = 1 : ($page > $totle ? $page = $totle : ''); $next = $page + 1; $pre = $page == 1 ? 1 : $page - 1; $pages = wap_numofpage($page, $totle, "list.php?fid={$fid}&", $db_maxpage); forumcheck($fid, 'list'); $list = ''; $satrt = ($page - 1) * $per; $id = $satrt; $limit = pwLimit($satrt, $per); $query = $db->query("SELECT tid,author,subject,postdate,hits,replies,anonymous FROM pw_threads WHERE fid=" . pwEscape($fid) . " AND topped<3 AND ifcheck=1 ORDER BY topped DESC,lastpost DESC {$limit}"); while ($rt = $db->fetch_array($query)) { $id++; $rt['anonymous'] && ($rt['author'] = $db_anonymousname); $rt['postdate'] = get_date($rt['postdate'], "m-d H:i"); $rt['id'] = $id; $rt['subject'] = substrs(str_replace(' ', '', $rt['subject']), 30, 'N'); $listdb[] = $rt; } $forumname = wap_cv(strip_tags($forum[$fid]['name'])); }