Log in

View Full Version : Remote Script/Function for thread creation?


budd
01-07-2007, 02:55 AM
Hey I've searched around and can't find anything that really accomplishes this. I don't have any experience writing hacks myself, so was wondering if there was a way to do this by just using separate MySQL queries and PHP.

If I have a text file formatted so that a PHP script that I've written can parse various things (e.g. Topic, Author, Date, Text) from it. Is there any function for vB that can create threads "remotely"? If, for example, I have an associative PHP array ( $varArray ), with the variables that I need stored in it...

Something along the lines of:

createNewThread( $varArray[ "topic" ], $varArray[ "author" ], $varArray[ "date" ], $varArray[ "content" ], $varArray[ "forumid" ] );

I have roughly 400 threads to make, which I'd very much like to not have to enter each one manually. Also updating all of the relevant counters/datastore things seems a little too complicated for me to do manually for each thread. Since I can format the text file pretty easily to be parsed by PHP, a script or function to create vB threads would be very helpful.

Could anyone point me to a hack that can accomplish this, or tell me what files I would need to include, and that sort of thing? Would be greatly appreciated.

Thanks

[edit]

I forgot to say that I'm using vB 3.6.4

[edit (again)]:

I'd found a thread by Orba about creating threads but assumed it was for a previous version of vB and wouldn't work. I gave it a shot anyways and it worked fine. A mod can close/delete this thread :)