vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vBulletin 2.x Full Releases (https://vborg.vbsupport.ru/forumdisplay.php?f=4)
-   -   RealTime Template Compressor: Reduces page sizes, loads pages faster, saves Bandwidth (https://vborg.vbsupport.ru/showthread.php?t=56589)

Erwin 09-01-2003 05:54 AM

Logician, I have to say it again - this is such a great idea! :) Absolutely minimal server overhead for a huge bandwidth saving! :) I use And such a simple concept, easily implemented, yet no one else thought of it. Pure genius.

Logician 09-01-2003 06:52 AM

Quote:

Today at 09:54 AM Erwin said this in Post #41
Logician, I have to say it again - this is such a great idea! :) Absolutely minimal server overhead for a huge bandwidth saving! :) I use And such a simple concept, easily implemented, yet no one else thought of it. Pure genius.
Thank you pal.. Great you liked it! :)

KuraFire 09-01-2003 09:42 AM

Quote:

08-30-03 at 10:40 AM Logician said this in Post #23
If you are using WebTemplates to manage your "normal pages", the answer is YES. Otherwise no.. :)

Actually, this will just work for EVERY page that you output using vBulletin's doooutput function. That doesn't limit one to Webtemplates at all, most of my entire site is done using vB's dooutput function (and all of KFN 6 will be done using vB3's print_output() function), and as such this hack will apply to all those pages. :)

works fine in vB3 as well btw, I just placed the code (with tiny changes) in vB3's print_output function in the proper place, works like a charm. Dunno yet if I'm gonna keep it though, unformatted source code might be 'more difficult for people to rip', but usually people don't rip sourcecode, they learn from sourcecode. Lack of proper indenting also looks unprofessional...

Erwin 09-01-2003 10:44 AM

One side effect - this hack does remove spaces in between images in the output as well. No big deal, but the buttons in the postbit are cramped next to each other. :)

Logician 09-01-2003 11:17 AM

Quote:

Today at 02:44 PM Erwin said this in Post #44
One side effect - this hack does remove spaces in between images in the output as well. No big deal, but the buttons in the postbit are cramped next to each other. :)
As a matter of fact all these minor side effects can be cured by using
PHP Code:

&nbsp

instead of spaces in the affected templates. ;) It is a better syntax as far as HTML is concerned too.

Quote:

Actually, this will just work for EVERY page that you output using vBulletin's doooutput function. That doesn't limit one to Webtemplates at all, most of my entire site is done using vB's dooutput function (and all of KFN 6 will be done using vB3's print_output() function), and as such this hack will apply to all those pages.
That is right. The hack applies to all VB pages so if your regular pages are vb integrated too, you'll have the compression in them as well. But the question was whether the hack can be applied to regular (non-vb integrated) pages or not and the answer is no unless user uses a vb-integrated solution such as webtemplates. :)

lasto 09-01-2003 12:37 PM

i noticed the buttons where all together and thought it was me

ok will fix with command above cheers

StrykerContact 09-02-2003 04:54 AM

This is great, I use to use this sort of thing to compress my html pages.

Kriek 09-02-2003 11:25 AM

Excellent, though there seemed to be thousands of instances spanning thirteen styles/skins where I would need to replace relevant spaces with & nbsp;. So I decided to replay the backup functions file.

Sebastian 09-02-2003 09:44 PM

Logician, this is a great hack. However, i will not use it because i am too picky and html must look readable :p

i know there are many people that like to view the page source, i myself do.

its just a habit by most coders to look at the page source.

you also have to note that 1byte is extremely small, 1,000 bytes is just about 1KB.

there really isn't much you'll be saving, as even a user on 56k would probably not even noticed a difference in 5,000 bytes.

you might save a dollar or two by doing this, but a lot of page source viewers are gonna be like "what a crappy coder"

lol ;):p

seriously though, good thought.
i am trying to focus my time in reducing vbulletin queries. that is what kills me.

