[問題] Top 5 是否可以插入頁面數

phpBB 2 MOD Support
無論是官方或非官方認證之外掛,安裝與使用問題討論。
(發表文章請按照公告格式發表,違者砍文)

版主: 版主管理群

主題已鎖定
davidhuang
星球公民
星球公民
文章: 33
註冊時間: 2007-01-31 13:29

[問題] Top 5 是否可以插入頁面數

文章 davidhuang »

我們都知道於 PHP BB 中 經過搜尋功能搜尋出來的文章, 都會於每一文章的下顯示頁面數(如下圖), 想請教各位高手及先進, 如果要將頁面數加到 Top 5 中是否可行, 又該如何做呢?
圖檔

[推薦外掛] Top5
http://phpbb-tw.net/phpbb/viewtopic.php?t=40021

●架設主機作業系統:Linux (Fedoara Core 6)
●您的上網方式:Hinet ADSL 12M/1M
●您的 phpBB2 版本:phpBB 2.0.21
●您的 domain(網域名稱) :http://pspwave.eland.idv.tw
●您的 phpBB2 連結網址:http://pspwave.eland.idv.tw
~倉木麻衣~
竹貓忠實會員
竹貓忠實會員
文章: 1405
註冊時間: 2004-03-21 21:00

文章 ~倉木麻衣~ »

試看看這樣子修改

#
#--------[ OPEN ]----------------
#
includes/toplist.php

#
#--------[ FIND ]----------------
#

代碼: 選擇全部

