LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.

Notices


Reply
  Search this Thread
Old 02-23-2008, 09:46 PM   #1
tzouse
Member
 
Registered: May 2004
Location: Jamaica
Distribution: Red Hat 9/FC1/FC3/FC4
Posts: 35

Rep: Reputation: 15
how to show how many times a pic have been viewed or clicked on?


Have some pics on my site and want to know how many times they have been looked at.

If someone can point me to some code (php or javascript) that would be great.

Thanks!
 
Old 02-23-2008, 10:52 PM   #2
paulsm4
LQ Guru
 
Registered: Mar 2004
Distribution: SusE 8.2
Posts: 5,863
Blog Entries: 1

Rep: Reputation: Disabled
The place to find this information is to look in your web server's "access" log.
 
Old 02-24-2008, 02:19 AM   #3
theNbomr
LQ 5k Club
 
Registered: Aug 2005
Distribution: OpenSuse, Fedora, Redhat, Debian
Posts: 5,399
Blog Entries: 2

Rep: Reputation: 908Reputation: 908Reputation: 908Reputation: 908Reputation: 908Reputation: 908Reputation: 908Reputation: 908
Quote:
Originally Posted by paulsm4 View Post
The place to find this information is to look in your web server's "access" log.
While this is ostensibly true, not all views/clicks will come directly from your server. Caches of various sorts will supply hits that cannot be recorded in your server logs. There is know way of knowing for sure.

The server logs will tell you some things, like trends and so on. The number of hits recorded by your server should be interpreted as the minimum number of actual hits.

--- rod.
 
Old 10-08-2008, 01:50 AM   #4
tzouse
Member
 
Registered: May 2004
Location: Jamaica
Distribution: Red Hat 9/FC1/FC3/FC4
Posts: 35

Original Poster
Rep: Reputation: 15
Kinda got side tracked!
But, is there a script lying around i can mess with to see how this is implemented??
 
Old 10-08-2008, 08:00 AM   #5
theNbomr
LQ 5k Club
 
Registered: Aug 2005
Distribution: OpenSuse, Fedora, Redhat, Debian
Posts: 5,399
Blog Entries: 2

Rep: Reputation: 908Reputation: 908Reputation: 908Reputation: 908Reputation: 908Reputation: 908Reputation: 908Reputation: 908
Most such scripts tend to be very site-specific or user-specific and the format of the log file can vary quite a bit. Give us a sample of your log file, and what your preferred language for implementation is, and someone will be able to cobble something together. Better still, take a shot on your own, and post code snippets here when you need help.
The general technique is not difficult. Usually, the web server logs are stored as records of hits, one per line, and mostly in chronological order. The various fields are fairly easy to discern by inspection.
--- rod.
 
Old 10-09-2008, 06:46 AM   #6
Nightfish
Member
 
Registered: Sep 2008
Posts: 36

Rep: Reputation: 15
just get a java script to record this somewhere.
on all anchors add the onClick="javascript:<increment count goes here>".
you don't need to search for one just make it yourself.
read this: http://www.c-point.com/JavaScript/ar...JavaScript.htm
for reading writing to files, make a function that does this, and use the onclick.

Fedora Development

Last edited by Nightfish; 10-22-2008 at 12:51 PM.
 
Old 10-09-2008, 07:34 AM   #7
theNbomr
LQ 5k Club
 
Registered: Aug 2005
Distribution: OpenSuse, Fedora, Redhat, Debian
Posts: 5,399
Blog Entries: 2

Rep: Reputation: 908Reputation: 908Reputation: 908Reputation: 908Reputation: 908Reputation: 908Reputation: 908Reputation: 908
How do you get the user to click on a picture every time they view it? Not all pictures are links.
--- rod.
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
How to check if someone viewed my files? piokon Linux - General 10 07-24-2007 03:47 AM
man documents, how is it viewed. pranavojha Linux - Newbie 5 03-26-2006 09:31 AM
System hangs; Atheros Madwifi-ping times out every 15/16 times james 456 Linux - Networking 0 01-12-2006 06:55 PM
LXer: Empower Technologies(TM) Software Development Kit Nominated as Most Promising New Technology at EE Times Award Show. LXer Syndicated Linux News 0 12-12-2005 01:46 PM
Error viewed in srvrep BongoKarl Linux - Networking 0 07-12-2005 08:30 AM

LinuxQuestions.org > Forums > Non-*NIX Forums > Programming

All times are GMT -5. The time now is 01:05 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration