參考連結:
簡子版
http://phpbb-tw.net/phpbb/viewtopic.php?t=33019
i-Portal
沒有...............................................
使用版本:phpBB2.0.13
網站位置:http://ss.199mb.com/
狀況描述:
裝了i-portal之後....不是是不是因為簡子版更改了function.php,
進入portal時會說\r
代碼: 選擇全部
Fatal error: Call to a member function on a non-object in /home/vhosts/ss.199mb.com/portal.php on line 102portal.php檔 (紅色字的是第102行)
代碼: 選擇全部
<?php
/***************************************************************************
* portal.php
* -------------------
* begin : 2004/7/25
* copyright : Ray (C) 2003,2004 iOptional
* email : blue_sky_ray02@hotmail.com
*
* $Id: portal.php,v 2.1.7 2004/7/25, 20:21 Ray 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);
// 顯示公告的版面ID
$PORTAL['portal_announce_forum'] = '1';
// 主題的長度
$PORTAL['max_len'] = 35;
// 顯示主題的數目\r
$PORTAL['max_topic'] = 10;
//
// Start session management
//
$userdata = session_pagestart($user_ip, PAGE_LOGIN);
init_userprefs($userdata);
//
// End session management
//
//
// 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');
$total_topics = get_db_stat('topiccount');
$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
{
\n $l_total_user_s = $lang['Registered_users_total'];
}
function cutStr($top_str) {
global $PORTAL;
$max_len = $PORTAL['max_len'];
$top_str = (strlen($top_str) > $max_len) ? (substr($top_str, 0, $max_len - 1) . "... more") : $top_str;
return $top_str;
}
$sql = "SELECT forum_id, topic_id, topic_title, topic_time, topic_replies, topic_views
FROM " . TOPICS_TABLE . " t
WHERE forum_id = " . $PORTAL['portal_announce_forum'] . "
ORDER BY topic_last_post_id DESC LIMIT 0, " . $PORTAL['max_topic'];
if( !$result = $db->sql_query($sql) )
{
echo '<p align="center"><font color="red"><b>ADV_TOPN_MOD TOPICS QUERY ERROR!!</b></font></p>';
}
while( $rows = $db->sql_fetchrow($result) )
{
$topic_url = append_sid("viewtopic.$phpEx?t=" . $rows['topic_id']);
$last_post_url = append_sid("viewtopic.$phpEx?p=$topic_last_post_id#$topic_last_post_id");
[color=red]$template->assign_block_vars("announce", array([/color]
"replies" => $rows['topic_replies'],
"views" => $rows['topic_views'],
"topic" => cutStr($rows['topic_title']),
"topic_url" => $topic_url,
"last_post_url" => $last_post_url,
"topic_time" => create_date('Y-m-d G:i', $rows['topic_time'], $board_config['board_timezone'])
));
}
$db->sql_freeresult($result);
$sql = "SELECT forum_id, topic_id, topic_title, topic_time, topic_replies, topic_views
FROM " . TOPICS_TABLE . " t
WHERE forum_id <> " . $PORTAL['portal_announce_forum'] . "
ORDER BY topic_last_post_id DESC LIMIT 0, " . $PORTAL['max_topic'];
if( !$result = $db->sql_query($sql) )
{
echo '<p align="center"><font color="red"><b>ADV_TOPN_MOD TOPICS QUERY ERROR!!</b></font></p>';
}
while( $rows = $db->sql_fetchrow($result) )
{
$topic_url = append_sid("viewtopic.$phpEx?t=" . $rows['topic_id']);
$last_post_url = append_sid("viewtopic.$phpEx?p=$topic_last_post_id#$topic_last_post_id");
$template->assign_block_vars("newtopic", array(
"replies" => $rows['topic_replies'],
"views" => $rows['topic_views'],
"topic" => cutStr($rows['topic_title']),
"topic_url" => $topic_url,
"last_post_url" => $last_post_url,
"topic_time" => create_date('Y-m-d G:i', $rows['topic_time'], $board_config['board_timezone'])
));
}
$db->sql_freeresult($result);
//
// Start output of page
//
define('SHOW_ONLINE', true);
$page_title = $lang['Home'];
include($phpbb_root_path . 'includes/page_header.'.$phpEx);
$template->set_filenames(array(
'body' => 'portal_index_body.tpl',
'announce' => 'portal_announce_body.tpl',
'links' => 'portal_links_body.tpl')
);
$template->assign_vars(array(
'L_TITLE' => $lang['Topic'],
'L_REPLIES' => $lang['Replies'],
'L_VIEWS' => $lang['Views'],
'L_TIMES' => $lang['Posted'],
'TOTAL_POSTS' => sprintf($l_total_post_s, $total_posts),
'TOTAL_USERS' => sprintf($l_total_user_s, $total_users),
'TOTAL_TOPICS' => sprintf($lang['total_topics'], $total_topics),
'NEWEST_USER' => sprintf($lang['Newest_user'], '<a href="' . append_sid("profile.$phpEx?mode=viewprofile&" . POST_USERS_URL . "=$newest_uid") . '">', $newest_user, '</a>'),
'L_FORUM' => $lang['Forum'],
'L_BOARD_NAVIGATION' => $lang['Board_navigation'],
'L_STATISTICS' => $lang['Statistics'],
'L_ANNOUNCEMENT' => $lang['Forum_announce'],
'L_NEW_ANNOUNCE' => $lang['Recent_announce'],
'L_NEW_TOPIC' => $lang['Recent_topic'],
'L_MAINMENU' => $lang['mainmenu'])
);
$template->assign_var_from_handle('ANNOUNCE', 'announce');
$template->assign_var_from_handle('LINKS', 'links');
//
// Generate the page
//
$template->pparse('body');
include($phpbb_root_path . 'includes/page_tail.'.$phpEx);
?>補充:
裝了以下外掛...
Cash Mod 2.2.2
Attach Mod 2.3.11
簡易子版面 1.0.0
and some of other should not 跟這問題有關
