![]() |
Quote:
|
I added this to a project I'm currently working on ... and I think it's great.
I modified the expression ... $vartext = preg_replace ("'([\r\t\n])[\s]+'", "", $vartext); this has been tested only on a non-public vb3 forum it seems to compress more then the original (view attachment) and it doesn't remove the "space" between the .... |
Quote:
But I'm confused how come it compresses more than my line as your line seems to remove successive spaces and my line removes them all. BTW it is also weird the original source sizes are different in your each screenshots (as if they belong to different pages?).. :) |
Currently, I have the compression as selectable by admin (in case of high server load).
I admit most of the compression is done in the <head> CSS section. ;) (I'm using vb3.) Quote:
I must have minimized a block ... new screenshots attached. |
I dont like the way this shrinks the page numbers in the thread list I.E. 1234 instead of 1 2 3 4
|
*** Installed ***
Thanks reloaded the first page and already see how much was saved, Thanks. Simple yet very very effective. |
Quote:
|
Quote:
To do this go into your ADMIN PANEL and do a search and replace for Search for text: <script type="text/javascript"> <!-- Replace with Text: <script type="text/javascript"> Search for text: //--> </script> Replace with: </script> You can also do this for <style> but it is not necessary as <style> will work when compressed. If you think the comments are necessary think again ... Comments are used to hide code from version 1 and 2 browsers. How many users do you think will visit your site with a 1 or 2 browser? And, if so, the site will not work as it should because they will not be able to interpret the javascript. A condtional statement checking for browser version should be used to render or not render javascript. Why send javascript bytes that will not be utilized by browser? |
Broke too much of my spacing, and I don't have enough time to redo it all right now. Awesome idea though, I had a 3.6% save.
Maybe I'll give this other compression method a try one day. |
Unfortunately the compression method of princeton creates problems in javascripts as he mentioned above. I confirmed that it compress better and fixes spacing problem but I believe trying to fix all javascripts in all templates is an headache so I prefer to use my compression method. Your call which one you want to use but make sure you fix your javascripts in princeton's method otherwise some features of your board (eg. smilies) will stop.
Frankly speaking I don't see spacing as a problem. It neither interferes with how board functions (it is just visual) nor hard to fix. I dont know how it will do if you have skins or something but in a default vb, it just affects page numbers which is very easy to fix with a one template edit. |
All times are GMT. The time now is 07:26 AM. |
Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2025, vBulletin Solutions Inc.
X vBulletin 3.8.12 by vBS Debug Information | |
---|---|
|
|
![]() |
|
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|