Erwin 09-03-2003 06:30 AM

Quote:

09-01-03 at 10:17 PM Logician said this in Post #45
As a matter of fact all these minor side effects can be cured by using
PHP Code:

&nbsp

instead of spaces in the affected templates. ;) It is a better syntax as far as HTML is concerned too.

True, except
PHP Code:

&nbsp

creates a wider space than a normal HTML whitespace. :) However, I still love your hack. 5% savings is equal to many many gigabytes for me per year.

Logician 09-03-2003 08:56 AM

Quote:

Today at 01:44 AM Sebastian said this in Post #49
you also have to note that 1byte is extremely small, 1,000 bytes is just about 1KB.

there really isn't much you'll be saving, as even a user on 56k would probably not even noticed a difference in 5,000 bytes.

I don't agree. If your gain is 5%, this means your speed is also 5% and it is not that trivial considering the fact that it applies to ALL vb pages, not only 1 page.

Besides if you are on a server which you are paying according to your bandwidth consumption (on most dedicated it is so) and you have a high traffic, even %1 or %2 less consumption can make a difference when it comes to paying your server bills especially in the long term.

But if you have a small site eating 2 GB. per month and your host allows you to spend 30 GB. per month, well you may not care about this hack or any other bandwidth related issues which is understandable.

Quote:

you might save a dollar or two by doing this, but a lot of page source viewers are gonna be like "what a crappy coder"
Oh just the contrary! A professional checking your source code will understand the logic behind instantly and such a comment will come from only a newbie.

As a matter of fact when I check source code of pages, I blame the developer if I notice a lot of inlined lines in the HTML code. It shows that dev. is either unaware of the results of these lines or don't care.

So please label the correct person as "the crappy coder". :glasses:

David Bott 09-03-2003 01:19 PM

I like the idea of this hack very much. On our site this would make a hugh impact in bandwidth seeing we currently to about 1.7 Terabytes a month. (Yes, you read that right.) But I just could not get past some of of the spacing issues created. I did a quick test of it, it worked very well, but during the short test I got 3 e-mails telling me something is wrong with the spaces on the site. (Like the page links)

Oh well....great job non-the-less.

David Bott
AVS Forum
http://www.avsforum.com

Boofo 09-03-2003 02:47 PM

Another excellent hack by the "Master". Thank you, sir. ;)

Skyline_GT 09-04-2003 06:21 AM

nice hack

MaDCaT75 09-04-2003 07:14 AM

Sorry but this just makes everything look weird on my forums.

insanctus 09-04-2003 07:23 AM

Hmm it only changed the spacing of my page links in threads, rest was not effected. :)

MaDCaT75 09-04-2003 07:24 AM

Yeah I just didnt like that part :ermm:

insanctus 09-04-2003 07:26 AM

all ya have to do as add html code for space, I just do not care enough to lmao.

MaDCaT75 09-04-2003 07:36 AM

I did that... it looked really weird :ermm:

lasto 09-04-2003 07:39 AM

all it did to me was make all buttons more compact but the above code fixed that.Besides that i aint noticed nothing weird.

Akex 09-05-2003 12:25 PM

Thx a lot, il will save bandwith :)

Mickie D 09-05-2003 02:47 PM

thanks logician

i always look forward to your releases :)

Erwin 09-05-2003 09:55 PM

Quote:

09-04-03 at 06:23 PM insanctus said this in Post #56
Hmm it only changed the spacing of my page links in threads, rest was not effected. :)
Easily fix - just edit the pagenav templates and move the space from OUTSIDE the <a link tags to WITHIN the <a link tags. :)

Crinos 09-06-2003 08:48 AM

There are a lot more "spacing" issues then the ones mentioned above ... the "down arrow" button marking new posts also loses its spacing in forumdisplay ... the postbit buttons all become cramped together in some areas ... forum text links separated by white space all get smashed together, etc ...

