[ABD] Sub forums for 2.0.4

A place for MOD Authors to post and receive feedback on MODs still in development. No MODs within this forum should be used within a live environment! No new topics are allowed in this forum.
Forum rules
READ: phpBB.com Board-Wide Rules and Regulations

IMPORTANT: MOD Development Forum rules

On February 1, 2009 this forum will be set to read only as part of retiring of phpBB2.
Locked
DoubleDoom
Registered User
Posts: 844
Joined: Wed Jun 26, 2002 6:48 pm

Post by DoubleDoom » Wed Dec 11, 2002 4:56 pm

I installed the Mod, but when I add a forum there comes an error: Couldn't update forum information.


Sounds like you havent made the 4 database changes
just installed the mod and it didn't go too smoothly

I'm not getting any error messages but my forum admin looks like this -


I cant read pdf files but if you have forums that appear in the index but not in the admin panel, go into phpmyadmin and delete them from there. This is the known issue referred to in the first post and only occurs when you try and delete forums with sub-forums in them. You should delete them backwards, one at a time to stop this error from happening.

Anyone installing this mod and have it installed should keep an eye on the thread as there are going to be some code changes required shortly to get this mod to work on phpbb2.0.4. Obviously, i am not posting this info until 2.0.4 is officially released as there are still changes being made daily to it. I guess this is going to be the same for many mods (especially those with profile fields).

SSJ7 Gohan
Registered User
Posts: 4
Joined: Wed Dec 11, 2002 4:34 pm

Post by SSJ7 Gohan » Wed Dec 11, 2002 5:00 pm

I have made the database change. I can add categories in forums, too. But I can't add forums.

DoubleDoom
Registered User
Posts: 844
Joined: Wed Jun 26, 2002 6:48 pm

Post by DoubleDoom » Wed Dec 11, 2002 5:03 pm

SSJ7 Gohan wrote: I have made the database change. I can add categories in forums, too. But I can't add forums.


Turn on debug and it will report what function is failing and where.

SSJ7 Gohan
Registered User
Posts: 4
Joined: Wed Dec 11, 2002 4:34 pm

Post by SSJ7 Gohan » Wed Dec 11, 2002 5:11 pm

The Sql-Query: $sql = "UPDATE " . FORUMS_TABLE . " SET forum_name = '" . str_replace("\'", "''", $HTTP_POST_VARS['forumname']) . "', cat_id = $new_cat_id, forum_desc = '" . str_replace("\'", "''", $HTTP_POST_VARS['forumdesc']) . "', forum_status = " . intval($HTTP_POST_VARS['forumstatus']) . ", forum_hier_level = " . $hier_level . ", prune_enable = " . intval($HTTP_POST_VARS['prune_enable']) . " WHERE forum_id = " . $forum_id;

Is wrong I think. It's in admin_forums.php in case modforum. The Query the code makes is UPDATE phpbb_forums SET forum_name = 'RPG-Studio Allgemein', cat_id = 0, forum_desc = 'Redet hier über den RPG-MAKER von SSJ7 Gohan!', forum_status = 0, forum_hier_level = , prune_enable = 0 WHERE forum_id = 18

DoubleDoom
Registered User
Posts: 844
Joined: Wed Jun 26, 2002 6:48 pm

Post by DoubleDoom » Wed Dec 11, 2002 6:10 pm

SSJ7 Gohan wrote: The Sql-Query: $sql = "UPDATE " . FORUMS_TABLE . " SET forum_name = '" . str_replace("\'", "''", $HTTP_POST_VARS['forumname']) . "', cat_id = $new_cat_id, forum_desc = '" . str_replace("\'", "''", $HTTP_POST_VARS['forumdesc']) . "', forum_status = " . intval($HTTP_POST_VARS['forumstatus']) . ", forum_hier_level = " . $hier_level . ", prune_enable = " . intval($HTTP_POST_VARS['prune_enable']) . " WHERE forum_id = " . $forum_id;

