Radon3k
01-21-2003, 04:21 AM
Hi there,
I'm developing something and now I'm stuck on it. This may sound weird, but I do have a point behind it, so please bare with me. For right now, I just want the simple procedure, and if that's successful, then I'll take it to the next step.
I have a text file that contains several thousand company names in it. What I want to be able to do, using the "add forum" section from /admin/forum.php, is have it read each line of the text file and create a category name for each company listed there.
Example:
Microsoft
Circuit City
Best Buy
When the script is executed, a category for Microsoft, a category for Circuit City, and a category for Best Buy would be created. To add onto that, with each category created, 4 forums would be added as well, all having the same names.
Example:
Category names:
Microsoft
Circuit City
Best Buy
Forum names:
General talk
What To Buy
What's On Sale
When the script is executed:
Microsoft
--General Talk
--What To Buy
--What's On Sale
Circuit City
--General Talk
--What To Buy
--What's On Sale
Best Buy
--General Talk
--What To Buy
--What's On Sale
You get the idea. I know that I need to use a loop (probably going to use a "for" loop) for this, but I'm unsure of how to import the file. To add onto that, I'm having trouble figuring out how to add it to the forums with the code from /admin/forum.php.
I've tried adding just one forum using an HTML form, but that did not work.
I'm thinking that I need to make the text file into a PHP file and make the company names an array. Though, that sounds like a lot of work for several thousand companies. If this were 10 companies, I'd add them manually via the Admin CP in vBulletin, but several thousand companies is a lot of work.
I know you're probably asking, "Why on Earth would you want to do that?". Please just bare with me.
Any guidance in the right direction would be most appreciative. Thanks! :)
I'm developing something and now I'm stuck on it. This may sound weird, but I do have a point behind it, so please bare with me. For right now, I just want the simple procedure, and if that's successful, then I'll take it to the next step.
I have a text file that contains several thousand company names in it. What I want to be able to do, using the "add forum" section from /admin/forum.php, is have it read each line of the text file and create a category name for each company listed there.
Example:
Microsoft
Circuit City
Best Buy
When the script is executed, a category for Microsoft, a category for Circuit City, and a category for Best Buy would be created. To add onto that, with each category created, 4 forums would be added as well, all having the same names.
Example:
Category names:
Microsoft
Circuit City
Best Buy
Forum names:
General talk
What To Buy
What's On Sale
When the script is executed:
Microsoft
--General Talk
--What To Buy
--What's On Sale
Circuit City
--General Talk
--What To Buy
--What's On Sale
Best Buy
--General Talk
--What To Buy
--What's On Sale
You get the idea. I know that I need to use a loop (probably going to use a "for" loop) for this, but I'm unsure of how to import the file. To add onto that, I'm having trouble figuring out how to add it to the forums with the code from /admin/forum.php.
I've tried adding just one forum using an HTML form, but that did not work.
I'm thinking that I need to make the text file into a PHP file and make the company names an array. Though, that sounds like a lot of work for several thousand companies. If this were 10 companies, I'd add them manually via the Admin CP in vBulletin, but several thousand companies is a lot of work.
I know you're probably asking, "Why on Earth would you want to do that?". Please just bare with me.
Any guidance in the right direction would be most appreciative. Thanks! :)