Go Back   vb.org Archive > vBulletin Modifications > Archive > vB.org Archives > vBulletin 2.x > vBulletin 2.x Full Releases
FAQ Community Calendar Today's Posts Search

Reply
 
Thread Tools
RealTime Template Compressor: Reduces page sizes, loads pages faster, saves Bandwidth Details »»
RealTime Template Compressor: Reduces page sizes, loads pages faster, saves Bandwidth
Version: 1.00, by Logician Logician is offline
Developer Last Online: Nov 2023 Show Printable Version Email this Page

Version: 2.2.x Rating:
Released: 08-28-2003 Last Update: Never Installs: 78
 
No support by the author.

As you know all vbulletin pages consists of templates and templates consists of HTML (+sometimes javascript) tags.

Nearly in all sites and HTML pages, HTML tags are written in a readable format so that developer can read the source code easily. VB templates abide by this rule too.

However when this "nicely readable" code is called by a visitor, page size unnecessarily increases because of the redundant "spaces" and "line breaks" in the source code which have no useful purpose regarding the page output but is there just for making the source code more readable to the developer.

This hack removes these unnecessary spaces and line breaks from your vbulletin templates AT THE MOMENT they are displayed (in realtime). It does NOT touch your original source code so it is still readable to you when you want to edit it in your admin CP. But it compress the output when they are sent to user's browser.

Removal of these unnecessary characters makes sure:
a) Page output shrinks in all vb pages
b) Thus page loads faster by all visitors
c) You save bandwidth.

Since the removed characters are unnecessary characters, display of your page does NOT change. Please see FAQ below for more info.

This hack is 100% compatible with Teck's Microstat Hack and my Advanced Templates: Dynamic Templates Changing according to different conditions hack and WebTemplates 2.x: VB Integrated Content Management System . It is a very easy to install add (just a few lines in 1 step) yet effective.

I appreciate if you can click INSTALL button, if you use the hack. Thank you. :glasses:

Show Your Support

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

Comments
  #32  
Old 08-30-2003, 07:36 PM
Cal Poly Forum Cal Poly Forum is offline
 
Join Date: Jul 2003
Posts: 59
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

PHP Code:
Parse errorparse error in /home/kkwak/public_html/forum/admin/functions.php on line 957

Fatal error
Call to undefined function: vbdate() in /home/kkwak/public_html/forum/admin/sessions.php on line 404 

Any idea?
edit: Oh no! The whole board is down and can't seem to restore my SQL Database (giving me an error).
Reply With Quote
  #33  
Old 08-30-2003, 10:07 PM
insanctus's Avatar
insanctus insanctus is offline
 
Join Date: Feb 2003
Location: Michigan
Posts: 582
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Upload your back up copy (if you did back it up) if not try posting the line 957 in here so that they can better help you.
Reply With Quote
  #34  
Old 08-31-2003, 12:16 AM
Crinos's Avatar
Crinos Crinos is offline
 
Join Date: Oct 2001
Location: Los Angeles, CA
Posts: 151
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

This is a good hack, but unfortunately I can't use it after trying it ... it does remove spaces between tags and makes the page become slightly smaller (I got as much as 12% compression in some pages), but it also removes spaces that should aesthetically be there (those that don't have  , for instance) ...

One example include the separation between the page number links in multiple page topics...

they appear 12345...Last Page
instead of the usual
1 2 3 4 5 ... Last Page
and frankly I don't have time to go back to each template and replace the simple spacing with   so it would be recognized by the hack as a legitimate spacing...

Sure, I can just modify the default page navigation templates, but those weren't the only templates affected just coz of simple spacing, and it surely defeats the purpose of the hack anyway

As I said, this is an excellent hack but I can't incorporate it for aesthetic reasons... keep up the good work tho ... I'm having a blast with the webtemplates
Reply With Quote
  #35  
Old 08-31-2003, 06:21 AM
heynurse heynurse is offline
 
