![]() |
|
|
Mod Options |
Compress Forum Templates (Speed up your Forums & Save Bandwidth) Details »»
|
|||||||||||||||||||||||
|
Compress Forum Templates (Speed up your Forums & Save Bandwidth)
Developer Last Online: Jan 2013
This modification is in the archives.
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: http://www.vbulletin.org/forum/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 ]
Step 4. [ close admincp/template.php and open admincp/index.php ] Step 5. [ look for ]
Step 6. [ below this, add the code ]
How-To Run 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. Download Now Only licensed members can download files, Click Here for more information. Supporters / CoAuthors Screenshots Show Your Support
No members have liked this post.
|
|||||||||||||||||||||||
Similar Mod
|
||||
| Mod | Developer | Type | Replies | Last Post |
| Compress Forum Templates | Trigunflame | vBulletin 3.5 Add-ons | 185 | 26 Feb 2012 01:53 |
| Save bandwidth with CSS. | Brad | vBulletin 2.x Template Modifications | 14 | 05 Nov 2005 18:11 |
|
#46
|
||||
|
||||
|
Trigunflame is a gent and solved my problem
![]() HOTM I say ![]() Laters No members have liked this post.
|
|
#47
|
||||
|
||||
|
Another problem.
Clicked edit and my page is twice its size? Not my day? No members have liked this post.
|
|
#48
|
||||
|
||||
|
Originally Posted by The Realist
Screenshot
, and again Im not getting this problem on my test forums.No members have liked this post.
Last edited by Trigunflame : 16 Apr 2005 at 11:47. |
|
#49
|
|||
|
|||
|
Had a nice problem relating to the footer template and the inline javascript.
It compressed to: <script type="text/javascript"><!-- // There was a vbulletin comment here vBulletin_init(); // Initialize 'Active' Table Cells //activecells_init();//--></script> The problem with that is that // is a line comment, and then there is no line break, so the whole javascript is commented out, and menu's do not get initialised, etc. The result is that those swishy JavaScript drop down menus break. You can fix this by updating your footer template to just have: <script type="text/javascript">vBulletin_init();/script> In place of the larger block. That does it for me ![]() Aside from that minor problem, this hack is wonderful. I'm going to go off and search for other places that might be impacted by this though... recommendation: Don't compress JavaScript at all... leave line breaks in. No members have liked this post.
Last edited by buro9 : 16 Apr 2005 at 11:38. |
|
#50
|
||||
|
||||
|
Originally Posted by buro9
Buro, did you try the new version? Mutli-Line javascript is left in its standard format short of tabs.
ie. using the updated version, my footer looks like this (Compressed Template): http://narutotalk.org
No members have liked this post.
Last edited by Trigunflame : 16 Apr 2005 at 11:42. |
||||
|
#51
|
|||
|
|||
|
Nope, everything else is working fine... editors doing their job, popups where needed are working (attachments, i have a translate hack, buddy list, thread replies, etc).
So just that one very small adjustment... and frankly, for the benefit this hack gives I'd opt for the editing of the footer template over reducing the compression the hack does. No members have liked this post.
|
|
#52
|
|||
|
|||
|
Originally Posted by Trigunflame
Hehe, maybe not
![]() I'll upgrade now ![]() No members have liked this post.
|
|
#53
|
|||
|
|||
|
It works, but I had to add a line break.
I'm not sure what version of footer I customised (most likely the vb3 beta one that I've been dragging through each update), but it had the <script block directly following the DST correction block: </if><script For some reason that I don't want to look into , it would not recognise that as a JS block and was compressing it.If I moved the <script onto a new line like thus: </if> <script Then it worked perfectly. As I said though... the footer template is one I modified in vb a long time ago... so this is likely not an issue as viewing the original now shows that they are indeed on new lines already and thus work perfectly. If anyone has old templates that they've modified though, they hopefully will read this and add the linebreak ![]() No members have liked this post.
|
|
#54
|
|||
|
|||
|
Hi
And here is the german translation for all german users: No members have liked this post.
|
|
#55
|
||||
|
||||
|
Update:
Removed support for inline javascript, all javascript stays line-per-line. Removed support for inline styles, all style data stays line-per-line. No members have liked this post.
|
|
#56
|
|||
|
|||
|
Would you please tell me what to change in the code, so that I can change it in the translation too?
No members have liked this post.
|
|
#57
|
|||
|
|||
|
Hrm,
Here's a little problem with the latest version. No members have liked this post.
|
|
#58
|
||||
|
||||
|
Originally Posted by Rambo
Ok, will try and contact; someone else is having same problem.
No members have liked this post.
|
|
#59
|
||||
|
||||
|
Update:
Im workin on the solution, ive identied the problem as a special template. No members have liked this post.
|
|
#60
|
||||
|
||||
|
Update;
Finished, everyone use the newest version of the code. Problem was a certain template that delt with fonts available from drop down menu, they were being compressed also, causing errors. No members have liked this post.
Last edited by Trigunflame : 16 Apr 2005 at 13:36. |
![]() |
«
Previous Mod
|
Next Mod
»
| Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) |
| Mod Options | |
|
|
| New To Site? | Need Help? |
All times are GMT. The time now is 13:08.







, it would not recognise that as a JS block and was compressing it.
