[問題]TOP5 怎隱藏

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

版主: 版主管理群

蕭遙
星球公民
星球公民
文章: 120
註冊時間: 2004-09-29 05:21

文章 蕭遙 »

剛才我裝了一遍,已經可以使用了。

改法是這樣:

代碼: 選擇全部


打開index.php   (指您已經安裝了bu的整合式TOP5的index.php)

找到\r

// 
// Mod setting 
// 
// Topics text length 
$MAX_STR_LEN = 60; 
// Topics to display 
$MAX_TOPICS = 5; 
// 0 => users can see all topics including authorized issue(but they cant read the posts) 
// 1 => users can see only authorized topics 
$AUTH_SECRUITY = 1; 

function cutStr($str) { 

   global $MAX_STR_LEN; 

   $str = (strlen($str) > $MAX_STR_LEN) ? (substr($str, 0, $MAX_STR_LEN - 1) . "...") : $str; 
   return $str; 
}

在其後插入\r

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

$auth_forum_ary = array();

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

if( !$q_forums = $db->sql_query($sql) )
{
	message_die(GENERAL_MESSAGE, 'ADV_TOP5 MOD ERROR!!');
}

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

	if( $is_auth_ary[$forum_id]['auth_read'] == 1)
	{
		array_push($auth_forum_ary, $forum_id);
	}
}

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

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

	$auth_forums .= ')';
}

就可以了
蕭遙
星球公民
星球公民
文章: 120
註冊時間: 2004-09-29 05:21

文章 蕭遙 »

我沒注意,其實那段session是不需要的……index.php裏邊有
reload_yip
星球公民
星球公民
文章: 84
註冊時間: 2004-06-03 23:12
來自: Starry Recollection
聯繫:

文章 reload_yip »

蕭遙 寫:剛才我裝了一遍,已經可以使用了。

改法是這樣:

代碼: 選擇全部


打開index.php   (指您已經安裝了bu的整合式TOP5的index.php)

找到\r

// 
// Mod setting 
// 
// Topics text length 
$MAX_STR_LEN = 60; 
// Topics to display 
$MAX_TOPICS = 5; 
// 0 => users can see all topics including authorized issue(but they cant read the posts) 
// 1 => users can see only authorized topics 
$AUTH_SECRUITY = 1; 

function cutStr($str) { 

   global $MAX_STR_LEN; 

   $str = (strlen($str) > $MAX_STR_LEN) ? (substr($str, 0, $MAX_STR_LEN - 1) . "...") : $str; 
   return $str; 
}

在其後插入\r

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

$auth_forum_ary = array();

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

if( !$q_forums = $db->sql_query($sql) )
{
	message_die(GENERAL_MESSAGE, 'ADV_TOP5 MOD ERROR!!');
}

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

	if( $is_auth_ary[$forum_id]['auth_read'] == 1)
	{
		array_push($auth_forum_ary, $forum_id);
	}
}

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

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

	$auth_forums .= ')';
}

就可以了
加入後....
孌成沒有版面....
只剩下TOP5 ....
圖檔
星之回憶 - Starry Recollection 是一個動漫綜合論壇,有好多動漫畫及音樂下載。

圖檔
鈴月坊 - Cosplay 香港專屬討論區。

圖檔
香港GW論壇 - 討論Gundam Wars 的地方。
蕭遙
星球公民
星球公民
文章: 120
註冊時間: 2004-09-29 05:21

文章 蕭遙 »

我以您的index.php進不去首頁…… 這樣,您將index.php恢復至沒有安裝top5並可正常瀏覽的狀態,然後按步驟重新安裝整合式top5以及我給的代碼,看看行否。另您還裝了什麽在首頁顯示的MOD麽?
reload_yip
星球公民
星球公民
文章: 84
註冊時間: 2004-06-03 23:12
來自: Starry Recollection
聯繫:

文章 reload_yip »

剛試了新的V2版....
也是有bug 存在....
安裝了後 線上人數變了為零。
圖檔
星之回憶 - Starry Recollection 是一個動漫綜合論壇,有好多動漫畫及音樂下載。

圖檔
鈴月坊 - Cosplay 香港專屬討論區。

