0) { $current_page = $_GET['page']; } else { $current_page = 1; } $number_of_pages = 1; $rows_to_show = 4; // number of items you want displayed on each page $sec_id = $_GET['sec_id']; // get the section id if ( $sec_id=="1") /// archive only for trailers { $my_query = "SELECT * from ali_video where video_subs_id = '$sec_id' AND archived='N' ORDER by date_added desc"; // the query you are performing } else { $my_query = "SELECT * from ali_video where video_subs_id = '$sec_id' ORDER by date_added desc"; // the query you are performing } // do paging math $Result = mysql_query($my_query); if ($Result) { $number_of_rows = mysql_num_rows($Result); // figure how many total pages $number_of_pages = floor($number_of_rows / $rows_to_show); $remaining_number_of_data = $number_of_rows % $rows_to_show; if ($remaining_number_of_data >= 1) { $number_of_pages = $number_of_pages + 1; } // create page navigation links at bottom of table, as needed if ($number_of_pages <= 1) { $page_navigation .= ""; } else { for ($i=1; $i<=$number_of_pages; $i++) { if ($i == 1) { // start with PREV button if ($current_page <= 1) { $prev_number = 1; } else { $prev_number = $current_page - 1; } $page_navigation .= "previous "; } if ($i == $current_page) { // bold current page $page_navigation .= "".$i." "; } else { $page_navigation .= "".$i." "; } if ($i == $number_of_pages) { // end with NEXT button if ($current_page >= $number_of_pages) { $next_page = $number_of_pages; } else { $next_page = $current_page + 1; } $page_navigation .= "next"; } } } } // set starting point for database query if ($current_page == 1) { $start_row = 0; } else { $start_row = $rows_to_show * ($current_page-1); } // now, get only rows to be displayed $Result = mysql_query($my_query." LIMIT ".$start_row.", ".$rows_to_show); if ($Result) { $query = "SELECT title from ali_video_subs where sections_id = '$sec_id'"; // the query you are performing $rs = mysql_query($query); $array = mysql_fetch_array($rs); if ($number_of_rows>0) { echo'

'.$array['title'].' - Page '.$current_page.'

'; echo '
'.$page_navigation.'
'; // the top page navigation echo''; $i=0; /// loop content here //////////////// // loop through results & build table rows while ($itemArray = mysql_fetch_array($Result)) { if($i%1==0) echo''; echo' '; $i++; if($i%1==0) echo ''; } echo"
'; echo'
'; $vimeo_id=$itemArray['vid_url']; $hash = unserialize(file_get_contents("http://vimeo.com/api/v2/video/$vimeo_id.php")); //generate a thumbnail from vimeo function if($hash[0]["thumbnail_medium"]!='') { echo '
'; } else { echo '
'; } echo'
'; if($hash[0]["title"]!='') { echo'

'.$hash[0]["title"].'

'.$hash[0]["description"].'

'; } else { echo'

'.getVimeoInfo($itemArray['vid_url'],"title").'

'.getVimeoInfo($itemArray['vid_url'],"description").'

'; } echo'
'; echo 'View Video'; echo'
'; echo'
"; } else if (!$number_of_rows) { ?>
New videos coming soon........
Sorry. We currently don't have videos in the "" section. Please try again later.
'.$page_navigation.'

