Shoutbox

php/mysql help - stats and templates? - Printable Version

-Shoutbox (https://shoutbox.menthix.net)
+-- Forum: MsgHelp Archive (/forumdisplay.php?fid=58)
+--- Forum: Skype & Technology (/forumdisplay.php?fid=9)
+---- Forum: Tech Talk (/forumdisplay.php?fid=17)
+----- Thread: php/mysql help - stats and templates? (/showthread.php?tid=47188)

php/mysql help - stats and templates? by Fourjays on 07-04-2005 at 09:31 PM

Hey,
A thread for the technically minded. ;)

Im currently busy at work on my own blogging system (mainly as a method to learn), which I hope to release to the public in the not so far future. So far I have most of the major stuff covered.

However, the one thing which I haven't got (and numerous google searches have provided no glory either - probably wrong search terms), is all the page statistics, like you get at the bottom of alot of php scripts (it will be an option in the config). What code do I need to generate all the statistics, such as parse times, number of queries, etc?

Also, does anyone know of any really simple way to implement some kind of templating system? I would like to do this, so that it is easy for users to make their own templates, but so far all I have found is a load of stuff on special engines, and one tutorial on making your own engine - which I tried and just got pages of errors.

Thanks for your help. :D


RE: php/mysql help - stats and templates? by Dempsey on 07-04-2005 at 09:33 PM

well to do the number of sql queries, you have to replace the SQL_query function with your own so it performs the query as well as incrementing a static variable then when you want to display the number of queires make it show it when the function takes no arguements.

I made that sound a lot more complicated than it is lol :P


RE: php/mysql help - stats and templates? by Fourjays on 07-04-2005 at 09:36 PM

I don't suppose you can point me towards the right section on the php or mysql site, or another tutorial website?

It does sound kinda complicated. :s


RE: php/mysql help - stats and templates? by Dempsey on 07-04-2005 at 09:43 PM

code:
function cnt_mysql_query($sql=FALSE)
    {
        static $queries = 0;
        if (!$sql)
        return $queries;
        $queries ++;
        return mysql_query($sql);
}

Then use cnt_mysql_query instead of mysql_query.  When you want to output the number just dont pass any arguements,
RE: php/mysql help - stats and templates? by ShawnZ on 07-05-2005 at 02:23 AM

Haha, what a couincidence, im doing the same project as you :)


RE: php/mysql help - stats and templates? by Snake on 07-05-2005 at 02:34 AM

I was just starting to work on template systeam for a stupid littel phone book script I have been working on. Unfortunatly I blew the hard drive in my test server and didn't have the chance to start programing the template systeam.


RE: php/mysql help - stats and templates? by Fourjays on 07-05-2005 at 10:31 AM

quote:
Originally posted by Shawnz
Haha, what a couincidence, im doing the same project as you :)

Maybe we should work together then. ;)

I want mine to be as versatile as possible, so that the user can do just about anything they want with it. I'm planning on having another go at getting a templating system working today, as I feel this is important for easy customisation.