[程式碼錯誤]hierarchie

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

版主: 版主管理群

主題已鎖定
william91
竹貓忠實會員
竹貓忠實會員
文章: 642
註冊時間: 2003-04-16 20:53
來自: 牛牛農場
聯繫:

[程式碼錯誤]hierarchie

文章 william91 »

問題外掛:hierarchie
參考連結:http://www.phpbb.com/phpBB/viewtopic.php?t=42505
使用版本:phpBB 2.0.4
網站位置:http://ppbc.hk.st
狀況描述: 我照安裝指引, 在index.php 中加入\r
[php]<?php

//
// get the hierarchie
//

$sql = "SELECT concat(c.cat_title, ', ', f.forum_name) AS hierarchie_title, f.forum_id, f.forum_hier_level + 1 AS hierarchie_level
FROM " . CATEGORIES_TABLE . " c, " . CAT_REL_CAT_PARENTS_TABLE . " ccp, " . FORUMS_TABLE . " f, " . CAT_REL_FORUM_PARENTS_TABLE . " cfp
WHERE ccp.parent_cat_id = c.cat_id
AND ccp.cat_id = $cat_id
AND cfp.parent_forum_id = f.forum_id
AND cfp.cat_id = $cat_id
ORDER BY c.cat_hier_level, f.forum_hier_level";

if( !($result = $db->sql_query($sql)) )
{
message_die(GENERAL_ERROR, 'Could not query hierarchie title', '', __LINE__, __FILE__, $sql);
}
while( $row = $db->sql_fetchrow($result) )
{
$template->assign_block_vars("navrow", array(
'U_SUBINDEX' => append_sid("index.$phpEx?" . POST_HIERARCHIE_URL . "=" . $row['hierarchie_level'] . "&" . POST_PARENTFORUM_URL . "=" . $row['forum_id']),
'L_SUBINDEX' => $row['hierarchie_title'])
);
}


//
// Get the categorie title
//

$sql = "SELECT cat_title
FROM " . CATEGORIES_TABLE . "
WHERE cat_id = $cat_id";

if( !($result = $db->sql_query($sql)) )
{
message_die(GENERAL_ERROR, 'Could not query categorie title', '', __LINE__, __FILE__, $sql);
}
$row = $db->sql_fetchrow($result);
$cf_title = $row['cat_title'] . ", " . $forum_name;
?>[/php]

後來便出現:

代碼: 選擇全部

Could not query superior forums of new topic information

DEBUG MODE

SQL Error : 1146 Table '[color=#ff0008]phpbb.cat_rel_forum_parents_table[/color]' doesn't exist

SELECT f.forum_id, cfp.parent_forum_id FROM phpbb_forums f, CAT_REL_FORUM_PARENTS_TABLE cfp WHERE f.forum_id IN ( 24 , 3 , 25 , 3 , 3 , 3 , 15 ) AND f.cat_id = cfp.cat_id

Line : 336
File : c:\appserv\www\phpbb\index.php
他顯示我 "phpbb.cat_rel_forum_parents_table"這個資料表未建立, 但應該讀取"phpbb_cat_rel_forum_parents_table", 是安裝檔內的問題嗎?
補充:
http://william91.myftp.org/phpbb/mods.php
間中上來走走吧~
御津闇慈
竹貓忠實會員
竹貓忠實會員
文章: 645
註冊時間: 2001-11-17 10:59

Re: [程式碼錯誤]hierarchie

文章 御津闇慈 »

william91 寫:問題外掛:hierarchie
參考連結:http://www.phpbb.com/phpBB/viewtopic.php?t=42505
使用版本:phpBB 2.0.4
網站位置:http://ppbc.hk.st
狀況描述: 我照安裝指引, 在index.php 中加入\r
[php]<?php

//
// get the hierarchie
//

