The Arcive of Official vBulletin Modifications Site.It is not a VB3 engine, just a parsed copy! |
|
Compress Forum Templates (Speed up your Forums & Save Bandwidth) Details »» | |||||||||||||||||||||||||||
Compress Forum Templates (Speed up your Forums & Save Bandwidth)
Developer Last Online: Nov 2019
Compress Forum Templates & Phrases Speed up your Forums & Save Bandwidth Description: Hi, this is a pretty simple hack that involves compressing the 'compiled' version of your templates, this way it only compresses the part thats to be shown on the forum and not the actual template data you edit. Background: Got the idea from Zero Tolerance in buro9's thread: https://vborg.vbsupport.ru/showthread.php?t=69787 The above hack compresses the page at parse time, while it provides some speed enhancement, on large pages you can actually "negate" the point of using the hack in the first place, because of the overhead in compression. Thus, the creation of this hack is to provide similiar functionality, but done in the adminCP; and without the overhead of constant compression. Info: No Queries. Only query is used when compressing your templates, the rest of the time its just pulling the templates straight out of the database like normal. Updates: Version 2.8 - Added Strip Whitespace from Start of JS Line by buro9 Version 2.7 - Option to strip HTML Comments from Compressed Output Version 2.6 - Removed Phrase Compression altogether, Too Iffy Version 2.5 - Removed the ASCII \n removal, emails should work now. Version 2.4 - Had to add editor_jsoptions_size to the Bad Templates array, it also was causing a font selection error. Version 2.3 - Added Phrase compression support, should help further increase page compression. Version 2.2 - Slightly Recoded Template compression for faster results. Version 2.1 - Added php_include templates to bad templates, will not compress these. Version 2.0 - Recoded Script, added support for certain templates to not compress Version 1.9 - Re-Added support for InLine Styles. Version 1.8 - Removed support for InLine Styles, all Style data is left with Linebreaks. Version 1.7 - Removed support for InLine Javascript, all JavaScript is left with Linebreaks. Version 1.6 - Fixed Tab problem, tabs are replaced with a single space Version 1.5 - Removed a part of the SQL. Version 1.4 - TOTALLY Remade, Works perfect now; Ultimate Compression Version 1.3 - Adjusted Again Version 1.2 - Adjusted Stripping regex Version 1.1 - Added Uncompress Support Version 1.0 - Release Install: Step 1. [ Open admincp/template.php ] Step 2. [ Go to about line: 1278, or just look for $_REQUEST['do'] == 'edit' ] Step 3. [ Above Step 2, add the below code ] PHP Code:
Step 5. [ look for ] PHP Code:
PHP Code:
1. Install 2. In the admincp left navigation, select "Compress Templates". 3. Repeat Step 2 after each modification of your Templates whenever you decide to change something. 4. If you want to uncompress all Templates, select "Uncompress Templates" 5. IF Any Templates Come Out Weird, add the template Name to the Bad Templates Array and Re-Run the Compress Templates. Supporters / CoAuthors Show Your Support
|
Comments |
#162
|
|||
|
|||
damn, this works like a champ
my board is heavily modified and i dont have any experience in coding or anything i mod it and it works at the first time. my board load so fast now thanks a million for writting this code edit: i just check my board again, and somehow, my quickreply text box disappeared :nervous: anyone know wat happen ? |
#163
|
|||
|
|||
above it, i did that and it works
HTML Code:
//############################################################################# // edit form for an existing template if ($_REQUEST['do'] == 'edit') |
#164
|
||||
|
||||
Any chance for a 3.5 Version?
|
#165
|
|||
|
|||
Quote:
|
#166
|
|||
|
|||
Quote:
Just copy the block of code into the foot of admincp/template.php And then add this XML to includes/xml/cpnav_vbulletin.xml Code:
<navoption comment="HACK : COMPRESS TEMPLATES" displayorder="51"> <phrase>compressall</phrase> <link>template.php?do=compressall</link> </navoption> <navoption link="template.php?do=compressall&revert=1" comment="HACK : COMPRESS TEMPLATES" displayorder="52"> <phrase>uncompressall</phrase> </navoption> Code:
</navgroup> <navgroup phrase="languages_and_phrases" permissions="canadminlanguages" displayorder="30"> The hack continues to work perfectly in vb3.5 |
#167
|
|||
|
|||
Oh, and I added the 'comment' attribute as I like being able to search the whole code base and see instantly what modifications I need to migrate at update time by simply looking for the word HACK.
|
#168
|
|||
|
|||
Quote:
if it's a select/read querie: from '$DB_site->query' to '$db->query_read' if it's a update/write querie: from '$DB_site->query' to '$db->query_write' You also need to add the phrases 'compressall' and 'uncompressall'. otherwise they won't show up in de navigation-menu of your adminCP. You can also remove the badtemplates 'phpinclude_start' and 'phpinclude_end'. They don't exist in vb3.5 gold Hidjra |
#169
|
|||
|
|||
this mod rocks, i luv it so much, it speeds up the forum like crazy
but does anyone here have the same problem like me after you compress the template, your text message box disappears. Here is a pic of my quick reply after the template compression |
#170
|
|||
|
|||
Quote:
Have you hacked that template though? Put anything in there that might make it less than rock solid (stacks of JavaScript and weird HTML for example?). You can just figure out what the template name for that is and add it to the array of templates to skip. However it shouldn't be an issue, figure out where you've broken it and fix that would be the better solution |
#171
|
|||
|
|||
Oh... and an example of the before and after HTML would be appreciated... at least we'd be able to understand what went wrong then.
|
|
|
X vBulletin 3.8.12 by vBS Debug Information | |
---|---|
|
|
More Information | |
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|