'; // the top page navigation } else if ($type=="details") { //// put in details here...... $video_id = $_GET['video_id']; $my_query = "SELECT * from ali_video where video_id = '$video_id'"; // the query you are performing // $my_query = "SELECT * from ali_video where video_id = '$video_id' AND archived='N'"; // the query you are performing $rs = mysql_query($my_query); $itemArray = mysql_fetch_array($rs); echo''; } if ($type=="vlby") // this will become vlby (video list by year) { $query = "SELECT DISTINCT YEAR(date_added) AS yr FROM ali_video ORDER BY yr DESC"; $Result = mysql_query($query); while ($row = mysql_fetch_array($Result)) { echo'
Archives for '.$row['yr'].'
'; // this gets the months in the year already queried //$query2 = "SELECT DISTINCT MONTH(date_added) AS mth FROM ali_video WHERE YEAR(date_added) = ".$row['yr']." order by mth DESC"; $query2 = "SELECT DISTINCT MONTH(date_added) AS mth, archived FROM ali_video WHERE YEAR(date_added) = ".$row['yr']." AND archived = 'Y' order by mth DESC"; $Result2 = mysql_query($query2); while ($row2 = mysql_fetch_array($Result2)) { //echo getVimeoInfo($itemArray2['vid_url'],"thumbnail_medium"); echo ''; // echo 'archived:'.$row2['archived']; echo'
'; } echo'
'; } } if ($type=="vlbm") // video list by month showing thumbnails { /* // this gets the videos or records you want in each month $query3 = "SELECT * FROM ali_video WHERE YEAR(date_added) = ".$year." AND MONTH(date_added) = ".$month." AND archived = "Y""; $Result3 = mysql_query($query3); while ($row3 = mysql_fetch_array($Result3)) { echo "
"; } echo'

'; */ // initialize paging options if (strlen($_GET['page'])>0) { $current_page = $_GET['page']; } else { $current_page = 1; } $number_of_pages = 1; $rows_to_show = 3; // number of items you want displayed on each page $month = $_GET['month']; $year = $_GET['year']; $my_query = "SELECT video_id, vid_url, archived FROM ali_video WHERE YEAR(date_added) = ".$year." AND MONTH(date_added) = ".$month." AND archived = 'Y'"; // the query you are performing // $my_query = "SELECT video_id, vid_url FROM ali_video WHERE YEAR(date_added) = ".$year." AND MONTH(date_added) = ".$month.""; // the query you are performing // do paging math $Result = mysql_query($my_query); if ($Result) { $number_of_rows = mysql_num_rows($Result); // figure how many total pages $number_of_pages = floor($number_of_rows / $rows_to_show); $remaining_number_of_data = $number_of_rows % $rows_to_show; if ($remaining_number_of_data >= 1) { $number_of_pages = $number_of_pages + 1; } // create page navigation links at bottom of table, as needed if ($number_of_pages <= 1) { $page_navigation .= ""; } else { for ($i=1; $i<=$number_of_pages; $i++) { if ($i == 1) { // start with PREV button if ($current_page <= 1) { $prev_number = 1; } else { $prev_number = $current_page - 1; } $page_navigation .= "previous "; } if ($i == $current_page) { // bold current page $page_navigation .= "".$i." "; } else { $page_navigation .= "".$i." "; } if ($i == $number_of_pages) { // end with NEXT button if ($current_page >= $number_of_pages) { $next_page = $number_of_pages; } else { $next_page = $current_page + 1; } $page_navigation .= "next"; } } } } // set starting point for database query if ($current_page == 1) { $start_row = 0; } else { $start_row = $rows_to_show * ($current_page-1); } // now, get only rows to be displayed $Result = mysql_query($my_query." LIMIT ".$start_row.", ".$rows_to_show); if ($Result) { echo'

Archives for '.convertmonth($month).', '.$year.' - Page '.$current_page.'

'; echo '
'.$page_navigation.'
'; // the top page navigation echo''; $i=0; /// loop content here //////////////// // loop through results & build table rows while ($itemArray = mysql_fetch_array($Result)) { if($i%1==0) echo''; echo' '; $i++; if($i%1==0) echo ''; } echo"
'; echo'
'; $vimeo_id=$itemArray['vid_url']; $hash = unserialize(file_get_contents("http://vimeo.com/api/v2/video/$vimeo_id.php")); //generate a thumbnail from vimeo function if($hash[0]["thumbnail_medium"]!='') { echo '
'; } else { echo '
'; } echo'
'; if($hash[0]["title"]!='') { echo'

'.$hash[0]["title"].'

'.$hash[0]["description"].'

'; } else { echo'

'.getVimeoInfo($itemArray['vid_url'],"title").'

'.getVimeoInfo($itemArray['vid_url'],"description").'

'; } echo'
'; echo 'View Video'; echo'
'; echo'
"; } mysql_free_result($Result); echo '
'.$page_navigation.'

'; // the top page navigation echo'
Back to Archive List
'; } /// end of main brace for this type ?>