vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vBulletin 3.0 Full Releases (https://vborg.vbsupport.ru/forumdisplay.php?f=33)
-   -   Compress Forum Templates (Speed up your Forums & Save Bandwidth) (https://vborg.vbsupport.ru/showthread.php?t=79923)

stan111 09-14-2005 06:59 AM

damn, this works like a champ
my board is heavily modified and i dont have any experience in coding or anything
i mod it and it works at the first time. my board load so fast now

thanks a million for writting this code

edit: i just check my board again, and somehow, my quickreply text box disappeared :nervous:
anyone know wat happen ?

stan111 09-14-2005 07:13 AM

above it, i did that and it works

HTML Code:

//#############################################################################
// edit form for an existing template
if ($_REQUEST['do'] == 'edit')


Andreas 09-14-2005 07:31 AM

Any chance for a 3.5 Version?

stan111 09-15-2005 06:20 AM

Quote:

Originally Posted by stan111

edit: i just check my board again, and somehow, my quickreply text box disappeared :nervous:
anyone know wat happen ?

anyone ?

buro9 09-15-2005 07:10 AM

Quote:

Originally Posted by KirbyDE
Any chance for a 3.5 Version?

It's really simple to migrate.

Just copy the block of code into the foot of admincp/template.php

And then add this XML to includes/xml/cpnav_vbulletin.xml
Code:

                <navoption comment="HACK : COMPRESS TEMPLATES" displayorder="51">
                        <phrase>compressall</phrase>
                        <link>template.php?do=compressall</link>
                </navoption>

    <navoption link="template.php?do=compressall&amp;revert=1" comment="HACK : COMPRESS TEMPLATES" displayorder="52">
                        <phrase>uncompressall</phrase>
                </navoption>

That needs to go ABOVE this piece:
Code:

        </navgroup>

        <navgroup phrase="languages_and_phrases" permissions="canadminlanguages" displayorder="30">

Which places it in the styles_and_templates group.

The hack continues to work perfectly in vb3.5 :)

buro9 09-15-2005 07:11 AM

Oh, and I added the 'comment' attribute as I like being able to search the whole code base and see instantly what modifications I need to migrate at update time by simply looking for the word HACK. :)

hidjra 10-05-2005 04:42 PM

Quote:

Originally Posted by buro9
It's really simple to migrate.

Just copy the block of code into the foot of admincp/template.php

And then add this XML to includes/xml/cpnav_vbulletin.xml
Code:

                <navoption comment="HACK : COMPRESS TEMPLATES" displayorder="51">
                        <phrase>compressall</phrase>
                        <link>template.php?do=compressall</link>
                </navoption>

    <navoption link="template.php?do=compressall&amp;revert=1" comment="HACK : COMPRESS TEMPLATES" displayorder="52">
                        <phrase>uncompressall</phrase>
                </navoption>

That needs to go ABOVE this piece:
Code:

        </navgroup>

        <navgroup phrase="languages_and_phrases" permissions="canadminlanguages" displayorder="30">

Which places it in the styles_and_templates group.

The hack continues to work perfectly in vb3.5 :)

This won't work. You'll need to change the queries to:
if it's a select/read querie:
from '$DB_site->query' to '$db->query_read'

if it's a update/write querie:
from '$DB_site->query' to '$db->query_write'

You also need to add the phrases 'compressall' and 'uncompressall'. otherwise they won't show up in de navigation-menu of your adminCP.

You can also remove the badtemplates 'phpinclude_start' and 'phpinclude_end'. They don't exist in vb3.5 gold


Hidjra

stan111 10-13-2005 10:05 AM

this mod rocks, i luv it so much, it speeds up the forum like crazy
but does anyone here have the same problem like me after you compress the template, your text message box disappears. Here is a pic of my quick reply after the template compression
https://vborg.vbsupport.ru/

buro9 10-13-2005 10:15 AM

Quote:

Originally Posted by stan111
this mod rocks, i luv it so much, it speeds up the forum like crazy
but does anyone here have the same problem like me after you compress the template, your text message box disappears. Here is a pic of my quick reply after the template compression
http://img411.imageshack.us/img411/7736/untitled7lo.jpg

Nope... don't have that at all.

Have you hacked that template though? Put anything in there that might make it less than rock solid (stacks of JavaScript and weird HTML for example?).