$template->assign_block_vars("toprow", array(
#
#--------[ BEFORE, ADD ]----------------
#

代碼: 選擇全部

	if( ( $rows['topic_replies'] + 1 ) > $board_config['posts_per_page'] )
	{
		$total_pages = ceil( ( $rows['topic_replies'] + 1 ) / $board_config['posts_per_page'] );
		$goto_page = ' [ <img src="' . $images['icon_gotopost'] . '" alt="' . $lang['Goto_page'] . '" title="' . $lang['Goto_page'] . '" />' . $lang['Goto_page'] . ': ';

		$times = 1;
		for($j = 0; $j < $rows['topic_replies'] + 1; $j += $board_config['posts_per_page'])
		{
			$goto_page .= '<a href="' . append_sid("viewtopic.$phpEx?" . POST_TOPIC_URL . "=" . $topic_id . "&start=$j") . '">' . $times . '</a>';
			if( $times == 1 && $total_pages > 4 )
			{
				$goto_page .= ' ... ';
				$times = $total_pages - 3;
				$j += ( $total_pages - 4 ) * $board_config['posts_per_page'];
			}
			else if ( $times < $total_pages )
			{
				$goto_page .= ', ';
			}
			$times++;
		}
		$goto_page .= ' ] ';
	}
	else
	{
		$goto_page = '';
	}
#
#--------[ FIND ]----------------
#

代碼: 選擇全部

'TOPIC_VIEWS' => $rows['topic_views'],
#
#--------[ AFTER, ADD ]----------------
#

代碼: 選擇全部

		'GOTO_PAGE' => $goto_page,
#
#--------[ OPEN ]----------------
#
templates/subSilver/index_body.tpl

#
#--------[ FIND ]----------------
#

代碼: 選擇全部

{toprow.TOPIC}</a></span>
#
#--------[ IN-LINE AFTER, ADD ]----------------
#

代碼: 選擇全部

<span class="gensmall"><br />{toprow.GOTO_PAGE}</span>
#
#--------[ SAVE/CLOSE ALL FILES ]----------------
#
# EoM
謝絕所有私人訊息詢問外掛相關問題
有問題請直接於版上發表, 集思廣議絕對比專挑特定人士詢問來的好

竹貓禁止發表含破解相關的軟體, 違者砍文
不要跟我講別的地方都可以發, 為什麼竹貓就不行
免費不等於破解, 傻傻的搞不清楚
davidhuang
星球公民
星球公民
文章: 33
註冊時間: 2007-01-31 13:29

文章 davidhuang »

倉木兄:

首先先感謝您如此願意幫忙....謝謝.

您的 Code 我改了但一樣無效, 我想是因為我將 Top 5 抽成一頁變為 Top50 的關係(不在 index 中), 提供我 Top50 PHP檔 加 上 Template 檔, 希望您或其他先進能夠幫忙.

toplist.php Code

代碼: 選擇全部

<?php
/***************************************************************************
 *                                index.php
 *                            -------------------
 *   begin                : Saturday, Feb 13, 2001
 *   copyright            : (C) 2001 The phpBB Group
 *   email                : support@phpbb.com
 *
 *   $Id: index.php,v 1.99.2.7 2006/01/28 11:13:39 acydburn Exp $
 *
 *
 ***************************************************************************/

/***************************************************************************
 *
 *   This program is free software; you can redistribute it and/or modify
 *   it under the terms of the GNU General Public License as published by
 *   the Free Software Foundation; either version 2 of the License, or
 *   (at your option) any later version.
 *
 ***************************************************************************/

define('IN_PHPBB', true);
$phpbb_root_path = './';
include($phpbb_root_path . 'extension.inc');
include($phpbb_root_path . 'common.'.$phpEx);

//
// Start session management
//
$userdata = session_pagestart($user_ip, PAGE_INDEX);
init_userprefs($userdata);
//
// End session management
//

if ($userdata['user_id'] == ANONYMOUS) 
{ 
   redirect(append_sid("login.$phpEx?redirect=toplist.$phpEx", true)); 
}

$viewcat = ( !empty($HTTP_GET_VARS[POST_CAT_URL]) ) ? $HTTP_GET_VARS[POST_CAT_URL] : -1;

if( isset($HTTP_GET_VARS['mark']) || isset($HTTP_POST_VARS['mark']) )
{
	$mark_read = ( isset($HTTP_POST_VARS['mark']) ) ? $HTTP_POST_VARS['mark'] : $HTTP_GET_VARS['mark'];
}
else
{
	$mark_read = '';
}

//
// Handle marking posts
//
if( $mark_read == 'forums' )
{
	if( $userdata['session_logged_in'] )
	{
		setcookie($board_config['cookie_name'] . '_f_all', time(), 0, $board_config['cookie_path'], $board_config['cookie_domain'], $board_config['cookie_secure']);
	}

	$template->assign_vars(array(
		"META" => '<meta http-equiv="refresh" content="3;url='  .append_sid("index.$phpEx") . '">')
	);

	$message = $lang['Forums_marked_read'] . '<br /><br />' . sprintf($lang['Click_return_index'], '<a href="' . append_sid("index.$phpEx") . '">', '</a> ');

	message_die(GENERAL_MESSAGE, $message);
}
//
// End handle marking posts
//

$tracking_topics = ( isset($HTTP_COOKIE_VARS[$board_config['cookie_name'] . '_t']) ) ? unserialize($HTTP_COOKIE_VARS[$board_config['cookie_name'] . "_t"]) : array();
$tracking_forums = ( isset($HTTP_COOKIE_VARS[$board_config['cookie_name'] . '_f']) ) ? unserialize($HTTP_COOKIE_VARS[$board_config['cookie_name'] . "_f"]) : array();

//
// If you don't use these stats on your index you may want to consider
// removing them
//
$total_posts = get_db_stat('postcount');
$total_users = get_db_stat('usercount');
$newest_userdata = get_db_stat('newestuser');
$newest_user = $newest_userdata['username'];
$newest_uid = $newest_userdata['user_id'];

if( $total_posts == 0 )
{
	$l_total_post_s = $lang['Posted_articles_zero_total'];
}
else if( $total_posts == 1 )
{
	$l_total_post_s = $lang['Posted_article_total'];
}
else
{
	$l_total_post_s = $lang['Posted_articles_total'];
}

if( $total_users == 0 )
{
	$l_total_user_s = $lang['Registered_users_zero_total'];
}
else if( $total_users == 1 )
{
	$l_total_user_s = $lang['Registered_user_total'];
}
else
{
	$l_total_user_s = $lang['Registered_users_total'];
}


//
// Start page proper
//
$sql = "SELECT c.cat_id, c.cat_title, c.cat_order
	FROM " . CATEGORIES_TABLE . " c 
	ORDER BY c.cat_order";
if( !($result = $db->sql_query($sql)) )
{
	message_die(GENERAL_ERROR, 'Could not query categories list', '', __LINE__, __FILE__, $sql);
}

$category_rows = array();
while ($row = $db->sql_fetchrow($result))
{
	$category_rows[] = $row;
}
$db->sql_freeresult($result);

if( ( $total_categories = count($category_rows) ) )
{
	//
	// Define appropriate SQL
	//
	switch(SQL_LAYER)
	{
		case 'postgresql':
			$sql = "SELECT f.*, p.post_time, p.post_username, u.username, u.user_id 
				FROM " . FORUMS_TABLE . " f, " . POSTS_TABLE . " p, " . USERS_TABLE . " u
				WHERE p.post_id = f.forum_last_post_id 
					AND u.user_id = p.poster_id  
					UNION (
						SELECT f.*, NULL, NULL, NULL, NULL
						FROM " . FORUMS_TABLE . " f
						WHERE NOT EXISTS (
							SELECT p.post_time
							FROM " . POSTS_TABLE . " p
							WHERE p.post_id = f.forum_last_post_id  
						)
					)
					ORDER BY cat_id, forum_order";
			break;

		case 'oracle':
			$sql = "SELECT f.*, p.post_time, p.post_username, u.username, u.user_id 
				FROM " . FORUMS_TABLE . " f, " . POSTS_TABLE . " p, " . USERS_TABLE . " u
				WHERE p.post_id = f.forum_last_post_id(+)
					AND u.user_id = p.poster_id(+)
				ORDER BY f.cat_id, f.forum_order";
			break;

		default:
			$sql = "SELECT f.*, p.post_time, p.post_username, u.username, u.user_id
				FROM (( " . FORUMS_TABLE . " f
				LEFT JOIN " . POSTS_TABLE . " p ON p.post_id = f.forum_last_post_id )
				LEFT JOIN " . USERS_TABLE . " u ON u.user_id = p.poster_id )
				ORDER BY f.cat_id, f.forum_order";
			break;
	}
	if ( !($result = $db->sql_query($sql)) )
	{
		message_die(GENERAL_ERROR, 'Could not query forums information', '', __LINE__, __FILE__, $sql);
	}

	$forum_data = array();
	while( $row = $db->sql_fetchrow($result) )
	{
		$forum_data[] = $row;
	}
	$db->sql_freeresult($result);

	if ( !($total_forums = count($forum_data)) )
	{
		message_die(GENERAL_MESSAGE, $lang['No_forums']);
	}

	//
	// Obtain a list of topic ids which contain
	// posts made since user last visited
	//
	if ($userdata['session_logged_in'])
	{
		// 60 days limit
		if ($userdata['user_lastvisit'] < (time() - 5184000))
		{
			$userdata['user_lastvisit'] = time() - 5184000;
		}

		$sql = "SELECT t.forum_id, t.topic_id, p.post_time 
			FROM " . TOPICS_TABLE . " t, " . POSTS_TABLE . " p 
			WHERE p.post_id = t.topic_last_post_id 
				AND p.post_time > " . $userdata['user_lastvisit'] . " 
				AND t.topic_moved_id = 0"; 
		if ( !($result = $db->sql_query($sql)) )
		{
			message_die(GENERAL_ERROR, 'Could not query new topic information', '', __LINE__, __FILE__, $sql);
		}

		$new_topic_data = array();
		while( $topic_data = $db->sql_fetchrow($result) )
		{
			$new_topic_data[$topic_data['forum_id']][$topic_data['topic_id']] = $topic_data['post_time'];
		}
		$db->sql_freeresult($result);
	}

	//
	// Obtain list of moderators of each forum
	// First users, then groups ... broken into two queries
	//
	$sql = "SELECT aa.forum_id, u.user_id, u.username 
		FROM " . AUTH_ACCESS_TABLE . " aa, " . USER_GROUP_TABLE . " ug, " . GROUPS_TABLE . " g, " . USERS_TABLE . " u
		WHERE aa.auth_mod = " . TRUE . " 
			AND g.group_single_user = 1 
			AND ug.group_id = aa.group_id 
			AND g.group_id = aa.group_id 
			AND u.user_id = ug.user_id 
		GROUP BY u.user_id, u.username, aa.forum_id 
		ORDER BY aa.forum_id, u.user_id";
	if ( !($result = $db->sql_query($sql)) )
	{
		message_die(GENERAL_ERROR, 'Could not query forum moderator information', '', __LINE__, __FILE__, $sql);
	}

	$forum_moderators = array();
	while( $row = $db->sql_fetchrow($result) )
	{
		$forum_moderators[$row['forum_id']][] = '<a href="' . append_sid("profile.$phpEx?mode=viewprofile&" . POST_USERS_URL . "=" . $row['user_id']) . '">' . $row['username'] . '</a>';
	}
	$db->sql_freeresult($result);

	$sql = "SELECT aa.forum_id, g.group_id, g.group_name 
		FROM " . AUTH_ACCESS_TABLE . " aa, " . USER_GROUP_TABLE . " ug, " . GROUPS_TABLE . " g 
		WHERE aa.auth_mod = " . TRUE . " 
			AND g.group_single_user = 0 
			AND g.group_type <> " . GROUP_HIDDEN . "
			AND ug.group_id = aa.group_id 
			AND g.group_id = aa.group_id 
		GROUP BY g.group_id, g.group_name, aa.forum_id 
		ORDER BY aa.forum_id, g.group_id";
	if ( !($result = $db->sql_query($sql)) )
	{
		message_die(GENERAL_ERROR, 'Could not query forum moderator information', '', __LINE__, __FILE__, $sql);
	}

	while( $row = $db->sql_fetchrow($result) )
	{
		$forum_moderators[$row['forum_id']][] = '<a href="' . append_sid("groupcp.$phpEx?" . POST_GROUPS_URL . "=" . $row['group_id']) . '">' . $row['group_name'] . '</a>';
	}
	$db->sql_freeresult($result);

		$sql = "SELECT user_id, username, user_birthday, user_level 
		FROM " . USERS_TABLE . " 
		WHERE user_birthday >= " . gmdate('md0000',time() + (3600 * $board_config['board_timezone'])) . " 
			AND user_birthday <= " . gmdate('md9999',time() + (3600 * $board_config['board_timezone']))." 
			AND user_active = 1 
		ORDER BY username DESC";
	if ( !($result = $db->sql_query($sql)) )
	{
		message_die(GENERAL_ERROR, 'Could not query members birthday information', '', __LINE__, __FILE__, $sql);
	}

	$user_birthdays = array();
	while ( $row = $db->sql_fetchrow($result) )
	{
		$bday_year = $row['user_birthday'] % 10000;
		$age = ( $bday_year ) ? ' ('.(gmdate('Y')-$bday_year).')' : '';
		$color = '';
		if ( $row['user_level'] == ADMIN )
		{
			$color = ' style="color:#' . $theme['fontcolor3'] . '"';
		}
		else if ( $row['user_level'] == MOD )
		{
			$color = ' style="color:#' . $theme['fontcolor2'] . '"';
		}
		$user_birthdays[] = '<a href="' . append_sid("profile.$phpEx?mode=viewprofile&" . POST_USERS_URL . "=" . $row['user_id']) . '"' . $color . '>' . $row['username'] . '</a>' . $age;
	}
	$db->sql_freeresult($result);

	$birthdays = (!empty($user_birthdays)) ?
		sprintf($lang['Congratulations'],implode(', ',$user_birthdays)) :
		$lang['No_birthdays'];

	if ( $board_config['bday_lookahead'] != -1 )
	{
		$start = gmdate('md9999',strtotime('+'.$board_config['bday_lookahead'].' day') + (3600 * $board_config['board_timezone']));
		$end = gmdate('md0000',strtotime('+1 day') + (3600 * $board_config['board_timezone']));
		$operator = ($start > $end) ? 'AND' : 'OR';
		$sql = "SELECT user_id, username, user_birthday, user_level 
			FROM " . USERS_TABLE . " 
			WHERE (user_birthday <= $start 
				$operator user_birthday >= $end)
				AND user_birthday <> 0 
				AND user_active = 1 
			ORDER BY username DESC";
		if ( !($result = $db->sql_query($sql)) )
		{
			message_die(GENERAL_ERROR, 'Could not query upcoming birthday information', '', __LINE__, __FILE__, $sql);
		}
		$upcoming_birthdays = array();
		while ( $row = $db->sql_fetchrow($result) )
		{
			$bday_year = $row['user_birthday'] % 10000;
			$age = ( $bday_year ) ? ' ('.(gmdate('Y')-$bday_year).')' : '';
			$color = '';
			if ( $row['user_level'] == ADMIN )
			{
				$color = ' style="color:#' . $theme['fontcolor3'] . '"';
			}
			else if ( $row['user_level'] == MOD )
			{
				$color = ' style="color:#' . $theme['fontcolor2'] . '"';
			}
			$upcoming_birthdays[] = '<a href="' . append_sid("profile.$phpEx?mode=viewprofile&" . POST_USERS_URL . "=" . $row['user_id']) . '"' . $color . '>' . $row['username'] . '</a>' . $age;
		}

		$upcoming = (!empty($upcoming_birthdays)) ?
			sprintf($lang['Upcoming_birthdays'],$board_config['bday_lookahead'],implode(', ',$upcoming_birthdays)) :
			sprintf($lang['No_upcoming'],$board_config['bday_lookahead']);
	}

	if ( !empty($user_birthdays) || !empty($upcoming_birthdays) || $board_config['bday_show'] )
	{
		$template->assign_block_vars('birthdays',array());
		if ( !empty($upcoming_birthdays) || $board_config['bday_show'] )
		{
			$template->assign_block_vars('birthdays.upcoming',array());
		}
	}

	//
	// Find which forums are visible for this user
	//
	$is_auth_ary = array();
	$is_auth_ary = auth(AUTH_VIEW, AUTH_LIST_ALL, $userdata, $forum_data);

	// 
// + Better Toplist ===== 
// 
   // 
   // Option of Toplist Start 
   // 

      // 主題字數長度 
      $MAX_STR_LEN = 180; 
          
      // 主題列表數目 
      $MAX_TOPICS = 50; 
	  $MAX_TOPICS2 = 10;
	  $MAX_TOPICS3 = 10;
	  
	  //不想顯示於 TopList 的討論區
      $HideForum1 = 43;
	  $HideForum2 = 11;
	  $HideForum3 = 12;
          
      // 0 => users can see all topics including authorized issue(but they cant read the posts) 
      // 1 => users can see only authorized topics 
      $AUTH_SECRUITY = 0; 

      // 主題排序依據 
      $sortby = 'topic_last_post_id'; 
      $sortby2 = 'topic_replies'; 
      $sortby3 = 'topic_views'; 

   // 
   // Option of Toplist End 
   // 

   function cutStr($str) { 
      global $MAX_STR_LEN; 
      $str = (mb_strlen($str, 'utf-8') > $MAX_STR_LEN) ? (mb_substr($str, 0, $MAX_STR_LEN - 3, 'utf-8') . "...") : $str;// UTF-8 
      return $str; 
   } 

   // Find which forums are visible for this user 
   $is_auth_ary_top5 = array(); 
   $is_auth_ary_top5 = auth(AUTH_READ, AUTH_LIST_ALL, $userdata); 

   $auth_forum_ary_top5 = array(); 

   // Get forum info 
   $sql = "SELECT forum_id FROM " . FORUMS_TABLE; 

   if( !$q_forums = $db->sql_query($sql) ) 
   { 
      message_die(GENERAL_ERROR, 'Toplist ERROR: Fetch forum info fail', __LINE__, __FILE__, $sql); 
   } 

   // Authorized forums info 
   while( $forum_row = $db->sql_fetchrow($q_forums) ) 
   { 
      $forum_id1 = $forum_row['forum_id']; 

      if( $is_auth_ary_top5[$forum_id1]['auth_read'] == 1) 
      { 
         if(function_exists("array_push")) 
         { 
            array_push($auth_forum_ary_top5, $forum_id1); 
         } else { 
            $auth_id=count($auth_forum_ary_top5); 
            $auth_forum_ary_top5[$auth_id]=$forum_id1; 
         } 
      } 
   } 

   if( sizeOf($auth_forum_ary_top5) == 0 || !$AUTH_SECRUITY ) 
   { 
      $auth_forums_top5 = ""; 
   } 
   else 
   { 
      $auth_forums_top5 = 'AND f.forum_id IN('; 

      if(sizeOf($auth_forum_ary_top5) > 1) 
      { 
         $auth_forums_top5 .= implode (',', $auth_forum_ary_top5); 
      } 
      else 
      { 
         $auth_forums_top5 .= $auth_forum_ary_top5[0]; 
      } 

      $auth_forums_top5 .= ')'; 
   } 

   // 最後發表 
   // query
   // AND f.forum_id != $HideForum 過濾某一討論區的最新文章不要出現在 Top 列中
   $sql = "SELECT t.topic_id, t.topic_title, t.topic_poster, t.topic_views, t.topic_replies, t.topic_last_post_id, f.forum_id, f.forum_name 
   FROM " . TOPICS_TABLE . " t, " . FORUMS_TABLE . " f 
   WHERE t.forum_id = f.forum_id
   AND topic_moved_id = '0'
   
   AND f.forum_id != $HideForum1
   AND f.forum_id != $HideForum2
   AND f.forum_id != $HideForum3

   $auth_forums_top5 
   ORDER BY $sortby DESC LIMIT 0, $MAX_TOPICS"; 


   if( !$result = $db->sql_query($sql) ) 
   { 
      message_die(GENERAL_ERROR, 'Toplist ERROR: Fetch topic info fail', __LINE__, __FILE__, $sql); 
   } 

   // fetch rows 
   while( $rows = $db->sql_fetchrow($result) ) 
   { 
      $topic_url = append_sid("viewtopic.$phpEx?t=" . $rows['topic_id']); 
      $forum_url = append_sid("viewforum.$phpEx?f=" . $rows['forum_id']); 

      $topic_poster = $rows['topic_poster']; 
      $topic_last_post_id = $rows['topic_last_post_id']; 

      // Grab topic poster and last replier data 
      
      $sql = "SELECT post_username, user_id, username 
      FROM " . POSTS_TABLE . ", " . USERS_TABLE . " 
      WHERE topic_id = '" . $rows['topic_id'] . "' 
      AND poster_id = user_id 
      ORDER BY post_id LIMIT 0, 1"; 

      if( !$p_result = $db->sql_query($sql) ) 
      { 
         message_die(GENERAL_ERROR, 'Toplist ERROR: Fetch topic poster fail', __LINE__, __FILE__, $sql); 
      } 

      $p_row = $db->sql_fetchrow($p_result); 

      $poster_name = ( $topic_poster != ANONYMOUS ) ? $p_row['username'] : ( !$p_row['post_username'] ? $lang['Guest'] : $p_row['post_username']); 
      $poster_url = ( $topic_poster != ANONYMOUS && !$p_row['post_username'] ) ? ('<a href="' . append_sid("profile.$phpEx?mode=viewprofile&u=$topic_poster") . '">' . "$poster_name</a>") : $poster_name; 
       
      /* 省略 主題發表人 查詢 */ 

      $sql = "SELECT post_username, user_id, username, post_time 
      FROM " . POSTS_TABLE . ", " . USERS_TABLE . " 
      WHERE post_id = '$topic_last_post_id' 
      AND poster_id = user_id"; 

      if( !$r_result = $db->sql_query($sql) ) 
      { 
         message_die(GENERAL_ERROR, 'Toplist ERROR: Fetch topic last replier fail', __LINE__, __FILE__, $sql); 
      } 

      $r_row = $db->sql_fetchrow($r_result); 

      $replier_id = $r_row['user_id']; 
      $replier_name = ( $replier_id != ANONYMOUS ) ? $r_row['username'] : ( !$r_row['post_username'] ? $lang['Guest'] : $r_row['post_username']); 
      $replier_url = ( $replier_id != ANONYMOUS && !$r_row['post_username'] ) ? ('<a href="' . append_sid("profile.$phpEx?mode=viewprofile&u=$replier_id") . '">' . "$replier_name</a>") : $replier_name; 

      $last_post_url = append_sid("viewtopic.$phpEx?p=$topic_last_post_id#$topic_last_post_id"); 

      $template->assign_block_vars("toprow", array( 
         'FORUM_NAME' => $rows['forum_name'], 
		 'FORUM_URL' => $forum_url, 
		 'TOPIC' => cutStr($rows['topic_title']), 
		 'TOPIC_URL' => $topic_url, 
		 'TOPIC_VIEWS' => $rows['topic_views'], 
		 'TOPIC_REPLIES' => $rows['topic_replies'], 
		 'POST_TIME' => create_date($board_config['default_dateformat'], $r_row['post_time'], $board_config['board_timezone']), 
		 'POSTER_URL' => $poster_url, 
		 'REPLIER_URL' => $replier_url, 
		 'LAST_POST_URL' => $last_post_url
		 
      )); 
   } 

   // 最多回覆 
   // query
   // AND f.forum_id != $HideForum 過濾某一討論區的最新文章不要出現在 Top 列中
   $date = time() - ( 7 * 86400 ); 
   $sql2 = "SELECT t.topic_id, t.topic_title, t.topic_poster, t.topic_views, t.topic_replies, t.topic_last_post_id, f.forum_id, f.forum_name 
   FROM " . TOPICS_TABLE . " t, " . FORUMS_TABLE . " f 
   WHERE t.forum_id = f.forum_id 
   AND topic_moved_id = '0' 
   AND t.topic_time > $date
   AND f.forum_id != $HideForum1
   AND f.forum_id != $HideForum2
   AND f.forum_id != $HideForum3
   $auth_forums_top5 
   ORDER BY $sortby2 DESC LIMIT 0, $MAX_TOPICS2"; 

   if( !$result2 = $db->sql_query($sql2) ) 
   { 
      message_die(GENERAL_ERROR, 'Toplist ERROR: Fetch topic info fail', __LINE__, __FILE__, $sql2); 
   } 

   // fetch rows 
   while( $rows2 = $db->sql_fetchrow($result2) ) 
   { 
      $topic_url2 = append_sid("viewtopic.$phpEx?t=" . $rows2['topic_id']); 
      $forum_url2 = append_sid("viewforum.$phpEx?f=" . $rows2['forum_id']); 

      $topic_poster2 = $rows2['topic_poster']; 
      $topic_last_post_id2 = $rows2['topic_last_post_id']; 

      // Grab topic poster and last replier data 

      $sql2 = "SELECT post_username, user_id, username 
      FROM " . POSTS_TABLE . ", " . USERS_TABLE . " 
      WHERE topic_id = '" . $rows2['topic_id'] . "' 
      AND poster_id = user_id 
      ORDER BY post_id LIMIT 0, 1"; 

      if( !$p_result2 = $db->sql_query($sql2) ) 
      { 
         message_die(GENERAL_ERROR, 'Toplist ERROR: Fetch topic poster fail', __LINE__, __FILE__, $sql2); 
      } 

      $p_row2 = $db->sql_fetchrow($p_result2);  

      $poster_name2 = ( $topic_poster2 != ANONYMOUS ) ? $p_row2['username'] : ( !$p_row2['post_username'] ? $lang['Guest'] : $p_row2['post_username']); 
      $poster_url2 = ( $topic_poster2 != ANONYMOUS && !$p_row2['post_username'] ) ? ('<a href="' . append_sid("profile.$phpEx?mode=viewprofile&u=$topic_poster2") . '">' . "$poster_name2</a>") : $poster_name2;

      /* 省略 主題發表人 查詢 */ 

      $sql2 = "SELECT post_username, user_id, username, post_time 
      FROM " . POSTS_TABLE . ", " . USERS_TABLE . " 
      WHERE post_id = '$topic_last_post_id2' 
      AND poster_id = user_id"; 

      if( !$r_result2 = $db->sql_query($sql2) ) 
      { 
         message_die(GENERAL_ERROR, 'Toplist ERROR: Fetch topic last replier fail', __LINE__, __FILE__, $sql2); 
      } 

      $r_row2 = $db->sql_fetchrow($r_result2); 

      $replier_id2 = $r_row2['user_id']; 
      $replier_name2 = ( $replier_id2 != ANONYMOUS ) ? $r_row2['username'] : ( !$r_row2['post_username'] ? $lang['Guest'] : $r_row2['post_username']); 
      $replier_url2 = ( $replier_id2 != ANONYMOUS && !$r_row2['post_username'] ) ? ('<a href="' . append_sid("profile.$phpEx?mode=viewprofile&u=$replier_id2") . '">' . "$replier_name2</a>") : $replier_name2; 

      $last_post_url2 = append_sid("viewtopic.$phpEx?p=$topic_last_post_id2#$topic_last_post_id2"); 

      $template->assign_block_vars("toprow_reply", array( 
         'FORUM_NAME2' => $rows2['forum_name'], 
         'FORUM_URL2' => $forum_url2, 
         'TOPIC' => cutStr($rows2['topic_title']), 
         'TOPIC_URL2' => $topic_url2, 
         'TOPIC_VIEWS2' => $rows2['topic_views'], 
         'TOPIC_REPLIES2' => $rows2['topic_replies'], 
         'POST_TIME2' => create_date('Y-m-d', $r_row2['post_time'], $board_config['board_timezone']), 
         'POSTER_URL2' => $poster_url2, 
         'REPLIER_URL2' => $replier_url2, 
         'LAST_POST_URL2' => $last_post_url2 
      )); 
   } 
    
   // 最多觀看 
   // query
   // AND f.forum_id != $HideForum 過濾某一討論區的最新文章不要出現在 Top 列中
   $date = time() - ( 7 * 86400 ); 
   $sql3 = "SELECT t.topic_id, t.topic_title, t.topic_poster, t.topic_views, t.topic_replies, t.topic_last_post_id, f.forum_id, f.forum_name 
   FROM " . TOPICS_TABLE . " t, " . FORUMS_TABLE . " f 
   WHERE t.forum_id = f.forum_id 
   AND topic_moved_id = '0' 
   AND t.topic_time > $date
   AND f.forum_id != $HideForum1
   AND f.forum_id != $HideForum2
   AND f.forum_id != $HideForum3
   $auth_forums_top5 
   ORDER BY $sortby3 DESC LIMIT 0, $MAX_TOPICS3"; 
    
   if( !$result3 = $db->sql_query($sql3) ) 
   { 
      message_die(GENERAL_ERROR, 'Toplist ERROR: Fetch topic info fail', __LINE__, __FILE__, $sql3); 
   } 

   // fetch rows 
   while( $rows3 = $db->sql_fetchrow($result3) ) 
   { 
      $topic_url3 = append_sid("viewtopic.$phpEx?t=" . $rows3['topic_id']); 
      $forum_url3 = append_sid("viewforum.$phpEx?f=" . $rows3['forum_id']); 

      $topic_poster3 = $rows3['topic_poster']; 
      $topic_last_post_id3 = $rows3['topic_last_post_id']; 

      // Grab topic poster and last replier data 
      
      $sql3 = "SELECT post_username, user_id, username 
      FROM " . POSTS_TABLE . ", " . USERS_TABLE . " 
      WHERE topic_id = '" . $rows3['topic_id'] . "' 
      AND poster_id = user_id 
      ORDER BY post_id LIMIT 0, 1"; 

      if( !$p_result3 = $db->sql_query($sql3) ) 
      { 
         message_die(GENERAL_ERROR, 'Toplist ERROR: Fetch topic poster fail', __LINE__, __FILE__, $sql3); 
      } 

      $p_row3 = $db->sql_fetchrow($p_result3);  

      $poster_name3 = ( $topic_poster3 != ANONYMOUS ) ? $p_row3['username'] : ( !$p_row3['post_username'] ? $lang['Guest'] : $p_row3['post_username']); 
     $poster_url3 = ( $topic_poster3 != ANONYMOUS && !$p_row3['post_username'] ) ? ('<a href="' . append_sid("profile.$phpEx?mode=viewprofile&u=$topic_poster3") . '">' . "$poster_name3</a>") : $poster_name3;
    
      /* 省略 主題發表人 查詢 */ 

      $sql3 = "SELECT post_username, user_id, username, post_time 
      FROM " . POSTS_TABLE . ", " . USERS_TABLE . " 
      WHERE post_id = '$topic_last_post_id3' 
      AND poster_id = user_id"; 

      if( !$r_result3 = $db->sql_query($sql3) ) 
      { 
         message_die(GENERAL_ERROR, 'Toplist ERROR: Fetch topic last replier fail', __LINE__, __FILE__, $sql3); 
      } 

      $r_row3 = $db->sql_fetchrow($r_result3); 

      $replier_id3 = $r_row3['user_id']; 
      $replier_name3 = ( $replier_id3 != ANONYMOUS ) ? $r_row3['username'] : ( !$r_row3['post_username'] ? $lang['Guest'] : $r_row3['post_username']); 
      $replier_url3 = ( $replier_id3 != ANONYMOUS && !$r_row3['post_username'] ) ? ('<a href="' . append_sid("profile.$phpEx?mode=viewprofile&u=$replier_id3") . '">' . "$replier_name3</a>") : $replier_name3;

      $last_post_url3 = append_sid("viewtopic.$phpEx?p=$topic_last_post_id3#$topic_last_post_id3"); 

      $template->assign_block_vars("toprow_view", array( 
         'FORUM_NAME3' => $rows3['forum_name'], 
         'FORUM_URL3' => $forum_url3, 
         'TOPIC' => cutStr($rows3['topic_title']), 
         'TOPIC_URL3' => $topic_url3, 
         'TOPIC_VIEWS3' => $rows3['topic_views'], 
         'TOPIC_REPLIES3' => $rows3['topic_replies'], 
         'POST_TIME3' => create_date('Y-m-d', $r_row3['post_time'], $board_config['board_timezone']), 
         'POSTER_URL3' => $poster_url3, 
         'REPLIER_URL3' => $replier_url3, 
         'LAST_POST_URL3' => $last_post_url3 
      )); 
   } 
// 
// - Better Toplist ===== 
// 

	//
	// Begin - "The Blog Mod" changes
	//
	include($phpbb_root_path . 'includes/weblogs_common.'.$phpEx);
	include($phpbb_root_path . 'includes/functions_weblog.'.$phpEx);

	//
	// Get Weblog Data
	//
	$weblog_data = fetch_visible_weblogs ();

	for ($i = 0; $i < count($weblog_data) && $i < 10; $i++)
	{
		if ( !empty($recent_weblogs) )
		{
			$recent_weblogs .= ', <a href="' . append_sid ("weblog.$phpEx?" . POST_WEBLOG_URL . "=" . $weblog_data[$i]['weblog_id']) . '"';
		}
		else
		{
			$recent_weblogs = '<a href="' . append_sid ("weblog.$phpEx?" . POST_WEBLOG_URL . "=" . $weblog_data[$i]['weblog_id']) . '"';
		}

		if ( $weblog_data[$i]['user_level'] == ADMIN )
		{
			$recent_weblogs .= ' style="color:#' . $theme['fontcolor3'] . '">';
		}
		else if ( $weblog_data[$i]['user_level'] == MOD )
		{
			$recent_weblogs .= ' style="color:#' . $theme['fontcolor2'] . '">';
		}
		else
		{
			$recent_weblogs .= '>';
		}

		if ( $weblog_config['index_list_by_username'] )
		{
			$recent_weblogs .= $weblog_data[$i]['username'] . '</a>';
		}
		else
		{
			$recent_weblogs .= $weblog_data[$i]['weblog_name'] . '</a>';
		}
	}
	//
	// End - "The Blog Mod" changes
	//

	//
	// Start output of page
	//
	define('SHOW_ONLINE', true);
	$page_title = $lang['Index'];
	include($phpbb_root_path . 'includes/toplist_page_header.'.$phpEx);

	$template->set_filenames(array(
		'body' => 'toplist_body.tpl')
	);

	$template->assign_vars(array(
		'TOTAL_POSTS' => sprintf($l_total_post_s, $total_posts),
		'TOTAL_USERS' => sprintf($l_total_user_s, $total_users),
		'NEWEST_USER' => sprintf($lang['Newest_user'], '<a href="' . append_sid("profile.$phpEx?mode=viewprofile&" . POST_USERS_URL . "=$newest_uid") . '">', $newest_user, '</a>'), 
		'BIRTHDAYS' => $birthdays,
		'UPCOMING' => $upcoming,
#
// The Blog Entry by support [at] TheBlogMod.com
		'MOST_RECENT_WEBLOGS' => sprintf( (( $weblog_config['index_list_by_username'] ) ? $lang['Most_recent_weblogs_user'] : $lang['Most_recent_weblogs']) , $recent_weblogs),


		'FORUM_IMG' => $images['forum'],
		'FORUM_NEW_IMG' => $images['forum_new'],
		'FORUM_LOCKED_IMG' => $images['forum_locked'],

		'L_TODAYS_BIRTHDAYS' => $lang['Todays_Birthdays'],
		'L_VIEW_BIRTHDAYS' => $lang['View_Birthdays'],
		'L_FORUM' => $lang['Forum'],
		'L_TOPICS' => $lang['Topics'],
		'L_REPLIES' => $lang['Replies'],
		'L_VIEWS' => $lang['Views'],
		'L_POSTS' => $lang['Posts'],
		'ICON_URL' => $images['icon_latest_reply'],
        'ICON_ALT' => $lang['View_latest_post'],
		'MAX_TOPICS' => $MAX_TOPICS,
		'MAX_TOPICS2' => $MAX_TOPICS2,
		'MAX_TOPICS3' => $MAX_TOPICS3,
        'L_AUTHOR' => $lang['Author'], 
		'L_LASTPOST' => $lang['Last_Post'], 
		'L_NO_NEW_POSTS' => $lang['No_new_posts'],
		'L_NEW_POSTS' => $lang['New_posts'],
		'L_NO_NEW_POSTS_LOCKED' => $lang['No_new_posts_locked'], 
		'L_NEW_POSTS_LOCKED' => $lang['New_posts_locked'], 
		'L_ONLINE_EXPLAIN' => $lang['Online_explain'], 

		'L_MODERATOR' => $lang['Moderators'], 
		'L_FORUM_LOCKED' => $lang['Forum_is_locked'],
		'L_MARK_FORUMS_READ' => $lang['Mark_all_forums'], 

		'U_MARK_READ' => append_sid("index.$phpEx?mark=forums"))
	);

	//
	// Let's decide which categories we should display
	//
	$display_categories = array();

	for ($i = 0; $i < $total_forums; $i++ )
	{
		if ($is_auth_ary[$forum_data[$i]['forum_id']]['auth_view'])
		{
			$display_categories[$forum_data[$i]['cat_id']] = true;
		}
	}

	//
	// Okay, let's build the index
	//
	for($i = 0; $i < $total_categories; $i++)
	{
		$cat_id = $category_rows[$i]['cat_id'];

		//
		// Yes, we should, so first dump out the category
		// title, then, if appropriate the forum list
		//
		if (isset($display_categories[$cat_id]) && $display_categories[$cat_id])
		{
			$template->assign_block_vars('catrow', array(
				'CAT_ID' => $cat_id,
				'CAT_DESC' => $category_rows[$i]['cat_title'],
				'U_VIEWCAT' => append_sid("index.$phpEx?" . POST_CAT_URL . "=$cat_id"))
			);

			if ( $viewcat == $cat_id || $viewcat == -1 )
			{
				for($j = 0; $j < $total_forums; $j++)
				{
					if ( $forum_data[$j]['cat_id'] == $cat_id )
					{
						$forum_id = $forum_data[$j]['forum_id'];

						if ( $is_auth_ary[$forum_id]['auth_view'] )
						{
							if ( $forum_data[$j]['forum_status'] == FORUM_LOCKED )
							{
								$folder_image = $images['forum_locked']; 
								$folder_alt = $lang['Forum_locked'];
							}
							else
							{
								$unread_topics = false;
								if ( $userdata['session_logged_in'] )
								{
									if ( !empty($new_topic_data[$forum_id]) )
									{
										$forum_last_post_time = 0;

										while( list($check_topic_id, $check_post_time) = @each($new_topic_data[$forum_id]) )
										{
											if ( empty($tracking_topics[$check_topic_id]) )
											{
												$unread_topics = true;
												$forum_last_post_time = max($check_post_time, $forum_last_post_time);

											}
											else
											{
												if ( $tracking_topics[$check_topic_id] < $check_post_time )
												{
													$unread_topics = true;
													$forum_last_post_time = max($check_post_time, $forum_last_post_time);
												}
											}
										}

										if ( !empty($tracking_forums[$forum_id]) )
										{
											if ( $tracking_forums[$forum_id] > $forum_last_post_time )
											{
												$unread_topics = false;
											}
										}

										if ( isset($HTTP_COOKIE_VARS[$board_config['cookie_name'] . '_f_all']) )
										{
											if ( $HTTP_COOKIE_VARS[$board_config['cookie_name'] . '_f_all'] > $forum_last_post_time )
											{
												$unread_topics = false;
											}
										}

									}
								}

								$folder_image = ( $unread_topics ) ? $images['forum_new'] : $images['forum']; 
								$folder_alt = ( $unread_topics ) ? $lang['New_posts'] : $lang['No_new_posts']; 
							}

							$posts = $forum_data[$j]['forum_posts'];
							$topics = $forum_data[$j]['forum_topics'];
							$icon = $forum_data[$j]['forum_icon'];	// Forum Icon Mod

							if ( $forum_data[$j]['forum_last_post_id'] )
							{
								$last_post_time = create_date($board_config['default_dateformat'], $forum_data[$j]['post_time'], $board_config['board_timezone']);

								$last_post = $last_post_time . '<br />';

								$last_post .= ( $forum_data[$j]['user_id'] == ANONYMOUS ) ? ( ($forum_data[$j]['post_username'] != '' ) ? $forum_data[$j]['post_username'] . ' ' : $lang['Guest'] . ' ' ) : '<a href="' . append_sid("profile.$phpEx?mode=viewprofile&" . POST_USERS_URL . '='  . $forum_data[$j]['user_id']) . '">' . $forum_data[$j]['username'] . '</a> ';
								
								$last_post .= '<a href="' . append_sid("viewtopic.$phpEx?"  . POST_POST_URL . '=' . $forum_data[$j]['forum_last_post_id']) . '#' . $forum_data[$j]['forum_last_post_id'] . '"><img src="' . $images['icon_latest_reply'] . '" border="0" alt="' . $lang['View_latest_post'] . '" title="' . $lang['View_latest_post'] . '" /></a>';
							}
							else
							{
								$last_post = $lang['No_Posts'];
							}

							if ( count($forum_moderators[$forum_id]) > 0 )
							{
								$l_moderators = ( count($forum_moderators[$forum_id]) == 1 ) ? $lang['Moderator'] : $lang['Moderators'];
								$moderator_list = implode(', ', $forum_moderators[$forum_id]);
							}
							else
							{
								$l_moderators = '&nbsp;';
								$moderator_list = '&nbsp;';
							}

							$row_color = ( !($i % 2) ) ? $theme['td_color1'] : $theme['td_color2'];
							$row_class = ( !($i % 2) ) ? $theme['td_class1'] : $theme['td_class2'];

							$template->assign_block_vars('catrow.forumrow',	array(
								'ROW_COLOR' => '#' . $row_color,
								'ROW_CLASS' => $row_class,
								'FORUM_FOLDER_IMG' => $folder_image, 
								'FORUM_ICON_IMG' => ($icon) ? '<img src="' . $phpbb_root_path . $icon . '" alt="'.$forum_data[$j]['forum_name'].'" title="'.$forum_data[$j]['forum_name'].'" border="0" />' : '',	// Forum Icon Mod
								'FORUM_NAME' => $forum_data[$j]['forum_name'],
								'FORUM_DESC' => $forum_data[$j]['forum_desc'],
								'POSTS' => $forum_data[$j]['forum_posts'],
								'TOPICS' => $forum_data[$j]['forum_topics'],
								'LAST_POST' => $last_post,
								'MODERATORS' => $moderator_list,

								'L_MODERATOR' => $l_moderators, 
								'L_FORUM_FOLDER_ALT' => $folder_alt, 

								'U_VIEWFORUM' => append_sid("viewforum.$phpEx?" . POST_FORUM_URL . "=$forum_id"))
							);
						}
					}
				}
			}
		}
	} // for ... categories

}// if ... total_categories
else
{
	message_die(GENERAL_MESSAGE, $lang['No_forums']);
}

//
// Generate the page
//
$template->pparse('body');

include($phpbb_root_path . 'includes/page_tail.'.$phpEx);

?>

toplist_body.tpl Code

代碼: 選擇全部

<script type="text/javascript" src="includes/virtualpaginate.js">
</script>

<style type="text/css">

/*Sample CSS used for the Virtual Pagination Demos. Modify/ remove as desired*/

.virtualpage, .virtualpage2, .virtualpage3{
/*hide the broken up pieces of contents until script is called. Remove if desired*/
display: none;
font-family: "Tahoma", "Georgia"; font-size: 12px ; color: #333333;
}

.paginationstyle{ /*Style for demo pagination divs*/
font-family: "Tahoma", "Georgia"; font-size: 12px ; color: #333333;
width: 250px;
text-align: center;
padding: 1px 0;
margin: 1px 0;
}

.paginationstyle select{ /*Style for demo pagination divs' select menu*/
border: 1px solid navy;
margin: 0 15px;
}

.paginationstyle a{ /*Pagination links style*/
padding: 0 5px;
text-decoration: none;
border: 1px solid black;
color: navy;
background-color: white;
}

.paginationstyle a:hover, .paginationstyle a.selected{
color: #000;
background-color: #FEE496;
}

.paginationstyle a.imglinks{ /*Pagination Image links style (class="imglinks") */
border: 0;
padding: 0;
}

.paginationstyle a.imglinks img{
vertical-align: bottom;
border: 0;
}

.paginationstyle a.imglinks a:hover{
background: none;
}

.paginationstyle .flatview a:hover, .paginationstyle .flatview a.selected{ /*Pagination div "flatview" links style*/
color: #000;
background-color: yellow;
}

</style>

<script type="text/JavaScript">
<!--
function MM_swapImgRestore() { //v3.0
  var i,x,a=document.MM_sr; for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++) x.src=x.oSrc;
}

function MM_preloadImages() { //v3.0
  var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
    var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)
    if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}
}

