第 1 頁 (共 1 頁)
[問題] 推薦網站出現錯誤(已解決)
發表於 : 2005-01-25 17:47
由 黑風凱特
我爬了文
點我
照上面的安裝後,進首頁出現下面的文字
Parse error: parse error, unexpected T_VARIABLE in /home/tssimon/public_html/phpbb/index.php on line 31
我重新照說明上的做法重新修改INDEX.PHP五次了~還是一樣~
如果重新上傳之前未修改的檔就可以確實進入~但換成修改的就不行~
現在網頁我把INDEX還原成之前備份的了,不過下方出現無法顯示區塊~
如果照說明的修改INDEX上傳則會出現\r
Parse error: parse error, unexpected T_VARIABLE in /home/tssimon/public_html/phpbb/index.php on line 31
發表於 : 2005-01-25 18:25
由 赤影
我安裝成功喔!你查一查index.php內有沒有什麼錯誤,例如可能:
1.欠了","
2.複製錯方向,上下掉亂了
3.欠了"{" / "}"
4.欠了開新行!
這是我常常錯的地方~
發表於 : 2005-01-25 18:46
由 黑風凱特
index.php我重新裝了很多次,看了您的回覆後我又重裝了一次~
還是一樣~>"<!
發表於 : 2005-01-26 13:32
由 黑風凱特
請問這個程式碼有規定放在哪嗎??還是在該文件中任一處都行??
我在猜會不會是這個放錯地方~~
導致index.php出錯~
代碼: 選擇全部
#
#-----[ ACTION: OPEN ]------------------------------------------
#
language/lang_chinese_traditional_taiwan/lang_main.php
#
#-----[ ACTION: ADD ]------------------------------------------
#
// Related links
$lang['Site_links'] = "推薦網站";
發表於 : 2005-01-26 16:32
由 小西
// Related links
$lang['Site_links'] = "推薦網站";
放在lang_main.php任何一個地方\r
錯誤應該不是因為這個..
發表於 : 2005-01-26 16:46
由 ~倉木麻衣~
把錯誤程式碼的前後幾行貼出來會比較快~
發表於 : 2005-01-26 17:34
由 黑風凱特
太長了~~我只貼這樣\r
phpbb/index.php
代碼: 選擇全部
/***************************************************************************
*
* 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);
include($phpbb_root_path . "includes/links_constants.$phpEx"); Links_MOD
//
// Start session management
//
$userdata = session_pagestart($user_ip, PAGE_INDEX);
init_userprefs($userdata);
//
// End session management
//
$viewcat = ( !empty($HTTP_GET_VARS[POST_CAT_URL]) ) ? $HTTP_GET_VARS[POST_CAT_URL] : -1;
\r
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( $category_rows[] = $db->sql_fetchrow($result) );
$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;
發表於 : 2005-01-26 17:40
由 ~倉木麻衣~
黑風凱特 寫:太長了~~我只貼這樣\r
phpbb/index.php
代碼: 選擇全部
define('IN_PHPBB', true);
$phpbb_root_path = './';
include($phpbb_root_path . 'extension.inc');
include($phpbb_root_path . 'common.'.$phpEx);
include($phpbb_root_path . "includes/links_constants.$phpEx"); [color=blue]Links_MOD[/color]
//
// Start session management
//
$userdata = session_pagestart($user_ip, PAGE_INDEX);
問題就出在藍色標示的地方..
原本應該是 // Links_MOD 吧?
因為少了 // 註解~所以剖析錯誤
發表於 : 2005-01-26 19:43
由 黑風凱特
成功了~
原來是安裝包裡好像沒加上~
我照論壇上面的就成功了~
謝謝幫忙~