Licznik: $licznik

"; if ($show==2) echo " (licznik: $licznik)"; $tmp = tempnam("", "licznik"); $handle = fopen($tmp, "w"); fwrite($handle, $licznik); fclose($handle); rename($tmp, $plik); } } $lang=_get('lang'); $lang = ($lang=="pl") ? "_pl" : ""; //////// SCIAGAJ PO NAZWIE if ($sciagaj!="") { $plik = $dir."/".$sciagaj; if (preg_match("%/%", $sciagaj) || !file_exists($plik)) { echo "ERROR!!!"; die; } header("Location: $plik"); if (is_file($plik)) licz("$plik", false); die; } /////////////////////////////////////////////// $nrf = _get('file'); if ($nrf!="") { $filename = "$dir/FILES.xxc"; if (file_exists($filename)){ $handle = fopen($filename, "r"); $nr = 0; while (!feof($handle)) { list ($plik, $size, $date, $time, $remote) = fscanf($handle, "%s %d %s %s %s "); if ($plik=="") continue; if ($nr==$nrf) { if (strlen($remote)<=1) $remote="$dir/"; header("Location: $remote"."$plik"); licz("$dir/$plik", false); die; } $nr = $nr+1; } } echo "ERROR!!!\n"; die; } /////////////////////////////////////////////// $tytul = htmlentities($dir); if (file_exists("$dir/TITLE$lang.xx")) { $handle = fopen("$dir/TITLE$lang.xx", "r"); $tytul = fread($handle, filesize("$dir/TITLE$lang.xx")); fclose($handle); } function start_page($tytul, $dir) { if (file_exists("$dir/UTF-8.xx")) header("Content-Type: text/html; charset=utf-8"); else header("Content-Type: text/html; charset=iso-8859-2"); echo "\n\n\n"; global $css; if (file_exists("$dir/style.css")) { echo "\n"; $css = 1; } else $css = 0; if (file_exists("$dir/UTF-8.xx")) echo "\n"; else echo "\n"; echo "" . htmlspecialchars($tytul) . "\n\n\n"; } function stop_page() { echo "

\n" . "\n"; global $css; if ($css) echo "\n" . "\"Valid\n\n"; echo "

\n\n\n"; } function show_desc($przed, $plik, $po) { $filename = "$plik.desc"; if (file_exists($filename)) { $handle2 = fopen($filename, "r"); $contents = fread($handle2, filesize($filename)); fclose($handle2); echo $przed . htmlspecialchars($contents) . $po; } } /////////////////////////////////////////////// function daj_url($cel) { global $dir; return "?dir=".$dir."&plik=".$cel; } function a_href($opis) { global $cel; echo "" . $opis . ""; } function forma($ile, $jeden, $dwa, $piec) { if ($ile==1) return $ile ." ".$jeden; if ($ile%10>=2 && $ile%10<=4 && ($ile%100<10 || $ile%100>20)) return $ile ." ".$dwa; return $ile ." ".$piec; } function ile_zdjec() { global $dir, $cel; $filename = "$dir/$cel/PICTURES.xxc"; $ile = 0; if (file_exists($filename)) { $fd = fopen ($filename, "r"); while (!feof ($fd)) { list ($plik, $size, $date, $time, $remote, $a, $b, $c) = fscanf($fd, "%s %d %s %s %s %s %s %s "); if ($plik=="") continue; $ile = $ile + 1; } fclose ($fd); } return forma($ile, "zdjêcie", "zdjêcia", "zdjêæ"); } function ile_stacji() { global $dir, $cel; $filename = "$dir/$cel/PICTURES.xxc"; $ile = 0; if (file_exists($filename)) { $fd = fopen ($filename, "r"); while (!feof ($fd)) { list ($plik, $size, $date, $time, $remote, $a, $b, $c) = fscanf($fd, "%s %d %s %s %s %s %s %s "); if ($plik=="") continue; $plik = preg_replace("/\d/", "", $plik); $tab[$plik] = 1; } $ile = sizeof($tab); fclose ($fd); } return forma($ile, "stacja", "stacje", "stacji"); } /////////////////////////////////////////////// $nrf = _get('picture'); if ($nrf!="") { $filename = "$dir/PICTURES.xxc"; if (file_exists($filename)) { $handle = fopen($filename, "r"); $nr = 0; while (!feof($handle)) { list ($plik, $size, $date, $time, $remote, $a, $b, $c) = fscanf($handle, "%s %d %s %s %s %s %s %s "); if ($plik=="") continue; if ($nr==$nrf) { list ($test) = fscanf($handle, "%s "); //echo "AAAAA $test AAA"; $is_next = $test!=""; $is_prev = $nr>0; if (strlen($remote)<=1) $remote="$dir/"; if (strlen(_get('play'))>0 && $is_next) header("Refresh: ". $delay . "; url=?dir=" . urlencode($dir) . "&picture=" . ($nr+1) . "&play=1"); start_page("$tytul - zdjêcie $nrf", $dir); echo "
\n"; if (strlen($date)>1){ echo htmlspecialchars("$date $time");} show_desc(strlen($date)>1 ? ", " : "", "$dir/$plik", ""); licz("$dir/$plik", 2); echo ""; echo $is_prev ? "<<" : "<<"; echo "\n  \n^^\n  \n"; echo $is_next ? ">>" : ">>"; echo "\n  \n"; echo $is_next ? "|>" : "|>"; echo "
"; echo "\n"; echo "\n"; die; } $nr = $nr+1; } } echo "ERROR!!!\n"; die; } start_page($tytul, $dir); echo "

