SitePoint Sponsor

User Tag List

Results 1 to 5 of 5
  1. #1
    SitePoint Member effortless's Avatar
    Join Date
    Oct 2009
    Posts
    22
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Remembering A User

    Hi guys,

    I am currently running a video sharing site, but the script seems to have some issues.

    For 1, a user can refresh the video, and it will increase the view count.

    For 2, a user can rate his/her own video.

    The help forum for the script is pretty dead, so I thought i'd ask here. I know you guys are going to want more details, so please let me know what you need. Thanks.

  2. #2
    Always A Novice bronze trophy
    K. Wolfe's Avatar
    Join Date
    Nov 2003
    Location
    Columbus, OH
    Posts
    2,182
    Mentioned
    66 Post(s)
    Tagged
    2 Thread(s)
    Well if theres already authentication enabled (your users have to log in) then there will already be a session set, most likely with your users username. Its eluding me right now how to print_r on all saved sessions, if someone would chime in on how to do that. This will give you the ability to check username against video author so that they cant rate their own video.

    I would suspect using a session would also be a good idea to limit view counts on refreshing.

  3. #3
    SitePoint Evangelist Waffles's Avatar
    Join Date
    Nov 2005
    Posts
    435
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    print_r($_SESSION);

    i believe

    to stop the viewcount from refreshing you could use a session variable for to prevent multiple refreshes per session, set a cookie, or for as close to fool proof as you can get, log the IP the user every time they visit the video and prevent that IP from triggering the update function (massive massive database with lots of users)

    to stop rating simply logic like:

    PHP Code:
    if($_SESSION['logged_in_user'] == $currentVideoOwner) { 
        echo 
    'Your video has XXX rating';
    } else { 
       echo 
    'Why not rate this video?';


  4. #4
    SitePoint Member
    Join Date
    Dec 2008
    Posts
    7
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    print_r as waffles said.

    it's mostly saved as memberid or uid or mid. (most programmers use these parameters).

    Also check session-hijack.

  5. #5
    SitePoint Enthusiast exoticshawls's Avatar
    Join Date
    Aug 2009
    Posts
    67
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    well users don't Waite that much coz there are other websites for video sharing. so my opinion is that change your host. because lot of time it is only a host and we are thinking its due to our script.


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •