Register Members List Search Today's Posts Mark Forums Read

Reply
 
Thread Tools
  #31  
Old 08 Feb 2004, 03:02
Andreas's Avatar
Andreas Andreas is offline
 
Join Date: Jan 2004
Real name: Andreas
$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.
Reply With Quote
  #32  
Old 08 Feb 2004, 03:03
Wired1's Avatar
Wired1 Wired1 is offline
 
Join Date: Nov 2003
So would this part of the code I edited in to that last post work?

Block Disabled:      (Update License Status)  
Suspended or Unlicensed Members Cannot View Code.


ThreadID and PostID are columns in a table I have created.
Reply With Quote
  #33  
Old 08 Feb 2004, 03:06
Andreas's Avatar
Andreas Andreas is offline
 
Join Date: Jan 2004
Real name: Andreas
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


Block Disabled:      (Update License Status)  
Suspended or Unlicensed Members Cannot View Code.

to get the IDs into your table. Or make an update or whatever you want to to with the values.

Last edited by KirbyDE; 08 Feb 2004 at 03:09.
Reply With Quote
  #34  
Old 08 Feb 2004, 03:09
Wired1's Avatar
Wired1 Wired1 is offline
 
Join Date: Nov 2003
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)...
Reply With Quote
  #35  
Old 08 Feb 2004, 03:16
Wired1's Avatar
Wired1 Wired1 is offline
 
Join Date: Nov 2003
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
Block Disabled:      (Update License Status)  
Suspended or Unlicensed Members Cannot View Code.

$post[postid] is supposed to be $post['postid'] (quotes) correct? Also, $DB_site->query is just vB's way of doing $result = mysql_query($sql, $connection); right?

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)
Reply With Quote
  #36  
Old 08 Feb 2004, 03:21
M1th's Avatar
M1th M1th is offline
 
Join Date: Jul 2002
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.
__________________
Chamber of Secrets - The Ultimate Harry Potter Community!
Reply With Quote
  #37  
Old 08 Feb 2004, 03:26
Wired1's Avatar
Wired1 Wired1 is offline
 
Join Date: Nov 2003
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!

Last edited by Wired1; 08 Feb 2004 at 03:29.
Reply With Quote
  #38  
Old 08 Feb 2004, 03:28
Andreas's Avatar
Andreas Andreas is offline
 
Join Date: Jan 2004
Real name: Andreas
> 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.
Reply With Quote
  #39  
Old 08 Feb 2004, 03:34
M1th's Avatar
M1th M1th is offline
 
Join Date: Jul 2002
Originally Posted by Wired1
That might boil down to a cron job, as they could hit that number at any time. There might be a way though for it to PM or email you when members hit x # of posts, and you creat 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!
Ah, thats a good way too, though, im not sure how that differs from creating a new thread/post?



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.
__________________
Chamber of Secrets - The Ultimate Harry Potter Community!
Reply With Quote
  #40  
Old 08 Feb 2004, 03:34
Wired1's Avatar
Wired1 Wired1 is offline
 
Join Date: Nov 2003
>> $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.

Last edited by Wired1; 08 Feb 2004 at 03:36.
Reply With Quote
  #41  
Old 08 Feb 2004, 16:44
version2's Avatar
version2 version2 is offline
 
Join Date: Feb 2003
Originally Posted by Wired1
>> $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.
All right. Here is one for ya. I have my script working great on my test machine. I move it to the production server and boom. Nothing. I get no output. No errors. No posts or threads being created. Nada. Changed the userid and forumid correctly. Everything else is the same.

Anyone got any ideas for me to check out?
__________________
version2 aka van aka mol
Reply With Quote
  #42  
Old 08 Feb 2004, 20:26
Wired1's Avatar
Wired1 Wired1 is offline
 
Join Date: Nov 2003
Go back to the last post I made with the full code in it. Does that work on both sites?
Reply With Quote
  #43  
Old 08 Feb 2004, 20:39
version2's Avatar
version2 version2 is offline
 
Join Date: Feb 2003
Originally Posted by Wired1
Go back to the last post I made with the full code in it. Does that work on both sites?
Actually, I got it working and I have been doing so many other things...I forgot what I did!
__________________
version2 aka van aka mol
Reply With Quote
  #44  
Old 08 Feb 2004, 20:44
version2's Avatar
version2 version2 is offline
 
Join Date: Feb 2003
Damn. If its not one thing its another. Now, even though I have explicitly names the username and fetched all the bbuserinfo data manually...my script is posting as random members.

Main difference right now is I have vbcron running the script once an hour. Maybe vbcron is the problem.
__________________
version2 aka van aka mol

Last edited by version2; 08 Feb 2004 at 20:50.
Reply With Quote
  #45  
Old 09 Feb 2004, 06:56
Wired1's Avatar
Wired1 Wired1 is offline
 
Join Date: Nov 2003
I'd copy the code exactly to a test file, run that a couple of times. If it does it correctly each time, then it's probably vbcron.
Reply With Quote
Reply

Similar Threads
Thread Thread Starter Forum Replies Last Post
Administrative and Maintenance Tools Mass User Creation and Auto Posting alexgeek vBulletin 3.6 Add-ons 102 10 Mar 2015 07:34



Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off


New To Site? Need Help?

All times are GMT. The time now is 08:58.

Layout Options | Width: Wide Color: