The Arcive of Official vBulletin Modifications Site.It is not a VB3 engine, just a parsed copy! |
|
#31
|
||||
|
||||
$DB_site->insert_id() gives you the id generated by the last mySQL INSERT statement (if inserting into a table with an auto-increment column like postid, threadid, etc.).
But you don't need that (see my previous post) if you are using vB functions to create threads/posts - only if you are manually dealing with the database. > But I can only use $post['threadid'] and $post['postid'] after the build_new_post is hit in the code, correct? Yes, that's correct. |
#32
|
||||
|
||||
So would this part of the code I edited in to that last post work?
PHP Code:
ThreadID and PostID are columns in a table I have created. |
#33
|
||||
|
||||
Not really, as there are $-signs missing before ThreadID and PostID and thus it won't compile
But the concept is right. I don't know what you want to do with your table but you could call PHP Code:
|
#34
|
||||
|
||||
Lol yeah. Conceptually it's kewl. That definitely just solved like 5 potential SNAFUs! Trying to think if there were any other questions I had... (re-reading the thread quickly)...
|
#35
|
||||
|
||||
Ok, this is a minor one. If you look at the original post that started this thread, it has the title of the thread within the top of the post. I know that with proper use of templates an postbit this can be removed, but is there a way to prevent it from getting into the DB at all?
Also, with PHP Code:
Also, what do you guys think about this comment I made earlier: I'm also looking into how to auto create a forum/sub forum, but for security reasons, I think I might not let the bot have this access, and find out how to do it with normal mySQL statements (or $DB_site->query now that you've shown me its wonders) |
#36
|
||||
|
||||
Wow... this is almost the thing I need too!!
Er.. I want to create a thread automatically when a member reaches xth number of posts. I want to be able to exclude some forums from their post counts (that i know how to do). What I'm having trouble with is the actual conditional for this and also WHERE to put the code (which php file). appreciate any help. |
#37
|
||||
|
||||
That might boil down to a cron job, as they could hit that number at any time. There might be a way though for the vB admin system to PM or email you when members hit x # of posts, and you create it manually. then again, if it can notify u, it can make a thread
This will turn into one kickass tutorial for others! Much props goes to you all! |
#38
|
||||
|
||||
> but is there a way to prevent it from getting into the DB at all?
AFAIK not. This would require a modification of build_new_post(). > $post[postid] is supposed to be $post['postid'] (quotes) correct? You can ommit the quotes. > Also, $DB_site->query is just vB's way of doing $result = mysql_query($sql, $connection); right? Yes. vB uses a class (DB_sql_vb) the wraps mysql_ functions and thus makes database-handling easier. |
#39
|
||||
|
||||
Quote:
Hmm, what I was thinking is, a way to do a check on members post count after they've done a new post. So the code has to go kinda after all that. Question is, where is the best place to put such a code. |
#40
|
||||
|
||||
>> $post[postid] is supposed to be $post['postid'] (quotes) correct?
>You can ommit the quotes. Everywhere, or just within $DB_site->query? > Hmm, what I was thinking is, a way to do a check on members post count after > they've done a new post. So the code has to go kinda after their own post sql > query or new post function. Question is, where is the best place to put such a > code. oooohhhh I get it now. Hrm... I suppose you'd slap that into the build_new_post function, or right after a call to that function. beats me where the best place would be though. |
Thread Tools | |
Display Modes | |
|
|
X vBulletin 3.8.12 by vBS Debug Information | |
---|---|
|
|
More Information | |
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|