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
  #11  
Old 09-25-2004, 11:47 PM
buro9 buro9 is offline
 
Join Date: Feb 2002
Location: London, UK
Posts: 585
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by mrboz
wow - this makes every page load much faster

thanks very much, great hack.
Your site will be even quicker if you let vBulletin store your CSS as external files. Then they can cache in the browser and you send less with each page request
Reply With Quote
  #12  
Old 09-26-2004, 12:09 AM
turbidblue's Avatar
turbidblue turbidblue is offline
 
Join Date: Apr 2004
Location: Indiana
Posts: 89
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by buro9
Your site will be even quicker if you let vBulletin store your CSS as external files. Then they can cache in the browser and you send less with each page request

how?

[high]* turbidblue is interested [/high]
Reply With Quote
  #13  
Old 09-26-2004, 12:31 PM
buro9 buro9 is offline
 
Join Date: Feb 2002
Location: London, UK
Posts: 585
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by turbidblue
how?

[high]* turbidblue is interested [/high]
Check your AdminCP options:

AdminCP > vBulletin Options > Style & Language Settings > Store CSS Stylesheets as Files? = Yes

Note that vBulletin needs to be able to write the files to the folder:
Quote:
If you would like to store the CSS stylesheet for each style as a file, you must ensure that you have a directory called 'vbulletin_css' inside the 'clientscript' folder, and that the web server has permission to write and delete files within that directory.
So you will need to create the directory is it doesn't exist, and then CHMOD the directory in question to have permissions something like 755 or 775 depending on how your Apache is configured. You don't want to CHMOD it 777... you never want to do that.

You can usually set permissions via FTP programs or SFTP... but it can always be done from SSH or Telnet
Reply With Quote
  #14  
Old 09-26-2004, 12:35 PM
buro9 buro9 is offline
 
Join Date: Feb 2002
Location: London, UK
Posts: 585
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by buro9
Check your AdminCP options:

AdminCP > vBulletin Options > Style & Language Settings > Store CSS Stylesheets as Files? = Yes

Note that vBulletin needs to be able to write the files to the folder:


So you will need to create the directory is it doesn't exist, and then CHMOD the directory in question to have permissions something like 755 or 775 depending on how your Apache is configured. You don't want to CHMOD it 777... you never want to do that.

You can usually set permissions via FTP programs or SFTP... but it can always be done from SSH or Telnet
And yes, I realise that 664 is probably a better chmod... but you know... some servers I've been on are just lovely and hardened and prevent writing withour very specific chmod values... 755 and 775 being the most common two... so I was being lazy in giving execute too as this prevents people bugging me about something unrelated to the hack
Reply With Quote
  #15  
Old 09-26-2004, 02:58 PM
Paul M's Avatar
Paul M Paul M is offline
 
Join Date: Sep 2004
Location: Nottingham, UK
Posts: 23,748
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

The full version screws up nicely formatted posts when you edit them, so I have used the "lite" version which doesn't do this.
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 03: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.06163 seconds
  • Memory Usage 2,358KB
  • Queries Executed 28 (?)
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
  • (9)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
  • (15)post_thanks_box
  • (15)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (15)post_thanks_postbit_info
  • (14)postbit
  • (14)postbit_onlinestatus
  • (15)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