function MM_findObj(n, d) { //v4.01
  var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
    d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
  if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
  for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
  if(!x && d.getElementById) x=d.getElementById(n); return x;
}

function MM_swapImage() { //v3.0
  var i,j=0,x,a=MM_swapImage.arguments; document.MM_sr=new Array; for(i=0;i<(a.length-2);i+=3)
   if ((x=MM_findObj(a[i]))!=null){document.MM_sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];}
}
//-->
</script>

<TABLE width="100%" style="border: 1px dashed gray; padding: 3px; background-color: #FFFFFF">
<TR>
<TD>
<font style="font-size: 12px ; color: #d63700">ImageShack 圖片分享 - 貼圖教學....<a href="http://www.sonydslr.com.tw/alpha/viewtopic.php?t=606">詳細內容</a></font> │
<font style="font-size: 12px ; color: #d63700">SDF 發生筆戰怎麼辦....<a href="http://www.sonydslr.com.tw/alpha/viewtopic.php?t=3572">詳細內容</a></font>
</TD>
</TR>
</TABLE>

<table width="100%" cellspacing="0" cellpadding="2" border="0" align="center">
  <tr> 
	<td align="left" valign="bottom"><span class="gensmall">
	<!-- BEGIN switch_user_logged_in -->
	{LAST_VISIT_DATE}&nbsp;&nbsp;&nbsp;
	<!-- END switch_user_logged_in -->
	{CURRENT_TIME}<br /></span><span class="nav"><a href="{U_INDEX}" class="nav">{L_INDEX}</a></span>&nbsp;&nbsp;<a href="http://www.sonydslr.com.tw/alpha/rss/rss_readme.php" target="_blank"><img src="images/rss.gif" border="0" align="absmiddle"></a> | <font class="mainmenu"><img src="images/home.gif" align="absmiddle">&nbsp;<A HREF="#" ONCLICK="this.style.behavior='url(#default#homepage)';this.setHomePage('http://www.sonydslr.com.tw');"><u>設為首頁</u></A> | <img src="images/favorites.gif" align="absmiddle">&nbsp;<a href="javascript:window.external.AddFavorite('http://www.sonydslr.com.tw', 'SONY DSLR Family (Minolta) 單眼相機家族')"><u>加入最愛</u></a> | <img src="images/search_icon.gif" border="0" align="absmiddle"> <a href="search_google.php">Google進階搜尋</a> | <img src="images/style.gif" align="absmiddle">&nbsp;<a href="http://www.sonydslr.com.tw/alpha/rss/style_readme.php" target="_blank">如何選擇版面風格</a></font></td>
	<td align="right" valign="bottom" class="gensmall">
	</td>
  </tr>