You can just figure out what the template name for that is and add it to the array of templates to skip. However it shouldn't be an issue, figure out where you've broken it and fix that would be the better solution :)

buro9 10-13-2005 10:16 AM

Oh... and an example of the before and after HTML would be appreciated... at least we'd be able to understand what went wrong then.

mutus123 10-15-2005 04:18 PM

Piecing together instructions of both buro9 and hidjra, I was able to install this for 3.5.

I hope it's not wrong of me to do this but I went ahead and updated the text file instructions for 3.5.

This is a great hack, again many thanks.

Edit: Text file removed, as I discovered what I did is frowned upon here.

buro9 10-15-2005 06:28 PM

Quote:

Originally Posted by mutus123
Piecing together instructions of both buro9 and hidjra, I was able to install this for 3.5.

I hope it's not wrong of me to do this but I went ahead and updated the text file instructions for 3.5, as the current installation file is obsolete. I'm posting it here to maybe help some others.

This is a great hack, again many thanks.

To be fair, the 3.5 install is virtually identical to the 3.0 install ;)

The only real difference is adding the elements to the admincp.

I'm sure most of us simply upgraded manually ;) Though I'm also sure that your file will be very appreciated by those who would prefer a fuller set of instructions :)

mutus123 10-15-2005 08:14 PM

Quote:

Originally Posted by buro9
To be fair, the 3.5 install is virtually identical to the 3.0 install ;)

The only real difference is adding the elements to the admincp.

I'm sure most of us simply upgraded manually ;) Though I'm also sure that your file will be very appreciated by those who would prefer a fuller set of instructions :)

Understood. I realize this particular hack is for 3.0.x, therefor the install file is perfectly fine. I meant no offense.

But it won't work for 3.5, so I just thought it may help a few people to outline the process of making this work in 3.5. It's not a big deal, but like you said, many prefer a full set of instructions, and are not always confident in manipulating code, nor able to solve a problem when an error occurs. So I just combined yours and hidjra's instructions.

Cheers and thank you again for this wonderful hack :)

buro9 10-16-2005 08:22 AM

Quote:

Originally Posted by mutus123
Cheers and thank you again for this wonderful hack :)

Oh, it's not mine, it's Trigunflames. Next time I see him on messenger I'm gonna bug him to re-package for 3.5. The live compress hack out there needs to be taken down by this one... this one is just so much more efficient (less overhead as you only do when you change things, not on every page hit).

stan111 10-16-2005 11:04 PM

thanks a lot , buro9
i have template mod like background picture in the quick reply text message area
https://vborg.vbsupport.ru/showthrea...und+quickreply

i dont know if this would make it disappear

buro9 10-17-2005 07:10 AM

Quote:

Originally Posted by stan111
thanks a lot , buro9
i have template mod like background picture in the quick reply text message area
https://vborg.vbsupport.ru/showthrea...und+quickreply

i dont know if this would make it disappear

It's very likely.

I can't see the source code of the template to be able to see what it might do. The hack you linked to is very old and the original zip file attached to that thread is no longer there.

I would suggest that you either add this template to the array of bad_templates so that it doesn't get compressed (everything else still will), or that you uninstall that hack or revert the template.

stan111 10-17-2005 07:56 AM

thanks again for a fast reply, buro9
i added too many hacks and now i have no idea how to uninstall that
so would you please show me how to add that template to array of bad_templates ?

buro9 10-17-2005 08:01 AM

Quote:

Originally Posted by stan111
thanks again for a fast reply, buro9
i added too many hacks and now i have no idea how to uninstall that
so would you please show me how to add that template to array of bad_templates ?

Just take the name of the template that is breaking, and find this piece of code in the compression hack above:
PHP Code:

    $badTemplates = array(
        
'editor_jsoptions_font',
        
'editor_jsoptions_size',
        
'phpinclude_start',
        
'phpinclude_end'
    
); 

Simply add the name of the template that is causing problems to that array... which means adding a line like this at the end of the array (but within the brackets):
PHP Code:

,'templateName' 

And then upload and re-run the admincp thingy and it will skip compressing that template.

Oh, one more thing... if you have already applied the hack and it is still broken, uncompress the templates, apply this change, and the re-compress the templates :)

stan111 10-17-2005 08:03 AM

omg, u r so fast, man
you rock
thanks a ton
let me go try that now

stan111 10-17-2005 08:15 AM

