je galeria osetrena spravne? vsetko ide akurat ked prepinam medzi spodnymi(malymi) obrazkami tak mi zmiznu a musim dat back pre spatne zobrazenie
//audiotrack: zdroják zmazaný, kód patrí do code tagov
galeria v php
a ako by si to riesil...nevedel by si mi ten skript popisat...resp nevedel by si mi poradit najlahsiu galeriu na svete v php
Kód: Vybrať všetko
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="sk" lang="sk">
<head>
<meta http-equiv="content-type" content="text/html; charset=windows-1250" />
<title>Photos</title>
<meta name="robots" content="all" />
<script type="text/javascript"> </script>
<style type="text/css">@import "main.css";</style>
</head>
<body>
<div id="container">
<div id="author">
<h1>Gallery Name</h1>
<h2>[email protected]</h2>
<br class="clear" />
</div>
<div id="image">
<?
$settings["thumbsdir"]="thumbs/"; //deklaracia miniatur
$settings["imagesperpage"]=9;
@$dirhandle=opendir('.');
while ((@$filename=readdir($dirhandle))!==false)
{
if (ereg("jpg|gif|png|JPG|GIF|PNG",$filename)) // podporovane formaty
{
$files[]=$filename;
// vytvorenie miniatury a zistenie ci existuje
if (!file_exists($settings["thumbsdir"].$filename))
{
if (ereg("jpg|JPG",$filename)) $image=imagecreatefromjpeg($filename);
elseif (ereg("gif|GIF",$filename)) $image=imagecreatefromgif($filename);
elseif (ereg("png|PNG",$filename)) $image=imagecreatefromjpeg($filename);
$width=imagesx($image); $height=imagesy($image);
$thumbw=$width/10; $thumbh=$height/10;
$image2=imagecreatetruecolor($thumbw,$thumbh);
imagecopyresampled($image2,$image,0,0,0,0,$thumbw,$thumbh,$width,$height);
if (ereg("jpg|JPG",$filename))
{
imagejpeg($image2,$settings["thumbsdir"].$filename,80);
}
elseif (ereg("gif|GIF",$filename))
{
imagegif($image2,$settings["thumbsdir"].$filename);
}
elseif (ereg("png|PNG",$filename))
{
imagepng($image2,$settings["thumbsdir"].$filename);
}
}
}
}
sort($files);
if (isset($_GET["image"])) $key=array_search($_GET["image"],$files);
else $key=0;
list($width,$height)=getimagesize($files[$key]);
echo '<img src="',$files[$key],'" width="',$width,'" height="',$height,'" alt="',$files[$key],'" /><br />';
?>
</div>
<div id="position">
<?
$totalfiles=count($files);
echo '<span>',$key+1,'/',$totalfiles,'</span>';
?>
</div>
<div id="thumbnails">
<?
$halfperpage=floor($settings["imagesperpage"]/2);
if ($key<$halfperpage)
{
$start=0;
$end=$settings["imagesperpage"]-1;
}
elseif ($key+$halfperpage>$totalfiles-1)
{
$start=$totalfiles-$settings["imagesperpage"];
$end=$totalfiles-1;
}
else
{
$start=$key-$halfperpage;
$end=$key+$halfperpage;
}
for ($i=$start;$i<=$end;$i++)
{
echo '<a href="index.php?image=',$files[$i],'"><img src="',$settings["thumbsdir"],$files[$i],'" alt="',$files[$i],'" /></a>';
}
?>
</div>
<div id="navigation">
<?
if ($key) echo '<a href="index.php?image=',$files[$key-1],'"><< Previous</a> | ';
if ($key+1<count($files)) echo '<a href="index.php?image=',$files[$key+1],'">Next >></a>';
?>
<br />Pages:
<?
$totalpages=ceil($totalfiles/$settings["imagesperpage"]);
for ($i=0;$i<$totalpages;$i++)
{
$pagekey=$i*$settings["imagesperpage"];
echo '<a href="index.php?image=',$files[$pagekey],'">';
if ($settings["imagesperpage"]==1) echo $files[$pagekey];
else echo ' ',$i+1;
echo '</a>';
if ($i<$totalpages-1) echo ' | ';
}
?>
</div>
</div>
</body>
</html>
Nepozeral si niečo v tomto zmysle?
http://www.hotscripts.com/category/php/ ... galleries/
http://www.google.sk/search?hl=sk&q=php ... =&aq=f&oq=
http://www.hotscripts.com/category/php/ ... galleries/
http://www.google.sk/search?hl=sk&q=php ... =&aq=f&oq=