Go Back   vb.org Archive > vBulletin Modifications > Archive > vB.org Archives > General > Member Archives

Reply
 
Thread Tools
Details »»

Version: , by (Guest)
Developer Last Online: Jan 1970 Show Printable Version Email this Page

Version: Unknown Rating:
Released: 10-25-2000 Last Update: Never Installs: 0
 
No support by the author.

Forumdisplay Optimization for vB 1.1.2 & 1.1.3 by rangersfan 2000

Open forumdisplay.php, and dont put in the dashes! As always backup forumdisplay.php in case something goes wrong.

Code:
Find this Code:
---------------
$threads=$DB_site->query("SELECT threadid,title,open,lastpost,replycount,postusername,lastposter,notes,iconid,views FROM thread WHERE forumid=$forumid AND visible=1 $datecut ORDER BY lastpost DESC LIMIT $limitlower,$perpage");
---------------

(editor note.. If you have changed this query and it no longer matches the above, the important part is to replace "iconid" with "thread.iconid", add "icon.title AS icontitle",
   add "icon.iconpath", replace "title" with "thread.title AS threadtitle" and add "LEFT JOIN icon ON (icon.iconid = thread.iconid)" after "FROM thread")

Replace with:
---------------
$threads=$DB_site->query("SELECT thread.iconid, icon.title AS icontitle, icon.iconpath,threadid,thread.title AS threadtitle,
                                 open,lastpost,replycount,postusername,lastposter,notes,views,userindex
                          FROM thread
                          LEFT JOIN icon ON (icon.iconid = thread.iconid)
                          WHERE forumid=$forumid AND visible=1 $datecut
                          ORDER BY lastpost
                          DESC LIMIT $limitlower,$perpage");
----------------

Find this code:
----------------
  if ($showicons==1 and $thread[iconid]!=0) {
    if ($icon=$DB_site->query_first("SELECT title,iconpath FROM icon WHERE iconid=$thread[iconid]")) {
      $threadicon="<img src=\"$icon[iconpath]\" alt=\"$icon[title]\" border=0>";
    } else {
      $threadicon="&nbsp;";
    }
  } else {
    $threadicon="&nbsp;";
  }
----------------

Replace with:
----------------
  $threadicon="&nbsp;";
  if ($showicons==1 and $thread[iconid]!=0)
  {
     $threadicon="<img src=\"$thread[iconpath]\" alt=\"$thread[icontitle]\" border=0>";
  }
-----------------

version 1.1.2 and version 1.1.3beta1 and 2 Find this code:
-----------------
  if ($wordwrap!=0) {
    $thread[title]=eregi_replace("([^\n\r <>\"\\-]{$wordwrap})"," \\1 ",$thread[title]);
  }
  $threadtitle=htmlspecialchars($thread[title]);
-----------------

Replace with:
-----------------
  if ($wordwrap!=0) {
    $thread[threadtitle]=eregi_replace("([^\n\r <>\"\\-]{$wordwrap})"," \\1 ",$thread[threadtitle]);
  }
  $threadtitle=htmlspecialchars($thread[threadtitle]);
-----------------

version 1.1.3beta3 find this code:
-----------------
  if ($wordwrap!=0) {
    $thread[title]=dowordwrap($thread[title]);
  }
  $threadtitle=htmlspecialchars($thread[title]);

Replace with:
-----------------
  if ($wordwrap!=0) {
    $thread[title]=dowordwrap($thread[threadtitle]);
  }
  $threadtitle=htmlspecialchars($thread[threadtitle]);
That's it! Enjoy. This will cut your queries on forumdisplay from (Num of threads on page + 6) to 6!

Also please forgive me but I have a thing about code structure and readability.

[Edited by rangersfan on 10-26-2000 at 04:43 PM]

Show Your Support

  • This modification may not be copied, reproduced or published elsewhere without author's permission.

Comments
  #12  
Old 10-26-2000, 02:24 PM
Guest
 
Posts: n/a
Default

Quote:
Hi,

I have looked thru all files and cannot find the above statement. I have vb 1.1.3 too.
Can you find the instances of $wordwrap in forumdisplay.php? You can also send me your forumdisplay.php and I will see what you are missing.

webmaster@hedgehogwheels.com
Reply With Quote
  #13  
Old 10-26-2000, 02:45 PM
Guest
 
Posts: n/a
Default

Cheers for this, have sent email now.


The only instance of it is as follows:

Code:
if ($wordwrap!=0) {
    $thread[title]=dowordwrap($thread[title]);
  }
Quote:
Originally posted by rangersfan
Quote:
Hi,

I have looked thru all files and cannot find the above statement. I have vb 1.1.3 too.
Can you find the instances of $wordwrap in forumdisplay.php? You can also send me your forumdisplay.php and I will see what you are missing.

webmaster@hedgehogwheels.com
Reply With Quote
  #14  
Old 10-26-2000, 02:50 PM
Guest
 
Posts: n/a
Default

Quote:
Originally posted by rangersfan
Well, hopefully, any update would have this in it already.
Yes it will
Reply With Quote
  #15  
Old 10-26-2000, 02:55 PM
Guest
 
Posts: n/a
Default

good saved me some work
Reply With Quote
  #16  
Old 10-26-2000, 03:30 PM
Guest
 
Posts: n/a
Default

same i couldn't find it if i searched for the entire code... but searching just for the first line i found it

Code:
if ($wordwrap!=0) {
and then the next 3 lines under it was it
Reply With Quote
  #17  
Old 10-26-2000, 03:58 PM
Guest
 
Posts: n/a
Default

When I search in forumdisplay this is what I get:

Code:
if ($wordwrap!=0) {
    $thread[title]=dowordwrap($thread[title]);
  }
Reply With Quote
  #18  
Old 10-26-2000, 04:31 PM
Guest
 
Posts: n/a
Default

it went in fine for me and seems to be doing it's trick

the combination of this, the showthread and global optimizations seem to be helping my board along.

I'm getting between 3-5k posts a day and every little bit helps
Reply With Quote
  #19  
Old 10-26-2000, 07:44 PM
Guest
 
Posts: n/a
Default

Ok I fixed the problem. It seems I am still using 1.1.3beta2 and with beta3 John moved the eregi line into a function hence the differences. If you have already changed the code, it will work either way as the function just calls the same code you pasted in.
Reply With Quote
  #20  
Old 10-26-2000, 07:57 PM
Guest
 
Posts: n/a
Default

Yeah I installed it before you found a problem. It is producing no error...and seems to be running smooth...I get around 290+ concurrent users during peak hours.

Thanks.
Reply With Quote
Reply

Thread Tools

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:24 AM.


Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2024, vBulletin Solutions Inc.
X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.07153 seconds
  • Memory Usage 2,266KB
  • Queries Executed 24 (?)
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
  • (4)bbcode_code
  • (4)bbcode_quote
  • (1)footer
  • (1)forumjump
  • (1)forumrules
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (1)modsystem_post
  • (1)navbar
  • (6)navbar_link
  • (120)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (1)pagenav_pagelink
  • (10)post_thanks_box
  • (10)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (10)post_thanks_postbit_info
  • (9)postbit
  • (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
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • postbit_display_complete
  • post_thanks_function_can_thank_this_post_start
  • pagenav_page
  • pagenav_complete
  • tag_fetchbit_complete
  • forumrules
  • navbits
  • navbits_complete
  • showthread_complete