vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   Modification Requests/Questions (Unpaid) (https://vborg.vbsupport.ru/forumdisplay.php?f=112)
-   -   How do I not include subforums in lastpostby? (https://vborg.vbsupport.ru/showthread.php?t=46496)

Ang 12-08-2002 06:46 PM

How do I not include subforums in lastpostby?
 
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:
PHP Code:

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

with this one
PHP Code:

$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

Quote:

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

Quote:

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:
PHP Code:

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

change to:
PHP Code:

        $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:
PHP Code:

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



All times are GMT. The time now is 06:28 AM.

Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2025, vBulletin Solutions Inc.

X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.01085 seconds
  • Memory Usage 1,737KB
  • Queries Executed 10 (?)
More Information
Template Usage:
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (5)bbcode_php_printable
  • (2)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (8)printthreadbit
  • (1)spacer_close
  • (1)spacer_open 

Phrase Groups Available:
  • global
  • postbit
  • showthread
Included Files:
  • ./printthread.php
  • ./global.php
  • ./includes/init.php
  • ./includes/class_core.php
  • ./includes/config.php
  • ./includes/functions.php
  • ./includes/class_hook.php
  • ./includes/modsystem_functions.php
  • ./includes/class_bbcode_alt.php
  • ./includes/class_bbcode.php
  • ./includes/functions_bigthree.php 

Hooks Called:
  • init_startup
  • init_startup_session_setup_start
  • init_startup_session_setup_complete
  • cache_permissions
  • fetch_threadinfo_query
  • fetch_threadinfo
  • fetch_foruminfo
  • style_fetch
  • cache_templates
  • global_start
  • parse_templates
  • global_setup_complete
  • printthread_start
  • bbcode_fetch_tags
  • bbcode_create
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • printthread_post
  • printthread_complete