Exemple #1
0
 //use in html navigation: next>>
 $pl = $pagination[0]['pl'];
 //use in html navigation: <<previous
 //get all videos
 $all_videos = array();
 $sql10 = "SELECT * FROM group_videos WHERE group_id = {$group_id} AND video_status='active' LIMIT {$set_limit}, {$limit}";
 $query10 = @mysql_query($sql10);
 while ($result10 = @mysql_fetch_array($query10)) {
     //collect each videos details
     $each_video = mysql_real_escape_string($result10['video_id']);
     $sql11 = "SELECT * FROM videos WHERE indexer = {$each_video} AND approved = 'yes'";
     $query11 = @mysql_query($sql11);
     $result11 = @mysql_fetch_array($query11);
     if (!empty($result11)) {
         //get video star rating
         $stars_array = stars_array($each_video);
         //call the stars function (results returned as array)
         //merge video data with stars array
         $all_videos[] = array_merge($stars_array, $result11);
     }
 }
 //set condition for hidding certain blocks (more videos)
 if (empty($all_videos)) {
     $show_v = 1;
 } else {
     $show_v = 2;
 }
 //get group comments
 $limit2 = $config["comment_page_limits"];
 $pagination2 = pagination("SELECT * FROM group_comments WHERE group_id = {$group_id} ORDER BY indexer DESC", $limit2);
 $set_limit2 = $pagination2[0]['set_limit'];
Exemple #2
0
 }
 $query = @mysql_query($sql);
 while ($result_videos = @mysql_fetch_array($query)) {
     $change_date = dateTimeDiff($result_videos['date_uploaded']);
     $result_videos['date_uploaded'] = $change_date;
     $uploaded_by = mysql_real_escape_string($result_videos['user_id']);
     $video_length = mysql_real_escape_string($result_videos['video_length']);
     $video_id = mysql_real_escape_string($result_videos['indexer']);
     // get comments inforation IF NEEDED IN TEMPLATE
     $sql2 = "SELECT indexer FROM videocomments WHERE video_id = {$video_id}";
     $query2 = @mysql_query($sql2);
     $comments_number = @mysql_num_rows($query2);
     $comments_array = array('comments' => $comments_number);
     // get video rating stars
     $stars_array = array();
     $stars_array = stars_array($video_id);
     // get video uploaded by username
     $sql_user = "******";
     $uploaded_by = @mysql_query($sql_user);
     $by_result = @mysql_fetch_array($uploaded_by);
     $uploaded_by_username = $by_result['user_name'];
     $uploaded_by_array = array('uploaded_by' => $uploaded_by_username);
     // strip off the the video duration hours if null => 00:00:00
     $video_length_hours = substr($video_length, 0, 2);
     if ($video_length_hours == '00') {
         $result_videos['video_length'] = substr($video_length, 3, 5);
     }
     // merge comments array and video array
     $result_all_videos = @array_merge($result_videos, $comments_array, $stars_array, $uploaded_by_array);
     $browse_videos[] = $result_all_videos;
 }
Exemple #3
0
 if ($set_limit == 0) {
     $results_show = 1;
 }
 if ($total_records == 0) {
     $results_show = 0;
 }
 define($get_type, true);
 while ($result1 = @mysql_fetch_array($query)) {
     $media_id = mysql_real_escape_string($result1['indexer']);
     $sql2 = "SELECT indexer FROM {$media_comments} WHERE {$row_id} = {$media_id}";
     $query2 = @mysql_query($sql2);
     $comments_number = @mysql_num_rows($query2);
     $comments_array = array('comments' => $comments_number);
     $id = $media_id;
     if ($get_type == 'videos') {
         $stars_array = stars_array($media_id);
     } else {
         include 'stars_include.php';
         $stars_array = array('star1' => $star1, 'star2' => $star2, 'star3' => $star3, 'star4' => $star4, 'star5' => $star5);
     }
     // we need dynamic media image query
     $result_image = $get_type;
     switch ($result_image) {
         case 'audios':
             $pic_sql = "SELECT album_picture FROM audio_albums WHERE album_id = '{$media_id}' LIMIT 1";
             $album_pic_result = @mysql_query($pic_sql);
             $row = mysql_fetch_array($album_pic_result);
             $album_pic_result = $row['album_picture'];
             if ($album_pic_result != "") {
                 $album_pic = 'addons/audio/images/album_images/' . $album_pic_result;
             } else {