HTML Logo by World Wide Web Consortium (www.w3.org). Click to learn more about our commitment to accessibility and standards.

Moving forward with Composr

ocPortal has been relaunched as Composr CMS, which is now in beta. ocPortal 9 will be superseded by Composr 10.

Head over to compo.sr for our new site, and to our migration roadmap. Existing ocPortal member accounts have been mirrored.


Hit Counter

Login / Search

 [ Join | More ]
 Add topic 
Posted
Rating:
#4710 (In Topic #960)
Avatar

Fan in training

Hit Counter

Doe anyone have a Hit Counter for ocPortal?

I was thinking about hacking one together, but don't see any need to reinvent the wheel.

Thanks,
James

Back to the top
 
Posted
Rating:
#4720
Avatar

There is already one built-in. You can view it by logging into your admin centre, clicking the "Statistics" link at the bottom right, and then the "Page Views" link.

Back to the top
 
Posted
Rating:
#4722
Avatar

Fan in training

an ocPortal bot log would be cool….

N…

Ultimatech Computer Consultancy:Website Design Aspen
The Graphic Design Resource:Graphic Design Forums, Photoshop Training
Back to the top
 
Posted
Rating:
#4731
Avatar

Fan in training

Thanks for the tip Allen.  That is great for me as the sysadmin and I also like Nigel's idea of a bot log.

However, what I was looking for more was a public style hit counter.  What I envisioned was like block_side_hitbox.  Add it to the main page and at each load it would check the IP number against all ip's that had visited in, say, the last 24hours or that day (not sure about the coding and system hit for each).  If it is a new ip, log it so it knows it counted it and increment the hit score.  If the same ip revisits the same day (or within 24hours) it doesn't get counted again.

I like the page views with like the news and stuff, but the numbers are a little misleading.  If I click on the view news it adds another count to it, and then the numbers become misleading.

I've been reading though the dev guide and it doesn't seem like it would be very hard.  The ocP dev team did a great job of including 99.9% of the functions that I would otherwise have to hand code.

I'll play around with it for a bit, as soon as I have a stable beta I'll post it here (if that's ok???).

Thanks,
James

Back to the top
 
Posted
Rating:
#4738
Avatar

Sure :). I have actually added a hit counter block to my todo list, but it'll be a while before our next release will be coming out.


Become a fan of ocPortal on Facebook or add me as a friend. Add me on on Twitter.
Was I helpful?
  • If not, please let us know how we can do better (please try and propose any bigger ideas in such a way that they are fundable and scalable).
  • If so, please let others know about ocPortal whenever you see the opportunity.
  • If my reply is too Vulcan or expressed too much in business-strategy terms, and not particularly personal, I apologise. As a company & project maintainer, time is very limited to me, so usually when I write a reply I try and make it generic advice to all readers. I'm also naturally a joined-up thinker, so I always express my thoughts in combined business and technical terms. I recognise not everyone likes that, don't let my Vulcan-thinking stop you enjoying ocPortal on fun personal projects.
  • If my response can inspire a community tutorial, that's a great way of giving back to the project as a user.
Back to the top
 
Posted
Rating:
#5102
Avatar

Fan in training

I am working on the Hit Counter and I am working on several modes for it.

I have 2 quick questions though:

1)  using ocp_query_value is there a way for that function to return rows that are equal to or less than a specified value?  If so can someone give me an example?  What I am looking to do is if the counter is configured to only count an IP number if it has not visited in past 24 hours is query a table to return rows where time => the currentime - 24 hours.

2)  This is for all the readers of the forums:

My current plan for my hit counter is to operate in 3 modes:

  Hour mode: Only count people that have not visited within the past X hours
  Daily Mode: Count an IP only once per day
  Simple Mode: Count every page load, no matter how many times from the same IP number.

Using one of these tree modes will give the most flexability for count hits, if you only want IP numbers that are new in the past X hours or that day you can limit it.  This gives (IMHO) a more accurate count of visitors.  If you do, however, want to count each and every page load, it will do that as well.

Now for the question: are there any other features anyone would like me to implement and/or comments about layout on the page?

I was planning on a block_side type of lay out that would be very close to the Nuke layout:

+—————-+
|   Hit Counter     |
+—————-+
|  256 Hits Since  |
| November 2004  |
|                       |
|   2 Hits Today   |
+—————-+

OK so the drawing is a little crude, but you get the idea.

Thanks,
James

Back to the top
 
Posted
Rating:
#5105
Avatar

Fan in training

I found a work around to the query question, so I hope to have a working BETA by the end of the weekend.

I am still looking for sugestions on the Hit Counter though if anyone has any.  Also, if anyone would like to beta test for me (I currently only have Windows IIS Machines that I can test on) please PM or E-Mail me.

Thanks,
James

Back to the top
 
Posted
Rating:
#5116
Avatar

Community saint

If you post your mod here, I will test it on a few of the installations I am running, and can let you know of any bugs in any of the enviroemnts.
Back to the top
 
Posted
Rating:
#5136
Avatar

Fan in training

This is the beta of my Hit Counter for ocPortal.  Currently, it only works if the Language is EN.  I am reading though the docs to see what I can do to make it work on other languages, although I can't do the translation myself.  At any rate, should be just as easy as uploading the files, installing though Modeules/Block in the Admin Center and then adding [block]side_hit_box[/block] to your main comcode page (one side or the other).

Please see the Hit Box for ocPortal.txt file for more information.

Thanks,
James

** EDIT: Uploaded new zip file.  I had a small upper/lower case issues in the php file.
** EDIT: Uploaded new zip file.  Made major changes

Attachment
» Download: hit_box.zip (5 Kb, 862 downloads so far)

Back to the top
 
Posted
Rating:
#5139
Avatar

Honoured member

If you need Dutch translation give me a hollar, shouldnt take longer then a few minutes.

im working on the Dutch Trans. for OCP with  Flyber

:D  Dont shoot the messenger!!  :D

How many of you believe in telekinesis? Raise my hand.

Chris Graham said

I guess a warning in your line of work tends tomean 'run for cover'. Fortunately it's not so severe when it comes to computers ;).
Back to the top
 
Posted
Rating:
#5150
Avatar

Community saint

Works perfectly.  Good job JMcNutt
Back to the top
 
Posted
Rating:
#5155
Avatar

Well-settled

Is there a live example of this working just so I can have a peek? Not being lazy, but I'm in work so I can't test it on my site ;)

 The Last Outpost - Entertainment news, reviews, previews & interviews. No holds barred - big boys' language in use!

Back to the top
 
Posted
Rating:
#5157
Avatar

Honoured member

ill set it up on my test site im uploading for the dutch translation for OCP

:D  Dont shoot the messenger!!  :D

How many of you believe in telekinesis? Raise my hand.

Chris Graham said

I guess a warning in your line of work tends tomean 'run for cover'. Fortunately it's not so severe when it comes to computers ;).
Back to the top
 
Posted
Rating:
#5163
Avatar

Community saint

http://neurixcs.com

This is one of my live test sites.
Back to the top
 
Posted
Rating:
#5194
Avatar

Honoured member

looks good the block.

:D  Dont shoot the messenger!!  :D

How many of you believe in telekinesis? Raise my hand.

Chris Graham said

I guess a warning in your line of work tends tomean 'run for cover'. Fortunately it's not so severe when it comes to computers ;).
Back to the top
 
Posted
Rating:
#5200
Avatar

Fan in training

I have it on my two sites as well:

http://portal.bullheadschools.com
http://jimbo.mybesthost.com

James

Back to the top
 
Posted
Rating:
#7400
Avatar

Well-settled

I'm glad to see people working on mods and additions for ocPortal.  I'll look forward to adding this to my site.  

-Aaron

-Aaron / PoliticalVoice

"Some mornings it just doesn't seem worth it to gnaw through the leather straps." - Emo Phillips

"Really don't mind if you sit this one out. My word's but a whisper, your deafness a SHOUT. I may make you feel, but I can't make you think." - From the album Thick as a Brick by Jethro Tull (written by Ian Anderson)
Back to the top
 
Posted
Rating:
#7402
Avatar

Fan in training

Thanks, if you have any trouble getting it going.  Let me know.

Jim

Back to the top
 
1 guests and 0 members have just viewed this: None
Control functions:

Quick reply   Contract

Your name:
Your message: