Go Back   vb.org Archive > vBulletin Modifications > Archive > Modification Graveyard
FAQ Community Calendar Today's Posts Search

Reply
 
Thread Tools
Page Output Compression - Whitespace stripper. Details »»
Page Output Compression - Whitespace stripper.
Version: 1.00, by buro9 buro9 is offline
Developer Last Online: Jul 2012 Show Printable Version Email this Page

Category: Board Optimization - Version: 3.0.6 Rating:
Released: 09-22-2004 Last Update: Never Installs: 70
 
No support by the author.

No longer supported by the author.

Show Your Support

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

Comments
  #2  
Old 09-23-2004, 04:11 PM
nexialys
Guest
 
Posts: n/a
Default

this have been done in another hack related to templates compression...

most of the time, it's not good to have such a feature because html is not written well, or is not xhtml relevent...
Reply With Quote
  #3  
Old 09-23-2004, 04:18 PM
buro9 buro9 is offline
 
Join Date: Feb 2002
Location: London, UK
Posts: 585
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by nexialys
this have been done in another hack related to templates compression...
I did search, maybe you could point to where this is.

Quote:
Originally Posted by nexialys
most of the time, it's not good to have such a feature because html is not written well, or is not xhtml relevent...
The hack doesn't break things, it doesn't affect JavaScript, etc... it merely collapses white space.

As both HTML and XHTML renderers ignore white space the hack can't possibly do anything that the HTML or XHTML wasn't already doing.

I've tested it on my forum and been sure to not upset anything anywhere... I only replace multiple white spaces with a single space... there is no chance a renderering engine will alter what it does because of this.

If I didn't put back 1 white space for the many taken out, then I would agree that I might be affecting the page display or something... as someone might've relied on spacing. However, I leave a single space in there for that reason.

Please show me how my hack does what you imply.
Reply With Quote
  #4  
Old 09-23-2004, 08:14 PM
Red Blaze's Avatar
Red Blaze Red Blaze is offline
 
Join Date: Jan 2003
Location: Texas
Posts: 493
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

I'm using 3.0.0, and I had to do something else, and still worked.

You see, I didn't find:

PHP Code:
if (DB_QUERIES
  { 
But I did find:

PHP Code:
    $pageendtime microtime(); 
I just put:

PHP Code:
$patterns = array('/\>\s+\</''/^\s*/m'); 
    
$replace = array('> <'''); 
    
$vartext preg_replace($patterns$replace$vartext); 
AFTER what I had to find and it works just as you said. Now my forums are running faster. ^^;;
Reply With Quote
  #5  
Old 09-23-2004, 08:48 PM
buro9 buro9 is offline
 
Join Date: Feb 2002
Location: London, UK
Posts: 585
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by Sonikku
I'm using 3.0.0, and I had to do something else, and still worked.

You see, I didn't find:

PHP Code:
if (DB_QUERIES
  { 
But I did find:

PHP Code:
    $pageendtime microtime(); 
Strange indeed.

I've just checked the default file from Jelsoft for vBulletin 3.0.3 and the code as I've pasted it is on line 1852. So it is there when shipped.

You must've removed it at some point, maybe for another hack?

Well... no worries. If it didn't have the if (DB_QUERIES) block then you would be best to place the hack code BEFORE the $pageendtime variable. Otherwise the stat you get telling you how long the page took to load will not reflect the inclusion of the hack, as the $pageendtime is literally the timestamp of the page as it finishes being generated.
Reply With Quote
  #6  
Old 09-23-2004, 08:49 PM
buro9 buro9 is offline
 
Join Date: Feb 2002
Location: London, UK
Posts: 585
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Hehe... I just noticed you said 3.0.0. Well, the hack version does say 3.0.3

It works anyway... just place the hack BEFORE the $pageendtime variable is set
Reply With Quote
  #7  
Old 09-23-2004, 09:13 PM
58sniper 58sniper is offline
 
Join Date: Sep 2002
Posts: 127
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

That won't work if someone uses the <pre> tag, which utilizes whitespace for formatting.
Reply With Quote
  #8  
Old 09-23-2004, 10:24 PM
buro9 buro9 is offline
 
Join Date: Feb 2002
Location: London, UK
Posts: 585
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by 58sniper
That won't work if someone uses the <pre> tag, which utilizes whitespace for formatting.
A fine point... added a 'lite' version to the first post that leaves white space at the beginning of lines alone.

However if you have a tech site in which you paste lots of HTML, etc... and you want to preserve space within that. Then you'd be best not using this hack at all
Reply With Quote
  #9  
Old 09-24-2004, 01:40 AM
Ghostsuit's Avatar
Ghostsuit Ghostsuit is offline
 
Join Date: Nov 2001
Location: Glasgow, Scotland
Posts: 199
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Simple and effective. Oh and anyone that has VB3 MicroStats hack installed will not be able to find

Code:
if (DB_QUERIES)
  {
    $pageendtime = microtime();
so place it before

Code:
if (DB_QUERIES)
		{
			$ms = '';
Thats should do the job.
Reply With Quote
  #10  
Old 09-25-2004, 10:17 PM
mrboz's Avatar
mrboz mrboz is offline
 
Join Date: Feb 2003
Posts: 13
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

wow - this makes every page load much faster

thanks very much, great hack.
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 04:20 PM.


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.09011 seconds
  • Memory Usage 2,299KB
  • Queries Executed 23 (?)
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
  • (2)bbcode_code
  • (5)bbcode_php
  • (4)bbcode_quote
  • (1)footer
  • (1)forumjump
  • (1)forumrules
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (1)modsystem_post
  • (1)navbar
  • (4)navbar_link
  • (120)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (2)pagenav_pagelink
  • (10)post_thanks_box
  • (10)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (10)post_thanks_postbit_info
  • (9)postbit
  • (9)postbit_onlinestatus
  • (10)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