Ok, after looking further into the code, this isn't a bug, per say, although it appears to function as one.
The way that the code is written in vShare 2.7, a user must be logged in for any of those fields to be updated (Watched Videos or I've Watched, etc). Then, it only updates the videos if the user is not looking at their own videos (but someone elses). So, the behavior that you described is correct. If you want to change this behavior, you would need to replace lines 149-176 of the view_video.php code from:
PHP Code:
if (isset($_SESSION['UID']))
{
$sql = "UPDATE `users` SET
`user_watched_video`=`user_watched_video`+1 WHERE
`user_id`='" . (int) $_SESSION['UID'] . "'";
mysql_query($sql) or mysql_die($sql);
if ($_SESSION['UID'] != $video_info['video_user_id'])
{
$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);
}
$sql = "SELECT * FROM `playlists` WHERE
`playlist_user_id`='" . (int) $_SESSION['UID'] . "' AND
`playlist_video_id`='" . (int) $video_id . "'";
$result = mysql_query($sql) or mysql_die($sql);
if (mysql_num_rows($result) == 0)
{
$sql = "INSERT INTO `playlists` SET
`playlist_user_id`='" . (int) $_SESSION['UID'] . "',
`playlist_video_id`='" . (int) $video_id . "'";
$result = mysql_query($sql) or mysql_die($sql);
}
}
To
PHP Code:
if (isset($_SESSION['UID']))
{
$sql = "UPDATE `users` SET
`user_watched_video`=`user_watched_video`+1 WHERE
`user_id`='" . (int) $_SESSION['UID'] . "'";
mysql_query($sql) or mysql_die($sql);
$sql = "SELECT * FROM `playlists` WHERE
`playlist_user_id`='" . (int) $_SESSION['UID'] . "' AND
`playlist_video_id`='" . (int) $video_id . "'";
$result = mysql_query($sql) or mysql_die($sql);
if (mysql_num_rows($result) == 0)
{
$sql = "INSERT INTO `playlists` SET
`playlist_user_id`='" . (int) $_SESSION['UID'] . "',
`playlist_video_id`='" . (int) $video_id . "'";
$result = mysql_query($sql) or mysql_die($sql);
}
}
$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);
Bookmarks