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
  #82  
Old 11-28-2004, 05:15 AM
blueuniverse blueuniverse is offline
 
Join Date: Jul 2004
Location: UK
Posts: 146
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by Paul M
Which other one ?

That is basically the final version that people came up with - it uses the more agressive stripping except for the listed scripts, where it uses the 'lite' version.
The full one at the beginning. What I want really is just a lite version, which strips all the tags but won't affect the formatting in the post.
Reply With Quote
  #83  
Old 11-28-2004, 07:47 AM
buro9 buro9 is offline
 
Join Date: Feb 2002
Location: London, UK
Posts: 585
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by blueuniverse
The full one at the beginning. What I want really is just a lite version, which strips all the tags but won't affect the formatting in the post.
Originally I offered the hack in two parts... a full aggressive version and a lite version.

The hack was then modified by some users to run both parts according to which php file was being run... and this is a good idea so I changed the hack to reflect these modifications.

If you want just a lite version then the code is still there, just take out the bits that the aggressive version and the switch would need.

What this means is that where I now have this in the hack:
PHP Code:
// HACK : START : COMPRESS
$thisscriptis = array(
    
'editpost',
    
'register',
    
'newreply',
    
'newthread',
    
'sendmessage',
    
'private',
);

if (!
in_array(THIS_SCRIPT$thisscriptis)) {
    
$patterns = array('/\>\s+\</''/^\s*/m');
    
$replace = array('> <''');
    
$vartext preg_replace($patterns$replace$vartext);
} else {
    
$vartext preg_replace('/\>\s+\</''> <'$vartext);
}
// HACK : END : COMPRESS 
You only need this to have a lite version:
PHP Code:
// HACK : START : COMPRESS
$vartext preg_replace('/\>\s+\</''> <'$vartext);
// HACK : END : COMPRESS 
Note that we still recognised one scenario where this would be annoying... and that is when your forum is one where people are likely to post HTML or XML within their posts within PRE tags... as the formatting of that would also be changed.

So in that scenario the recommendation was that you don't run this hack... as it is designed to remove whitespace and that means that it re-formats HTML, XHTML, XML style text.

Anyhow... hope that helps.
Reply With Quote
  #84  
Old 11-28-2004, 08:03 AM
blueuniverse blueuniverse is offline
 
Join Date: Jul 2004
Location: UK
Posts: 146
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Ok then. Thats pretty simple. Anyway, thanks for the hack, hopefully it should speed stuff up significantly.
Reply With Quote
  #85  
Old 11-28-2004, 03:31 PM
blueuniverse blueuniverse is offline
 
Join Date: Jul 2004
Location: UK
Posts: 146
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Also, is the aggressive version a better bet for those who don't offer html in the posts. Are there any other disadvantages?
Reply With Quote
  #86  
Old 11-28-2004, 09:58 PM
buro9 buro9 is offline
 
Join Date: Feb 2002
Location: London, UK
Posts: 585
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by blueuniverse
Also, is the aggressive version a better bet for those who don't offer html in the posts. Are there any other disadvantages?
The difference is this:

The 'lite' version only collapses whitespace between HTML tags.

The 'aggressive' version collapses all whitespace, even where it does not occur between HTML tags.

There is no performance impact when using one over the other.

The difference is the output... the aggressive can remove more... but if you have people posting things like guitar tablature then the whitespace needed for formatting that is changed and it ruins it.

Because the lite version only touches the space between HTML, the lite version wouldn't affect that.

It just depends how much you want to remove
Reply With Quote
  #87  
Old 01-14-2005, 07:34 PM
newtsys newtsys is offline
 
Join Date: Dec 2004
Location: Idaho
Posts: 78
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

very good I installed it on my 3.0.5 and it definately sped the forum up!
Reply With Quote
  #88  
Old 02-07-2005, 06:09 PM
Bad Bunny's Avatar
Bad Bunny Bad Bunny is offline
 
Join Date: Apr 2002
Posts: 555
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Thanks for the work. It does it's job, and even my small forum was sped up significantly.
Reply With Quote
  #89  
Old 02-07-2005, 08:55 PM
Erwin's Avatar
Erwin Erwin is offline
 
Join Date: Jan 2002
Posts: 7,604
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

I still use this on 3.0.6 - works well.
Reply With Quote
  #90  
Old 02-08-2005, 01:57 AM
Lord Brar's Avatar
Lord Brar Lord Brar is offline
 
Join Date: Jul 2004
Posts: 102
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

wow! I can't belive the pageloading times now!!! Thanks a lot for the hack mate!
Reply With Quote
  #91  
Old 02-23-2005, 12:44 PM
Eternal2u Eternal2u is offline
 
Join Date: Feb 2004
Posts: 42
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

when you do this mod you ++++ the code tags..all the text inside the code is also on one line..which for some people isn't that big of a deal...for me it is..installed..then quickly uninstalled..
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:48 PM.


Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2025, vBulletin Solutions Inc.
X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.07181 seconds
  • Memory Usage 2,311KB
  • 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
  • (2)bbcode_php
  • (3)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
  • (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