Back to vBulletin 3.8 Add-ons

Super Speedy UserCP
Mod Version: 1.01, by Birched

vB Version: 3.8.4 Rating: (5 votes - 4.80 average) Installs: 55
Released: 08 Aug 2009 Last Update: Never Downloads: 0
Not Supported Code Changes Re-usable Code Translations  

TIME TO INSTALL: 10 seconds (requires editing of one file in one place)

This simple code modification increases my usercp.php loading speed by 6x. I think it will be most useful in cases where there are many subscribed forums.

It is listed as a modification for version 3.8.3 (which I am currently working with), but this mod works as far back as 3.0.1 (the 'find' text might be slightly different, but the function name and the text you replace is the same).
EDIT: Tested up to 3.8.4.

It works because the php function is_array() is excruciatingly slow, and an empty array gives the same return value as an empty variable.

This code would likely break if someone introduced a location in the code where the $lastpostarray variable was set to something (i.e. not nothing) that was not an array.

There are lots of these checks in the vBulletin code. It's likely that further speed increases could be achieved by changing more of them -- just remember that there is an unlikely circumstance (see previous paragraph) where it would cause problems. If you find other locations with significant effects, please post them in a reply!

##### IN FILE

functions_forumlist.php

##### FIND

function construct_forum_bit($parentid, $depth = 0, $subsonly = 0)
{
global $vbulletin, $stylevar, $vbphrase, $show;
global $imodcache, $lastpostarray, $counters, $inforum;

// this function takes the constant MAXFORUMDEPTH as its guide for how
// deep to recurse down forum lists. if MAXFORUMDEPTH is not defined,
// it will assume a depth of 2.

// call fetch_last_post_array() first to get last post info for forums
if (!is_array($lastpostarray))

##### REPLACE

if (!is_array($lastpostarray))

##### WITH

if (!$lastpostarray)

#####

And that's it! Enjoy, and I hope it helps!

Download

No files for download.

Supporters / CoAuthors

  • Birched

Similar Mods

End-User Options Change your UserCP Navbar with the New UserCP Dropdown Menu! vBulletin 3.7 Add-ons
End-User Options GTUserCP - Enhanced USERCP Interface + USERCP Menu vBulletin 3.6 Template Modifications

vblts.ru supports vBulletin®, 2022-2024