[問題]top5

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

版主: 版主管理群

主題已鎖定
eduyian
星球公民
星球公民
文章: 177
註冊時間: 2004-09-16 16:44
來自: TET千里馬國際團隊
聯繫:

[問題]top5

文章 eduyian »

有適合 phpBB 2.0.10 使用的Top 5嗎?
一直裝失敗..........不知道是否版本不適用?
圖檔
●架設主機作業系統:Windows XP SP2
●我的上網方式:東森寬頻Cable
●我安裝的程式:Apache 2.44a+ PHP Version 4.3.10 + MySQL 版本 4.1.7 + phpMyAdmin 2.6.1-rc2
●我的 phpBB2 版本:phpBB2plus 2.0.21
頭像
ksbank
星球公民
星球公民
文章: 52
註冊時間: 2004-10-10 06:39
聯繫:

文章 ksbank »

請見
http://phpbb-tw.net/phpbb/viewtopic.php ... p5_mod_2.1

範例可以到我的網站上看看喔~~
不過沒註冊的話好像會看到廣告.....
我的論壇:http://members.lycos.co.uk/ksbank/
我的論壇空間:http://www.tripod.lycos.co.uk/
我的php版本:phpBB2.011
目前安裝外掛:●Cashmod221●birthday_1.5.6em●虛擬銀行●adv_top5_mod_2.1●快速回覆●主題類型●性別●會員閃光名稱●虛擬形象●竹貓公告條●Select Expand BBcodes
目前安裝風格:◎iCGstation◎bbnewhero
~~新手上陣!!請多多指教~~
eduyian
星球公民
星球公民
文章: 177
註冊時間: 2004-09-16 16:44
來自: TET千里馬國際團隊
聯繫:

文章 eduyian »

ksbank 寫:請見
http://phpbb-tw.net/phpbb/viewtopic.php ... p5_mod_2.1

範例可以到我的網站上看看喔~~
不過沒註冊的話好像會看到廣告.....
大大 :
感恩~已經成功 !!
幫我看一下效果如何?
http://eduyian.no-ip.com/
圖檔
●架設主機作業系統:Windows XP SP2
●我的上網方式:東森寬頻Cable
●我安裝的程式:Apache 2.44a+ PHP Version 4.3.10 + MySQL 版本 4.1.7 + phpMyAdmin 2.6.1-rc2
●我的 phpBB2 版本:phpBB2plus 2.0.21
頭像
sh85216s
竹貓忠實會員
竹貓忠實會員
文章: 306
註冊時間: 2003-09-04 20:13
來自: 阿里阿度

文章 sh85216s »

90分,背景色沒有處理好!!
架設主機︰Fedora Core 5
上網方式:Hinet ADSL (2M/512K)
安裝程式:Apache + php + MySql
phpBB2 版本: phpBB 2.0.21
phpBB2 連結網址: 小站
eduyian
星球公民
星球公民
文章: 177
註冊時間: 2004-09-16 16:44
來自: TET千里馬國際團隊
聯繫:

文章 eduyian »

sh85216s 寫:90分,背景色沒有處理好!!
大大可以教我如何設定嗎?
圖檔
●架設主機作業系統:Windows XP SP2
●我的上網方式:東森寬頻Cable
●我安裝的程式:Apache 2.44a+ PHP Version 4.3.10 + MySQL 版本 4.1.7 + phpMyAdmin 2.6.1-rc2
●我的 phpBB2 版本:phpBB2plus 2.0.21
eduyian
星球公民
星球公民
文章: 177
註冊時間: 2004-09-16 16:44
來自: TET千里馬國際團隊
聯繫:

文章 eduyian »

裝是裝成功了....
不過左點 最佳人氣 最多回覆
時並沒有效果!

請大大救我!!

代碼: 選擇全部

<?php
/***************************************************************************
 *                               adv_top5.php
 *                            -------------------
 *  Contains GPL code copyright of phpBB group.
 *
 *  MOD Name: Top5 topics
 *  Author: OOHOO
 *  Version: 1.x.x for phpBB 2 Beta serial
 *  Version: 2.0.0 for phpBB 2 RC serial
 *  Version: 2.1.0 for phpBB 2.0.0
 *
 ***************************************************************************/