". htmlspecialchars($tytul) . "

"; $dir2 = $dir; while ($dir2!="" && $dir2!='.') { $path=explode("/", $dir2); $dir2 = ""; for ($i = 0; $i[up]\n"; break; } } $filename = "$dir/README$lang.xx"; if (file_exists($filename)) { $handle = fopen($filename, "r"); $contents = fread($handle, filesize($filename)); fclose($handle); echo "
";
		echo htmlspecialchars($contents);
		echo "\n
"; } $filename = "$dir/main$lang.html"; if (file_exists($filename)) { include($filename); //$handle = fopen($filename, "r"); //$contents = fread($handle, filesize($filename)); //fclose($handle); //echo $contents; } $filename = "$dir/PICTURES.xxc"; if (file_exists($filename) && filesize($filename)>3) { $handle = fopen($filename, "r"); echo "\n"; echo "\n"; $nr = 0; while (!feof($handle)) { list ($plik, $size, $date, $time, $remote, $xs, $ys, $remotem) = fscanf($handle, "%s %d %s %s %s %s %s %s "); if ($plik=="") continue; $plikm = (strlen($remotem)>1 ? $remotem : "$dir/") . "$plik.m"; if ($nr%3==0) echo "\n"; echo "\n"; $nr = $nr+1; if ($nr%3==0) echo "\n"; } if ($nr%3!=0) echo "\n"; echo "
\"\"
\n"; if ($size>0) echo intval($size/1024) . " kB"; if (strlen($date)>1) { $date = "$date $time"; if ($size>0) echo ", "; echo htmlspecialchars($date); } show_desc("
\n", "$dir/$plik", "\n"); echo "\n
\n"; } $filename = "$dir/FILES.xxc"; if (file_exists($filename) && filesize($filename)>3) { $handle = fopen($filename, "r"); echo "\n"; echo "" . "\n"; $nr = 0; while (!feof($handle)) { list ($plik, $size, $date, $time, $remote) = fscanf($handle, "%s %d %s %s %s "); if ($plik=="") continue; $date = "$date $time"; echo "\n" . "\n" . "\n"; show_desc("\n"); echo "\n"; $nr=$nr+1; } echo "
FilenameSizeDateDescription
" . htmlentities($plik) . "".intval($size/1024)." kB".$date."
", "$dir/$plik", "\n
\n"; } licz("$dir/index", 1); stop_page(); ?>