Is wrong I think. It's in admin_forums.php in case modforum. The Query the code makes is UPDATE phpbb_forums SET forum_name = 'RPG-Studio Allgemein', cat_id = 0, forum_desc = 'Redet hier über den RPG-MAKER von SSJ7 Gohan!', forum_status = 0, forum_hier_level = , prune_enable = 0 WHERE forum_id = 18


and what is the lines of code including the lines directly above the line quoted (quote about 10 lines above)?

My guess is you have misstyped something but i need to see the lines lines in the file to see where.

Alternatively, you can get a text comparisin utility, such as araxis merge and compare your file to the one supplied in the mod and it will highlight the differences.

biggie
Registered User
Posts: 8
Joined: Tue Sep 24, 2002 10:04 pm

Post by biggie » Wed Dec 11, 2002 6:23 pm

Thanks DoubleDoom,

Problem is that the link Ralendil is refering to is giving the following result:
Le sujet ou message que vous recherchez n'existe pas.


So this is not helping me.

Any other solutions??? Otherwise I'm afraid I'll have to undo this modification, which I would regret!

SSJ7 Gohan
Registered User
Posts: 4
Joined: Wed Dec 11, 2002 4:34 pm

Post by SSJ7 Gohan » Wed Dec 11, 2002 7:11 pm

Code: Select all

			// Get hierarchie
			$sql = "SELECT cat_hier_level
				FROM " . CATEGORIES_TABLE . "
				WHERE cat_id = $new_cat_id";
			if( !$result = $db->sql_query($sql) )
			{
				message_die(GENERAL_ERROR, "Couldn't get hierarchie from categories table", "", __LINE__, __FILE__, $sql);
			}
			$row = $db->sql_fetchrow($result);

			$hier_level = $row['cat_hier_level'];
This Code doesn't work, $hier_level is always " "

DoubleDoom
Registered User
Posts: 844
Joined: Wed Jun 26, 2002 6:48 pm

Post by DoubleDoom » Wed Dec 11, 2002 7:12 pm

biggie wrote: Thanks DoubleDoom,

Problem is that the link Ralendil is refering to is giving the following result:
Le sujet ou message que vous recherchez n'existe pas.


So this is not helping me.

Any other solutions??? Otherwise I'm afraid I'll have to undo this modification, which I would regret!


I have no knowledge of the attachments mod but i do recall that its an easy fix that is pretty obvious to spot when you read the code around the error area.

QME
Registered User
Posts: 24
Joined: Tue Dec 10, 2002 11:07 pm

Im not sure if this will fill my need or not

Post by QME » Wed Dec 11, 2002 9:13 pm

I went to a demo of this and im not sure that it is doing what I need. Im actaully looking for sub catagories, not sub forums. Here is what I am lookinig for.

Idaho,Boise
Restaurants
Chinese

So what I need is a sub catagory of a Chinese restaurant in Boise Idaho. WIll this fill this need, or if not, is there something else that will??

QME

Billy T
Registered User
Posts: 4
Joined: Sat Nov 23, 2002 8:21 am

Post by Billy T » Wed Dec 11, 2002 9:59 pm

DoubleDoom wrote: go into phpmyadmin and delete them from there.


Thanks :D

The DareDevil
Registered User
Posts: 131
Joined: Wed May 08, 2002 7:42 pm

Post by The DareDevil » Wed Dec 11, 2002 11:40 pm

Okie dokie, install went well and my previous problems are fixed. This is great, only one thing: When I click any category with sub categories I can't see the sub-categories. The sub-categories are there, I can get to them from the jumpbox and the admin panel but they are not listed in the categories.

While I look through all these pages for an answer, I thought someone may have a quick fix for me.

Thanks,

ÐÐ

User avatar
MartinK
Registered User
Posts: 41
Joined: Mon Mar 11, 2002 8:32 pm

Post by MartinK » Thu Dec 12, 2002 8:17 pm

-Mac- wrote: Hi DoubleDoom :o)


I'm not quite the man you want to answer this but i'm sure i'll do. ;-)
-Mac- wrote:

Code: Select all

$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
			AND f.cat_id = c.cat_id
			ORDER BY c.cat_hier_level, f.forum_hier_level";
My guess is I need to change the SQL query to read :

Code: Select all

$sql = "SELECT concat(f.forum_name) AS hierarchie_title
                       FROM " . FORUMS_TABLE . "f," . "

                  AND

           SELECT concat(c.cat_title, ', ', f.forum_name) AS 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
			AND f.cat_id = c.cat_id
			ORDER BY c.cat_hier_level, 


Hm, ok, your guess goes in the right direction.... but some things are wrong. OK, lets see:

Code: Select all

SELECT 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
AND f.cat_id = c.cat_id
ORDER BY c.cat_hier_level, f.forum_hier_level";
That will do. I'm sure it can be optimized by killing the Querys on the CATEGORIES_TABLE, but i'm not quite sure of that just now. Hope it helps.

Greetings,
Martin

ShaunJUK
Registered User
Posts: 109
Joined: Tue Jun 18, 2002 7:01 pm

Post by ShaunJUK » Thu Dec 12, 2002 9:04 pm

Sheps wrote: There is a addition to the mod, it will include the ability to have posts in the main forum, as well as sub forums. Wait for it...


I so need this addition, if someone sends it to me I will check it and see if it works!
ShaunJUK

Email - info@ultimateforums.co.uk

Image

Roberdin
Registered User
Posts: 203
Joined: Sun Nov 24, 2002 3:56 pm
Location: London, United Kingdom

Upgrade Query

Post by Roberdin » Thu Dec 12, 2002 9:25 pm

I am not sure if this has been asked already, but how will this extensive modification affect how and if I can upgrade to a newer version of phpBB? I have phpBB 2.03, http://forums.roberdin.com.

Also, is there anyway I can get the contents of all of the catagories within forums to show? I can only get the forums that I create after I move a catagory to a Forum to show on the Forum Management Panel.

Thank you,
Roberdin

DoubleDoom
Registered User
Posts: 844
Joined: Wed Jun 26, 2002 6:48 pm

Post by DoubleDoom » Thu Dec 12, 2002 10:02 pm

MartinK wrote: I'm not quite the man you want to answer this but i'm sure i'll do. ;-)

Greetings,
Martin


Always good to see the author of this mod contribute to the thread.
shaunJUK wrote: There is a addition to the mod, it will include the ability to have posts in the main forum, as well as sub forums. Wait for it...

I so need this addition, if someone sends it to me I will check it and see if it works!


I have no plans to implement this into the mod now. Although it is possible, there will be problems when it comes to upgrading to php2.0.4 or higher as there will be no forum id attached. For the time being with 2.0.4 due in the next 10 days and possibly a 2.0.5 to follow before we see 2.2 which has sub-forums as standard, i think having upgradeability is better than having this feature.
I am not sure if this has been asked already, but how will this extensive modification affect how and if I can upgrade to a newer version of phpBB? I have phpBB 2.03


I am already working on php2.0.4 (11th Dec CVS) to make sure this mod works. It looks like one or two minor changes are needed.

However, to answer the main part of your question, this mod will not hinder any upgrades in the future. All sub-forums are allocated a forumid so will appear on future versions of phpbb, irrespective if you have sub-forum mod installed or are using phpbb2.2 when its out in the spring.
Also, is there anyway I can get the contents of all of the catagories within forums to show? I can only get the forums that I create after I move a catagory to a Forum to show on the Forum Management Panel.


Not sure quite what you mean. If the code is installed correctly, you should be able to create forums and catagories with no need to move anything.

Locked

Return to “[2.0.x] MODs in Development”