圖檔
香港GW論壇 - 討論Gundam Wars 的地方。
reload_yip
星球公民
星球公民
文章: 84
註冊時間: 2004-06-03 23:12
來自: Starry Recollection
聯繫:

文章 reload_yip »

蕭遙 寫:我以您的index.php進不去首頁…… 這樣,您將index.php恢復至沒有安裝top5並可正常瀏覽的狀態,然後按步驟重新安裝整合式top5以及我給的代碼,看看行否。另您還裝了什在首頁顯示的MOD?
論壇小幫手
Hide Forum
性別統計
網站連結 Link Mod
User Icon
i-forum icon
i-Forum Access

已嘗試了...也一樣呢...
也是沒有了版面
圖檔
星之回憶 - Starry Recollection 是一個動漫綜合論壇,有好多動漫畫及音樂下載。

圖檔
鈴月坊 - Cosplay 香港專屬討論區。

圖檔
香港GW論壇 - 討論Gundam Wars 的地方。
蕭遙
星球公民
星球公民
文章: 120
註冊時間: 2004-09-29 05:21

文章 蕭遙 »

剛才重新整理了一下,加了個array的還原語句,你看看行不行。

從沒有裝整合式TOP5並且能夠正常訪問首頁的index.php 開始:

打開index.php

找到:

代碼: 選擇全部

//
	// Find which forums are visible for this user
	//
	$is_auth_ary = array();
	$is_auth_ary = auth(AUTH_VIEW, AUTH_LIST_ALL, $userdata, $forum_data);
在其後加入:

代碼: 選擇全部

	// 
  	// TOP5 MOD Begin Edit by XY MOD by OOHOO 
  	// 	

//
// Mod setting
//
// Topics text length
$MAX_STR_LEN = 60;
// Topics to display
$MAX_TOPICS = 5;
// 0 => users can see all topics including authorized issue(but they cant read the posts)
// 1 => users can see only authorized topics
$AUTH_SECRUITY = 1;

function cutStr($str) {

	global $MAX_STR_LEN;

	$str = (strlen($str) > $MAX_STR_LEN) ? (substr($str, 0, $MAX_STR_LEN - 1) . "...") : $str;
	return $str;
}

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

$auth_forum_ary = array();

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

if( !$q_forums = $db->sql_query($sql) )
{
	message_die(GENERAL_MESSAGE, 'ADV_TOP5 MOD ERROR!!');
}

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

	if( $is_auth_ary[$forum_id]['auth_read'] == 1)
	{
		array_push($auth_forum_ary, $forum_id);
	}
}

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

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

	$auth_forums .= ')';
}


// set template
$template->set_filenames(array("body" => "adv_top5_body.tpl"));

$template->assign_vars(array(
	"icon_url" => $images['icon_latest_reply'],
	"icon_alt" => $lang['View_latest_post'],
	"nav_links" => "$last_link  $hot_links  $top_links"
));

// query

$date = time() - ( 7 * 86400 );

$sql = "SELECT t.topic_id, topic_title, topic_poster, topic_views, topic_replies, topic_last_post_id, f.forum_id, forum_name, p.post_time
	FROM " . TOPICS_TABLE . " t, " . FORUMS_TABLE . " f, " . POSTS_TABLE . " p
	WHERE t.forum_id = f.forum_id
	AND t.topic_last_post_id = p.post_id
	AND topic_moved_id = '0'
	AND p.post_time > $date
	$auth_forums
	ORDER BY topic_last_post_id DESC LIMIT 0, $MAX_TOPICS";

if( !$result = $db->sql_query($sql) )
{
	echo '<p align="center"><font color="red"><b>ADV_TOPN_MOD TOPICS QUERY ERROR!!</b></font></p>';
	exit;
}

// 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_MESSAGE, 'ADV_TOP5 MOD TOPIC_POSTER QUERY ERROR!!');
	}

	$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") . '" target="_top">' . "$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_MESSAGE, 'ADV_TOP5 MOD LAST_REPLIER QUERY ERROR!!');
	}

	$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") . '" target="_top">' . "$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("top5row", 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
	));
}

