$count_videos); $new_array = @array_merge($result, $vid_count); $all_categories[] = $new_array; } } $which_one = mysql_real_escape_string($_GET['load']); $result_featured = array(); $limit = (int) mysql_real_escape_string($config['see_more_limits']); if ($which_one == '' ) $which_one = 'recent'; //get featured videos ---------------------------- if ($which_one == 'featured') { $pagination = pagination("SELECT indexer FROM videos WHERE featured = 'yes' AND approved='yes' $sql_public_private ORDER BY indexer DESC", $limit); $set_limit = $pagination[0]['set_limit']; $total_pages = $pagination[0]['total_pages']; $current_page = $pagination[0]['current_page']; $total_records = $pagination[0]['total_records']; $next_page = $pagination[0]['next_page']; //use in html navigation (src) $prev_page = $pagination[0]['prev_page']; //use in html navigation (src) $nl = $pagination[0]['nl']; //use in html navigation: next>> $pl = $pagination[0]['pl']; //use in html navigation: < $comments_number); $stars_array = stars_array($video_id); //call the stars function (results returned as array) //merge comments array and video array $result2 = @array_merge($result1, $comments_array, $stars_array); $result_featured[]= $result2; } $see_more_title = $config['featured']; // PAGINATION PLUS >> start -- reusable code $url = 'videos/load'; //the url to be put in links - EDIT ME $additional_url_variable = '/featured/'; //information that goes in query string e.g. '&load=groups&friends=all' @include_once ($include_base . '/includes/pagination.inc.php'); // PAGINATION PLUS >> end } //------------------------------------------------ //get most views --------------------------------- if ($which_one == 'viewed') { $pagination = pagination("SELECT * FROM videos WHERE approved='yes' $sql_public_private ORDER BY number_of_views DESC",$limit); $set_limit = $pagination[0]['set_limit']; $total_pages = $pagination[0]['total_pages']; $current_page = $pagination[0]['current_page']; $total_records = $pagination[0]['total_records']; $next_page = $pagination[0]['next_page'];//use in html navigation (src) $prev_page = $pagination[0]['prev_page'];//use in html navigation (src) $nl = $pagination[0]['nl'];//use in html navigation: next>> $pl = $pagination[0]['pl'];//use in html navigation: < $comments_number); //get star rating $stars_array = stars_array($video_id);//call the stars function (results returned as array) //merge comments array and video array $result2 = array_merge($result1, $comments_array, $stars_array); $result_featured[] = $result2; } $see_more_title = $config['most_viewed']; //PAGINATION PLUS >> start -- reusable code $url = 'videos/load'; $additional_url_variable = '/viewed/'; include_once ($include_base . '/includes/pagination.inc.php'); //PAGINATION PLUS >> end } //----------------------------------------------------- //get most recent ----------------------------------- if ($which_one == 'recent') { $pagination = pagination("SELECT * FROM videos WHERE approved='yes' $sql_public_private ORDER BY indexer DESC", $limit); $set_limit = $pagination[0]['set_limit']; $total_pages = $pagination[0]['total_pages']; $current_page = $pagination[0]['current_page']; $total_records = $pagination[0]['total_records']; $next_page = $pagination[0]['next_page'];//use in html navigation (src) $prev_page = $pagination[0]['prev_page'];//use in html navigation (src) $nl = $pagination[0]['nl'];//use in html navigation: next>> $pl = $pagination[0]['pl'];//use in html navigation: < $comments_number); //get star rating $stars_array = stars_array($video_id);//call the stars function (results returned as array) //merge comments array and video array $result2 = array_merge($result1, $comments_array, $stars_array); $result_featured[] = $result2; } $see_more_title = $config['most_recent']; //PAGINATION PLUS >> start -- reusable code $url = 'videos/load'; //the url to be put in links - EDIT ME $additional_url_variable = '/recent/'; //add addtions information that goes in query string here , e.g. '&load=groups&friends=all' - EDIT ME @include_once ($include_base . '/includes/pagination.inc.php'); //PAGINATION PLUS >> end } //------------------------------------------------------ //get most commented ------------------------------------ if ($which_one == 'comments') { $pagination = pagination("SELECT * FROM videos WHERE approved='yes' $sql_public_private ORDER BY indexer DESC", $limit); $set_limit = $pagination[0]['set_limit']; $total_pages = $pagination[0]['total_pages']; $current_page = $pagination[0]['current_page']; $total_records = $pagination[0]['total_records']; $next_page = $pagination[0]['next_page'];//use in html navigation (src) $prev_page = $pagination[0]['prev_page'];//use in html navigation (src) $nl = $pagination[0]['nl'];//use in html navigation: next>> $pl = $pagination[0]['pl'];//use in html navigation: < $comments_number); //get star rating $stars_array = stars_array($video_id);//call the stars function (results returned as array) //merge comments array $result2 = @array_merge($result1, $comments_array, $stars_array); $result_featured[] = $result2; } //sort the final array by order of number of comments function arr_keys_multisort($arr, $my_key, $sort_type) { foreach ($arr as $key => $row) { $arr_tmp[$key] = $row["$my_key"]; } if ($sort_type == 'desc') @array_multisort($arr_tmp, SORT_DESC, $arr); else @array_multisort($arr_tmp, SORT_ASC, $arr); return $arr; } // return only config limit $result_featured_all = arr_keys_multisort($result_featured, 'comments', 'desc'); $limit_result_featured = array(); if ( sizeof($result_featured) < $limit ) $limit = sizeof($result_featured); $show_count = $limit + $set_limit; if ( $show_count > $vid_limit_count ) $show_count = $vid_limit_count; for ( $x = $set_limit; $x < $show_count; $x++ ) { $limit_result_featured[$x] = $result_featured_all[$x]; } $result_featured = $limit_result_featured; $see_more_title = $config['most_commented']; //PAGINATION PLUS >> start -- reusable code $url = 'videos/load'; //the url to be put in links - EDIT ME $additional_url_variable = '/comments/'; //add addtions information that goes in query string here , e.g. '&load=groups&friends=all' - EDIT ME @include_once ($include_base . '/includes/pagination.inc.php'); //PAGINATION PLUS >> end } //---------------------------------------------------------- $limit = $config['see_more_limits'];//lit for all the small box type layous calls //see more group videos -------------------------------------- if ($which_one == 'groupsvideos') { $group_id = mysql_real_escape_string($_GET['gid']); //check if group id specified if($group_id =='' || !is_numeric($group_id)){ $message = $config['error_11']; generic_error($message); //item could not be found } //Pagination $pagination = pagination("SELECT * FROM group_videos WHERE group_id = $group_id", $limit); $set_limit = $pagination[0]['set_limit']; $total_pages = $pagination[0]['total_pages']; $current_page = $pagination[0]['current_page']; $total_records = $pagination[0]['total_records']; $next_page = $pagination[0]['next_page'];//use in html navigation (src) $prev_page = $pagination[0]['prev_page'];//use in html navigation (src) $nl = $pagination[0]['nl'];//use in html navigation: next>> $pl = $pagination[0]['pl'];//use in html navigation: <> end } //----------------------------------------------------------------- //show "no videos to show" empty arrays if (empty($result_featured)) { $show_v = 1; } else { $show_v = 2; } //display results $template = "themes/$user_theme/templates/main_1.htm"; $inner_template1 = "themes/$user_theme/templates/inner_see_more.htm"; $TBS = new clsTinyButStrong; $TBS->NoErr = true; $TBS->LoadTemplate("$template"); $TBS->MergeBlock('blkfeatured', $result_featured); $TBS->MergeBlock('blk1', $all_categories); $TBS->Render = TBS_OUTPUT; $TBS->Show(); @mysql_close(); die(); ?>