modified:video cookie lifetime if video duration is bigger than one hour
This commit is contained in:
parent
6a92a03a4d
commit
54eed43f55
1 changed files with 4 additions and 1 deletions
|
@ -2181,8 +2181,11 @@
|
|||
{
|
||||
if(!isset($_COOKIE['video_'.$id])) {
|
||||
$currentTime = time();
|
||||
$vdetails = get_video_details($id);
|
||||
// Cookie life time at least 1 hour else if video duration is bigger set at video time.
|
||||
$cookieTime = ($vdetails['duration'] > 3600) ? $vdetails['duration'] : $cookieTime = 3600;
|
||||
$db->update(tbl("video"),array("views", "last_viewed"),array("|f|views+1",$currentTime)," videoid='$id' OR videokey='$id'");
|
||||
setcookie('video_'.$id,'watched',time()+3600);
|
||||
setcookie('video_'.$id,'watched',time()+$cookieTime);
|
||||
}
|
||||
}
|
||||
break;
|
||||
|
|
Loading…
Add table
Reference in a new issue