$template->assign_vars(array( 
   'S_CONTENT_DIRECTION' => $lang['DIRECTION'], 
   'S_CONTENT_ENCODING' => $lang['ENCODING'], 

   'T_HEAD_STYLESHEET' => $theme['template_name'] . "/" . $theme['head_stylesheet'], 
   'T_BODY_BGCOLOR' => '#'.$theme['td_color3'], 

   'L_FORUM' => $lang['Forum'], 
   'L_TOPICS' => $lang['Topics'], 
   'L_REPLIES' => $lang['Replies'], 
   'L_AUTHOR' => $lang['Author'], 
   'L_VIEWS' => $lang['Views'], 
   'L_POSTS' => $lang['Posts'], 
   'L_LASTPOST' => $lang['Last_Post'] 
));

	// Return array from TOP5
		
	$is_auth_ary = array();
	$is_auth_ary = auth(AUTH_VIEW, AUTH_LIST_ALL, $userdata, $forum_data);
	
	//\r
	//   TOP5 MOD END EDITED BY XY MOD by OOHOO
	//
打開風格目錄下的index_body.tpl

在合適地方插入:

代碼: 選擇全部


<table width="100%" height="100%" cellpadding="0" cellspacing="0" border="0" style="{background-color: white"> 
  <tr><td height="18" valign="top"><span class="nav">{nav_links}</span></td></tr> 
  <tr> 
    <td valign="top"> 
      <table width="100%" border="0" cellpadding="4" cellspacing="1" width="100%" class="forumline"> 
   <tr> 
     <th align="center" class="thCornerL" width="20%"> {L_FORUM} </th> 
     <th align="center" class="thTop" width="40%"> {L_TOPICS} </th> 
     <th align="center" class="thTop" nowrap>  {L_AUTHOR}  </th> 
     <th align="center" class="thTop" nowrap> {L_REPLIES} </th> 
     <th align="center" class="thTop" nowrap> {L_VIEWS} </th> 
     <th align="center" class="thCornerR" nowrap> {L_LASTPOST} </th> 
   </tr> 
   <!-- BEGIN top5row --> 
        <tr> 
          <td class="row1" nowrap><span class="forumlink"><a href="{top5row.forum_url}" target="_top" class="forumlink">{top5row.forum_name}</a></span></td>        
          <td class="row2" nowrap><span class="topictitle"><a href="{top5row.topic_url}" target="_top" class="topictitle">{top5row.topic}</a></span></td> 
          <td class="row1" align="center" nowrap><span class="name">{top5row.poster_url}</span></td> 
          <td class="row2" align="center" nowrap><span class="postdetails">{top5row.topic_replies}</span></td> 
          <td class="row1" align="center" nowrap><span class="postdetails">{top5row.topic_views}</span></td> 
          <td class="row2" align="center" nowrap><span class="postdetails">{top5row.post_time}<br />{top5row.replier_url} <a href="{top5row.last_post_url}" target="_top"><img src="{icon_url}" border="0" alt="{icon_alt}" /></a></span></td>        
        </tr> 
        <!-- END top5row --> 
      </table> 
    </td>  
  </tr> 
</table>
在我自己機器上測試通過。看看你裝了之後是不是版面還會不見……
reload_yip
星球公民
星球公民
文章: 84
註冊時間: 2004-06-03 23:12
來自: Starry Recollection
聯繫:

文章 reload_yip »

蕭遙 寫:剛才重新整理了一下,加了個array的還原語句,你看看行不行。

從沒有裝整合式TOP5並且能夠正常訪問首頁的index.php 開始:

打開index.php

找到:

代碼: 選擇全部

//
	// Find which forums are visible for this user
	//
	$is_auth_ary = array();
	$is_auth_ary = auth(AUTH_VIEW, AUTH_LIST_ALL, $userdata, $forum_data);
在其後加入:

代碼: 選擇全部

	// 
  	// TOP5 MOD Begin Edit by XY MOD by OOHOO 
  	// 	

//
// Mod setting
//
// Topics text length
$MAX_STR_LEN = 60;
// Topics to display
$MAX_TOPICS = 5;
// 0 => users can see all topics including authorized issue(but they cant read the posts)
// 1 => users can see only authorized topics
$AUTH_SECRUITY = 1;

