PDA

View Full Version : Add 1 post to post count


Sylvus
05-04-2003, 02:17 PM
Does anyone know where the code is in newthread.php or newreply.php that adds +1 to a users post count after they made the post?

I'm using:


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


But it doesn't work. Thanks!

Syl...

filburt1
05-04-2003, 02:40 PM
Just:

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

Sylvus
05-04-2003, 11:02 PM
Hello. Thank-you for taking the time to write that out for me, but it does not work. I am using it in functions.php as a test and here is the code I'm using it with.

I am logged in with the Test Account when trying this out.


if($post[username] == "Test Account") {
$extrainfo = "Testing 1 2 3";

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

} else {
$extrainfo = "Not logged in as Test Account";
}


Post count still remains the same. :( The $extrainfo is placed into the postbit template so I know if it's working or not. It does say "Testing 1 2 3" in the post bit but the query is not working. No errors or anything, simply not adding 1 post everytime the Test Account is online. Any ideas?

EDIT: Next day. I got it working. Bonehead, beginner PHP mistakes.

Syl...