Hallo,
ich wollte ein Blätterscript für meine Gallery programmieren.
Dabei ist folgendes raus gekommen:
PHP-Code:
<?php
//Abfrage der DB nach der Anzahl der Biler
$sql ="SELECT count(id) AS Anzahl FROM pictures WHERE gallery_id = '".mysql_real_escape_string($_GET['gallery'])."'";
$result = mysql_query($sql);
$row = mysql_fetch_assoc($result);
$num = $row['Anzahl'];
//Angezeigte Bilder pro Seite
$limit = 1;
$images = ceil($num/$limit);
if(isset($_GET['image']))
{
if(!$_GET['image']) $_GET['image'] = 1;
$count = 1;
while($count <= $images)
{
if($count != $_GET['image'])
{
echo '[url="'.$_SERVER['PHP_SELF'].'?action=gallery&gallery='.htmlentities($_GET['gallery']).'&image='.$count.'"][img]images/back.gif[/img][/url]';
}
$count++;
}
}
else
{
$image_start = 1;
$count = 1;
while($count <= $images)
{
if($count != $image_start)
{
echo '[url="'.$_SERVER['PHP_SELF'].'?action=gallery&gallery='.htmlentities($_GET['gallery']).'&image='.$count.'"][img]images/next.gif[/img][/url]';
}
$count++;
}
}
?>
Nur, es will nicht so wie ich will, weil ich auch gerade einen ziemlichen Hänger habe.
Jetzt wird mir das Icon zum nächsten Bild immer so oft angezeigt, wie noch Bilder da sind.
Und das will ich nicht.
Ich will, dass immer nur ein Icon angezeigt wird.
Nur habe ich wie schon gesagt gerade einen hänger und weiß nicht wie ich das am besten umsetzten soll?
Könnte ihr mir da mal helfen?
Danke