Go to main content

Textpattern CMS support forum

You are not logged in. Register | Login | Help

#1 2005-01-30 02:00:29

andie_weaver
New Member
Registered: 2005-01-29
Posts: 4

Very simple hit counter plugin

I needed a counter for my website, so I made a small plugin that outputs the number of entries in the log-table. The flaw is of course that this will not be a count of unique visitors, but a count of pageloads, but someone might find it useful anyway. You can download the plugin here .

/Andie

Last edited by andie_weaver (2005-01-30 02:01:23)

Offline

#2 2005-01-30 13:18:04

andie_weaver
New Member
Registered: 2005-01-29
Posts: 4

Re: Very simple hit counter plugin

If anyone has an idea on how to use the present txp data to make a counter of unique visitors rather than pageloads, please tell!

Offline

#3 2005-01-30 14:40:43

t1m
Member
From: Massachusetts, USA
Registered: 2004-09-11
Posts: 17
Website

Re: Very simple hit counter plugin

I’de be interested to see a customizable unique hit counter, something that would output the hits on to a page in text format.


“You know you’ve achieved perfection in design, not
when you have nothing more to add, but when you have
nothing more to take away.” -Antoine de Saint-Exupery

Offline

#4 2005-01-30 16:20:59

andie_weaver
New Member
Registered: 2005-01-29
Posts: 4

Re: Very simple hit counter plugin

I’m now using a counter script called BBClone, and I suppose it’s not neccesary to build into TXP what is already being done well by others. Would be nice to be able to use the existing txp logs, though, so I’m still looking for tips on how to do that.

Anyway, I made a plugin that works with BBClone. You install the counter script (get it from here), set it up and then install this plugin so that instead of a chunk of php code pasted in your textpattern page, you can use a txp tag instead, which I find much more neat. At the moment it just outputs the number of unique visitors, future development would include making the tag accept attributes to output other statistics as well. It’s not a complete solution plugin, you also have to add this little snippet of code to your index.php:
<code>
define(“_BBCLONE_DIR”, “bbclone/”);
define(“COUNTER”, _BBCLONE_DIR.“mark_page.php”);
if (is_readable(COUNTER)) include_once(COUNTER);
</code>

Download the plugin here

/Andie

Last edited by andie_weaver (2005-01-30 16:41:59)

Offline

#5 2005-01-30 16:29:57

wilshire
Plugin Author
From: Akron, Ohio
Registered: 2004-08-27
Posts: 656
Website

Re: Very simple hit counter plugin

A friendly reminder…

Before writing a plugin, make sure someone else didn’t already.

bbClone plugin

Offline

#6 2005-01-30 16:37:41

andie_weaver
New Member
Registered: 2005-01-29
Posts: 4

Re: Very simple hit counter plugin

oops, should have done that. So easy to make these small plugins, that you forget to check if someone did it before you.

Edit: My plugin actually does not do the same as the one mentioned, but they can be used together. Use the first bbclone-plugin to get the statistics-application working on your site, then use my txp-tag to output the number of visitors on your page.

/andie

Last edited by andie_weaver (2005-02-01 21:30:45)

Offline

#7 2006-06-26 20:29:45

-M&N-
New Member
Registered: 2005-12-17
Posts: 5

Re: Very simple hit counter plugin

the download link is incorrect! have someone original plugin?

Offline

Board footer

Powered by FluxBB