Log in

View Full Version : How do I not include subforums in lastpostby?


Ang
12-08-2002, 06:46 PM
I would like the "last post by" link on the main page of the forum to only link posts made in a 1st level forum, not its subforums. Is this possible?

Xenon
12-08-2002, 07:03 PM
no it's not possible, without rewriting more scripts...

the lastpost is saved from within newreply.php
you can try to replace in newreply.php
this line:$DB_site->query("UPDATE forum SET replycount=replycount+1,lastpost='".time()."',lastposter='".addslashes($postusername)."' WHERE forumid IN ($foruminfo[parentlist])");

with this one
$DB_site->query("UPDATE forum SET replycount=replycount+1,lastpost='".time()."',lastposter='".addslashes($postusername)."' WHERE forumid=$threadinfo[forumid]");
but i can't prove it'll work perfect

Ang
12-08-2002, 07:09 PM
I tried that and it didn't seem to have any effect. Thank you though.

Xenon
12-08-2002, 07:20 PM
it just have effect on new posts!

so leave it this way and test it with some new posts..

Ang
12-08-2002, 07:22 PM
it just have effect on new posts!

so leave it this way and test it with some new posts.. That's what I did. I changed the code, uploaded it and made a new post in the subforum, and the new post showed up on the main forum page still.

Xenon
12-08-2002, 07:25 PM
hmm, have you created a new thread?

just test it with new posts, for new thread you have to change newthread.php....

Ang
12-19-2002, 10:18 AM
just test it with new posts, for new thread you have to change newthread.php.... Exactly what would I change in newthread? Also, thank you so far for your help.

Xenon
12-19-2002, 10:34 PM
in newthread.php find: $DB_site->query("UPDATE forum SET replycount=replycount+1,threadcount=threadcount+1, lastpost='".time()."',lastposter='".addslashes($postusername)."' WHERE forumid IN ($foruminfo[parentlist])");

change to: $DB_site->query("UPDATE forum SET replycount=replycount+1,threadcount=threadcount+1, lastpost=IF(forumid=$forumid,'".time()."',lastpost),lastposter=IF(forumid=$forumid,'".addslashes($postusername)."',lastposter) WHERE forumid IN ($foruminfo[parentlist])");

also in newreply.php my mod is a bit wrong, use this one instead:
$DB_site->query("UPDATE forum SET replycount=replycount+1,lastpost=IF(forumid=$threa dinfo[forumid],'".time()."',lastpost),lastposter=IF(forumid=$threadinfo[forumid],'".addslashes($postusername)."',lastposter) WHERE forumid IN ($foruminfo[parentlist])");