| Current Version: | 0.4 |
|---|---|
| Code: | Code |
| Forum Thread: | http://forum.nucleuscms.org/viewtopic.php?t=3558 |
With this plugin you can add a textual or graphical counter to your weblog, which count's the number of visitors, instead of the number of hits. It does this by starting a phpsession when the visitor views the first page, and it stores the value of the counter at that moment for the visitor so that he sees the same value for the counter on every page. It also detects the most common bots and spiders, like google, to prevent them from being counted. It stores the value of the counter as a blogoption so that every blog in your Nucleus installation has its own counter.
To display the (textual) counter add the skinvar <%Counter2%> somewhere in your skin (you can also use <%Counter2(textual)%>). If you prefer a graphical counter you can use <%Counter2(graphical)%> (don't forget to upload the images as well as decribed in the Installation)
Since version 0.4 NP_Counter2 also includes a 'feedcounter' to count how many times your feeds where downloaded. This counter doesn't use a phpsession. To count, add in every skin of your feeds (rss1, rss2, atom,…) somewhere <%Counter2(feeds,nodisplay)%>, this will count everytime your feed is downloaded. To show the value of this 'feedcounter' add somewhere in the skin of your blog <%Counter2(feeds,textual,nocount)%> (or <%Counter2(feeds,graphical,nocount)%> for a graphical version)
Due to the use of a blogoption this plugin requires Nucleus v2.20 or higher.
NP_Counter2.php, upload it to the plugins folder of your Nucleus installation and install.index.php (or your config.php). If you use NP_WIE you should have done this already. (if you only plan to use the feedcounter this is not necessary, since the feedcounter doesn't use a phpsession) session_start();
counter2 (lowercase!) in your plugins directory. Create 10 images (for every digit one) and call them 0.png, 1.png, 2.png, and so on and put them in the counter2 directory (or download my 10 (ugly To upgrade to version 0.3 (or higher) when you are using version 0.1 or 0.2, you should first uninstall the previous version (before you do this 'back-up' the value of your counter, because this is also deleted!)
Once again (sorry!) when you are using version 0.3 and want to upgrade to 0.4, you should first uninstall the plugin (don't forget to backup!)
The skinvar has three options:
Some examples:
<%Counter2(visits,textual)%> <%Counter2(visits,graphical,nocount)%> <%Counter2(feeds,textual,nocount)%> <%Counter2(feeds,nodisplay)%>
You can get the code of the plugin HERE
NP_CommentRSSversion 0.4 works with Nucleus CMS version 3.31 - 2007-11-02 ftruscot