vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   Modification Requests/Questions (Unpaid) (https://vborg.vbsupport.ru/forumdisplay.php?f=112)
-   -   subject of last post??? (https://vborg.vbsupport.ru/showthread.php?t=36604)

chipheodeptrai 03-27-2002 03:45 AM

subject of last post???
 
1 Attachment(s)
Hi there

Im looking for subject of last post, but i cant search it, please help me i can where do i get thread???

the same attachment

thanks for your help :chinese:

yasunari 03-28-2002 11:08 AM

I have make some changes of this hack,
Thanks for Firefly's idea. It's work better now.. I have test this new ver on my board. http://www.kelvinlo.net/vbb/

Before --> 88 queries
Now --> 33 queries


Step 1: Change index.php & forumdisplay.php

Find this code in BOTH files:
PHP Code:

        // prepare template vars
        
if (!$showforumdescription) {
          
$forum['description']='';
        } 

Add the follow code after this:
PHP Code:

$threadtitle$DB_site->query_first("SELECT threadid,title FROM thread WHERE forumid=$forum[forumid] order by lastpost DESC");
$forum['thread']=$threadtitle[title];
$forum['threadid']=$threadtitle[threadid];

$lastposttitle=$threadtitle[title];
$lastposttitle_all $lastposttitle;
if (
strlen($lastposttitle) > 30) { 
$lastposttitle substr($lastposttitle,0,28); 
$lastposttitle .= "..."



Change the templates forumhome_lastpostby:

found this code:
PHP Code:

by <a href="member.php?s=$session[sessionhash]&action=getinfo&find=lastposter&forumid=$forum[forumid]"><b>$forum[lastposter]</b></a

Add this after it:
PHP Code:

<br><b><a href="showthread.php?s=$session[sessionhash]&threadid=$forum[threadid]title="$lastposttitle_all">$lastposttitle</a></b


Admin 03-28-2002 02:35 PM

Just thought you should know this will add *4* queries for every forum you have...

yasunari 03-29-2002 12:23 AM

heh, yes it make more queries..

It specialy takes heavy queries on the index..
Page generated in 0.7211850 seconds (15.79% PHP - 84.21% MySQL) with 87 queries.

Admin 03-29-2002 06:36 AM

Then why use it? And you have 4 queries there that can be done with only one:
Code:

$lastpostinfo = $DB_site->query_first("
        SELECT u.userid,t.lastposter AS username,t.title,t.threadid
        FROM thread t
        LEFT JOIN user u ON t.lastposter=u.username
        WHERE t.forumid=$forum[forumid] ORDER BY t.lastpost DESC
");

And you don't even need userid, lastposter and threadid as that's already handled by vB.

yasunari 03-29-2002 08:14 AM

Thanks Firefly, I have make a little change of that code now.. wish it work better. I am going to test it on my board tonight, I have this hack work on my test board :squareeyed:

Current know problem: It will show the thread title from the private forums if you turn your private forum visible to others.

Admin 03-29-2002 11:30 AM

PPN already released a hack that does this with no extra queries, it just stores the last thread title in the forum table.

yasunari 03-29-2002 12:27 PM

Can you post the link here?

Admin 03-29-2002 12:29 PM

Look at PPN's profile, you can find it there.

yasunari 03-29-2002 12:32 PM

Thanks! I got it now :classic:


All times are GMT. The time now is 01:41 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.01977 seconds
  • Memory Usage 1,739KB
  • 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
  • (1)bbcode_code_printable
  • (4)bbcode_php_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (10)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