Please login or register.

Login with username, password and session length
Advanced search  

News:

Latest sNews - sNews 1.7 - with its own forums - for discussion and user mods.

Author Topic: [MOD] Page load time (sNews All Versions)  (Read 6083 times)

George Antoniadis

  • Sr. Member
  • ****
  • Karma: 0
  • Posts: 479
[MOD] Page load time (sNews All Versions)
« on: December 15, 2005, 05:56:54 am »

Not exactly a mod.
Just shows the loading time of the page...
Put this in the absolute top of your index.php

Code: [Select]
$time = microtime();
$time = explode(" ", $time);
$time = $time[1] + $time[0];
$start = $time;
?>
and then put this somewhere in your footer.
(best to put it after all php code has been executed or else won't display the correct time.)

Code: [Select]
$time = microtime();
$time = explode(" ", $time);
$time = $time[1] + $time[0];
$finish = $time;
$totaltime = ($finish - $start);
echo("Load time: ".round($totaltime,3)." seconds.");
?>
(I put this after the XHTML barbecue thingie in the default template~ :)

Ps. I used this code to check the times in different modded versions of sNews...
Ps2. The code for this is "stolen" from Totally PHP... :)
Ps3. This is also used to allow "worried" people to see load times ~ :) (from a comment by marcus)
Logged
How I feel like I'm starless, I'm ready to fade now.
And how I feel like I'm starless, I'm hopeless and greyed out.

Patric Ahlqvist

  • Nobodys perfect, but Im pretty effing close
  • ULTIMATE member
  • ******
  • Karma: 65
  • Posts: 4867
  • I'm a self-made man and worships my creator.
    • p-ahlqvist.com
[MOD] Page load time (sNews All Versions)
« Reply #1 on: January 09, 2006, 05:38:54 pm »

Stole that ;)
Logged
"It's only dead fish that goes with the flow... "
Updated

bryn

  • Hero Member
  • *****
  • Karma: 2
  • Posts: 934
    • http://www.cssugly.com
[MOD] Page load time (sNews All Versions)
« Reply #2 on: January 09, 2006, 08:53:38 pm »

hehe..had that!!! ;)
but I don't want my sNews sites to start looking like NUKE!!!

just kidding!  :P
Logged
Over 1,000 posts of joy, sNews is not only brilliant, but fun too! thanks guys :D

George Antoniadis

  • Sr. Member
  • ****
  • Karma: 0
  • Posts: 479
[MOD] Page load time (sNews All Versions)
« Reply #3 on: January 09, 2006, 09:00:39 pm »

nuke? :P did I offend you in any way? :P rofl! ^_^
Logged
How I feel like I'm starless, I'm ready to fade now.
And how I feel like I'm starless, I'm hopeless and greyed out.

bryn

  • Hero Member
  • *****
  • Karma: 2
  • Posts: 934
    • http://www.cssugly.com
[MOD] Page load time (sNews All Versions)
« Reply #4 on: January 09, 2006, 09:05:44 pm »

I offended myself just by mentioning it..rofl ;D ;D ;D

ooh that takes me back a few years..deja vu..and the same to you!  :P
Logged
Over 1,000 posts of joy, sNews is not only brilliant, but fun too! thanks guys :D

Luka

  • Administrator
  • ULTIMATE member
  • ******
  • Karma: 36
  • Posts: 1717
    • http://www.snewscms.com
[MOD] Page load time (sNews All Versions)
« Reply #5 on: January 09, 2006, 09:35:46 pm »

Easy bryn mate, easy...  ;D ;D
Logged

bryn

  • Hero Member
  • *****
  • Karma: 2
  • Posts: 934
    • http://www.cssugly.com
[MOD] Page load time (sNews All Versions)
« Reply #6 on: January 10, 2006, 12:09:01 am »

it's ok Luka..I'm over it..found something I like and believe is a must for all webmasters..

those were the days my friend
we thought they'd never end
we'd sing and dance
forever and a day
though coded lines were few
the crap we never knew
but..we were young
and sure to have our way

la-da-di-da-di-dah
la-da-di-da-di-ddah

my version of a popular British Eurovision Song Contest entry..by Mary somebody or other..hehe

doesnt hurt to have a sing-a-long every now and then..good for the soul ;D
Logged
Over 1,000 posts of joy, sNews is not only brilliant, but fun too! thanks guys :D

Patric Ahlqvist

  • Nobodys perfect, but Im pretty effing close
  • ULTIMATE member
  • ******
  • Karma: 65
  • Posts: 4867
  • I'm a self-made man and worships my creator.
    • p-ahlqvist.com
[MOD] Page load time (sNews All Versions)
« Reply #7 on: January 11, 2006, 03:38:36 pm »

Mary Hopkins ?

Found a li'l something while searching on that lyric: The whole lyric.
Just for you, bryn ;)
Logged
"It's only dead fish that goes with the flow... "
Updated

bryn

  • Hero Member
  • *****
  • Karma: 2
  • Posts: 934
    • http://www.cssugly.com
[MOD] Page load time (sNews All Versions)
« Reply #8 on: January 11, 2006, 08:56:34 pm »

yey that's the gal ;D

cheers mate..after writing that I couldn't get the tune out of my head for ages..and I don't even like it that much!

showing my age here too..

still..that's a handy lyrics site..I might use it to dig up some other fossilithic tunes that will keep me amused while I tap away..heh! ;D
Logged
Over 1,000 posts of joy, sNews is not only brilliant, but fun too! thanks guys :D

George Antoniadis

  • Sr. Member
  • ****
  • Karma: 0
  • Posts: 479
[MOD] Page load time (sNews All Versions)
« Reply #9 on: January 12, 2006, 10:11:34 am »

ROFLOMFGOFMGFOGMFOGMFOGMFOGMFOGMmgfgggggggggggggggggggggggggggggggggg!!!!!!!!!!!!!!!

^_^ bryn you are my new favorite band dude! :P
<3
Logged
How I feel like I'm starless, I'm ready to fade now.
And how I feel like I'm starless, I'm hopeless and greyed out.

bryn

  • Hero Member
  • *****
  • Karma: 2
  • Posts: 934
    • http://www.cssugly.com
[MOD] Page load time (sNews All Versions)
« Reply #10 on: January 12, 2006, 10:25:08 am »

get Skype 2 everybody..it has the new video wotnot thingy-majig

then we can schedule a community sing-a-long featuring all of our favourite tunes..and maybe some not so favourite ones eh! ;D
Logged
Over 1,000 posts of joy, sNews is not only brilliant, but fun too! thanks guys :D