[問題] top5 v2的問題
版主: 版主管理群
-
madoka0201
- 星球普通子民

- 文章: 13
- 註冊時間: 2004-02-24 00:14
[問題] top5 v2的問題
昨天裝了top5 v2
是裝好了....
可是我發現 HOT 和 TOP 這兩個按了沒反應...
按了之後跟LAST 5一樣...是剛裝的關係?還是有什麼地方有問題
PHPBB版本:2.0.11
網址:http://www.ce.lhu.edu.tw/phpbb2/
請大大幫我看看囉!!
是裝好了....
可是我發現 HOT 和 TOP 這兩個按了沒反應...
按了之後跟LAST 5一樣...是剛裝的關係?還是有什麼地方有問題
PHPBB版本:2.0.11
網址:http://www.ce.lhu.edu.tw/phpbb2/
請大大幫我看看囉!!
猛然發現我已無法沒有妳
-
madoka0201
- 星球普通子民

- 文章: 13
- 註冊時間: 2004-02-24 00:14
-
madoka0201
- 星球普通子民

- 文章: 13
- 註冊時間: 2004-02-24 00:14
-
madoka0201
- 星球普通子民

- 文章: 13
- 註冊時間: 2004-02-24 00:14
-
madoka0201
- 星球普通子民

- 文章: 13
- 註冊時間: 2004-02-24 00:14
剛剛又發現一個問題了....
那個top 5表格上面應該會有'版面''主題''發表人'回覆'觀看'最後發表'
我的會沒出來耶~~
是我動到了什麼嗎??
http://www.ce.lhu.edu.tw/phpbb2/
adv_top5.php的內容
那個top 5表格上面應該會有'版面''主題''發表人'回覆'觀看'最後發表'
我的會沒出來耶~~
是我動到了什麼嗎??
http://www.ce.lhu.edu.tw/phpbb2/
adv_top5.php的內容
代碼: 選擇全部
<?php
/***************************************************************************
* HACK : adv_top5.php
* DESCRIPTION : A MOD to display the top-5 articles
*
* AUTHOR : OOHOO
* VERSION : 2.0
* RELEASE : Monday, Jan 3, 2002
* CONTACT : mchiang@bigpond.net.au
*
***************************************************************************/
/***************************************************************************
*
* 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.
*
***************************************************************************/
$phpbb_root_path = "./";
define('IN_PHPBB', true);
include($phpbb_root_path . 'extension.inc');
include($phpbb_root_path . 'common.'.$phpEx);
//
// 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;
}
//
// Start session management
//
$userdata = session_pagestart($user_ip, PAGE_INDEX, $session_length);
init_userprefs($userdata);
//
// End session management
//
// 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) )
{
echo '<p align="center"><font color="red"><b>ADV_TOP5 MOD ERROR!!</b></font></p>';
exit;
}
// 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 .= ')';
}
// select mode
$mode=$HTTP_GET_VARS['mode'];
switch($mode)
{
case 'last':
$sortby = "topic_last_post_id";
break;
case 'hot':
$sortby = "topic_views";
break;
case 'top':
$sortby = "topic_replies";
break;
default:
$sortby = "topic_last_post_id";
$mode = "last";
break;
}
// nav links
$last_link = ( ($mode == "last") ? "<font style=\"{color: #ff006e}\">[LAST $MAX_TOPICS]</font>" : ('<a href="' . append_sid("adv_top5.$phpEx?mode=last") . '" class="nav">LAST</a>'));
$hot_links = ( ($mode == "hot") ? "<font style=\"{color: #ff006e}\">[HOT $MAX_TOPICS]</font>" : ('<a href="' . append_sid("adv_top5.$phpEx?mode=hot") . '" class="nav">HOT</a>'));
$top_links = ( ($mode == "top") ? "<font style=\"{color: #ff006e}\">[TOP $MAX_TOPICS]</font>" : ('<a href="' . append_sid("adv_top5.$phpEx?mode=top") . '" class="nav">TOP</a>'));
// 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
$sql = "SELECT topic_id, topic_title, topic_poster, topic_views, topic_replies, topic_last_post_id, f.forum_id, forum_name
FROM " . TOPICS_TABLE . " t, " . FORUMS_TABLE . " f
WHERE t.forum_id = f.forum_id
$auth_forums
ORDER BY $sortby 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) )
{
echo '<p align="center"><font color="red"><b>ADV_TOPN_MOD TOPIC_POSTER QUERY ERROR!!</b></font></p>';
exit;
}
$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) )
{
echo '<p align="center"><font color="red"><b>ADV_TOPN_MOD LAST_REPLIER QUERY ERROR!!</b></font></p>';
exit;
}
$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("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
));
}
//
// Generate the page
//
$gen_simple_header = TRUE;
include($phpbb_root_path . 'includes/page_header.'.$phpEx);
$template->pparse("body");
echo "</body></html>";
?>
猛然發現我已無法沒有妳
-
madoka0201
- 星球普通子民

- 文章: 13
- 註冊時間: 2004-02-24 00:14

