include("config.inc.php"); $header = ""; $date = ""; $resultn = ""; $location = ""; $content = ""; $dir7 =""; $numrec =""; require ("$lib/nav.php"); dbconnect(); // EERST CAT OPVANGEN EN CHECKEN $cat = $_GET['cat']; $offset = $_GET['offset']; $offseti = $_GET['offseti']; if ($cat =="") { $sqlc = "select id from eco_gallery_cat WHERE aproved='Y' ORDER BY date DESC LIMIT 1"; $getid = mysql_query($sqlc); list($cat) = mysql_fetch_row($getid); } $result = mysql_query("SELECT header, dir, date, location, content FROM eco_gallery_cat WHERE id = '$cat' AND aproved='Y'"); $resultn = mysql_num_rows ($result); while (list($c_header, $c_dir, $c_date, $c_location, $c_content) = mysql_fetch_row($result)) { $header = stripslashes($c_header); $location = stripslashes($c_location); $content = stripslashes($c_content); $date = strftime("%A %B %d", strtotime("$c_date")); $dir7 = stripslashes($c_dir); $eco_title = "pictures - $header - $date"; $eco_description = "Pictures from Barefoot event $header taken at $date"; $eco_keywords = "pictures, barefoot, events, "; $eco_keywords .= str_replace(" ", ", ", $header); } if ($resultn == "0") { Header("Location: http://www.barefootevents.nl/"); } $limit=9; if (!$offset) $offset=0; $result = mysql_query("select count(*) from eco_gallery WHERE cat ='$cat'"); list($numrec) = mysql_fetch_row($result); $numpage = intval($numrec/$limit); if ($numrec%$limit) { $numpage++; } include("$lib/style/head.php"); ?>
|
function imageRandom($dir, $types) {
$images = array();
$new = array();
if ( !empty($types) ) {
$types = explode(",", $types);
foreach ( $types as $t ) {
$glob = $dir . '*.' . $t;
$new = glob( $glob );
if ( !empty( $new ) ) {
$images = (array)$new + (array)$images;
}
}
} else {
$images = glob( $dir . '*.*' );
}
$key = array_rand($images);
$image = $images[$key];
echo $image;
}
?>
|
|||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||