Log in

View Full Version : Updating # of posts?


tubedogg
03-12-2001, 03:07 PM
Ok this is gonna sound kinda weird but here goes...
I'm gonna run a contest similar to that of ascifi.com and dvdcouponpost.com where the winner is determined by x # of posts in a certain amount of time. I would like for my users to keep their current # of posts, but also have a total they've made for the contest (i.e. from starting at 0 at the beginning of the contest). I'm just gonna use the biography profile field, but here's where my question comes in: I think I found on the reply PHP page where I would need to insert code to increment a number stored in that field. I believe it's right after this in newreply.php:
// update user stuff

// some other code here

$DB_site->query("UPDATE user SET
".iif ($foruminfo[countposts],"posts=posts+1,","")."
$dotitle"."lastpost='".time()."' WHERE userid='$bbuserinfo[userid]'");
Is that right? And could anyone give me a little help with how to do the actual incrementing? I think it's something like
$DB_site->query("UPDATE userfield SET field1=field1+1 WHERE userid='$bbuserinfo[userid]'");
Would this be right? Thanks for any help you could give me. :)
One other small question: What's the difference in newreply.php between postreply and newreply?

03-12-2001, 03:20 PM
newreply is the code that shows the page that you enter the post into. postreply is the code that processes your post and submits it to the database.

03-14-2001, 08:42 AM
*bump*

Anyone, please?? :D

03-16-2001, 08:30 AM
*bump*

Thought of something else. Would it be easier to just create a custom profile field instead of using one of the existing ones (i.e. Biography)?

Thanks for any help. :D