PDA

View Full Version : adding forums via mysql


kjhkjh
08-10-2007, 05:00 AM
If I have a whole bunch of duplicate forums to add and it's taking forever doing adding them manually through the admin control panel, can I add them through mysql.

I have Navicat mysql gui and I can export whatever forums are in the 'forum' table as a csv, then duplicate and update lines in this file to add a whole bunch of new forums than import it back into mysql.

My question is... is this good enough?

To add additional forums is this the only place (the 'forum' table) that I would need to edit. Or are there other places that would need editing.

Am I going to mess up the auto increment of the forum ID's by manually adding a bunch of furms and changing the forum ID's? Or when forums are added later in the ACP, will it know to add the forum ID 1 number up from the batch that I imported?

Can you see any problems adding forums in this way?

Thanks for your help.

UPDATE ---------

I added a bunch of forums directly into the mysql table "myforumprefix_forum"
I made the edits on these for the forum id's, names, parent forums, etc.

Bt when I check the Admin control panel, they don't show in the forum manager?

At least equally as important, they aren't showing on my forums!

Can anyone let me know what else I have to do when adding forums manually outside the ACP?
Do other tables need updating?

Help is really appreciated, I'm trying to find a quick way to add hundreds and hundreds of forums.

Also is their an advisable limit to the number of forums?

TIA

ZomgStuff
08-10-2007, 07:00 PM
I'm really interested on how to do this myself. I want to make an autoscript for users to be able to create their own subforums.

kjhkjh
08-10-2007, 07:14 PM
My update on this...


I have added forums to the table 'forum'
I have updated the parent ID's, descriptions etc of each of the forums that I've added.
I believe I now have to update the datastore which is basically a series of records in an serialized form that has information about the forums and its permissions. (this was the advice vb.com gave but I can find no documentation about how to do this, and I know I'm gonna mess it up unless I get help :) - especially how to do it safely)

They also said it would be in your best interested to look at http://members.vbulletin.com/api. In particular the Datamanager class for Forums. But this is just mumbo jumbo to me... is there an idiots guide or can anyone give me good direction on this for a start point.

Any help here is much appreciated - I'm trying to save myself over 100 hours of adding and updating forums - please help

patrickb
08-13-2007, 06:34 AM
basically, either run the Rebuild Forum Information in Maintenance->Update counters.

What this calls is basically build_forum_permissions....which in turns calls build_forum_genealogy....which updates the genealogy of your forums (specifically the childlist and parentlist fields) which are necessary to show up in vB.

I have an external interface to add forums to my vB site. I also have a cron job that runs every hour to see if there's any new forums added. If so, it calls build_forum_permissions to update everything.

Hope this helps.

Antivirus
08-13-2007, 01:50 PM
Ken Iovino wrote a pretty good article on the datastore, it might help you...

https://vborg.vbsupport.ru/showthread.php?t=110628&highlight=datastore

kjhkjh
08-13-2007, 10:01 PM
Thanks patrick and antivirus, I will check into both.

patrick if I add the forums directly to the 'forum' table, (I can change over all the aprent id's etc, so that the entries in the tabl are complete), I'm just wondering if Rebuild Forum Information in Maintenance->Update counters will do the whole serializing that is required to make these forums appear in the admin control panel and on the forum itself?

Thanks again, appreciated

Paul M
08-13-2007, 10:11 PM
The ACP maintenance option will rebuild the datastore cache based on what's in the forum table.

kjhkjh
08-13-2007, 11:51 PM
Thanks Paul and Patrick, I wish I had known this sooner, I've been adding forums over the last few days, have probably worked for about 30 hours on this so far!

Not sure if you can help me with another post here (https://vborg.vbsupport.ru/showthread.php?t=155140). I'm trying to insert some code or find a mod so that the stats for forwarder forums (which forward to a regular forum under the same website) appear. The link (https://vborg.vbsupport.ru/showthread.php?t=155140) explains better.

Thanks for your help on the acp maintenance idea.