PDA

View Full Version : Miscellaneous Hacks - Page Loading Time


linuxututs
10-17-2009, 10:00 PM
Changed to Beta Version !!
Bug Found !

Its no biggy, but still doesn't do what its meant to do on "ALL" pages.
The timer does not load while viewing thread !!!

Sorry, I call myself testing this on "ALL" pages before releasing it, but apparently I overlooked that one page loading.

Please if anyone can come up with a fix, Please post.

The Mod/Hack works fine other than that. ( Works as should on Joomla, and phpbb )
This is a vBulletin thing, and I'm still learning vBulletin code, so please bare with me.

Updated the Instructions in the download attachment also.

Page Loading Time ( Hack )

I Searched for nearly two hours to find this hack. Either all the scripts I found had backlinks in them or they plain just didn't work.

2 Step Page Loading Time ( Hack )

1) Place this code at the bottom of your " headinclude "

( Style Manager/your_style/All Style Options/ >>Go )

<script Language="JavaScript">
<!-- hide script from non compliant broswers
// author: Susan Lee

var from_time = new Date();
from_time = from_time.getTime();
function show_loading_time()
{
var to_time = new Date();
to_time = to_time.getTime();
var secs = (to_time - from_time) /1000;
document.f.t.value = secs + " seconds";
}
// end hiding from non compliant browsers-->
</script>

2) Now Place this code anywhere in your " footer " you'd like to see the Page Load Time.

( Style Manager/your_style/All Style Options/ >>Go )

<!--A1 --><body onLoad="show_loading_time()"><!-- -->
<!--A1 -->
<form name="f" onSubmit="0"> Page Loading Time:
<input Size="15" Name="t" Value="Plz Wait"><!-- -->

If you don't want the white box you can use "Front Range 4x4" code and and change it to plain text with what-ever color you chose.

Replace:
<input Size="15" Name="t" Value="Plz Wait"><!-- -->

With:
<input size="10" name="t"/ style="color:white;border:none;background:#8C411C;"><!-- -->

Change to your desired colors.

( Thanks "Front Range 4x4" for the help :cool: )


I Placed mine before $ad_location[ad_footer_start]

Cheers,

COL NIL SATIS
10-18-2009, 01:19 PM
Nice

clicked installed!!!

BucWiLd
10-18-2009, 08:43 PM
gonna give it a shot..maybe, waiting for more feedback

Daryn
10-19-2009, 12:30 AM
Using vbAdvanced. I get a time on the homepage, but just get plz wait on every other page.

dacho
10-19-2009, 12:35 AM
10x man

drbox
10-19-2009, 03:47 AM
thanks

installed

how make show as text not in text box

abdobasha2004
10-19-2009, 04:59 AM
thanks, it is good

linuxututs
10-19-2009, 05:05 AM
Using vbAdvanced. I get a time on the homepage, but just get plz wait on every other page.

I have vBadvanced Installed also, and Having no problems with showing.
( Anyone else seen this ? )