yeah, it works like a champ
it skips that template, now my forum going way faster
thanks a million for all your help, buro9

buro9 10-17-2005 08:32 AM

Quote:

Originally Posted by stan111
yeah, it works like a champ
it skips that template, now my forum going way faster
thanks a million for all your help, buro9

It could go even faster if you did two things:
  1. Move your stylesheets to files. The option for this is in the AdminCP.
  2. Much more time consuming... validate your pages with the W3C Validation service: http://validator.w3.org/check?uri=ht...elyviet.com%2F
Currently your pages are not coming back XHTML Transitional compliant, in fact on your home page there were 653 errors (probably only 20 or 30 things in actual templates). The cleaner your HTML is, the faster a browser will render it. Force the browser to have to deal with your errors, and it will slow down as it has to spend time trying to guess what you want.

vBulletin ships valid XHTML Transitional code... so it's just up to you to make sure when you hack it that things are still cool.

Examples:
Close your tags: <p> should always have an end </p>, <img> should always have a self-closing slash <img />.

Include required attributes: <script> has to have a type: <script type="text/javascript">

Comment out your JavaScript for non-capable browsers: <script type="text/javascript"><!--
function boo() {alert('boo');}
// --></script>

Lots of TR tags are missing.

Etc, etc.

If your HTML is clean, it will render much faster as the browsers job is much easier.

stan111 10-17-2005 12:50 PM

i didn't know that i got that many errors on my page. i keep wondering why my homepage load so damn slow
thanks a lot for showing me all of those stuffs, buro9
that will be my next project
:up: buro9

Wisch 10-20-2005 12:45 AM

Awesome, optimized my forums, no errors, very smooth and efficient as always but with a noticable loading speed increase.
Thanks / *INSTALLED*

kzap 11-13-2005 01:44 AM

can anyone convert this into a xml plugin for 3.5?

Anyway just to add to the others who posted instructions to install on vb3.5

1.) https://vborg.vbsupport.ru/showpost....&postcount=165

2.) https://vborg.vbsupport.ru/showpost....&postcount=167

3.) add the code above
Code:

// #############################################################################
// form to edit a style
if ($_REQUEST['do'] == 'editstyle')

4.) Replace $DB_site->fetch_array with $db->fetch_array

That should do it, works like a charm :)

mutus123 11-13-2005 12:06 PM

Quote:

Originally Posted by kzap
can anyone convert this into a xml plugin for 3.5?

I have it installed on my 3.5.1 as a stand-alone product (no file edits).

I offered to either release it or give it to the original author to release, but got no response.

buro9 11-14-2005 07:38 AM

Quote:

Originally Posted by mutus123
I offered to either release it or give it to the original author to release, but got no response.

I have him in trillian, I'll ask for you :)

noj75 12-14-2005 10:20 AM

Hi all,

I have 3.5.2 but the area thats requires this edit:
PHP Code:

construct_nav_option($vbphrase['find_updated_templates'], 'template.php?do=findupdates''<br />'); 

actually reads like this in my admincp/index.php
PHP Code:

construct_nav_option($navoption['text'], $navoption['link']); 

Any ideas where i have to place this addition of code?
PHP Code:

  construct_nav_option("Compress Templates"'template.php?do=compressall''<br />'); 
construct_nav_option("Uncompress Templates"'template.php?do=compressall&revert=1''<br />'); 

Best regards

T3MEDIA 02-04-2006 01:25 PM

wow this really really works. Nice. Real nice.

Trigunflame 02-04-2006 02:12 PM

Quote:

Originally Posted by mutus123
I have it installed on my 3.5.1 as a stand-alone product (no file edits).

I offered to either release it or give it to the original author to release, but got no response.

Im finally back from my hiatus and play to fix a lot of the bugs and release some stuff again.

Ill try to wokr on whatever I can today and tomorrow; im working on the backup system right now.

Trigunflame 02-04-2006 02:30 PM

Quote:

Originally Posted by T3MEDIA
wow this really really works. Nice. Real nice.

You just now tried it ......... lol :ninja: think i made this many months ago


All times are GMT. The time now is 12:18 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.01561 seconds
  • Memory Usage 1,837KB
  • 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
  • (5)bbcode_code_printable
  • (1)bbcode_html_printable
  • (5)bbcode_php_printable
  • (14)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
  • (30)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