MemHT Portal is a Free PHP CMS and Blog
It permit the creation and the management online of websites with few and easy steps.
It's completely customizable, expandable and suitable for all needs.
Moderators: Moderators
Forum RSS feedReply
Generation time page
AuthorText
eros23
Junior Member

Posts: 77
Contributes: 68

Gender: _NEUTRAL_
Online: No
Date: 06/02/2009 14:01
Generation time page
#post18117
Ho creato un mod e ho fatto una piccola guida visto che era poco per voi utenti per installare un misuratore di velocità delle pagine (in quanto tempo il server genera la vostra pagina) in modo da tenerlo sempre sotto controllo

P.s.
un buon consiglio?? non fate superare i 0.15 sec. altrimenti vi trovate un sito lento

English:
I created a mod and I did a little guidance because it was just for you users to install a speed meter of the pages (as long the server generates your page) so as to always keep it under control
Edited: 06/02/2009 14:20
Delete Edit Quote
 
doulis
Donator

Posts: 239
Contributes: 227

Gender: _MALE_
Online: No

Version: 4.0.1
Country: Greece
Languages: Greek & Little English
Date: 06/02/2009 18:12
Re: Generation time page
#post18122
how can i install it in my site?
GREEK MUSIC PORTAL:::
http://www.midipart.gr/main
Delete Edit Quote
 
eros23
Junior Member

Posts: 77
Contributes: 68

Gender: _NEUTRAL_
Online: No
Date: 06/02/2009 20:46
Re: Generation time page
#post18124
Download the file and follow the guide. you'll need to change only 3 files.
Delete Edit Quote
 
mem
MemHT's Dad
Admin & Developer

mem

Posts: 6901
Contributes: 4406

Gender: _MALE_
Online: No

Languages: English, Italiano, Македонски, Српски
Date: 07/02/2009 09:33
Re: Generation time page
#post18130
MemHT has already a "speed detector", just put echo "Loaded in: $totaltime"; at the end of index.php
Follow me on twitter if you want to be updated on the MemHT 5 development.
Delete Edit Quote
 
doulis
Donator

Posts: 239
Contributes: 227

Gender: _MALE_
Online: No

Version: 4.0.1
Country: Greece
Languages: Greek & Little English
Date: 22/02/2009 21:36
Re: Generation time page
#post18460
quote
mem:
MemHT has already a "speed detector", just put echo "Loaded in: $totaltime"; at the end of index.php



here is the end of the code.. what have to add because i cant do it by myself

code
$mtime = microtime();
$mtime = explode(" ",$mtime);
$mtime = $mtime[1] + $mtime[0];
$endtime = $mtime;
$totaltime = sprintf("%01.2f",($endtime - $starttime));
$totaltime = explode(".",$totaltime);


if ($totaltime[1]>=75) { $totaltime = ($totaltime[0]+1).".00";
} else if ($totaltime[1]>=50) { $totaltime = $totaltime[0].".75";
} else if ($totaltime[1]>=25) { $totaltime = $totaltime[0].".50";
} else if ($totaltime[1]>0) { $totaltime = $totaltime[0].".25";
} else { $totaltime = $totaltime[0].".00"; }

if ($dblink->get_num("SELECT time FROM memht_statistics_loadtime WHERE time='$totaltime' LIMIT 1")>0) {
        $dblink->query("UPDATE memht_statistics_loadtime SET hits=hits+1 WHERE time='$totaltime'");
} else {
        $dblink->query("INSERT INTO memht_statistics_loadtime (time,hits,started) VALUES ('$totaltime',1,$tzNOW)");
}

//===========================================
//DATABASE: DISCONNECT
//===========================================
$dblink->disconnect();

?>
GREEK MUSIC PORTAL:::
http://www.midipart.gr/main
Delete Edit Quote
 
sisnox
Moderator
Developer


Posts: 1638
Contributes: 897

Gender: _MALE_
Online: No

Version: 4.0.1
Country: Portugal
Languages: Portuguese, Portuguese and little english ^^
Date: 22/02/2009 22:10
Re: Generation time page
#post18462
Hi

Open file index.php

find
code

if ($totaltime[1]>=75) { $totaltime = ($totaltime[0]+1).".00";
} else if ($totaltime[1]>=50) { $totaltime = $totaltime[0].".75";
} else if ($totaltime[1]>=25) { $totaltime = $totaltime[0].".50";
} else if ($totaltime[1]>0) { $totaltime = $totaltime[0].".25";
} else { $totaltime = $totaltime[0].".00"; }

if ($dblink->get_num("SELECT time FROM memht_statistics_loadtime WHERE time='$totaltime' LIMIT 1")>0) {
        $dblink->query("UPDATE memht_statistics_loadtime SET hits=hits+1 WHERE time='$totaltime'");
} else {
        $dblink->query("INSERT INTO memht_statistics_loadtime (time,hits,started) VALUES ('$totaltime',1,$tzNOW)");
}
 


Replace:
code

if ($totaltime[1]>=75) { $totaltime = ($totaltime[0]+1).".00";
} else if ($totaltime[1]>=50) { $totaltime = $totaltime[0].".75";
} else if ($totaltime[1]>=25) { $totaltime = $totaltime[0].".50";
} else if ($totaltime[1]>0) { $totaltime = $totaltime[0].".25";
} else { $totaltime = $totaltime[0].".00"; }

echo "<div style='text-align: center; font-weight:bold;'>Loaded in: $totaltime</div>";

if ($dblink->get_num("SELECT time FROM memht_statistics_loadtime WHERE time='$totaltime' LIMIT 1")>0) {
        $dblink->query("UPDATE memht_statistics_loadtime SET hits=hits+1 WHERE time='$totaltime'");
} else {
        $dblink->query("INSERT INTO memht_statistics_loadtime (time,hits,started) VALUES ('$totaltime',1,$tzNOW)");
}
 
Delete Edit Quote
 
doulis
Donator

Posts: 239
Contributes: 227

Gender: _MALE_
Online: No

Version: 4.0.1
Country: Greece
Languages: Greek & Little English
Date: 23/02/2009 02:17
Re: Generation time page
#post18470
thanks MR. PAULO!!! Smile
GREEK MUSIC PORTAL:::
http://www.midipart.gr/main
Delete Edit Quote
 
Reply
Tags Cloud
Advertising
Help MemHT Portal
Navigator
Users Block
Hi Guest
IP: 38.107.191.107

Username
Password
Language
MemHT Portal is a free software released under the GNU/GPL License by Miltenovik Manojlo