</table>

<table width="100%" height="100%" cellpadding="0" cellspacing="0" border="0">
  <tr>
 <td valign="top">

 <table width="100%" border="0" cellpadding="4" cellspacing="1" width="" class="forumline">
	<tr>
	  <th align="center" class="thCornerL">Icon</th>
	  <th align="center" class="thCornerL" width="30%">&nbsp;{L_FORUM}&nbsp;</th>
	  <th align="center" class="thTop" width="30%">&nbsp;{L_TOPICS}&nbsp;</th>
	  <th align="center" class="thTop" width="10%">&nbsp;&nbsp;{L_AUTHOR}&nbsp;&nbsp;</th>
	  <th align="center" class="thTop" width="5%">&nbsp;{L_REPLIES}&nbsp;</th>
	  <th align="center" class="thTop" width="5%">&nbsp;{L_VIEWS}&nbsp;</th>
	  <th align="center" class="thCornerR" width="20%">&nbsp;{L_LASTPOST}&nbsp;</th>
	</tr>
<tr><td colspan="7" bgcolor="#FFFFFF" style="border-bottom: 1px dashed gray"><img src="images/topnew.gif" alt="{L_NO_NEW_POSTS}" align="absmiddle"/>&nbsp;<span class="genmed"><b><font color="#FF3300">最新回覆文章</font></b>( <b>TOP {MAX_TOPICS}  </b>) - 買賣交換區文章不顯示(請自行於該區爬文).</span></td></tr>
	<!-- BEGIN toprow -->
  <tr>
 <td class="row1"><span class="forumlink"><img src="templates/xand/images/top10.gif" alt="{L_NO_NEW_POSTS}" align="absmiddle"/></span></td>
 <td class="row1"><span class="forumlink"><a href="{toprow.FORUM_URL}" target="_top" class="forumlink">{toprow.FORUM_NAME}</a></span></td>
 <td class="row2"><span class="topictitle"><a href="{toprow.TOPIC_URL}" target="_top" class="topictitle">{toprow.TOPIC}</a></span></td>
 <td class="row1" align="center"><span class="name">{toprow.POSTER_URL}</span></td>
 <td class="row2" align="center"><span class="postdetails">{toprow.TOPIC_REPLIES}</span></td>
 <td class="row1" align="center"><span class="postdetails">{toprow.TOPIC_VIEWS}</span></td>
 <td class="row2" align="center"><span class="postdetails">{toprow.POST_TIME}<br />{toprow.REPLIER_URL}&nbsp;<a href="{toprow.LAST_POST_URL}" target="_top"><img src="{ICON_URL}" border="0" alt="{ICON_ALT}" /></a></span></td>  
  </tr>
  <!-- END toprow -->