/***************************************************************************
 *
 *   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);

//
// Mod setting
//
// Topics text length
$MAX_STR_LEN = 50;
// 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;
}

//
// gzip_compression
//
$do_gzip_compress = FALSE;
if($board_config['gzip_compress'])
{
	$phpver = phpversion();

	if($phpver >= "4.0.4pl1")
	{
		if(extension_loaded("zlib"))
		{
			ob_start("ob_gzhandler");
		}
	}
\n	else if($phpver > "4.0")
	{
		if(strstr($HTTP_SERVER_VARS['HTTP_ACCEPT_ENCODING'], 'gzip'))
		{
			if(extension_loaded("zlib"))
			{
				$do_gzip_compress = TRUE;
				ob_start();
				ob_implicit_flush(0);

				header("Content-Encoding: gzip");
			}
		}
	}
}

header ("Cache-Control: no-store, no-cache, must-revalidate");
header ("Cache-Control: pre-check=0, post-check=0, max-age=0", false);
header ("Pragma: no-cache");
header ("Expires: " . gmdate("D, d M Y H:i:s", time()) . " GMT");
header ("Last-Modified: " . gmdate("D, d M Y H:i:s") . " GMT");


//
// 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) )
{
	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 .= ')';
}

// 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: #ff0000}\"><<最新文章 $MAX_TOPICS>></font>" : ('<a href="' . append_sid("adv_top5.$phpEx?mode=last") . '" class="nav">最新文章</a>')); 
$hot_links = ( ($mode == "hot") ? "<font style=\"{color: #ff0000}\"> 最佳人氣 $MAX_TOPICS </font>" : ('<a href="' . append_sid("adv_top5.$phpEx?mode=hot") . '" class="nav">最佳人氣</a>')); 
$top_links = ( ($mode == "top") ? "<font style=\"{color: #ff0000}\"> 最多回覆 $MAX_TOPICS </font>" : ('<a href="' . append_sid("adv_top5.$phpEx?mode=top") . '" class="nav">最多回覆</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
	AND topic_moved_id = '0'
	$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) )
	{
		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("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
	));
}

$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'] 
));


//
// Generate the page
//
//$gen_simple_header = TRUE;

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

$template->pparse("body");

$db->sql_close();
//
// Compress buffered output if required
// and send to browser
//
if($do_gzip_compress)
{
	//\r
	// Borrowed from php.net!
	//
	$gzip_contents = ob_get_contents();
	ob_end_clean();

	$gzip_size = strlen($gzip_contents);
	$gzip_crc = crc32($gzip_contents);

	$gzip_contents = gzcompress($gzip_contents, 9);
	$gzip_contents = substr($gzip_contents, 0, strlen($gzip_contents) - 4);

	echo "\x1f\x8b\x08\x00\x00\x00\x00\x00";
	echo $gzip_contents;
	echo pack("V", $gzip_crc);
	echo pack("V", $gzip_size);
}

exit;
?>
http://eduyian.no-ip.com/
圖檔
●架設主機作業系統:Windows XP SP2
●我的上網方式:東森寬頻Cable
●我安裝的程式:Apache 2.44a+ PHP Version 4.3.10 + MySQL 版本 4.1.7 + phpMyAdmin 2.6.1-rc2
●我的 phpBB2 版本:phpBB2plus 2.0.21
神川小羽
調皮の小羽
調皮の小羽
文章: 1461
註冊時間: 2004-05-01 05:55
來自: 謎樣之筱語
聯繫:

文章 神川小羽 »

由phpBB 使用問答區 移動到 外掛區去嚕~~~
-.-
頭像
gaia_hwang
星球普通子民
星球普通子民
文章: 14
註冊時間: 2004-02-10 15:33
來自: Taiepi City
聯繫:

文章 gaia_hwang »

http://phpbb-tw.net/phpbb/viewtopic.php ... &start=105
kaija 曾回應過

你可能裝了php 4.2.x之後的版本
這個版本之後傳變數不能直接傳
你在adv_top5.php的第145行附近找一下
有一行的註解是
// select mode
在這行之後加上底下這行程式就可以了
$mode=$HTTP_GET_VARS['mode'];
== 黃正文 Jenq-Wen Hwang == [ 網路環境教育工作者/電腦教學/電腦維護/網站製作/耶和華見證人 ]
-- 環保生活資訊網 http://gaia.org.tw 告訴您如何和大地之母(Gaia蓋婭)好好相處
-- 淨柳工作室(網站工作中心)/小太陽家族(家庭生活中心) http://www.gaia.idv.tw
主題已鎖定

回到「外掛問題討論」