Main
Index
Search
Posts
Who's
Online
Log
In

Home: Discontinued/Classic Products: Article Manager 1 Add-ons:
Hit Counter for Individual Articles?

 

 


woodwater
User

May 29, 2003, 3:50 PM

Post #1 of 4 (3539 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 (3534 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

--
support@interactivetools.com


BillG
User

May 30, 2003, 10:58 AM

Post #3 of 4 (3531 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:

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 .


Benjamin
Staff


Jun 4, 2003, 3:57 PM

Post #4 of 4 (3484 views)
Shortcut
Re: [woodwater] Hit Counter for Individual Articles? [In reply to] Can't Post

Hey guys, check out the following thread: http://www.interactivetools.com/forum/forum.cgi?post=12737

Smile
Ben
interactivetools.com