Wouldn't you like to know how many people have read your blog post? Well, I do like so. In the blog system mangoBlog, which I use for this weblog, this wasn't a default option, and there wasn't a plugin yet to add this.
So, I created a plugin. You will already see the words "view Count: x" underneath this blog text.
What's new in:
See changes in subversion
Compatibility bug fix for version 1.6 of mangoblog
Added new admin setting "view count text", so you can now decide what viewcount text you want to show in your website.
Added new admin setting "show count in weblog?" to optionally hide your view counts.
The viewcounts are now also shown on the Posts overview page! Thanks to Mark Aplet for the tip!
Zipped the outdated version of settingsForm.cfm in 1.2.4. this version fixes that.
Fixed a bug with the latest version of mangoblog, which prevented the plugin from working.
Less database interaction because of caching.
Support for MySQL as well as MSSQL!
Admin-problem resolved for implementations which use a table-prefix with their database tables.
How to use?
Go to your mangoBlog admin > Plugins, and enter the following url to download:
Then, you need to activate it by pressing the link 'Activate' next to the plugin.
- "Count views from web spiders/crawlers?" Default: No.
These are page requests done by search engines like Google, to index your website. To be honest, these aren't real views, but on the other hand, it IS a request.
- "" Default: 2 hours.
ViewCount remembers the time and IP address for each counted view. After how many hours should we consider a page view from the same IP to the same post a new view?
- "Show viewCount in website?"
In case you want to hide the view count from the public.
- "Text to show"
By default, the plugin will show "View count: 123". Here, you can change the text which will be shown.
You can use a placeholder for the viewcount number by adding $viewcount$.
Examples: "viewed $viewcount$ times", "$viewcount$ views", or "| $viewcount$ keer bekeken".
If you leave the $viewcount$ out, then it will be added to the end of the text. And yes, you can add html
- You can change the counts yourself.
If you already have your blog for years, and don't want to look like a lonely idiot with no visitors at all, then just start off with a higher number.
Are the counts not working/showing up on your pages?
That will probably have to do with your template/Theme. Check if your post.cfm-template (found in /skins/template-name/) contains a tag <mango:Event name="beforePostContentEnd" />. If not, then just copy and paste this tag into the div at the end of the post, just after the "Posted by ..." text.
Want to show the view count on the index pages as well?
As you can see on my homepage and archive pages, the view count is show for each post. To accomplish this, you need to edit the 2 templates index.cfm and archives.cfm, both in your Theme directory. Just add the following text near the "Posted by ..." line:
<mango:Event name="showViewCount" />
The code itself
When you're using the plugin, and/or have any questions, leave me a comment! I'd like it ;-)| Viewed 3694 times