心靈捕手 寫:hodielee 寫:Mac 寫:資料庫應該沒問題,因為你提高文章數不也都顯示出來了嗎?
~Mac
最底下永遠只顯示第一頁共0頁
有一區發表超過50篇文章數\r
我在組態裡設每頁顯示主題數都只顯示出一頁第2頁跑不出來
假設我設每頁顯示55篇主題文章就又全跑出來了
就是第2頁跑不出來
頭很大
依照您的描述, 我猜想:
很可能是這個變數(
$topics_count )的值出了問題.
建議您: 比對一下 phpbb 2.0.13
在 viewforum.php 中出現 $topics_count 的地方, 是否有異狀?
如果方便的話, 那麼也請貼出包含 $topics_count 的上下行程式碼.
因為我還沒升級到2.0.13現在有這問題還不感升級
我是用舊檔案比對的沒發現錯誤
以下是附近代碼藍色是我收尋到的紅色則是附近的MOD
//
// Generate a 'Show topics in previous x days' select box. If the topicsdays var is sent
// then get it's value, find the number of topics with dates newer than it (to properly
// handle pagination) and alter the main query
//
$previous_days = array(0, 1, 7, 14, 30, 90, 180, 364);
$previous_days_text = array($lang['All_Topics'], $lang['1_Day'], $lang['7_Days'], $lang['2_Weeks'], $lang['1_Month'], $lang['3_Months'], $lang['6_Months'], $lang['1_Year']);
if ( !empty($HTTP_POST_VARS['topicdays']) || !empty($HTTP_GET_VARS['topicdays']) )
{
$topic_days = ( !empty($HTTP_POST_VARS['topicdays']) ) ? intval($HTTP_POST_VARS['topicdays']) : intval($HTTP_GET_VARS['topicdays']);
$min_topic_time = time() - ($topic_days * 86400);
$sql = "SELECT COUNT(t.topic_id) AS forum_topics
FROM " . TOPICS_TABLE . " t, " . POSTS_TABLE . " p
WHERE t.forum_id = $forum_id
AND p.post_id = t.topic_last_post_id
AND p.post_time >= $min_topic_time";
if ( !($result = $db->sql_query($sql)) )
{
message_die(GENERAL_ERROR, 'Could not obtain limited topics count information', '', __LINE__, __FILE__, $sql);
}
$row = $db->sql_fetchrow($result);
$topics_count = ( $row['forum_topics'] ) ? $row['forum_topics'] : 1; $limit_topics_time = "AND p.post_time >= $min_topic_time";
if ( !empty($HTTP_POST_VARS['topicdays']) )
{
$start = 0;
}
}
else
{
$topics_count = ( $forum_row['forum_topics'] ) ? $forum_row['forum_topics'] : 1;
$limit_topics_time = '';
$topic_days = 0;
}
$select_topic_days = '<select name="topicdays">';
for($i = 0; $i < count($previous_days); $i++)
{
$selected = ($topic_days == $previous_days[$i]) ? ' selected="selected"' : '';
$select_topic_days .= '<option value="' . $previous_days[$i] . '"' . $selected . '>' . $previous_days_text[$i] . '</option>';
}
$select_topic_days .= '</select>';
//
// All GLOBAL announcement data, this keeps GLOBAL announcements
// on each viewforum page ...
//
$sql = "SELECT t.*, u.username, u.user_id, u2.username as user2, u2.user_id as id2, p.post_time, p.post_username
FROM " . TOPICS_TABLE . " t, " . USERS_TABLE . " u, " . POSTS_TABLE . " p, " . USERS_TABLE . " u2
WHERE t.topic_poster = u.user_id
AND p.post_id = t.topic_last_post_id
'U_VIEW_TOPIC' => $view_topic_url)
);
}
//-- mod : split topic type ------------------------------------------------------------------------
//-- add
$template->assign_block_vars('row', array());
$template->assign_block_vars('row.footer', array());
$template->assign_block_vars('row', array());
$template->assign_block_vars('row.footer_table', array());
//-- fin mod : split topic type --------------------------------------------------------------------
$topics_count -= $total_announcements;
$template->assign_vars(array(
'PAGINATION' => generate_pagination("viewforum.$phpEx?" . POST_FORUM_URL . "=$forum_id&topicdays=$topic_days", $topics_count, $board_config['topics_per_page'], $start),
'PAGE_NUMBER' => sprintf($lang['Page_of'], ( floor( $start / $board_config['topics_per_page'] ) + 1 ), ceil( $topics_count / $board_config['topics_per_page'] )),
'L_GOTO_PAGE' => $lang['Goto_page'])
);
}
else
{
//
// No topics
//
$no_topics_msg = ( $forum_row['forum_status'] == FORUM_LOCKED ) ? $lang['Forum_locked'] : $lang['No_topics_post_one'];
//-- mod : split topic type ------------------------------------------------------------------------