Go Back   vb.org Archive > Community Discussions > Modification Requests/Questions (Unpaid)
FAQ Community Calendar Today's Posts Search

Reply
 
Thread Tools Display Modes
  #1  
Old 03-27-2002, 03:45 AM
chipheodeptrai chipheodeptrai is offline
 
Join Date: Mar 2002
Posts: 56
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default subject of last post???

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:
Attached Images
File Type: gif lastpost.gif (3.2 KB, 0 views)
Reply With Quote
  #2  
Old 03-28-2002, 11:08 AM
yasunari yasunari is offline
 
Join Date: Mar 2002
Posts: 18
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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
Reply With Quote
  #3  
Old 03-28-2002, 02:35 PM
Admin's Avatar
Admin Admin is offline
Coder
 
Join Date: Oct 2023
Location: Server
Posts: 1
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Just thought you should know this will add *4* queries for every forum you have...
Reply With Quote
  #4  
Old 03-29-2002, 12:23 AM
yasunari yasunari is offline
 
Join Date: Mar 2002
Posts: 18
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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.
Reply With Quote
  #5  
Old 03-29-2002, 06:36 AM
Admin's Avatar
Admin Admin is offline
Coder
 
Join Date: Oct 2023
Location: Server
Posts: 1
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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.
Reply With Quote
  #6  
Old 03-29-2002, 08:14 AM
yasunari yasunari is offline
 
Join Date: Mar 2002
Posts: 18
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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.
Reply With Quote
  #7  
Old 03-29-2002, 11:30 AM
Admin's Avatar
Admin Admin is offline
Coder
 
Join Date: Oct 2023
Location: Server
Posts: 1
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

PPN already released a hack that does this with no extra queries, it just stores the last thread title in the forum table.
Reply With Quote
  #8  
Old 03-29-2002, 12:27 PM
yasunari yasunari is offline
 
Join Date: Mar 2002
Posts: 18
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Can you post the link here?
Reply With Quote
  #9  
Old 03-29-2002, 12:29 PM
Admin's Avatar
Admin Admin is offline
Coder
 
Join Date: Oct 2023
Location: Server
Posts: 1
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Look at PPN's profile, you can find it there.
Reply With Quote
  #10  
Old 03-29-2002, 12:32 PM
yasunari yasunari is offline
 
Join Date: Mar 2002
Posts: 18
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Thanks! I got it now :classic:
Reply With Quote
Reply


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT. The time now is 09:43 PM.


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.06806 seconds
  • Memory Usage 2,280KB
  • Queries Executed 12 (?)
More Information
Template Usage:
  • (1)SHOWTHREAD
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (1)ad_showthread_beforeqr
  • (1)ad_showthread_firstpost
  • (1)ad_showthread_firstpost_sig
  • (1)ad_showthread_firstpost_start
  • (1)bbcode_code
  • (4)bbcode_php
  • (1)footer
  • (1)forumjump
  • (1)forumrules
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (1)navbar
  • (3)navbar_link
  • (120)option
  • (10)post_thanks_box
  • (10)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (10)post_thanks_postbit_info
  • (10)postbit
  • (1)postbit_attachment
  • (10)postbit_onlinestatus
  • (10)postbit_wrapper
  • (1)spacer_close
  • (1)spacer_open
  • (1)tagbit_wrapper 

Phrase Groups Available:
  • global
  • inlinemod
  • postbit
  • posting
  • reputationlevel
  • showthread
Included Files:
  • ./showthread.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/functions_bigthree.php
  • ./includes/class_postbit.php
  • ./includes/class_bbcode.php
  • ./includes/functions_reputation.php
  • ./includes/functions_post_thanks.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
  • showthread_start
  • showthread_getinfo
  • forumjump
  • showthread_post_start
  • showthread_query_postids
  • showthread_query
  • bbcode_fetch_tags
  • bbcode_create
  • showthread_postbit_create
  • postbit_factory
  • postbit_display_start
  • post_thanks_function_post_thanks_off_start
  • post_thanks_function_post_thanks_off_end
  • post_thanks_function_fetch_thanks_start
  • post_thanks_function_fetch_thanks_end
  • post_thanks_function_thanked_already_start
  • post_thanks_function_thanked_already_end
  • fetch_musername
  • postbit_imicons
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • postbit_attachment
  • postbit_display_complete
  • post_thanks_function_can_thank_this_post_start
  • tag_fetchbit_complete
  • forumrules
  • navbits
  • navbits_complete
  • showthread_complete