PDA

View Full Version : Administrative and Maintenance Tools - Remove all (Template-)Comments from any HTML-Output


MrZeropage
07-22-2006, 10:00 PM
This small PlugIn will give you the option to remove all comments you put in your templates before the HTML-code gets spit out to the client's browser.

You can activate or deactivate this feature via AdminCP (vBulletin Settings -> General Settings) and even allow usergroups to view those comments anyway (like for Developer, Styler, Admins ect.)

In addition you are able to activate the removal of blank Lines in the HTML-output, this makes the code more clean after removing the comments ;)



Just import the product and adjust the settings the way you need it :cool:

Don't forget to click INSTALL (https://vborg.vbsupport.ru/vborg_miscactions.php?do=installhack&threadid=121872) if you use this ;)



Bugs:
none found yet

Planned feature:
1) remove //-Comments from JavaScript

Snake
07-23-2006, 11:44 AM
I'll definitenly install this when I get back to home. Thanks! :)

KTBleeding
07-23-2006, 02:22 PM
Oh, neat..

This is something I actually thought about yesterday. Thanks.

MGM
07-23-2006, 09:27 PM
While I understand that having a lower page size makes things load faster, what is the effect of using the coding to remove the comments? Like, does it add more server load? Do the disadvantages outweigh the advantages?

MGM out

tako
07-24-2006, 05:11 AM
How does it effect to the board's loading and parsing performance? Positive or negative? Oops, same question as MGM's...

MrZeropage
07-24-2006, 05:15 AM
This way you can add more internal information to the code, by now there are often more information in the sourcecode than you think of.

Example:
most modification add their code in templates like<!-- this is additional function for admins-->

[...CODE...]

<!-- / of special mod -->
This means although the user can't use/see this function, he has some information about installed addons in his sourcecode.

MGM
07-24-2006, 05:39 AM
But again, is the advantages of removing the comments better than the disadvantage of having the code check every template and remove every comment line for line?

MGM out

MrZeropage
07-24-2006, 05:53 AM
But again, is the advantages of removing the comments better than the disadvantage of having the code check every template and remove every comment line for line?It does not check the code line-per-line it is just some simple replacements in the final output, only one command per comment-type

utw-Mephisto
07-25-2006, 11:33 PM
Works perfect - thanks :)

Some people did not understand in your 3.5x release what it does ..

Here a screenshot (including spelling mistakes :D) :

Mudvayne
07-29-2006, 08:01 PM
Installed n working fine for RC3 :)..

Paul M
07-29-2006, 08:25 PM
So how does this affect script code that is enclosed inside <!-- --> ?

nevetS
08-29-2006, 04:53 AM
I just installed. I noticed this script in my page:

<script type="text/javascript">
<!--
vB_AJAX_ThreadRate_Init('showthread_threadrate_for m');
var threadid = 17;
//-->
</script>


It was properly untouched. I haven't tested it extensively, but it seems to do the trick. I don't know the real SEO affect of something like this, but I do like the idea of removing a lot of template-related comments from the code.

MrZeropage
08-29-2006, 05:04 AM
This was done to remove comments from the templates (so I can put some more information for myself in it without any user getting those information) and not for any SEO-related thing :)

Jaxel
08-29-2006, 10:34 AM
Isn't there already an opion to remove comments from output in the regular VB control panel?

ForumDog
08-29-2006, 02:04 PM
That just affects template identification comments as far as I know.

MrZeropage
08-29-2006, 02:12 PM
Yes, this is only for Template-Names itself

DeMagH
12-02-2006, 02:48 PM
thanks a zillion, my comments are usually long and very illustrative, which is not good if someone is seeing the page source.

worked like a charm with vbulletin 3.6.2

DeMagH
01-15-2007, 11:56 PM
hi, i installed this and was working perfectly, till we found a small bug.

whenever a user is previewing a msg, all the line spacings are gone, though the previewed msg has its original line spacing pattern.

uninstalled it cuz some users got annoyed from this happening all the time. Though i didn't mark it here as uninstalled as i think this will be fixed easily. waiting for the update.

One question though:
how does it affect the overall server load? cuz i think in big forums this is gonna be a serious problem.

Also, in the userCP when logged in as moderator/admin the moderate threads page is out of forum size "800px is the size of my forums, it extends a little bit out of this when I installed the pluggin", the moderate posts seems to be working fine though ?!!!

MrZeropage
01-16-2007, 05:09 AM
Ok, will have a closer look on this, thanks for reporting

DeMagH
01-16-2007, 07:19 PM
ok thanks, but i had a question about how does this patch affect the server load, any ideas?

Staxed
02-03-2007, 09:24 AM
ok thanks, but i had a question about how does this patch affect the server load, any ideas?

any answer to this?

blindMoe
08-12-2007, 11:44 AM
It is amazing, I was thinking that I needed something to help clean up the ugly vbulletin source code. It took about 20 seconds to stumble upon this and I feel like I hit the jackpot. I even thought I was going to have to modify the regexp to get rid of the blank lines but you have already done that also :)

I am having one problem though, for me it is getting rid of all the blank lines but not the comments. I have both options enabled in the admincp (General Options) and I am not sure what else it could be. At first I thought it was because I was running vbcmps but then I realized that the script was removing the blank lines.

If you have any ideas it would be greatly appreciated. Once again, great product, thanks a bunch.

blindMoe
08-13-2007, 07:16 AM
I uninstalled then reinstalled the product and everything seems to work great now! Thanks again!

yoyoyoyo
10-01-2007, 12:18 PM
this hack caused some serious problems in 3.6.8 with certain plugins not working for guests, but it took me awhile to discover it, since I am usually logged in as admin ;)

I disabled all plugins, and then enabled them one by one until I came upon this one as being the problematic one.

I suggest exercising great caution when using this in 3.6.8

MrZeropage
10-01-2007, 12:36 PM
Hmmm, working fine here on vB3.6.8

What addons/functions stopped working? what was the problem/error?

yoyoyoyo
10-02-2007, 11:02 AM
Hmmm, working fine here on vB3.6.8

What addons/functions stopped working? what was the problem/error?
I sent you a PM

MoMan
12-01-2009, 06:24 AM
BTW, simply add 'and $show['guest'] == True' to the conditional prior to the code that strips line breaks, and the editor preview/quote problem will disappear for members.

mahakala
08-03-2010, 11:24 PM
can you update this for 4.0.5 ?