$sql = "SELECT concat(c.cat_title, ', ', f.forum_name) AS hierarchie_title, f.forum_id, f.forum_hier_level + 1 AS hierarchie_level
FROM " . CATEGORIES_TABLE . " c, " . CAT_REL_CAT_PARENTS_TABLE . " ccp, " . FORUMS_TABLE . " f, " . CAT_REL_FORUM_PARENTS_TABLE . " cfp
WHERE ccp.parent_cat_id = c.cat_id
AND ccp.cat_id = $cat_id
AND cfp.parent_forum_id = f.forum_id
AND cfp.cat_id = $cat_id
ORDER BY c.cat_hier_level, f.forum_hier_level";

if( !($result = $db->sql_query($sql)) )
{
message_die(GENERAL_ERROR, 'Could not query hierarchie title', '', __LINE__, __FILE__, $sql);
}
while( $row = $db->sql_fetchrow($result) )
{
$template->assign_block_vars("navrow", array(
'U_SUBINDEX' => append_sid("index.$phpEx?" . POST_HIERARCHIE_URL . "=" . $row['hierarchie_level'] . "&" . POST_PARENTFORUM_URL . "=" . $row['forum_id']),
'L_SUBINDEX' => $row['hierarchie_title'])
);
}


//
// Get the categorie title
//

$sql = "SELECT cat_title
FROM " . CATEGORIES_TABLE . "
WHERE cat_id = $cat_id";

if( !($result = $db->sql_query($sql)) )
{
message_die(GENERAL_ERROR, 'Could not query categorie title', '', __LINE__, __FILE__, $sql);
}
$row = $db->sql_fetchrow($result);
$cf_title = $row['cat_title'] . ", " . $forum_name;
?>[/php]

後來便出現:

代碼: 選擇全部

Could not query superior forums of new topic information

DEBUG MODE

SQL Error : 1146 Table '[color=#ff0008]phpbb.cat_rel_forum_parents_table[/color]' doesn't exist

SELECT f.forum_id, cfp.parent_forum_id FROM phpbb_forums f, CAT_REL_FORUM_PARENTS_TABLE cfp WHERE f.forum_id IN ( 24 , 3 , 25 , 3 , 3 , 3 , 15 ) AND f.cat_id = cfp.cat_id

Line : 336
File : c:\appserv\www\phpbb\index.php
他顯示我 "phpbb.cat_rel_forum_parents_table"這個資料表未建立, 但應該讀取"phpbb_cat_rel_forum_parents_table", 是安裝檔內的問題嗎?
補充:
http://william91.myftp.org/phpbb/mods.php
先執行下列sql語法

代碼: 選擇全部

ALTER TABLE phpbb_categories
ADD parent_forum_id SMALLINT(5) UNSIGNED DEFAULT '0' NOT NULL,
ADD cat_hier_level TINYINT UNSIGNED DEFAULT '0' NOT NULL;


ALTER TABLE phpbb_forums
ADD forum_hier_level TINYINT UNSIGNED DEFAULT '0' NOT NULL AFTER forum_last_post_id,
ADD forum_issub TINYINT(1) DEFAULT '0' NOT NULL AFTER forum_hier_level;


CREATE TABLE phpbb_cat_rel_cat_parents (
cat_id mediumint(8) unsigned NOT NULL default '0',
parent_cat_id mediumint(8) unsigned NOT NULL default '0',
PRIMARY KEY  (cat_id,parent_cat_id)
);

CREATE TABLE phpbb_cat_rel_forum_parents (
cat_id mediumint(8) unsigned NOT NULL default '0',
parent_forum_id smallint(5) unsigned NOT NULL default '0',
PRIMARY KEY  (cat_id,parent_forum_id)
);
我到現在還搞不清楚怎麼用~"~
william91
竹貓忠實會員
竹貓忠實會員
文章: 642
註冊時間: 2003-04-16 20:53
來自: 牛牛農場
聯繫:

Re: [程式碼錯誤]hierarchie

文章 william91 »

御津闇慈 寫:
william91 寫:問題外掛:hierarchie
參考連結:http://www.phpbb.com/phpBB/viewtopic.php?t=42505
使用版本:phpBB 2.0.4
網站位置:http://ppbc.hk.st
狀況描述: 我照安裝指引, 在index.php 中加入\r
[php]<?php

