The Arcive of Official vBulletin Modifications Site.It is not a VB3 engine, just a parsed copy! |
|
#1
|
|||
|
|||
Issues creating multiple threads with Thread_FirstPost
I'm working on a script, which requires multiple threads to be posted in a newly created forum.
In order to do that, I've created a little function which takes some basic info like forumid, userid, title and post content, and creates a Thread_FirstPost datamanager instance and then saves the post. This works like a charm .. only .. it'll post the first post, and then nothing. Once I call the function once, it simply won't do anything anymore after that. What am I doing wrong here? Function: PHP Code:
|
#2
|
||||
|
||||
Quote:
You should have PHP Code:
PHP Code:
PHP Code:
|
#3
|
|||
|
|||
If I get the foruminfo that way, I get the following errors:
Quote:
If I fetch the forum info, like so: PHP Code:
I'm thinking that perhaps vB expects the forumcache to be updated between two thread-postings or something? As a last resort I can always use a simple redirect to post the second thread, which I'm guessing would work, but I'd rather get this to work if at all possible. |
#4
|
||||
|
||||
I know what it is. Are you posting in rapid succesion and thereby violating the default time interval between posts?
Just after your sets and before you save put this. It's what I do in Articlebot. PHP Code:
|
#5
|
||||
|
||||
Re the above;
Instead of altering the floodcheck setting you should really add this ; PHP Code:
|
#6
|
||||
|
||||
Quote:
However, in the 3.5 series you need to do it the way I stated. PHP Code:
Quote:
Even so, the inline docs for pre_save_post suggest it will is not likely called for threads, mostly posts. I'll have to test it when I update Articlebot for 3.6. |
#7
|
||||
|
||||
Quote:
Quote:
|
#8
|
||||
|
||||
Quote:
Quote:
|
#9
|
||||
|
||||
Had another look.
If presave() has not been called then save() calls it for you. |
#10
|
|||
|
|||
But how with this class (or another class_dm*) I can edit existing post? Please help!
example will be realy helpful |
Thread Tools | |
Display Modes | |
|
|
X vBulletin 3.8.12 by vBS Debug Information | |
---|---|
|
|
More Information | |
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|