@mysql_select_db(“NP_com_natcom”) or die(“
// If no “videos per page” limit has been specified, we set it 20 articles per page.
if ($limit==””) { $limit=30; }
// If the user has chosen a media form we add that to the SQL string, if not we leave it blank.
if ($category==””) { $wherecategory=””; }
else { $wherecategory =”where category=’$category’ or alt_category=’$category'”; }
// If the user has chosen a sorting/ordering format we add that to the SQL string,
// if not we default it to date descending, publication descending.
if ($order1==””) { $orderby1=”ORDER BY DATED DESC, VIDEO_ID ASC”; }
else { $orderby1 =”ORDER BY $sort1 $order1″; }
// This SQL query is only done to count the amount of hits. We need this result
// for the pagination!
$query_count = “SELECT VIDEO_ID FROM videos $wherecategory $orderby1”;
$result_count = mysql_query($query_count, $link);
$totalrows = mysql_num_rows($result_count);
if(empty($page)) { $page = 1; }
$limitvalue = $page * 50 – (50);
// This is the actual SQL query that gets the list of videos. The special thing is the
// DATED-date that are stored in a special format in “FDATED”.
// It adds the search variables that we just set, $wherecategory, and then the ordering variables we set.
$query_Get_video_list = “SELECT VIDEO_ID, FILENAME, LINK, MIRROR_LINK, FILE_TYPE, LENGTH, FILE_SIZE, DATE_FORMAT(DATED, ‘%b %D, %Y’) as FDATED, CATEGORY, ALT_CATEGORY, ARTICLE_ID, PREVIEW_PIC, IMAGE_GALLERY, DESCRIPTION_EN AS DESCRIPTION FROM videos $wherecategory $orderby1 LIMIT $limitvalue, 50”;
// This echo function is used to display the resulting SQL query. It’s only used for debugging
// and is therefor REM
// echo $query_Get_video_list;
// The execution of the SQL query we just put together
$Get_video_list = @mysql_query ($query_Get_video_list, $link) or die(“$query_Get_video_list”);
// And we store it in this array
$row_Get_video_list = mysql_fetch_array($Get_video_list);
$totalRows_Get_video_list = mysql_num_rows($Get_video_list);
// Closing server connection
mysql_close($link);
// Now, let’s build the video list page! Since this is incorporated into the
// npcom.php template, we don’t need the menu and stuff like that, only the page
// itself!
?>
Welcome to NP.com’s video library.
Use the controls to the right to refine your search. NP.com doesn’t offer any support for your computer If you’ve got a videofile that we don’t have, |
Displaying : by ( ) |
PREV] “); } else echo(“[PREV] “); ?> |
“.$i.” “); else echo(” $i “); if($i==22) echo(“ “); if($i==42) echo(“ “); if($i==62) echo(“ “); if($i==82) echo(“ “); if($i==102) echo(“ “); } if(($totalrows % 50) != 0) |
0) { $pagenext=$page+1; echo(” [NEXT]”); } else echo(” [NEXT]”); // End of first pagination ?> |
Video archive temporarily offline!
|
PREV] “); } else echo(“[PREV] “); ?> |
“.$i.” “); else echo(” $i “); if($i==22) echo(“ “); if($i==42) echo(“ “); if($i==62) echo(“ “); if($i==82) echo(“ “); if($i==102) echo(“ “); } if(($totalrows % 50) != 0) |
0) { $pagenext=$page+1; echo(” [NEXT]”); } else echo(” [NEXT]”); // End of the second pagination function! ?> |