Videos Watched total not incrementing
I am just now noticing that in my profile the Videos Watched total is not increasing and is 0. When I look in the database (user.user_video_viewed) the number is 0 and has never had an increase ever.
I have done modifications to my scripts but am not sure which mod could have shut off the correct line. I have not modified my view_video.php. So it must be another file somewhere calling this php.
Profile view is working.
Vshare 2.7
Did I delete a line somewhere in the video layout page that sends the view info to another page for entry in the database?
The site I am working on is DiligentHeed.com
Videos Watched total not incrementing
Thanks bplex for shooting me back to the view_video.php file.
More testing shows that incrementation only occurs if a user is logged in and he watches a video that is not his own. Incrementation will not occur if you watch your own video while logged in. And incrementation does not occur if the viewer is not logged in.
So, my site has no users that log in and therefore had no views adding up. However if I look at individual views for videos I can see numbers increasing.
Question/Comment: I guess I should remove the if condition surrounding the incrementation code to allow guests to cause the incrementing also.
if ($_SESSION['UID'] != $video_info['video_user_id'])
Nope, tried removing that line and it makes no difference. Why not? The UID would be the guest IP address so it should work either way??!!
I am copying my code in case there is a wrong character I am not seeing here.
$sql = "UPDATE `users` SET
`user_video_viewed`=`user_video_viewed`+1 WHERE
`user_id`='" . (int) $video_info['video_user_id'] . "'";
mysql_query($sql) or mysql_die($sql);