diff --git a/upload/includes/functions.php b/upload/includes/functions.php index ba563baa..972108b6 100644 --- a/upload/includes/functions.php +++ b/upload/includes/functions.php @@ -2184,8 +2184,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; diff --git a/upload/rss.php b/upload/rss.php index f9dd2fcb..8c3ee565 100644 --- a/upload/rss.php +++ b/upload/rss.php @@ -30,7 +30,7 @@ switch($mode) case 'recent': default: { - $videos = get_videos(array('limit'=>$limit,'order'=>'date_added DESC')); + $videos = get_videos(array('limit'=>$limit,'broadcast'=>'public','order'=>'date_added DESC')); $title = "Recently Added Videos"; } break; @@ -38,21 +38,21 @@ switch($mode) case 'views': { - $videos = get_videos(array('limit'=>$limit,'order'=>'views DESC')); + $videos = get_videos(array('limit'=>$limit,'broadcast'=>'public','order'=>'views DESC')); $title = "Most Viewed Videos"; } break; case 'rating': { - $videos = get_videos(array('limit'=>$limit,'order'=>'rating DESC')); + $videos = get_videos(array('limit'=>$limit,'broadcast'=>'public','order'=>'rating DESC')); $title = "Top Rated Videos"; } break; case 'watching': { - $videos = get_videos(array('limit'=>$limit,'order'=>'last_viewed DESC')); + $videos = get_videos(array('limit'=>$limit,'broadcast'=>'public','order'=>'last_viewed DESC')); $title = "Videos Being Watched"; } break;