PDA

View Full Version : resetable posts counter


mega77
12-13-2001, 08:05 PM
newthread.php

$DB_site->query("UPDATE user SET
".iif ($foruminfo[countposts],"posts=posts+1,","")."
$dotitle"."lastpost='".time()."' WHERE userid='$bbuserinfo[userid]'");

I've created the field call reset_posts (same field as posts) in user table and whenever someone post the new thread I like to +1 in that field ... work just same as "posts" field but i want to reset "reset_posts" field weekly or monthly manually for my event purpose.

Can anyone modify the above script? Am I looking at the right parts of the script? I just started to learn PHP ...

Thanks in advance

mega77
12-13-2001, 09:05 PM
$DB_site->query("UPDATE user SET
".iif ($foruminfo[countposts],"posts=posts+1,","")."
$dotitle"."lastpost='".time()."' WHERE userid='$bbuserinfo[userid]'");

$DB_site->query("UPDATE user SET reset_post = reset_post + 1 WHERE userid='$bbuserinfo[userid]'");


plz help ... i added last line ... is it going to work?

Freddie Bingham
12-13-2001, 09:29 PM
$DB_site->query("UPDATE user SET
".iif ($foruminfo[countposts],"posts=posts+1,reset_post=reset_post+1,","")."
$dotitle"."lastpost='".time()."' WHERE userid='$bbuserinfo[userid]'");

mega77
12-13-2001, 09:38 PM
[QUOTE]Originally posted by freddie
$DB_site->query("UPDATE user SET
".iif ($foruminfo[countposts],"posts=posts+1,reset_post=reset_post+1,","")."
$dotitle"."lastpost='".time()."' WHERE userid='$bbuserinfo[userid]'");