<tr><td colspan="7" bgcolor="#FFFFFF" style="border-bottom: 1px dashed gray"><img src="images/topnew.gif" alt="{L_NO_NEW_POSTS}" align="absmiddle"/>&nbsp;<span class="genmed"><b><font color="#FF3300"><font size="4">7</font>天內最多回覆文章</font></b>( <b>TOP {MAX_TOPICS2} </b> ) - 買賣交換區文章不顯示(請自行於該區爬文).</span></td></tr>
  <!-- BEGIN toprow_reply -->
  <tr>
 <td class="row1"><span class="forumlink"><img src="templates/xand/images/top10.gif" alt="{L_NO_NEW_POSTS}" align="absmiddle"/></span></td>
 <td class="row1"><span class="forumlink"><a href="{toprow_reply.FORUM_URL2}" target="_top" class="forumlink">{toprow_reply.FORUM_NAME2}</a></span></td>
 <td class="row2"><span class="topictitle"><a href="{toprow_reply.TOPIC_URL2}" target="_top" class="topictitle">{toprow_reply.TOPIC}</a></span></td>
 <td class="row1" align="center"><span class="name">{toprow_reply.POSTER_URL2}</span></td>
 <td class="row2" align="center"><span class="postdetails">{toprow_reply.TOPIC_REPLIES2}</span></td>
 <td class="row1" align="center"><span class="postdetails">{toprow_reply.TOPIC_VIEWS2}</span></td>
 <td class="row2" align="center"><span class="postdetails">{toprow_reply.POST_TIME2}<br />{toprow_reply.REPLIER_URL2}&nbsp;<a href="{toprow_reply.LAST_POST_URL2}" target="_top"><img src="{ICON_URL}" border="0" alt="{ICON_ALT}" /></a></span></td>  
  </tr>
  <!-- END toprow_reply -->