Join Date: Jan 2002
Posts: 160
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Nice job Logician! Thanks for the great documentation with your hacks!
Reply With Quote
  #36  
Old 08-31-2003, 11:11 AM
oldgamesnu oldgamesnu is offline
 
Join Date: Jun 2003
Posts: 4
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Seems to work perfectly. Great Work!
--------------------------------------------------
Powered by: vBulletin Version 2.2.9
Copyright ©2000, 2001, Jelsoft Enterprises Limited.

Page generated in 0.24441695 seconds (88.99% PHP - 11.01% MySQL) with 25 queries.
[Debug Mode OFF] [PHP v4.3.2] [GZIP disabled]
[Output: 156.90 Kb. compressed to 148.90 Kb. by saving 8.00 Kb. (5.10%)] [Server Load: 0.00 » 0.01 : 0.00]
Reply With Quote
  #37  
Old 08-31-2003, 12:03 PM
msimplay's Avatar
msimplay msimplay is offline
 
Join Date: Aug 2002
Location: UK
Posts: 1,059
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

works fine on the forum but messes up my Vbhome layout when i'm signed in as admin
Reply With Quote
  #38  
Old 08-31-2003, 05:15 PM
Logician's Avatar
Logician Logician is offline
 
Join Date: Nov 2001
Location: inside vb code
Posts: 4,449
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Yesterday at 11:36 PM Cal Poly Forum said this in Post #31
PHP Code:
Parse errorparse error in /home/kkwak/public_html/forum/admin/functions.php on line 957

Fatal error
Call to undefined function: vbdate() in /home/kkwak/public_html/forum/admin/sessions.php on line 404 

Any idea?
edit: Oh no! The whole board is down and can't seem to restore my SQL Database (giving me an error).
Can not be related to this hack. You obviously applied it wrongly.
Reply With Quote
  #39  
Old 08-31-2003, 08:46 PM
Erwin's Avatar
Erwin Erwin is offline
 
Join Date: Jan 2002
Posts: 7,604
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Very cool! Thanks, mate.

I installed this on my vB3 forums, and integrated it into my own version of microstats. Working very well.
Reply With Quote
  #40  
Old 08-31-2003, 09:12 PM
Logician's Avatar
Logician Logician is offline
 
Join Date: Nov 2001
Location: inside vb code
Posts: 4,449
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
08-30-03 at 08:09 PM JulianD said this in Post #29
You know, I was thinking about it.. wouldn't be possible to disable this hack only if the Add template name in comments option is active on the control panel?
Yes that can be possible:

You need to change this line in the hack
PHP Code:
 $vartext=preg_replace ("/(\>)(\s*)(\\r\\n)*(\s*)(\<)/"'\\1\\5'$vartext); 
as:
PHP Code:
if ($addtemplatename==0) { $vartext=preg_replace ("/(\>)(\s*)(\\r\\n)*(\s*)(\<)/"'\\1\\5'$vartext); } 
And also add:
PHP Code:
global $addtemplatename
right after:
PHP Code:
function dooutput($vartext,$sendheader=1) { 
This will enable compression if template name option is turned on in settings page.

Enjoy..
Reply With Quote
  #41  
Old 08-31-2003, 09:17 PM
Logician's Avatar
Logician Logician is offline
 
Join Date: Nov 2001
Location: inside vb code
Posts: 4,449
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Yesterday at 04:03 PM msimplay said this in Post #36
works fine on the forum but messes up my Vbhome layout when i'm signed in as admin
Never tried with vbhome (nor have ever used it) so dont know how they along together but I wouldn't expect any problems unless there is a HTML tag untideness (like missing < > etc.) in its source code.
Reply With Quote
Reply


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 12:14 AM.


Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2024, vBulletin Solutions Inc.
X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.07529 seconds
  • Memory Usage 2,328KB
  • 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
  • (6)bbcode_php
  • (3)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
  • (4)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_onlinestatus
  • (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
  • postbit_imicons
  • 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