Register Members List Search Today's Posts Mark Forums Read

Reply
 
Mod Options
Compress Forum Templates (Speed up your Forums & Save Bandwidth) Details »
Compress Forum Templates (Speed up your Forums & Save Bandwidth)
Mod Version: 2.8, by Trigunflame (Member) Trigunflame is offline
Developer Last Online: Nov 2019 I like it Show Printable Version Email this Page

This modification is in the archives.
vB Version: 3.0.7 Rating: (2 votes - 5.00 average) Installs: 95
Released: 14 Apr 2005 Last Update: Never Downloads: 8
Supported  

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 ]


Block Disabled:      (Update License Status)  
Suspended or Unlicensed Members Cannot View Code.

Step 4. [ close admincp/template.php and open admincp/index.php ]
Step 5. [ look for ]


Block Disabled:      (Update License Status)  
Suspended or Unlicensed Members Cannot View Code.

Step 6. [ below this, add the code ]


Block Disabled:      (Update License Status)  
Suspended or Unlicensed Members Cannot View 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

Click image for larger version

Name:	example.JPG
Views:	1191
Size:	423.0 KB
ID:	25733  

Show Your Support

  • To receive notifications regarding updates -> Click to Mark as Installed.
  • This modification may not be copied, reproduced or published elsewhere without author's permission.
Similar Mod
Mod Developer Type Replies Last Post
Compress Forum Templates Trigunflame vBulletin 3.5 Add-ons 187 12 Jan 2014 16:41
Save bandwidth with CSS. Brad vBulletin 2.x Template Modifications 14 05 Nov 2005 19:11

Comments
  #2  
Old 14 Apr 2005, 21:21
Cyricx Cyricx is offline
 
Join Date: Sep 2002
So if I'm understanding you right..

The part the page loads has the spaces stripped, but when you edit the template in the admincp, it has all the spaces there for ease of navigating?

Would it be possible or would it help even more to strip out the html commenting?
__________________
Cyricx (Chris)
Reply With Quote
  #3  
Old 14 Apr 2005, 21:29
DR@M W@VR DR@M W@VR is offline
 
Join Date: Aug 2002
I tryed this out and it gave me some javascript errors on showthread and the portal page. This might be just applying to my board however.

Luckly I downloaded a backup of my templates before I tryed it out.
__________________
Majestic Forum

Last edited by DR@M W@VR; 14 Apr 2005 at 21:30. Reason: typo
Reply With Quote
  #4  
Old 14 Apr 2005, 21:40
Trigunflame's Avatar
Trigunflame Trigunflame is offline
 
Join Date: Aug 2002
Real name: Dusty Burns
Originally Posted by DR@M W@VR
I tryed this out and it gave me some javascript errors on showthread and the portal page. This might be just applying to my board however.

Luckly I downloaded a backup of my templates before I tryed it out.
I don't get any errors on any of my pages :/

-----------

Ps. Re-Editing a template, resaves the normal version of it, so really you would only need to re-save a template that was causing the js errors. That or fix the JS.
Reply With Quote
  #5  
Old 14 Apr 2005, 21:41
Trigunflame's Avatar
Trigunflame Trigunflame is offline
 
Join Date: Aug 2002
Real name: Dusty Burns
Originally Posted by Cyricx
So if I'm understanding you right..

The part the page loads has the spaces stripped, but when you edit the template in the admincp, it has all the spaces there for ease of navigating?

Would it be possible or would it help even more to strip out the html commenting?
In the database, there are 2 fields were the template is stored as an editable copy, and a output copy.

This script just modifies the output copy, that way the editing copy is still easy to edit.
Reply With Quote
  #6  
Old 14 Apr 2005, 21:49
Trigunflame's Avatar
Trigunflame Trigunflame is offline
 
Join Date: Aug 2002
Real name: Dusty Burns
Update:

Added support to uncompress all templates.
Reply With Quote
  #7  
Old 14 Apr 2005, 22:23
Trigunflame's Avatar
Trigunflame Trigunflame is offline
 
