vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vBulletin 3.5 Add-ons (https://vborg.vbsupport.ru/forumdisplay.php?f=113)
-   -   Realtime Template Compressor: Reduces page sizes, loads pages faster, saves bandwidth (https://vborg.vbsupport.ru/showthread.php?t=83248)

Submerge 01-15-2006 11:57 PM

Quote:

Originally Posted by exegete
The solution to the paragraph bug is to alter the regular expression in such a way that newline characters appearing between textarea tags are left untouched.

I leave this as an exercise for the reader. :)

Not all of us are php experts :(

Smiry Kin's 01-16-2006 12:25 AM

donno if its cos im on 3.5.2

but i get:

XML Error: unknown at Line 0

Club3G 01-16-2006 12:27 AM

Quote:

Originally Posted by exegete
The solution to the paragraph bug is to alter the regular expression in such a way that newline characters appearing between textarea tags are left untouched.

I leave this as an exercise for the reader

Quote:

Originally Posted by Submerge
Not all of us are php experts :(

That's coder-speak for "I don't know how to do it". ;)

Even if the mod is bugged, IMHO it's still worth running on bigger forums if bandwidth is a concern.

ryuji 01-16-2006 12:52 PM

my variation of the script doesnt have the paragraph or javascript bugs, just dont uncomment the code i commented out as breaking stuff

natralis 01-16-2006 03:18 PM

works great for me
cheers

[Output: 42.78 Kb. compressed to 39.45 Kb. by saving 3.33 Kb. (7.77%)]

Totti 01-16-2006 03:28 PM

Quote:

Originally Posted by ryuji
these are the results of my experiments with the code... this one doesnt break anything and ill see if i can figure out a way to make it not bust javascript

PHP Code:

//Logician Hack:
//$page_byte=strlen($output);

//this broke scripts on my setup, if you want to test, click on 'more' smileys in advanced editor or try to bring up the user popup when you click on there name on a thread
                //$output=preg_replace ('/(\s*)\r\n(\s*)/', "", $output);
//this broke scripts on my setup, if you want to test, click on 'more' smileys in advanced editor or try to bring up the user popup when you click on there name on a thread


$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);

//$output = str_replace('</body>', '<center><span class="smallfont">[Output: ' . $page_kilobyte . ' Kb. compressed to <b>' . $pagenew_kilobyte . '</b> Kb. by saving <b>' . $pagesaved_kilobyte . '</b> Kb. (' . $pagesaved_perc . '%)]</span></center></body>', $output);
//Logician Hack: 

remove the comments to re-enable the compression efficiency dialog


so that is the best working code at the moment?
still any known bugs then?

Club3G 01-16-2006 06:19 PM

I'm running that code, only the advanced editor bug. (It strips line breaks if you edit a post in advanced mode). Other than that, no problems whatsoever.

Riuji, unless you see a difference between my code and yours (I don't).
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);

$output = str_replace('</body>', '<center><span class="smallfont">[Output: ' . $page_kilobyte . ' Kb. CMP <b>' . $pagenew_kilobyte . '</b> Kb. Net <b>' . $pagesaved_kilobyte . '</b> Kb. (' . $pagesaved_perc . '%)]</span></center>
<br></body>', $output);
//Logician Hack:

I'd LOVE to see it keep a running tally in the admincp of kb saved.

ryuji 01-16-2006 10:02 PM

Quote:

Originally Posted by Club3G
I'm running that code, only the advanced editor bug. (It strips line breaks if you edit a post in advanced mode). Other than that, no problems whatsoever.

Riuji, unless you see a difference between my code and yours (I don't).
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);

$output = str_replace('</body>', '<center><span class="smallfont">[Output: ' . $page_kilobyte . ' Kb. CMP <b>' . $pagenew_kilobyte . '</b> Kb. Net <b>' . $pagesaved_kilobyte . '</b> Kb. (' . $pagesaved_perc . '%)]</span></center>
<br></body>', $output);
//Logician Hack:

I'd LOVE to see it keep a running tally in the admincp of kb saved.


i dont have the advanced mode issue you speak of does it go away if you comment out the code for the file size savings?

Club3G 01-16-2006 11:14 PM

Nope, it still does it. :(

ryuji 01-17-2006 11:22 AM

what version of vbb are you running and try commenting out the replacment lines and figure out just which one is breaking the advanced editor


All times are GMT. The time now is 02:30 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
  • Page Generation 0.01482 seconds
  • Memory Usage 1,752KB
  • Queries Executed 10 (?)
More Information
Template Usage:
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (2)bbcode_code_printable
  • (1)bbcode_php_printable
  • (5)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (4)pagenav_pagelink
  • (1)pagenav_pagelinkrel
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (10)printthreadbit
  • (1)spacer_close
  • (1)spacer_open 

Phrase Groups Available:
  • global
  • postbit
  • showthread
Included Files:
  • ./printthread.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/class_bbcode_alt.php
  • ./includes/class_bbcode.php
  • ./includes/functions_bigthree.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
  • printthread_start
  • pagenav_page
  • pagenav_complete
  • bbcode_fetch_tags
  • bbcode_create
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • printthread_post
  • printthread_complete