I am giving this hack a chance, I really am, by hunting all templates in my test forum that contain visible white space and grumpily replacing them with &nbsp; ... just incorporating the hack isn't enough if you like your page to not look amateurish with all the lost white space...

Even the slightest misalignment makes me cringe, what more for squished links :D

tpearl5 09-07-2003 11:53 PM

faster load time/less bandwidth usage > a couple spacing issues :)

Very nice! This will definitely be helpful.

Crinos 09-08-2003 12:07 AM

Quote:

Today at 05:53 PM tpearl5 said this in Post #65
faster load time/less bandwidth usage > a couple spacing issues :)
Believe me, if it was just a "couple", installing it would be a no-brainer ;)

matthew tucker 09-08-2003 05:33 AM

I have this code, in a PHP include file called from global.php

PHP Code:

if ( $bbuserinfo['userid'] != )
$contact_but '<a href="../forums/showthread.php?s=' $session['sessionhash'] . '&threadid=125"><img src="../forums/images/top_contact.gif" alt="Contact ASE" border="0"></a>';
  
$reg_ucp '<a href="../forums/usercp.php?s=' $session['sessionhash'] . '"><img border="0" src="../forums/images/top_profile.gif" alt="Here you can view your subscribed threads, work with private messages and edit your profile and preferences"></a>';
  
$memberhead '<a href="../forums/memberlist.php?s=' $session['sessionhash'] . '"><img border="0" src="../forums/images/top_members.gif" alt="Find other users"></a>';
  
$searchhead '<a href="../forums/search.php?s=' $session['sessionhash'] . '"><img border="0" src="../forums/images/top_search.gif" alt="Search"></a>';
  
$logout '<a href="../forums/member.php?s=' $session['sessionhash'] . '&action=logout"><img border="0" src="../forums/images/top_logout.gif" alt="Logout"></a>'

and more like that, its a conditional nav buttons hack. I just put each of the variables and others in my header template

Code:

<td align="center" >
  $home_but
  $forums_but
  $cal_but
  $links_but
  $faq_but
  $contact_but
  $searchhead
  $memberhead
  $reg_ucp ...