<tr><td colspan="7" bgcolor="#FFFFFF" style="border-bottom: 1px dashed gray"><img src="images/topnew.gif" alt="{L_NO_NEW_POSTS}" align="absmiddle"/>&nbsp;<span class="genmed"><b><font color="#FF3300"><font size="4">7</font>天內最多點閱文章</font></b>(<b> TOP {MAX_TOPICS3}  </b>) - 買賣交換區文章不顯示(請自行於該區爬文).</span></td></tr>
  <!-- BEGIN toprow_view -->
  <tr>
 <td class="row1"><span class="forumlink"><img src="templates/xand/images/top10.gif" alt="{L_NO_NEW_POSTS}" align="absmiddle"/></span></td>
 <td class="row1"><span class="forumlink"><a href="{toprow_view.FORUM_URL3}" target="_top" class="forumlink">{toprow_view.FORUM_NAME3}</a></span></td>
 <td class="row2"><span class="topictitle"><a href="{toprow_view.TOPIC_URL3}" target="_top" class="topictitle">{toprow_view.TOPIC}</a></span></td>
 <td class="row1" align="center"><span class="name">{toprow_view.POSTER_URL3}</span></td>
 <td class="row2" align="center"><span class="postdetails">{toprow_view.TOPIC_REPLIES3}</span></td>
 <td class="row1" align="center"><span class="postdetails">{toprow_view.TOPIC_VIEWS3}</span></td>
 <td class="row2" align="center"><span class="postdetails">{toprow_view.POST_TIME3}<br />{toprow_view.REPLIER_URL3}&nbsp;<a href="{toprow_view.LAST_POST_URL3}" target="_top"><img src="{ICON_URL}" border="0" alt="{ICON_ALT}" /></a></span></td>  
  </tr>
  <!-- END toprow_view -->


