1 頁 (共 1 頁)

[問題] 主題類型分區劃 語法錯誤求助 (已解決)

發表於 : 2005-11-17 17:23
kkt
問題外掛:

http://wang5555.dnsfor.me/phpbb2/dload.php? ... file_id=24

## 外掛名稱: 主題類型分區劃 (資料庫版 by Martinet)
## 外掛版本: 1.0.3
## 外掛原作者: 炎之虛空(御津闇慈)
## 外掛資料庫化 : Martinet Oaf <oafwork@hotmail.com>

=============================================
安裝後控制台 error 訊息\r

Parse error: parse error, unexpected T_CONSTANT_ENCAPSED_STRING in /home/kktadmin/domains/kktfriend.com/public_html/phpBB2/admin/admin_forums.php on line 400
=============================================

我打開 admin_forums.php
找到第 400 行

代碼: 選擇全部

$sql = "INSERT INTO " . FORUMS_TABLE . " (forum_id, forum_name, cat_id, forum_desc, forum_order, forum_status, prune_enable, forum_topictypes" . $field_sql . ")
				VALUES ('" . $next_id . "', '" . str_replace("\'", "''", $HTTP_POST_VARS['forumname']) . "', " . intval($HTTP_POST_VARS[POST_CAT_URL]) . ", '" . str_replace("\'", "''", $HTTP_POST_VARS['forumdesc']) . "', $next_order, " . intval($HTTP_POST_VARS['forumstatus']) . ", " . intval($HTTP_POST_VARS['prune_enable']) ",'".str_replace("\'", "''", $HTTP_POST_VARS['topictypes'])."'".. $value_sql . ")";

============================================

原文安裝指示\r

代碼: 選擇全部

?#123;式碼:
$sql = "INSERT INTO " . FORUMS_TABLE . " (forum_id, forum_name, cat_id, forum_desc, forum_order, forum_status, prune_enable" . $field_sql . ") 
   VALUES ('" . $next_id . "', '" . str_replace("\'", "''", $HTTP_POST_VARS['forumname']) . "', " . intval($HTTP_POST_VARS[POST_CAT_URL]) . ", '" . str_replace("\'", "''", $HTTP_POST_VARS['forumdesc']) . "', $next_order, " . intval($HTTP_POST_VARS['forumstatus']) . ", " . intval($HTTP_POST_VARS['prune_enable']) . $value_sql . ")";

在行內找到 

?#123;式碼:
prune_enable

後面?#91;上 

?#123;式碼:
, forum_topictypes

在行內找到 

?#123;式碼:
$value_sql

前面?#91;上 

?#123;式碼:
",'".str_replace("\'", "''", $HTTP_POST_VARS['topictypes'])."'".

請看懂的大大幫助看看可以嗎? 多謝幫忙!!









.

發表於 : 2005-11-17 17:32
~倉木麻衣~
從這句來看

代碼: 選擇全部

. intval($HTTP_POST_VARS['prune_enable']) ",'".str_replace("\'", "''", $HTTP_POST_VARS['topictypes'])."'".. $value_sql . ")";
可以知道你將這段代碼\r

在行內找到

代碼: 選擇全部

$value_sql 
前面加上

代碼: 選擇全部

",'".str_replace("\'", "''", $HTTP_POST_VARS['topictypes'])."'".
弄成了 . $value_sql

發表於 : 2005-11-17 17:49
kkt
~倉木麻衣~大大, 我把那 [.] 刪去後, 仍是上邊error 訊息, 還是不行.

代碼: 選擇全部

				VALUES ('" . $next_id . "', '" . str_replace("\'", "''", $HTTP_POST_VARS['forumname']) . "', " . intval($HTTP_POST_VARS[POST_CAT_URL]) . ", '" . str_replace("\'", "''", $HTTP_POST_VARS['forumdesc']) . "', $next_order, " . intval($HTTP_POST_VARS['forumstatus']) . ", " . intval($HTTP_POST_VARS['prune_enable']) "",'".str_replace("\'", "''", $HTTP_POST_VARS['topictypes'])."'". $value_sql . ")";
			

發表於 : 2005-11-17 17:53
心靈捕手
kkt 寫:~倉木麻衣~大大, 我把那 [.] 刪去後, 仍是上邊error 訊息, 還是不行.

代碼: 選擇全部

				VALUES ('" . $next_id . "', '" . str_replace("\'", "''", $HTTP_POST_VARS['forumname']) . "', " . intval($HTTP_POST_VARS[POST_CAT_URL]) . ", '" . str_replace("\'", "''", $HTTP_POST_VARS['forumdesc']) . "', $next_order, " . intval($HTTP_POST_VARS['forumstatus']) . ", " . intval($HTTP_POST_VARS['prune_enable']) "",'".str_replace("\'", "''", $HTTP_POST_VARS['topictypes'])."'". $value_sql . ")";
			
引言部份以下列語法取代, 試試看:

代碼: 選擇全部

				VALUES ('" . $next_id . "', '" . str_replace("\'", "''", $HTTP_POST_VARS['forumname']) . "', " . intval($HTTP_POST_VARS[POST_CAT_URL]) . ", '" . str_replace("\'", "''", $HTTP_POST_VARS['forumdesc']) . "', $next_order, " . intval($HTTP_POST_VARS['forumstatus']) . ", " . intval($HTTP_POST_VARS['prune_enable']) . ",'".str_replace("\'", "''", $HTTP_POST_VARS['topictypes'])."'". $value_sql . ")";

發表於 : 2005-11-17 18:11
kkt
老師, 大大..

後台版面正常了, 但卻找不到主題選項.

我在找原因
這句 SQL 我把[等你改] 更改為 [222] 沒關系吧!!

ALTER TABLE `phpbb_forums` ADD `forum_topictypes` VARCHAR( 255 ) DEFAULT '[等你改],[]' NOT NULL

發表於 : 2005-11-17 18:14
kkt
噢..抱歉, 知道了, 在SQL 修改 .多謝老師 及~倉木麻衣~大大

發表於 : 2005-11-17 23:09
心靈捕手
kkt 寫:噢..抱歉, 知道了, 在SQL 修改 .多謝老師 及~倉木麻衣~大大
" 在SQL 修改"? :-o
不用這麼麻煩!

如果安裝正確的話, 那麼可以直接在後台更改.

控制台-> 版面管理-> 管理選項-> 建立新版面或編輯舊版面( 如下圖: 編輯" 會員須知" 版面)-> 這個版面的主題類型

圖檔

圖檔

發表於 : 2005-11-18 12:39
kkt
多謝捕手老師, 這後來知道了. 建議最好在原外掛加入說明, 可造福更多新手.

多謝所有大大!!

發表於 : 2005-11-18 20:07
*tytsim*
如可以像phpwind一樣可以按一按就可以找到某一個分類(p.s 在文章列表內[viewforum.php])