and usually the buttons (up to twelve of them depending on who's logged in) just wrap around inside the cell using up whatever rows they need.

But using the compressor. they just stay in one long line and push the cell way off to the right.

Is there anything I can do to fix this so that the compressor doesn't mess this up?

Logician 09-08-2003 08:47 AM

@Matthew: First try to add &nbsp; to your buttons like:
PHP Code:

if ( $bbuserinfo['userid'] != 
$contact_but '<a href="../forums/showthread.php?s=' $session['sessionhash'] . '&threadid=125"><img src="../forums/images/top_contact.gif" alt="Contact ASE" border="0"></a>&nbsp;'
  
$reg_ucp '<a href="../forums/usercp.php?s=' $session['sessionhash'] . '"><img border="0" src="../forums/images/top_profile.gif" alt="Here you can view your subscribed threads, work with private messages and edit your profile and preferences"></a>&nbsp;'
  
$memberhead '<a href="../forums/memberlist.php?s=' $session['sessionhash'] . '"><img border="0" src="../forums/images/top_members.gif" alt="Find other users"></a>&nbsp;'
  
$searchhead '<a href="../forums/search.php?s=' $session['sessionhash'] . '"><img border="0" src="../forums/images/top_search.gif" alt="Search"></a>&nbsp;'
  
$logout '<a href="../forums/member.php?s=' $session['sessionhash'] . '&action=logout"><img border="0" src="../forums/images/top_logout.gif" alt="Logout"></a>&nbsp;'

It should fix the problem. If it does not let us know your source code of your whole page with and without compression.

lasto 09-08-2003 09:43 AM

PHP Code:

&nbsp

does fix the problem logician

matthew tucker 09-08-2003 11:08 PM

Nope

I did try that, what it does is just put spaces between the buttons, and they stay in a horizontal line rather than wrapping at the table border.

without compression:

<body bgcolor="#9E93C1" text="#000000" id="all" leftmargin="10" topmargin="10" marginwidth="10" marginheight="10" link="#000020" vlink="#000020" alink="#000020">
<!-- BEGIN TEMPLATE: home_header -->
<!-- logo and buttons -->
<div class="txtcenter">

<table border="0" width="100%" cellspacing="0" cellpadding="0" >

<tr>
<td> </td>
<td> </td>
<td align="right"><bold><font face="verdana, arial, helvetica" size="2" >ASE is sponsored by: &nbsp&nbsp&nbsp&nbsp&nbsp</font></bold></td>
</tr>

<!-- logo -->

<tr>
<td valign="top" align="left" >
<a href="index.php?s="><img src="http://www.screeneditors.com/images/aselogocol-230x76.gif" border="0" alt="Australian Screen Editors Guild" align="left" ></a> </td>

<!-- buttons -->

<td align="center" >
<!-- buttons defined in ./forums/buttons.php -->
<a href="../index.php?s="><img src="../forums/images/top_home.gif" alt="Home" border="0"></a>
<a href="../forums/index.php?s="><img border="0" src="../forums/images/top_forums.gif" alt="Discussion Forums and Archives"></a>
<a href="../forums/calendar.php?s="><img src="../forums/images/top_calendar.gif" alt="Events Calendar" border="0"></a>
<a href="../forums/links.php?s="><img border="0" src="../forums/images/top_links.gif" alt="Useful Links"></a>
<a href="../forums/misc.php?s=&action=faq"><img src="../forums/images/top_faq.gif" alt="Frequently Asked Questions" border="0"></a>
<a href="../forums/showthread.php?s=&threadid=125"><img src="../forums/images/top_contact.gif" alt="Contact ASE" border="0"></a>
<a href="../forums/search.php?s="><img border="0" src="../forums/images/top_search.gif" alt="Search"></a>
<a href="../forums/memberlist.php?s="><img border="0" src="../forums/images/top_members.gif" alt="Find other users"></a>
<a href="../forums/usercp.php?s="><img border="0" src="../forums/images/top_profile.gif" alt="Here you can view your subscribed threads, work with private messages and edit your profile and preferences"></a>
<a href="../forums/member.php?s=&action=logout"><img border="0" src="../forums/images/top_logout.gif" alt="Logout"></a>
<a href="../forums/admin/index.php?s="><img border="0" src="../forums/images/top_admincp.gif" alt="Admincp"></a>
<a href="../forums/mod/index.php?s="><img border="0" src="../forums/images/top_mods.gif" alt="Moderators"></a> <br/>

</td>
<!-- sponsors -->

<td valign="top" align="right"><a href="../sponsors.htm"><img src="forums/logos/Atlab_230x76_1.gif" border="0" alt="Sponsors"></a></td>

</table>

with compression:

<body bgcolor="#9E93C1" text="#000000" id="all" leftmargin="10" topmargin="10" marginwidth="10" marginheight="10" link="#000020" vlink="#000020" alink="#000020"><!-- BEGIN TEMPLATE: home_header --><!-- logo and buttons --><div class="txtcenter"><table border="0" width="100%" cellspacing="0" cellpadding="0" ><tr><td></td><td></td><td align="right"><bold><font face="verdana, arial, helvetica" size="2" >ASE is sponsored by: &nbsp&nbsp&nbsp&nbsp&nbsp</font></bold></td></tr><!-- logo --><tr><td valign="top" align="left" ><a href="index.php?s="><img src="http://www.screeneditors.com/images/aselogocol-230x76.gif" border="0" alt="Australian Screen Editors Guild" align="left" ></a></td><!-- buttons --><td align="center" ><!-- buttons defined in ./forums/buttons.php --><a href="../index.php?s="><img src="../forums/images/top_home.gif" alt="Home" border="0"></a><a href="../forums/index.php?s="><img border="0" src="../forums/images/top_forums.gif" alt="Discussion Forums and Archives"></a><a href="../forums/calendar.php?s="><img src="../forums/images/top_calendar.gif" alt="Events Calendar" border="0"></a><a href="../forums/links.php?s="><img border="0" src="../forums/images/top_links.gif" alt="Useful Links"></a><a href="../forums/misc.php?s=&action=faq"><img src="../forums/images/top_faq.gif" alt="Frequently Asked Questions" border="0"></a><a href="../forums/showthread.php?s=&threadid=125"><img src="../forums/images/top_contact.gif" alt="Contact ASE" border="0"></a><a href="../forums/search.php?s="><img border="0" src="../forums/images/top_search.gif" alt="Search"></a><a href="../forums/memberlist.php?s="><img border="0" src="../forums/images/top_members.gif" alt="Find other users"></a><a href="../forums/usercp.php?s="><img border="0" src="../forums/images/top_profile.gif" alt="Here you can view your subscribed threads, work with private messages and edit your profile and preferences"></a><a href="../forums/member.php?s=&action=logout"><img border="0" src="../forums/images/top_logout.gif" alt="Logout"></a><a href="../forums/admin/index.php?s="><img border="0" src="../forums/images/top_admincp.gif" alt="Admincp"></a><a href="../forums/mod/index.php?s="><img border="0" src="../forums/images/top_mods.gif" alt="Moderators"></a><br/></td><!-- sponsors --><td valign="top" align="right"><a href="../sponsors.htm"><img src="forums/logos/AAV_Australia_230x76_1.jpg" border="0" alt="Sponsors"></a></td></table>

with compress ion and spaces

<body bgcolor="#9E93C1" text="#000000" id="all" leftmargin="10" topmargin="10" marginwidth="10" marginheight="10" link="#000020" vlink="#000020" alink="#000020"><!-- BEGIN TEMPLATE: home_header --><!-- logo and buttons --><div class="txtcenter"><table border="0" width="100%" cellspacing="0" cellpadding="0" ><tr><td></td><td></td><td align="right"><bold><font face="verdana, arial, helvetica" size="2" >ASE is sponsored by: &nbsp&nbsp&nbsp&nbsp&nbsp</font></bold></td></tr><!-- logo --><tr><td valign="top" align="left" ><a href="index.php?s="><img src="http://www.screeneditors.com/images/aselogocol-230x76.gif" border="0" alt="Australian Screen Editors Guild" align="left" ></a></td><!-- buttons --><td align="center" ><!-- buttons defined in ./forums/buttons.php --><a href="../index.php?s="><img src="../forums/images/top_home.gif" alt="Home" border="0"></a>&nbsp;
<a href="../forums/index.php?s="><img border="0" src="../forums/images/top_forums.gif" alt="Discussion Forums and Archives"></a>&nbsp;
<a href="../forums/calendar.php?s="><img src="../forums/images/top_calendar.gif" alt="Events Calendar" border="0"></a>&nbsp;
<a href="../forums/links.php?s="><img border="0" src="../forums/images/top_links.gif" alt="Useful Links"></a>&nbsp;
<a href="../forums/misc.php?s=&action=faq"><img src="../forums/images/top_faq.gif" alt="Frequently Asked Questions" border="0"></a>&nbsp;
<a href="../forums/showthread.php?s=&threadid=125"><img src="../forums/images/top_contact.gif" alt="Contact ASE" border="0"></a>&nbsp;
<a href="../forums/search.php?s="><img border="0" src="../forums/images/top_search.gif" alt="Search"></a>&nbsp;
<a href="../forums/memberlist.php?s="><img border="0" src="../forums/images/top_members.gif" alt="Find other users"></a>&nbsp;
<a href="../forums/usercp.php?s="><img border="0" src="../forums/images/top_profile.gif" alt="Here you can view your subscribed threads, work with private messages and edit your profile and preferences"></a>&nbsp;
<a href="../forums/member.php?s=&action=logout"><img border="0" src="../forums/images/top_logout.gif" alt="Logout"></a>&nbsp;
<a href="../forums/admin/index.php?s="><img border="0" src="../forums/images/top_admincp.gif" alt="Admincp"></a>&nbsp;
<a href="../forums/mod/index.php?s="><img border="0" src="../forums/images/top_mods.gif" alt="Moderators"></a>&nbsp; <br/></td><!-- sponsors --><td valign="top" align="right"><a href="../sponsors.htm"><img src="forums/logos/Quantel_230x76_2.gif" border="0" alt="Sponsors"></a></td></table>

SmEdD 09-09-2003 01:01 AM

put nowrap in the <td> area and drop the nbsp;'s

matthew tucker 09-09-2003 01:27 AM

No that's the OPPOSITE of what I want to do. I WANT the buttons to always wrap ... <td nowrap> forces no wrapping for the cell.

SmEdD 09-09-2003 01:58 AM

sorry didn't read you post completely ;)

and this is a wild guess but maybe try adding hspace="#" in your image tags.

Logician 09-09-2003 09:47 AM

Quote:

Today at 05:27 AM matthew tucker said this in Post #72
No that's the OPPOSITE of what I want to do. I WANT the buttons to always wrap ... <td nowrap> forces no wrapping for the cell.
When I put your source code in DreamWeaver then open in a browser, your images wraps at the end of table row just like you want and this applies to all source codes you quoted above.

Maybe you can point me to the page where you are experiencing the problem so that I can see it myself.

d3nnis 09-19-2003 07:26 PM

i got a problem...

please see my forum :

http://forums.keeptouch.net/forumdis...?s=&forumid=19

Those page numbers are joining together... how to leave this alone?

d3nnis 09-19-2003 07:53 PM

Quote:

Originally Posted by d3nnis
i got a problem...

please see my forum :

http://forums.keeptouch.net/forumdis...?s=&forumid=19

Those page numbers are joining together... how to leave this alone?


found my own solution.. at template -> forumdisplay_multipagenav_pagenumber

add a &nbsp; instead of space

Erwin 09-20-2003 06:00 AM

I uninstalled this hack in the end at my private forums, basically because some members using IE for some reason got really wide threads. Don't ask me why. :)

d3nnis 09-20-2003 04:39 PM

Quote:

Originally Posted by Erwin
I uninstalled this hack in the end at my private forums, basically because some members using IE for some reason got really wide threads. Don't ask me why. :)


yeah i am thinking of uninstalling it... i bascially have to find those affected templates and add in &nbsp; not worth... just to save that few percent of space and bandwidth

Dan_UPC 10-03-2003 01:52 PM

Another problem seems to be that if a template contains " " ie. a space, it is deleted but if the template contains " &nbsp;" then it gets displayed as " &nbsp;" ie. 2 spaces. The script doesn't strip the extra space.

NightWalk8r 10-03-2003 06:48 PM

great hack :D

-------------------------------------------------------------

Page generated in 0.14696705 seconds (87.31% PHP - 12.69% MySQL) with 18 queries.
[Debug Mode OFF] [PHP v4.3.3] [GZIP enabled - level 1]
[Output: 52.35 Kb. compressed to 49.96 Kb. by saving 2.39 Kb. (4.56%)] [Server Load: 2.92 ? 2.58 : 1.92]


All times are GMT. The time now is 01:01 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.01511 seconds
  • Memory Usage 1,879KB
  • 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
  • (1)bbcode_code_printable
  • (6)bbcode_php_printable
  • (12)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (2)pagenav_pagelink
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (40)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