function cutStr($str) {

	global $MAX_STR_LEN;

	$str = (strlen($str) > $MAX_STR_LEN) ? (substr($str, 0, $MAX_STR_LEN - 1) . "...") : $str;
	return $str;
}

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

$auth_forum_ary = array();

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

if( !$q_forums = $db->sql_query($sql) )
{
	message_die(GENERAL_MESSAGE, 'ADV_TOP5 MOD ERROR!!');
}

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

	if( $is_auth_ary[$forum_id]['auth_read'] == 1)
	{
		array_push($auth_forum_ary, $forum_id);
	}
}

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

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

	$auth_forums .= ')';
}


// set template
$template->set_filenames(array("body" => "adv_top5_body.tpl"));

$template->assign_vars(array(
	"icon_url" => $images['icon_latest_reply'],
	"icon_alt" => $lang['View_latest_post'],
	"nav_links" => "$last_link  $hot_links  $top_links"
));

// query

$date = time() - ( 7 * 86400 );

$sql = "SELECT t.topic_id, topic_title, topic_poster, topic_views, topic_replies, topic_last_post_id, f.forum_id, forum_name, p.post_time
	FROM " . TOPICS_TABLE . " t, " . FORUMS_TABLE . " f, " . POSTS_TABLE . " p
	WHERE t.forum_id = f.forum_id
	AND t.topic_last_post_id = p.post_id
	AND topic_moved_id = '0'
	AND p.post_time > $date
	$auth_forums
	ORDER BY topic_last_post_id DESC LIMIT 0, $MAX_TOPICS";

if( !$result = $db->sql_query($sql) )
{
	echo '<p align="center"><font color="red"><b>ADV_TOPN_MOD TOPICS QUERY ERROR!!</b></font></p>';
	exit;
}

// 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_MESSAGE, 'ADV_TOP5 MOD TOPIC_POSTER QUERY ERROR!!');
	}

	$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") . '" target="_top">' . "$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_MESSAGE, 'ADV_TOP5 MOD LAST_REPLIER QUERY ERROR!!');
	}

	$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") . '" target="_top">' . "$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("top5row", 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
	));
}

$template->assign_vars(array( 
   'S_CONTENT_DIRECTION' => $lang['DIRECTION'], 
   'S_CONTENT_ENCODING' => $lang['ENCODING'], 

   'T_HEAD_STYLESHEET' => $theme['template_name'] . "/" . $theme['head_stylesheet'], 
   'T_BODY_BGCOLOR' => '#'.$theme['td_color3'], 

   'L_FORUM' => $lang['Forum'], 
   'L_TOPICS' => $lang['Topics'], 
   'L_REPLIES' => $lang['Replies'], 
   'L_AUTHOR' => $lang['Author'], 
   'L_VIEWS' => $lang['Views'], 
   'L_POSTS' => $lang['Posts'], 
   'L_LASTPOST' => $lang['Last_Post'] 
));

	// Return array from TOP5
		
	$is_auth_ary = array();
	$is_auth_ary = auth(AUTH_VIEW, AUTH_LIST_ALL, $userdata, $forum_data);
	
	//
	//   TOP5 MOD END EDITED BY XY MOD by OOHOO
	//
打開風格目錄下的index_body.tpl

在合適地方插入:

代碼: 選擇全部


<table width="100%" height="100%" cellpadding="0" cellspacing="0" border="0" style="{background-color: white"> 
  <tr><td height="18" valign="top"><span class="nav">{nav_links}</span></td></tr> 
  <tr> 
    <td valign="top"> 
      <table width="100%" border="0" cellpadding="4" cellspacing="1" width="100%" class="forumline"> 
   <tr> 
     <th align="center" class="thCornerL" width="20%"> {L_FORUM} </th> 
     <th align="center" class="thTop" width="40%"> {L_TOPICS} </th> 
     <th align="center" class="thTop" nowrap>  {L_AUTHOR}  </th> 
     <th align="center" class="thTop" nowrap> {L_REPLIES} </th> 
     <th align="center" class="thTop" nowrap> {L_VIEWS} </th> 
     <th align="center" class="thCornerR" nowrap> {L_LASTPOST} </th> 
   </tr> 
   <!-- BEGIN top5row --> 
        <tr> 
          <td class="row1" nowrap><span class="forumlink"><a href="{top5row.forum_url}" target="_top" class="forumlink">{top5row.forum_name}</a></span></td>        
          <td class="row2" nowrap><span class="topictitle"><a href="{top5row.topic_url}" target="_top" class="topictitle">{top5row.topic}</a></span></td> 
          <td class="row1" align="center" nowrap><span class="name">{top5row.poster_url}</span></td> 
          <td class="row2" align="center" nowrap><span class="postdetails">{top5row.topic_replies}</span></td> 
          <td class="row1" align="center" nowrap><span class="postdetails">{top5row.topic_views}</span></td> 
          <td class="row2" align="center" nowrap><span class="postdetails">{top5row.post_time}<br />{top5row.replier_url} <a href="{top5row.last_post_url}" target="_top"><img src="{icon_url}" border="0" alt="{icon_alt}" /></a></span></td>        
        </tr> 
        <!-- END top5row --> 
      </table> 
    </td>  
  </tr> 
