View Full Version : Lastposter query
Boofo
05-14-2003, 06:30 AM
Can someone please tell me what I am doing wrong in this query? I am trying to set the lastposter as the original poster of the message (this query is from the editpost.php):
$DB_site->query("UPDATE thread SET lastpost='".time()."', lastposter='".addslashes($postusername)."' WHERE threadid='$threadinfo[threadid]'");
Xenon
05-14-2003, 11:22 AM
$postusername hast to be set already or it won't work.
but here you can use a simpler method:
$DB_site->query("UPDATE thread SET lastpost='".time()."', lastposter=postusername WHERE threadid='$threadinfo[threadid]'");
Boofo
05-14-2003, 03:46 PM
Isn't that basically the same code I have above?
And it's still not working. When I save an editpost using this, I get my name on it on the thread and forum list and not the name of the user who wrote the post.
Xenon
05-14-2003, 04:30 PM
no the difference is that my query uses directly the info in the db
if this querie doesn't produce what you want there is either a problem i don't understand exactly what you wan, or the postusername is set wrong in your thread or (most likely) the lastposter is overwritten after that querie again
Boofo
05-14-2003, 04:37 PM
Today at 12:30 PM Xenon said this in Post #4 (https://vborg.vbsupport.ru/showthread.php?postid=395071#post395071)
no the difference is that my query uses directly the info in the db
if this querie doesn't produce what you want there is either a problem i don't understand exactly what you wan, or the postusername is set wrong in your thread or (most likely) the lastposter is overwritten after that querie again
What I am doing is this: I have a checkbox in the editpost that when checked will update that post with the current date and time (like a newreply). But when I do that, it seems to want to put my name in the thread listing and forum listing as the last poster instead of the original poster of that message. If you want, I can pm you the code for the hack to look at. (It is small). ;)
Xenon
05-15-2003, 12:43 PM
hmm just be sure that nowhere below that code is anything like lastposter=$bbuserinfo[username] ;)
Boofo
05-15-2003, 01:01 PM
"lastposter=" is not anywhere in the editpost (mine or the original). What could be causing that?
vBulletin® v3.8.12 by vBS, Copyright ©2000-2025, vBulletin Solutions Inc.