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-26-2000 Last Update: Never Installs: 0
 
No support by the author.

This optimization just may help you out more than the forumdisplay did! Check it out...

edit global.php (the one in /forum, not the admin one)

find:

Code:
// ###################### Start makeforumjump #######################
Delete everything between that line and this line:

Code:
// ###################### Start countchar #######################
In it's place put this:

Code:
function makeforumjump()
{
  // this generates the jump to box
  global $DB_site,$forumid,$optionselected,$usecategories, $jumpforumid,$jumpforumtitle, $jumpforumbits,$curforumid;
  global $hideprivateforums,$defaultselected, $forumjump,$bbuserid,$bbusergroupid;

  if ($forumid!="")
  {
     $curforumid=$forumid;
  }   
  else
  {
     if ($threadid!="")
     {
        $getforumid=$DB_site->query_first("SELECT forumid FROM thread WHERE threadid=$threadid");
        $curforumid=$getforumid[forumid];
     }
  }  


  $forums=$DB_site->query("SELECT category.categoryid, category.title AS categorytitle,
                                     forumid, forum.title AS forumtitle
                              FROM category
                              LEFT JOIN forum ON (category.categoryid = forum.categoryid)
                              WHERE category.displayorder<>0 AND forum.displayorder <> 0 AND active=1
                              ORDER BY category.displayorder, forum.displayorder");
  $firstcat = 0;
  while ($forum=$DB_site->fetch_array($forums))
  {
     $currentcat = $forum[categoryid];
     if ($usecategories == 1)
     {
         $optionselected="";        
         if ($firstcat != $currentcat) // Print Category
         {
            $firstcat = $forum[categoryid];
            // This creates our "blank line" in the dropdown
            $jumpforumid="";   
            $jumpforumtitle="";
            eval("\$jumpforumbits .= \"".gettemplate("jumpforumbit")."\";");
            $jumpforumid="cat$forum[categoryid]";
            $jumpforumtitle="Category: $forum[categorytitle]";
            eval("\$jumpforumbits .= \"".gettemplate("jumpforumbit")."\";");
            $jumpforumid="";
            $jumpforumtitle="--------------------";
            eval("\$jumpforumbits .= \"".gettemplate("jumpforumbit")."\";");
         }
     } 

     if ($hideprivateforums==1)    
     {    
        $getperms=getpermissions($bbuserid,$bbusergroupid,$forum[forumid]);    
     }       
     else            
     {    
        $getperms[canview]=1;    
     }    
     if ($getperms[canview]==1)    
     {    
        $jumpforumid=$forum[forumid];    
        $jumpforumtitle="  $forum[forumtitle]";    
        if ($curforumid==$jumpforumid)    
        {    
           $optionselected="selected";    
           $selectedone=1;    
        }    
        eval("\$jumpforumbits .= \"".gettemplate("jumpforumbit")."\";");    
     }    
  }
  if ($selectedone!=1)
  {
     $defaultselected="selected";
  }
  eval("\$forumjump = \"".gettemplate("forumjump")."\";");
}
For the record the current forumjump retrieves a list of categories. Then for each record in that result set it runs a query of the forums that belong to that category. Have 50 categories, you have 51 queries. Now you would have 2. We still need to do something about that "getperms" function as it will run a query each time per forum. How about we retrieve that information along with the bbusername, bbpassword, bbuserid and have it available instead of constantly retrieveing it all the time. Just a thought.

[Edited by Ed Sullivan on 10-27-2000 at 05:45 PM]

Show Your Support

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

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

hehe i really love you sig rangersfan
Reply With Quote
  #13  
Old 10-26-2000, 11:35 PM
Guest
 
Posts: n/a
Default

yeah I think that my sig with the links will not be needed anymore.
Reply With Quote
  #14  
Old 10-27-2000, 11:41 AM
Guest
 
Posts: n/a
Default

I installed this hack and am wandering around trying to figure out where this is called from. On what screens should I notice this happening? On the main screen when the forums and categories are loaded?

Just curious, and thanks for the extra effort, rangersfan!
Reply With Quote
  #15  
Old 10-27-2000, 01:28 PM
Guest
 
Posts: n/a
Default

It is the small pulldown menu that appears on forumdisplay and allows you to select a forum to "jump to".
Reply With Quote
  #16  
Old 10-27-2000, 02:53 PM
Guest
 
Posts: n/a
Default

Your three optimizations are great. I was just wondering if you know if they are to be included in 1.1.4 and 2.0 or did John redo the coding.

Knowing this will greatly help development along at SitePoint.
Reply With Quote
  #17  
Old 10-27-2000, 02:57 PM
Guest
 
Posts: n/a
Default

Quote:
Originally posted by wluke
Your three optimizations are great. I was just wondering if you know if they are to be included in 1.1.4 and 2.0 or did John redo the coding.

Knowing this will greatly help development along at SitePoint.
I think its in 2.0
Reply With Quote
  #18  
Old 10-27-2000, 02:59 PM
Guest
 
Posts: n/a
Default

I have no clue, I have never had any communication with anybody at Jelsoft.
Reply With Quote
  #19  
Old 10-27-2000, 03:03 PM
Guest
 
Posts: n/a
Default

The 1.1.4 stable release is planned to have about a dozen known bug fixes along with many new optimizations, including those posted by rangersfan and Stallion, along with a few others.

Of course I am sure they will all make in into 2.0 as well.

-Chris
Reply With Quote
  #20  
Old 10-27-2000, 03:19 PM
Guest
 
Posts: n/a
Default

(blatant reply to bump my posts to 1000 )
Reply With Quote
  #21  
Old 10-27-2000, 05:15 PM
Guest
 
Posts: n/a
Default

For the record, I am copying rangersfan with his sig idea, and its not the other way around. :-)
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:53 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.04998 seconds
  • Memory Usage 2,271KB
  • Queries Executed 25 (?)
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
  • (3)bbcode_code
  • (1)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
  • (2)pagenav_pagelink
  • (11)post_thanks_box
  • (11)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (11)post_thanks_postbit_info
  • (10)postbit
  • (11)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