</table>
在我自己機器上測試通過。看看你裝了之後是不是版面還會不見……
裝了後...版面沒有不見...
但"查看誰在線上"的"目前使用者在線上"變了沒有了訪客跟會員....

PS:蕭遙兄MSNM有add 我嗎?
我錯手按了"否"....可以再add 一次嗎? :oops:
圖檔
星之回憶 - Starry Recollection 是一個動漫綜合論壇,有好多動漫畫及音樂下載。

圖檔
鈴月坊 - Cosplay 香港專屬討論區。

圖檔
香港GW論壇 - 討論Gundam Wars 的地方。
蕭遙
星球公民
星球公民
文章: 120
註冊時間: 2004-09-29 05:21

文章 蕭遙 »

繼續作修正(我怎麽縂修正)

index.php 内插入的代碼改成這些:

代碼: 選擇全部



	// 
  	// TOP5 MOD Begin Edit by XY MOD by OOHOO 
  	// 	

//
// Mod setting
//
// Topics text length
$MAX_STR_LEN = 60;
// Topics to display
$MAX_TOPICS = 5;
// 0 => users can see all topics including authorized issue(but they cant read the posts)
// 1 => users can see only authorized topics
$AUTH_SECRUITY = 1;

function cutStr($str) {

	global $MAX_STR_LEN;

	$str = (strlen($str) > $MAX_STR_LEN) ? (substr($str, 0, $MAX_STR_LEN - 1) . "...") : $str;
	return $str;
}

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

$auth_forum_ary = array();

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

if( !$q_forums = $db->sql_query($sql) )
{
	message_die(GENERAL_MESSAGE, 'TOP5 MOD ERROR!!');
}

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

	if( $is_auth_ary[$forum_id1]['auth_read'] == 1)
	{
		array_push($auth_forum_ary, $forum_id1);
	}
}

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

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

	$auth_forums .= ')';
}


// set template

$template->assign_vars(array(
	"icon_url" => $images['icon_latest_reply'],
	"icon_alt" => $lang['View_latest_post'],
));

// query

$date = time() - ( 7 * 86400 );

$sql = "SELECT t.topic_id, topic_title, topic_poster, topic_views, topic_replies, topic_last_post_id, f.forum_id, forum_name, p.post_time
	FROM " . TOPICS_TABLE . " t, " . FORUMS_TABLE . " f, " . POSTS_TABLE . " p
	WHERE t.forum_id = f.forum_id
	AND t.topic_last_post_id = p.post_id
	AND topic_moved_id = '0'
	AND p.post_time > $date
	$auth_forums
	ORDER BY topic_last_post_id DESC LIMIT 0, $MAX_TOPICS";

if( !$result = $db->sql_query($sql) )
{
	echo '<p align="center"><font color="red"><b>TOPN_MOD TOPICS QUERY ERROR!!</b></font></p>';
	exit;
}

// 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_MESSAGE, 'ADV_TOP5 MOD TOPIC_POSTER QUERY ERROR!!');
	}

	$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") . '" target="_top">' . "$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_MESSAGE, 'ADV_TOP5 MOD LAST_REPLIER QUERY ERROR!!');
	}

	$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") . '" target="_top">' . "$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("top5row", 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
	));
}

