Page 1 of 1

How to place blog stats on front page?

Posted: Wed Dec 07, 2005 3:19 am
by carl_galloway
Hi all,

Is there some way of putting some basic stats on the front page of my blog, such as;

1 date of last entry
2 total number of entries
3 number of comments
4 number of visitors this month or totally

I want to be able to include this in my template, and don't want to create a plugin. I think all this information should already exist within the database since I'm using the stats plugin already.

If it is possible, would I be able to create an html nugget? This wouldbemy preferred mthod, or would I need to call the serendipity hooks from within (say) index.tpl or entries.tpl.

Any help would be great.

Cheers
Carl[/list]

Re: How to place blog stats on front page?

Posted: Wed Dec 07, 2005 11:14 am
by garvinhicking
Hi!

This won't work without creating a sidebar plugin. The statistics plugin only gathers that data on the backend, not on the frontend, so you must make a similar plugin that reads the data and prints it in the sidebar.

I've created such a plugin and committed it to SVN of the 1.0 version. You can use this plugin in your current version as well. Just download all the files from here: http://svn.berlios.de/viewcvs/serendipi ... statistics

(basically you only need the serendipity_plugin_statistics.php and the lang_en.inc.php file)

Regards,
Garvin

Wow, that was fast!

Posted: Wed Dec 07, 2005 6:09 pm
by carl_galloway
Garvin,

Thank you for that. I've installed your plugin on my site if anyone else would like to see how it looks in its defaul format.

Cheers
Carl

Posted: Thu Dec 08, 2005 3:18 am
by BabeSpot
Thnks for this plugin Garvin! I have one question; is it also possible to show how many users (visitors) there are currently at your site?

Posted: Thu Dec 08, 2005 11:36 am
by garvinhicking
I just added this function to the repository, where you can fetch it. Or download the next generated nightly tarball.

Regards,
Garvin

Posted: Thu Dec 08, 2005 9:15 pm
by BabeSpot
And also a lot of thank-you's for this one Garvin !