session_start(); require("admin/include/conf.inc.php"); //konfiguracja $ikonka = $_GET['ikonka']; if ($ikonka == "") $ikonka = 0; function ikonka($id) { $male = array(); $img_path = "foto/".$id."/"; if (is_dir($img_path)) { $handler1 = opendir($img_path); while (false !== ($file = readdir($handler1))) { if (!is_file($file) && $file != "." && $file != "..") { $nazwa = explode(".", $file); $nn = explode("_", $nazwa[0]); switch ($nn[0]) { case 'm': $male[] = $file; break; } } }// ends while loop sort($male); } return $male[0]; } $galerie = array(); $sql = mysql_query("select *, UNIX_TIMESTAMP(data) as data from maxpro_galeria order by data desc"); if ($sql) { while ($p = mysql_fetch_array($sql)) { $galerie[] = $p['id']; } } $klucz = array_search($_GET['galeria'], $galerie); ?>