Join Date: Aug 2002
Real name: Dusty Burns
Update:

Adjust the whitespace regex, might prevent javascript errors..
Reply With Quote
  #8  
Old 15 Apr 2005, 00:15
The Realist's Avatar
The Realist The Realist is offline
 
Join Date: Oct 2001
Real name: Brian
I installed this hack but when I compress the templates my dropdown menu does not work. When I click it the page just shoots to the top of the screen?

Laters
Reply With Quote
  #9  
Old 15 Apr 2005, 05:03
Trigunflame's Avatar
Trigunflame Trigunflame is offline
 
Join Date: Aug 2002
Real name: Dusty Burns
Originally Posted by The Realist
I installed this hack but when I compress the templates my dropdown menu does not work. When I click it the page just shoots to the top of the screen?

Laters
Hmm this seems to be an IE problem, I get no errors whatsoever in firefox. IE for some reason doesnt like to "not" have, newlines in JS.

I redid the regex somewhat again, and it works; just not compressing as much as it used to; im gonna keep trying some different methods.
Reply With Quote
  #10  
Old 15 Apr 2005, 13:41
Cyricx Cyricx is offline
 
Join Date: Sep 2002
This weekend I'm refreshing my test site with the live site files, then I'll give this a healthy test run
__________________
Cyricx (Chris)
Reply With Quote
  #11  
Old 15 Apr 2005, 14:57
Trigunflame's Avatar
Trigunflame Trigunflame is offline
 
Join Date: Aug 2002
Real name: Dusty Burns
Originally Posted by Cyricx
This weekend I'm refreshing my test site with the live site files, then I'll give this a healthy test run
Ya this modification is really experimental.. main reason I didn't go into large coding detail or write a very large documentation.

Although after the latest code change, I'm pretty sure it fixed the problem with JS.
Reply With Quote
  #12  
Old 15 Apr 2005, 17:08
buro9 buro9 is offline
 
Join Date: Feb 2002
Originally Posted by Trigunflame
Ya this modification is really experimental.. main reason I didn't go into large coding detail or write a very large documentation.

Although after the latest code change, I'm pretty sure it fixed the problem with JS.
Very nice Trigunflame.

Negates the one I was working on for Zero Tolerence (I'm stuck with a fried hard-drive so it's in limbo... so I really appreciate this being picked up by someone else )

I'm actually going to install this myself... even though I wrote the compress hack
Reply With Quote
  #13  
Old 15 Apr 2005, 17:36
buro9 buro9 is offline
 
Join Date: Feb 2002
I've sent an update from my hack to let people know of yours.

I think it's a very valuable addition to any vBulletin admins arsenal of essential hacks
Reply With Quote
  #14  
Old 15 Apr 2005, 17:45
Trigunflame's Avatar
Trigunflame Trigunflame is offline
 
Join Date: Aug 2002
Real name: Dusty Burns
Originally Posted by buro9
I've sent an update from my hack to let people know of yours.

I think it's a very valuable addition to any vBulletin admins arsenal of essential hacks
Ya, unfortunately im not a master in REGEX, the compressing of the templates currently is not optimal in its design.

Since this is editing the actual parsed templates, one one regex needs to be written, not 2 like we are using now..

The problem lies within the JS tags, need to make one that removes whitespace AND tabs,newlines from every tag outside of <!-- // --> and <!-- -->, anything within those, retains its linebreaks and whitespace...
Reply With Quote
  #15  
Old 15 Apr 2005, 17:52
vulture vulture is offline
 
Join Date: Mar 2005
Originally Posted by buro9
Very nice Trigunflame.

Negates the one I was working on for Zero Tolerence (I'm stuck with a fried hard-drive so it's in limbo... so I really appreciate this being picked up by someone else )

I'm actually going to install this myself... even though I wrote the compress hack

Can this be used alongside your hack?
Reply With Quote
Reply


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Mod Options

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


New To Site? Need Help?

All times are GMT. The time now is 02:27.

Layout Options | Width: Wide Color: