The Arcive of Official vBulletin Modifications Site.It is not a VB3 engine, just a parsed copy! |
|
Realtime Template Compressor: Reduces page sizes, loads pages faster, saves bandwidth Details »» | |||||||||||||||||||||||||||
Realtime Template Compressor: Reduces page sizes, loads pages faster, saves bandwidth
Developer Last Online: Nov 2023
This is a port of Logican's Realtime Template Compressor hack from vBulletin 2.2.x to vBulletin 3.5.0 Beta 1. I wrote this by rewriting a version of the original hack, that I wrote for my forums when they ran 3.0.x, so that it would function as a plugin for 3.5.0.
I had originally sent this to Logican for him to release it but he replied granting me permission to release it; hence why I'm releasing this. Installation is very simple. Just import the plugin via vBulletin's "Download / Upload Plugins" page in the Plugin System in the Admin Control Panel and you're done. I'll try to correct any bugs that you might find. Let me know if you like this plugin and don't forget to click the install link if you install this. Update History Version 1.1.0: The expression was replaced with a more efficient one that increases the compression level from approximately 1-2% to approximately 4-8%. Version 1.0.0: Initial Release Show Your Support
|
Comments |
#232
|
|||
|
|||
Quote:
Code:
//Logician Hack: $page_byte=strlen($output); //$output=preg_replace ('/\r\n(\s*)/', "\r\n", $output); $output=preg_replace ('/<!-- .*? -->/',"",$output); $pagenew_byte=strlen($output); $page_kilobyte=number_format(($page_byte/1024),2); $pagenew_kilobyte=number_format(($pagenew_byte/1024),2); $pagesaved_byte=$page_byte-$pagenew_byte; $pagesaved_kilobyte=number_format((($pagesaved_byte)/1024),2); $pagesaved_perc=number_format(((100*$pagesaved_byte)/$page_byte),2); Code:
<!-- header Gallery Links--> Code:
<!-- What the @#@$ did I screw up this time? --> Code:
[Output: 0.00 Kb. compressed to 82.54 Kb. by saving -82.54 Kb. (0.00%)] |
#233
|
|||
|
|||
put a space before the --> there was a issue with it taking out code it wasnt supposed to.. i introduced the space before the -->
|
#234
|
|||
|
|||
[high]* Guest210212002 scratches his head
[/high] There's a space in the original code snippet I posted, but I put another one in anyhow. Code:
//Logician Hack: $page_byte=strlen($output); //$output=preg_replace ('/\r\n(\s*)/', "\r\n", $output); $output=preg_replace ('/<!-- .*? -->/',"",$output); $pagenew_byte=strlen($output); $page_kilobyte=number_format(($page_byte/1024),2); $pagenew_kilobyte=number_format(($pagenew_byte/1024),2); $pagesaved_byte=$page_byte-$pagenew_byte; $pagesaved_kilobyte=number_format((($pagesaved_byte)/1024),2); $pagesaved_perc=number_format(((100*$pagesaved_byte)/$page_byte),2); (Thank you very much for the help btw, ryuji, I appreciate you takin' the time to help me sort this out. ) |
#235
|
|||
|
|||
Quote:
Code:
.compressor { color: #2886B6; font: 10px verdana; } On a nother note, I'd love it if someone could find a way to make this conditional work. I've tried it in a few places and haven't found something to make it happen. Code:
$output = str_replace('</body>', '<if condition="in_array($bbuserinfo['usergroupid'], array(6))"><center><span class="compressor">[O: ' . $page_kilobyte . ' Kb C:<b>' . $pagenew_kilobyte . '</b> Kb. S: <b>' . $pagesaved_kilobyte . '</b> Kb. (' . $pagesaved_perc . '%)]</span></center></if></body>', $output); //Compressor |
#236
|
|||
|
|||
Running it on 3.5.3 and getting the paragraph break problem on Advanced Edit
|
#237
|
|||
|
|||
Quote:
|
#238
|
||||
|
||||
with 3.5.2
and element skil. it messes up the DHTML thing.. which is a pain really.. any way to sort this? |
#239
|
|||
|
|||
Wow, I just installed it and it seems to be working fine.
Is there a way to remove all <!-- comments --> in the code ? This would save a lot too. |
#240
|
||||
|
||||
mox- read the thread ...
All the last posts are about it My problem is that i got some <!-- bloa bla blubb --> code which is not stripped at all ... any way sorting it out beside making it one line with <!-- xxx --> in code?!? |
#241
|
|||
|
|||
where did you guys upload it tooo
|
|
|
X vBulletin 3.8.12 by vBS Debug Information | |
---|---|
|
|
More Information | |
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|