 |

woodwater
User
May 29, 2003, 3:50 PM
Post #1 of 4
(2672 views)
Shortcut
|
|
Hit Counter for Individual Articles?
|
Can't Post
|
|
Is it possible to have a hit counter for individual articles that says "This article has been viewed XX time(s)." ? We can also expand on it and have a feature that list the most popular articles according to how many times it has been viewed.
|
|
|  |
 |

Donna
Staff
/ Moderator

May 30, 2003, 10:01 AM
Post #2 of 4
(2667 views)
Shortcut
|
|
Re: [woodwater] Hit Counter for Individual Articles?
[In reply to]
|
Can't Post
|
|
Hi woodwater! Thanks for the post. :) Hmm. Do-able? I think so. How? Yeek, I've got no idea. It would take a rather ingenious script to manage that, I think. It's definitely not a feature that's built into Article Manager, but it's an interesting idea. :) If you manage to get something like that together, I'd love to see it. :) Donna
Hire me! Save time by getting our experts to help with your project. Template changes, advanced features, full integration, whatever you need. Whether you need one hour or fifty, get it done fast with Priority Consulting.
|
|
|  |
 |

BillG
User
May 30, 2003, 10:58 AM
Post #3 of 4
(2664 views)
Shortcut
|
|
Re: [woodwater] Hit Counter for Individual Articles?
[In reply to]
|
Can't Post
|
|
I don't know how to do it in CGI, but in Active Server Pages you can use the PageCounter component. Create a file called counter.asp, in a subdirectory ASPScript, with the following code: <% 'Instantiate the PageCounter object in IIS5 ' In IIS4 you may have to use IISSample instead of MSWC Set MyPageCounter = Server.CreateObject("MSWC.PageCounter") 'Increment the counter for this page. MyPageCounter.PageHit thisPage = Request.ServerVariables("URL") If Server.HTMLEncode(Request.QueryString("clear")) = "321" Then 'Reset the counter for this page, and reload MyPageCounter.Reset(thisPage) Response.Redirect(thisPage) End If Response.Write("<DIV class=PageCount>This Page has been viewed " & MyPageCounter.Hits & " times</div>") %> Then, add the following to your AM Article template: <!--#Include virtual="ASPScript/counter.asp"--> The cool thing about this is that you can reset any article's counter to zero by adding ?clear=321 to the end of any article URL. Of course, this assumes that you are using ASP pages and that your article's pages all end in .asp .
|
|
|  |
 | |  |
|