$template->assign_vars(array( 
   'S_CONTENT_DIRECTION' => $lang['DIRECTION'], 
   'S_CONTENT_ENCODING' => $lang['ENCODING'], 

   'T_HEAD_STYLESHEET' => $theme['template_name'] . "/" . $theme['head_stylesheet'], 
   'T_BODY_BGCOLOR' => '#'.$theme['td_color3'], 

   'L_FORUM' => $lang['Forum'], 
   'L_TOPICS' => $lang['Topics'], 
   'L_REPLIES' => $lang['Replies'], 
   'L_AUTHOR' => $lang['Author'], 
   'L_VIEWS' => $lang['Views'], 
   'L_POSTS' => $lang['Posts'], 
   'L_LASTPOST' => $lang['Last_Post'] 
));

	// Return array from TOP5
		
	$is_auth_ary = array();
	$is_auth_ary = auth(AUTH_VIEW, AUTH_LIST_ALL, $userdata, $forum_data);
	
	//
	//   TOP5 MOD END EDITED BY XY MOD by OOHOO
	//

其他不變
reload_yip
星球公民
星球公民
文章: 84
註冊時間: 2004-06-03 23:12
來自: Starry Recollection
聯繫:

文章 reload_yip »

蕭遙 寫:繼續作修正(我怎縂修正)

index.php 内插入的代碼改成這些:

代碼: 選擇全部



	// 
  	// TOP5 MOD Begin Edit by XY MOD by OOHOO 
  	// 	

//
// Mod setting
//
// Topics text length
$MAX_STR_LEN = 60;
// Topics to display
$MAX_TOPICS = 5;
// 0 => users can see all topics including authorized issue(but they cant read the posts)
// 1 => users can see only authorized topics
$AUTH_SECRUITY = 1;

function cutStr($str) {

	global $MAX_STR_LEN;

	$str = (strlen($str) > $MAX_STR_LEN) ? (substr($str, 0, $MAX_STR_LEN - 1) . "...") : $str;
	return $str;
}

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

$auth_forum_ary = array();

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

if( !$q_forums = $db->sql_query($sql) )
{
	message_die(GENERAL_MESSAGE, 'TOP5 MOD ERROR!!');
}

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

	if( $is_auth_ary[$forum_id1]['auth_read'] == 1)
	{
		array_push($auth_forum_ary, $forum_id1);
	}
}

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

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

	$auth_forums .= ')';
}


// set template

$template->assign_vars(array(
	"icon_url" => $images['icon_latest_reply'],
	"icon_alt" => $lang['View_latest_post'],
));

// query

$date = time() - ( 7 * 86400 );

$sql = "SELECT t.topic_id, topic_title, topic_poster, topic_views, topic_replies, topic_last_post_id, f.forum_id, forum_name, p.post_time
	FROM " . TOPICS_TABLE . " t, " . FORUMS_TABLE . " f, " . POSTS_TABLE . " p
	WHERE t.forum_id = f.forum_id
	AND t.topic_last_post_id = p.post_id
	AND topic_moved_id = '0'
	AND p.post_time > $date
	$auth_forums
	ORDER BY topic_last_post_id DESC LIMIT 0, $MAX_TOPICS";

if( !$result = $db->sql_query($sql) )
{
	echo '<p align="center"><font color="red"><b>TOPN_MOD TOPICS QUERY ERROR!!</b></font></p>';
	exit;
}

// 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_MESSAGE, 'ADV_TOP5 MOD TOPIC_POSTER QUERY ERROR!!');
	}

	$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") . '" target="_top">' . "$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_MESSAGE, 'ADV_TOP5 MOD LAST_REPLIER QUERY ERROR!!');
	}

	$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") . '" target="_top">' . "$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("top5row", 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
	));
}

