PDA

View Full Version : [fixed] in poll.php (updatelastpost function)


Mystics
Thu 10th Oct '02, 4:04pm
If "Update last post time" is set to yes and you place a vote, only the lastpost info (time & name) of the thread got updated. But it's also needed to update the lastpost info of the forum and all parent forums.

I think, this will fix it:

Replace in poll.php: if ($updatelastpost){ //option selected in CP
$DB_site->query("UPDATE thread SET lastpost=$ourtimenow WHERE threadid=$threadinfo[threadid]");
}with: if ($updatelastpost){ //option selected in CP
$foruminfo=getforuminfo($threadinfo[forumid]);
$DB_site->query("UPDATE forum SET lastpost=$ourtimenow,lastposter='".addslashes($threadinfo[lastposter])."' WHERE forumid IN ($foruminfo[parentlist])");
$DB_site->query("UPDATE thread SET lastpost=$ourtimenow WHERE threadid=$threadinfo[threadid]");
}Mystics

Steve Machol
Thu 10th Oct '02, 4:10pm
Moved to Bugs forum so a Developer can check this out.