( I've also done implemented this hack on 3 other sites )

And as far as customizing the box. I studied the code myself before ever posting it here, and don't see how to do it myself with my meager coding skills ( I get by though ... )

All of you are welcome to improve this anyway you see fit.
But, please post how you done it so the rest of Us can benefit from it.

I have a counter plugin I've created ( re-done someone elses code ) also, but its counting every page load and I'm not that good with vBulletin code as of yet.

If anyone is interested in improving that plugin, It would be GREAT for the community !

No need for linkbacks to the free web-counters that's out there.

Cheers,

meissenation
10-19-2009, 12:28 PM
Installed on my board - changed "Plz Wait" to "Please Wait" - Plz just seems too immature to have on a public board.

linuxututs
10-19-2009, 03:12 PM
Good idea, but I have only even seen it a couple of times when I had added some extra forum from the admin panel. ( Took a little longer for the page to load )

Glad everyone's liking it.

Thanks,

P.S. Think I'll change mine to " loading... " :D

Black Tiger
10-19-2009, 09:58 PM
Nice, marked installed.

However, you should put the instructions also into the zip file.

Black Tiger
10-19-2009, 10:13 PM
Disabled it for now, some problems occur.
For once... I don't like the box with the with backgrond.
Next to that, it's not working with me, it only gives a "plz wait" which I changed in "Please wait" but then it does not fit. That doesn't matter, but it does nog give the page loading time.

How do I get the page loading time and how do I get rid of the box? I would like it to be just plain text and transparant so it won't affect my background color.
This is how it looks at my forums now:
105471

Would also be nice to have the text as small as the rest.

Brandon Sheley
10-19-2009, 10:59 PM
nice mod
and I assume it would be easy enough to add a condition to only show this to staff?

linuxututs
10-20-2009, 01:45 AM
Disabled it for now, some problems occur.
For once... I don't like the box with the with backgrond.
Next to that, it's not working with me, it only gives a "plz wait" which I changed in "Please wait" but then it does not fit. That doesn't matter, but it does nog give the page loading time.

How do I get the page loading time and how do I get rid of the box? I would like it to be just plain text and transparant so it won't affect my background color.
This is how it looks at my forums now:
105471

Would also be nice to have the text as small as the rest.

I'm sorry your not getting this to work for you, because by all rights there is no reason for it not to. ( Unless your changing the script somehow )

And

Loco.M
nice mod
and I assume it would be easy enough to add a condition to only show this to staff?

I'm going to start working with the vBulletin's <if condition >'s , maybe tomorrow for this "Hit Counter" Plugin I'm working on. And then I'll be able to tell you more about what you'd need to do to have it only show for certain groups etc..

I'm sure there's plenty of members here that could help you with that to though.

Thanks,

linuxututs
10-20-2009, 03:12 AM
nice mod
and I assume it would be easy enough to add a condition to only show this to staff?

Here use this

<if condition="is_member_of($vbulletin->userinfo, 6, 7)"><!--A1 --><body onLoad="show_loading_time()"><!-- -->
<!--A1 -->
<form name="f" onSubmit="0"> Page Loading Time:
<input Size="13" Name="t" Value="loading..."><!-- --></if>

Just change the usergroup id's to whoever you want to show the load time to.
6 and 7 are my Administrators and Moderators.

Hope that helps you.

Thanks,

ZEHH
10-20-2009, 03:32 AM
Very good this hack, I just test on my forum and it worked.

Congratulations!

linuxututs
10-20-2009, 05:14 AM
Disabled it for now, some problems occur.
For once... I don't like the box with the with backgrond.
Next to that, it's not working with me, it only gives a "plz wait" which I changed in "Please wait" but then it does not fit. That doesn't matter, but it does nog give the page loading time.

How do I get the page loading time and how do I get rid of the box? I would like it to be just plain text and transparant so it won't affect my background color.
This is how it looks at my forums now:
105471

Would also be nice to have the text as small as the rest.

My bad "Black Tiger", you where partially right anyway.
I found it doesn't show while viewing threads.
But that is the Only place on My board that it doesn't load the time.

Once again, My Bad People, but its still a neat little hack regardless, is the only reason I don't delete it.

Plus I'm sure someone will come up with a fix and/or work around for us on this.

Cheers,

Hornstar
10-25-2009, 12:35 PM
Thanks this will be useful for myself.

Front Range 4x4
10-25-2009, 03:08 PM
I placed this only on Forumhome and changed the formatting to eliminate the ugly white box so it shows up simply as a line of text. You don't need the please wait. In the example below the text is white and background matches my site. Substitute your own colors.

<input size="10" name="t"/ style="color:white;border:none;background:#8C411C;">

Andyrew
10-25-2009, 08:20 PM
This old mod will show you page load times and server load. Even works on 3.8 ;)

https://vborg.vbsupport.ru/showthread.php?t=82900&highlight=microstats

Front Range 4x4
10-25-2009, 08:49 PM
Sometimes less is more, microstats is fine for those who want all that but I'm liking this for simplicity.