$template->assign_vars(array( 
   'S_CONTENT_DIRECTION' => $lang['DIRECTION'], 
   'S_CONTENT_ENCODING' => $lang['ENCODING'], 

   'T_HEAD_STYLESHEET' => $theme['template_name'] . "/" . $theme['head_stylesheet'], 
   'T_BODY_BGCOLOR' => '#'.$theme['td_color3'], 

   'L_FORUM' => $lang['Forum'], 
   'L_TOPICS' => $lang['Topics'], 
   'L_REPLIES' => $lang['Replies'], 
   'L_AUTHOR' => $lang['Author'], 
   'L_VIEWS' => $lang['Views'], 
   'L_POSTS' => $lang['Posts'], 
   'L_LASTPOST' => $lang['Last_Post'] 
));

	// Return array from TOP5
		
	$is_auth_ary = array();
	$is_auth_ary = auth(AUTH_VIEW, AUTH_LIST_ALL, $userdata, $forum_data);
	
	//
	//   TOP5 MOD END EDITED BY XY MOD by OOHOO
	//

其他不變
今次終於成功了>"<
感謝蕭遙兄的幫忙呢 :mrgreen:
圖檔
星之回憶 - Starry Recollection 是一個動漫綜合論壇,有好多動漫畫及音樂下載。

圖檔
鈴月坊 - Cosplay 香港專屬討論區。

圖檔
香港GW論壇 - 討論Gundam Wars 的地方。
bu
版面管理員
版面管理員
文章: 443
註冊時間: 2003-02-23 12:46
來自: 25° 4′N 121° 29′E
聯繫:

文章 bu »

但是新安裝的,還是可以用 整合式 TOP5 V2 喔
而且我試的時候,是可以的啊 @@"
*譯文資料在phpBB 技術文件
bu.femto-size
*和我聯絡,請寄 or Google Talk 圖檔
*作品: Intergrated Toplist & Message Can
蕭遙
星球公民
星球公民
文章: 120
註冊時間: 2004-09-29 05:21

文章 蕭遙 »

我用top5V2就無法在top5裏隱藏秘密版面的帖子…… 一定要改了才可以……
。。鳳凰寺 風。。
星球公民
星球公民
文章: 91
註冊時間: 2004-09-17 04:48
聯繫:

文章 。。鳳凰寺 風。。 »

剛剛看了你們上面的文章,
結果我稍微做了一點改變,
其實蕭遙不用改這麼多~
下面是我的改法~我是用2版的
Top5 2.1.0

這是原作者的改法
打開index_body.tpl(在適當處加入~)

代碼: 選擇全部

<iframe marginwidth=0 marginheight=0 src='adv_top5.php' frameborder=0 width='100%' scrolling=no height=250> 
</iframe>
然後這我自己的改法
打開index_body.tpl(在適當處加入~)

代碼: 選擇全部

<!-- BEGIN switch_user_logged_in --> 
<iframe marginwidth=0 marginheight=0 src='adv_top5.php' frameborder=0 width='100%' scrolling=no height=250> 
</iframe> 
<!-- END switch_user_logged_out -->
結果是必須登入後才能看到TOP 5,希望有幫到你們~
因為這是我第一次改,如果有錯的話,請多指教(有在我網頁測試過了,行得通~)
如果驕傲沒被現實大海冷冷拍響,又怎會懂得要多努力才走得到遠方;
如果夢想不曾墜落懸崖千均一髮,又怎會曉得執著的人擁有隱形翅膀。
reload_yip
星球公民
星球公民
文章: 84
註冊時間: 2004-06-03 23:12
來自: Starry Recollection
聯繫:

文章 reload_yip »

我們不是用 iframe 的~
adv_top5.php <------ 不是用這運作
而是在index.php 加入Top5 的字碼\r
所以你的改法不適合整合式Top5
圖檔
星之回憶 - Starry Recollection 是一個動漫綜合論壇,有好多動漫畫及音樂下載。

圖檔
鈴月坊 - Cosplay 香港專屬討論區。

圖檔
香港GW論壇 - 討論Gundam Wars 的地方。
。。鳳凰寺 風。。
星球公民
星球公民
文章: 91
註冊時間: 2004-09-17 04:48
聯繫:

文章 。。鳳凰寺 風。。 »

不好意思~剛剛沒看清楚上面寫"整合式TOP5"
我這是用南宮博士改的,不過我已經找不到文章了@@
如果驕傲沒被現實大海冷冷拍響,又怎會懂得要多努力才走得到遠方;
如果夢想不曾墜落懸崖千均一髮,又怎會曉得執著的人擁有隱形翅膀。
主題已鎖定

回到「外掛問題討論」