</table>


<iframe src="weblogs_news_title.php" width="959" height="225" frameborder=0 scrolling=no></iframe>



<table width="100%" cellspacing="0" border="0" align="center" cellpadding="2">
  <tr> 
 	<td align="left">
 	<!-- BEGIN switch_user_logged_in -->
 		<span class="gensmall"><a href="{U_MARK_READ}" class="gensmall">{L_MARK_FORUMS_READ}</a></span>
 	<!-- END switch_user_logged_in -->
 	</td>
	<td align="right"><span class="gensmall">{S_TIMEZONE}</span></td>
  </tr>
</table>

<table width="100%" cellpadding="3" cellspacing="1" border="0" class="forumline">
  <tr> 
	<td class="catHead" colspan="2" height="28"><span class="cattitle"><a href="{U_VIEWONLINE}" class="cattitle">{L_WHO_IS_ONLINE}</a></span></td>
  </tr>
  <tr> 
	<td class="row1" align="center" valign="middle" rowspan="4"><img src="templates/xand/images/whosonline.gif" alt="{L_WHO_IS_ONLINE}" /></td>
	<td class="row1" align="left" width="100%"><span class="gensmall">{TOTAL_POSTS}<br />{TOTAL_USERS}<br />{NEWEST_USER}</span>
	</td>
  </tr>
  <tr> 
	<td class="row1" align="left"><span class="gensmall">{TOTAL_USERS_ONLINE} &nbsp; [ {L_WHOSONLINE_ADMIN} ] &nbsp; [ {L_WHOSONLINE_MOD} ] &nbsp; [ {L_WHOSONLINE_USER} ] &nbsp; [ {L_WHOSONLINE_GUEST} ]<br />{RECORD_USERS}<br />{LOGGED_IN_USER_LIST}</span></td>
  </tr>

  <tr> 
	<td class="row1" align="left"><span class="gensmall">{MOST_RECENT_WEBLOGS}</span></td>
  </tr>

  <tr>
	<td class="row1" align="left"><span class="gensmall">{USERS_OF_THE_DAY_LIST}</span></td>
  </tr>

 <!-- BEGIN birthdays -->
  <tr> 
	<td class="catHead" colspan="2" height="28"><span class="cattitle">{L_TODAYS_BIRTHDAYS}</span></td>
  </tr>
  <tr> 
	<td class="row1" align="center" valign="middle"><img src="templates/xand/images/icon_birthday.gif" alt="{L_VIEW_BIRTHDAYS}" /></td>
	<td class="row1" align="left" width="100%">
	  <span class="gensmall">{BIRTHDAYS}
	  <!-- BEGIN upcoming -->
	  <br />{UPCOMING}
	  <!-- END upcoming -->
	  </span>
	</td>
  </tr>
  <!-- END birthdays -->

