Contact Us Forum Rules Search Archive
WebProWorld Part of WebProNews.com
Page One Link To Us Edit Profile Private Messages Archives FAQ RSS Feeds  
 

Go Back   WebProWorld > Webmaster, IT and Security Discussion > Web Programming Discussion Forum
Subscribe to the Newsletter FREE!


Register FAQ Members List Calendar Arcade Chatbox Mark Forums Read

Web Programming Discussion Forum Working with an API? Developing a plugin? Writing a Mod or script for your favorite blog, Web 2.0 site or Forum? Welcome.

Reply
 
LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 12-07-2007, 12:49 AM
edhan's Avatar
WebProWorld Veteran
 

Join Date: Aug 2003
Location: Singapore
Posts: 581
edhan RepRank 1
Question How many users read story records

Hi

Hope to find someone that can help with this.

How can I record how many users have read the story but do not want repeated users to click twice or more as it will make it inaccurate record.

The table will be called as Record and the fields are id, users, story and read. So this means that every story being read by users, it will be recorded as read identified by id. So if the same user wants to click Record again for the same story, it will check the field: read and if the same id, then it will say: Sorry, you have already read the story.

How should I start writing the program?

Thanks!
Reply With Quote
  #2 (permalink)  
Old 12-07-2007, 09:04 AM
DaveSawers's Avatar
WebProWorld Veteran
 

Join Date: Dec 2006
Location: Calgary, Alberta, Canada
Posts: 389
DaveSawers RepRank 1
Default Re: How many users read story records

Generate a cookie when a user first reads the story and check for its existence each time. If no cookie for that story, then the user hasn't read it before.

Why would you want to prevent users reading the story more than once?
__________________
Dynamic Software Development
www.activeminds.ca
Reply With Quote
  #3 (permalink)  
Old 12-07-2007, 09:15 AM
edhan's Avatar
WebProWorld Veteran
 

Join Date: Aug 2003
Location: Singapore
Posts: 581
edhan RepRank 1
Default Re: How many users read story records

Hi DaveSawers

Sorry as I may not be clear about what I want.

I am actually trying to keep tab on unique users in my membership to track how popular is a particular story where registered users will click the "READ BUTTON" at the end of the story to count as 1 for 1st reader, 2 for second reader and so forth.

Of course users can re-read the story but if they click on the "READ BUTTON", it will not be recorded as a count since they have already read the story the second or third time.

This is to update the number of times this story has been read to allow me to know how popular this particular story. It is like rating a story but collecting the number of clicks by registered users.

Hope this explanation is clear and do you have an idea how I can do it?
Reply With Quote
  #4 (permalink)  
Old 12-07-2007, 06:26 PM
DaveSawers's Avatar
WebProWorld Veteran
 

Join Date: Dec 2006
Location: Calgary, Alberta, Canada
Posts: 389
DaveSawers RepRank 1
Default Re: How many users read story records

Use the cookie method I suggested and only count users who don't have the cookie.
__________________
Dynamic Software Development
www.activeminds.ca
Reply With Quote
  #5 (permalink)  
Old 12-07-2007, 11:47 PM
edhan's Avatar
WebProWorld Veteran
 

Join Date: Aug 2003
Location: Singapore
Posts: 581
edhan RepRank 1
Default Re: How many users read story records

I do not know how to use cookie for tracking.

Do you have an example so to give me an idea as how to do that?

My idea is to record user field in the read field. So when the same user clicks on the Read Button, it will not record again. I think I will need another field for counting to update the number of registered users have read the story.

I just know the theory part of what I want to do but do not have a single idea how to put it in the programming.

Any advice or tip will be greatly appreciated.
Reply With Quote
  #6 (permalink)  
Old 12-08-2007, 10:22 AM
DaveSawers's Avatar
WebProWorld Veteran
 

Join Date: Dec 2006
Location: Calgary, Alberta, Canada
Posts: 389
DaveSawers RepRank 1
Default Re: How many users read story records

Depends on what programming language you want to use. Here is a good start for PHP programming: PHP Cookies

Or in ASP: ASP Cookies

Or in javascript: JavaScript Cookies

Go do some reading and learn how to do it for yourself.
__________________
Dynamic Software Development
www.activeminds.ca
Reply With Quote
  #7 (permalink)  
Old 12-08-2007, 10:58 AM
WebProWorld Pro
 

Join Date: Sep 2005
Location: Manchester, UK
Posts: 257
mikesmith76 RepRank 0
Default Re: How many users read story records

If the people marking stories as read are registered members you would be better off having a seperate table keeping track of the 'read' records, something along the lines of

tblArticleRead

ArticleId
UserId
ReadDate

This way even if the member does not have cookies enabled / clears their cookies they could only ever mark a story as read once.
Reply With Quote
  #8 (permalink)  
Old 12-08-2007, 12:47 PM
edhan's Avatar
WebProWorld Veteran
 

Join Date: Aug 2003
Location: Singapore
Posts: 581
edhan RepRank 1
Default Re: How many users read story records

Quote:
Originally Posted by mikesmith76 View Post
If the people marking stories as read are registered members you would be better off having a seperate table keeping track of the 'read' records, something along the lines of

tblArticleRead

ArticleId
UserId
ReadDate

This way even if the member does not have cookies enabled / clears their cookies they could only ever mark a story as read once.
As I am not good in programming, I can't figure out as how I can record the story read by different users. Example. story 1, story 2, etc. How to check and record story 1 being read by users as not to have the same user.
Reply With Quote
  #9 (permalink)  
Old 12-09-2007, 05:19 PM
WebProWorld Member
 

Join Date: Oct 2005
Posts: 39
niggles RepRank 1
Default Re: How many users read story records

Quote:
As I am not good in programming, I can't figure out as how I can record the story read by different users. Example. story 1, story 2, etc.
The way I do this (in PHP) is have something like this

href="show-articles.php?id=1234"

On the show-articles.php page it write "1234" to the database to save the fact they've read it.

Then the page redirects to the actual article:

header("location: my-real-article-url.php");

-----

You can only really count clicks to those articles if you do a redirect OR at the top of the article page write something to do the database to show they've visited the page.

Cheers,
Niggles
__________________
-------------------------------------------------
World Music World - bringing the World's Folk Music Cultures Together
http://www.worldmusicworld.com/
-------------------------------------------------
Reply With Quote
Reply

  WebProWorld > Webmaster, IT and Security Discussion > Web Programming Discussion Forum
Tags: ,



Thread Tools
Display Modes

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

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Similar Threads
Thread Thread Starter Forum Replies Last Post
Displaying records - PHP/MYSQL seorocks Web Programming Discussion Forum 1 12-22-2006 09:45 AM
Are you concerned about your records being accessible TrafficProducer Internet Security Discussion Forum 0 08-08-2006 07:20 PM
Google Breaks Records In 2Q jmiller Google Discussion Forum 17 07-27-2005 08:19 AM
Using phpBB2 users as main site users Dragonsi Web Programming Discussion Forum 6 09-16-2004 08:16 PM
Log records about Google? cjshu Google Discussion Forum 1 01-11-2004 06:14 PM


Search Engine Optimization by vBSEO 3.2.0