if ($v['viewinread'] && $v['type'] == 7) { $hasAreas = true; $areaFields[] = $v['fieldname'] ? $v['fieldname'] : 'field_' . (int) $v[id]; } } $hasAreas && ($areaids = $areas = array()); foreach ($readdb as $key => $read) { $read = array_merge((array) $read, (array) $pwMembers[$read['authorid']]); isset($bandb[$read['authorid']]) && ($read['groupid'] = 6); if ($read['istop'] == 'topped') { $readdb[$key] = viewread($read, ''); } else { if ($pageinverse) { $readdb[$key] = viewread($read, $start_limit--); } else { $readdb[$key] = viewread($read, $start_limit++); } } if ($db_mode == 'area') { $db_menuinit .= ",'td_read_" . $read['pid'] . "':'menu_read_" . $read['pid'] . "'"; } //地区字段 if ($hasAreas) { foreach ($areaFields as $v) { $readdb[$key][$v] && ($areaids[] = $readdb[$key][$v]); } } if ($areaids) { $areaService = L::loadClass('AreasService', 'utility'); $areas = $areaService->getFullAreaByAreaIds($areaids); }
} //导航 $msg_guide .= ' -> <a href="' . sprintf(URLREAD, $tid) . '">' . $title . '</a>'; //回帖列表 if ($read['replies'] > 0) { //开始记录, $start_limit = ($page - 1) * READ_PER; //作者编号 $authorids = ''; $SqlStr = 'SELECT * FROM `' . DB_TABLE_PRE . 'view_posts` WHERE `tid`=' . $tid . ' AND ifcheck=1 ORDER BY `postdate` LIMIT ' . $start_limit . ',' . READ_PER; $start_limit++; $MyDatabase->SqlStr = $SqlStr; if ($MyDatabase->Query()) { $DB_Record_Arr = $MyDatabase->ResultArr; foreach ($DB_Record_Arr as $read) { $readdb[] = viewread($read, $start_limit, $groups, $MyDatabase); if ($authorids) { $authorids .= ',' . $read['authorid']; } else { $authorids = $read['authorid']; } $start_limit++; } } else { ErrorMsg($SqlStr . '文件:' . __FILE__ . '<br />行数:' . __LINE__ . '<br />原因:读取帖子数据失败!'); } } /** * 显示单个帖子 * * @param 帖子数组 $read
} if ($pidArr) { $pw_posts = GetPtable($ptable); $query = $db->query("SELECT * FROM {$pw_posts} WHERE tid=" . S::sqlEscape($tid) . " AND ifcheck='1' AND pid IN(" . S::sqlImplode($pidArr) . ')'); while ($read = $db->fetch_array($query)) { $readdb[] = $read; $read['aid'] && ($_pids[$read['pid']] = $read['pid']); } } require_once R_P . 'require/bbscode.php'; if ($_pids) { $attachShow = new attachShow($isGM || $pwSystem['delattach'], $forumset['uploadset'], $forumset['viewpic']); $attachShow->init($tid, $_pids); } foreach ($readdb as $key => $read) { $readdb[$key] = viewread($read); } $GLOBALS += L::style(''); require_once PrintEot('readfloor'); ajax_footer(); function viewread($read) { global $winduid, $isGM, $pwSystem, $_G, $db_windpost, $tpc_buy, $tpc_pid, $tpc_tag, $tpc_author, $tid; $tpc_buy = $read['buy']; $tpc_pid = $read['pid']; $tpc_tag = NULL; $tpc_author = ''; if ($read['anonymous']) { $anonymous = !$isGM && $winduid != $read['authorid'] && !$pwSystem['anonyhide']; } else { $anonymous = false;
//导航 $msg_guide .= ' -> <a href="read.php?id=' . $tid . '">' . $title . '</a>'; //回帖列表 if ($read['replies'] > 0) { //开始记录, $start_limit = ($page - 1) * READ_PER; //作者编号 $authorids = ''; $SqlStr = 'SELECT * FROM `' . DB_TABLE_PRE . 'view_posts` WHERE `tid`=' . $tid . ' AND ifcheck=1 ORDER BY `postdate` LIMIT ' . $start_limit . ',' . READ_PER; $start_limit++; $MyDatabase->SqlStr = $SqlStr; if ($MyDatabase->Query()) { $DB_Record_Arr = $MyDatabase->ResultArr; foreach ($DB_Record_Arr as $read) { // DebugArr($read); $readdb[] = viewread($read, $start_limit); if ($authorids) { $authorids .= ',' . $read['authorid']; } else { $authorids = $read['authorid']; } $start_limit++; } } else { DebugStr($SqlStr); echo '文件:' . __FILE__; echo '<br />行数:' . __LINE__; echo '<br />原因:'; ErrorMsg('读取帖子数据失败!'); } }