</table>

<table width="100%" cellpadding="1" cellspacing="1" border="0">
<tr>
	<td align="left" valign="top"><span class="gensmall">{L_ONLINE_EXPLAIN}</span></td>
</tr>
</table>



<!-- BEGIN switch_user_logged_out -->
<form method="post" action="{S_LOGIN_ACTION}">
  <table width="100%" cellpadding="3" cellspacing="1" border="0" class="forumline">
	<tr> 
	  <td class="catHead" height="28"><a name="login"></a><span class="cattitle">{L_LOGIN_LOGOUT}</span></td>
	</tr>
	<tr> 
	  <td class="row1" align="center" valign="middle" height="28"><span class="gensmall">{L_USERNAME}: 
		<input class="post" type="text" name="username" size="10" />
		&nbsp;&nbsp;&nbsp;{L_PASSWORD}: 
		<input class="post" type="password" name="password" size="10" maxlength="32" />
		<!-- BEGIN switch_allow_autologin -->
		&nbsp;&nbsp; &nbsp;&nbsp;{L_AUTO_LOGIN} 
		<input class="text" type="checkbox" name="autologin" checked="checked" />
		<!-- END switch_allow_autologin -->
		&nbsp;&nbsp;&nbsp; 
		<input type="submit" class="mainoption" name="login" value="{L_LOGIN}" />
		</span> </td>
	</tr>
  </table>
</form>
<!-- END switch_user_logged_out -->

<br clear="all" />
~倉木麻衣~
竹貓忠實會員
竹貓忠實會員
文章: 1405
註冊時間: 2004-03-21 21:00

文章 ~倉木麻衣~ »

我想你的站應該是http://pspwave.eland.idv.tw/沒錯吧
phpBB預設是同一主題要超過15文章(主題+回覆)才會出現分頁
但我看了一下你站上的文章, 沒有任何一篇主題的文章數有超過15篇的
所以現階段改了也不會看到什麼效果

或是到後台調整「每頁顯示發表數」的設定, 將它調小一些再觀察看看
謝絕所有私人訊息詢問外掛相關問題
有問題請直接於版上發表, 集思廣議絕對比專挑特定人士詢問來的好

竹貓禁止發表含破解相關的軟體, 違者砍文
不要跟我講別的地方都可以發, 為什麼竹貓就不行
免費不等於破解, 傻傻的搞不清楚
davidhuang
星球公民
星球公民
文章: 33
註冊時間: 2007-01-31 13:29

文章 davidhuang »

~倉木麻衣~ 寫:我想你的站應該是http://pspwave.eland.idv.tw/沒錯吧
phpBB預設是同一主題要超過15文章(主題+回覆)才會出現分頁
但我看了一下你站上的文章, 沒有任何一篇主題的文章數有超過15篇的
所以現階段改了也不會看到什麼效果

或是到後台調整「每頁顯示發表數」的設定, 將它調小一些再觀察看看
倉木兄果然強...的確...測試到 15篇以上就可以了, 但發現點擊頁數會出現 "該文章不存在", 比對正確網址跟不正確的如下:

不正確:
viewtopic.php?t=&start=15
正確:
viewtopic.php?t=3520&postdays=0&postorder=asc&start=15

程式要在修改那裡呢?

謝謝倉木兄.
~倉木麻衣~
竹貓忠實會員
竹貓忠實會員
文章: 1405
註冊時間: 2004-03-21 21:00

文章 ~倉木麻衣~ »

davidhuang 寫:發現點擊頁數會出現 "該文章不存在", 比對正確網址跟不正確的如下:

不正確:
viewtopic.php?t=&start=15
正確:
viewtopic.php?t=3520&postdays=0&postorder=asc&start=15

程式要在修改那裡呢?
我上頭修改的程式有個部份沒注意到
請將原文提到要改的toplist.php裡的這行

代碼: 選擇全部

$goto_page .= '<a href="' . append_sid("viewtopic.$phpEx?" . POST_TOPIC_URL . "=" . $topic_id . "&start=$j") . '">' . $times . '</a>';
改成這樣

代碼: 選擇全部

$goto_page .= '<a href="' . append_sid("viewtopic.$phpEx?" . POST_TOPIC_URL . "=" . $rows['topic_id'] . "&start=$j") . '">' . $times . '</a>';
謝絕所有私人訊息詢問外掛相關問題
有問題請直接於版上發表, 集思廣議絕對比專挑特定人士詢問來的好

竹貓禁止發表含破解相關的軟體, 違者砍文
不要跟我講別的地方都可以發, 為什麼竹貓就不行
免費不等於破解, 傻傻的搞不清楚
davidhuang
星球公民
星球公民
文章: 33
註冊時間: 2007-01-31 13:29

文章 davidhuang »

~倉木麻衣~ 寫:
davidhuang 寫:發現點擊頁數會出現 "該文章不存在", 比對正確網址跟不正確的如下:

不正確:
viewtopic.php?t=&start=15
正確:
viewtopic.php?t=3520&postdays=0&postorder=asc&start=15

程式要在修改那裡呢?
我上頭修改的程式有個部份沒注意到
請將原文提到要改的toplist.php裡的這行

代碼: 選擇全部

$goto_page .= '<a href="' . append_sid("viewtopic.$phpEx?" . POST_TOPIC_URL . "=" . $topic_id . "&start=$j") . '">' . $times . '</a>';
改成這樣

代碼: 選擇全部

$goto_page .= '<a href="' . append_sid("viewtopic.$phpEx?" . POST_TOPIC_URL . "=" . $rows['topic_id'] . "&start=$j") . '">' . $times . '</a>';
謝謝...您太強了...感恩.............. :-D
主題已鎖定

回到「外掛問題討論」