//
// get the hierarchie
//

$sql = "SELECT concat(c.cat_title, ', ', f.forum_name) AS hierarchie_title, f.forum_id, f.forum_hier_level + 1 AS hierarchie_level
FROM " . CATEGORIES_TABLE . " c, " . CAT_REL_CAT_PARENTS_TABLE . " ccp, " . FORUMS_TABLE . " f, " . CAT_REL_FORUM_PARENTS_TABLE . " cfp
WHERE ccp.parent_cat_id = c.cat_id
AND ccp.cat_id = $cat_id
AND cfp.parent_forum_id = f.forum_id
AND cfp.cat_id = $cat_id
ORDER BY c.cat_hier_level, f.forum_hier_level";

if( !($result = $db->sql_query($sql)) )
{
message_die(GENERAL_ERROR, 'Could not query hierarchie title', '', __LINE__, __FILE__, $sql);
}
while( $row = $db->sql_fetchrow($result) )
{
$template->assign_block_vars("navrow", array(
'U_SUBINDEX' => append_sid("index.$phpEx?" . POST_HIERARCHIE_URL . "=" . $row['hierarchie_level'] . "&" . POST_PARENTFORUM_URL . "=" . $row['forum_id']),
'L_SUBINDEX' => $row['hierarchie_title'])
);
}


//
// Get the categorie title
//

$sql = "SELECT cat_title
FROM " . CATEGORIES_TABLE . "
WHERE cat_id = $cat_id";

if( !($result = $db->sql_query($sql)) )
{
message_die(GENERAL_ERROR, 'Could not query categorie title', '', __LINE__, __FILE__, $sql);
}
$row = $db->sql_fetchrow($result);
$cf_title = $row['cat_title'] . ", " . $forum_name;
?>[/php]

後來便出現:

代碼: 選擇全部

Could not query superior forums of new topic information

DEBUG MODE

SQL Error : 1146 Table '[color=#ff0008]phpbb.cat_rel_forum_parents_table[/color]' doesn't exist

SELECT f.forum_id, cfp.parent_forum_id FROM phpbb_forums f, CAT_REL_FORUM_PARENTS_TABLE cfp WHERE f.forum_id IN ( 24 , 3 , 25 , 3 , 3 , 3 , 15 ) AND f.cat_id = cfp.cat_id

Line : 336
File : c:\appserv\www\phpbb\index.php
他顯示我 "phpbb.cat_rel_forum_parents_table"這個資料表未建立, 但應該讀取"phpbb_cat_rel_forum_parents_table", 是安裝檔內的問題嗎?
補充:
http://william91.myftp.org/phpbb/mods.php
先執行下列sql語法

代碼: 選擇全部

ALTER TABLE phpbb_categories
ADD parent_forum_id SMALLINT(5) UNSIGNED DEFAULT '0' NOT NULL,
ADD cat_hier_level TINYINT UNSIGNED DEFAULT '0' NOT NULL;


ALTER TABLE phpbb_forums
ADD forum_hier_level TINYINT UNSIGNED DEFAULT '0' NOT NULL AFTER forum_last_post_id,
ADD forum_issub TINYINT(1) DEFAULT '0' NOT NULL AFTER forum_hier_level;


CREATE TABLE phpbb_cat_rel_cat_parents (
cat_id mediumint(8) unsigned NOT NULL default '0',
parent_cat_id mediumint(8) unsigned NOT NULL default '0',
PRIMARY KEY  (cat_id,parent_cat_id)
);

CREATE TABLE phpbb_cat_rel_forum_parents (
cat_id mediumint(8) unsigned NOT NULL default '0',
parent_forum_id smallint(5) unsigned NOT NULL default '0',
PRIMARY KEY  (cat_id,parent_forum_id)
);
我到現在還搞不清楚怎麼用~"~
我當然已做了.....是他讀取錯我的資料表, 把:
phpbb_cat_rel_cat_parents

轉成了:
phpbb.cat_rel_cat_parents
間中上來走走吧~
主題已鎖定

回到「外掛問題討論」