Skift billedet.
Hej.Jeg har denne kode til at vise nogle billeder på siden. men kunne godt tænke mig at man kunne skfite mellem billederne, altså når man har åbnet et vindue med et billede, skal man bare kunne hoppe videre til næste billede.
index.php
...
<br><br><?php
$mappe = "$_GET[map]";
$vis_til = $vis_fra + 9;
$handle = opendir(''.$mappe.'');
while (false !== ($file = readdir($handle))) {
if ($file != '.' && $file != '..') {
$files[] = $file;
}
}
closedir($handle);
$antal_filer = sizeof($files);
$antal_sider = ceil($antal_filer / 9);
$as = floor($antal_filer / 9) * 9;
if(!$_GET[visfra]) { $vis_fra = 0; } else { $vis_fra = $_GET[visfra]; }
$vis_fra1 = $vis_fra;
$vis_til = $vis_fra + 9;
$i = 1;
echo '<div align="center"><center><table border="0" width="495" cellspacing="0" cellpadding="0"><tr>';
while(($vis_fra < $vis_til) && ($vis_fra < $antal_filer)) {
echo '<td width="165">';
echo '<div align="center"><table border="0" width="1" bordercolor="#000000" cellspacing="0" cellpadding="0" bordercolorlight="#000000" bordercolordark="#000000" height="1"><tr><td width="100%">';
echo '<a href="vis.php?mappe='.$mappe.'&billede='.$files[$vis_fra].'" ';
?>
onClick="window.open(this.href, '_blank', 'left=0,top=0,resizable=1,width=640,height=480,scrollbars=no');return false;">
<?
echo '<center><img border="0" src="'.$mappe.'/'.$files[$vis_fra].'" width="125" height="125"></a></td></tr></table></div><br> </center></td>';
if($i == "3") {
echo '</tr><tr>';
$i = 0;
}
$i++;
$vis_fra++;
}
echo '<tr></table>';
$a = 1;
$vs = 0;
$antal_sider++;
if(($_GET[visfra] != 0) && ($_GET[visfra] != "")){
$back = $vis_fra1 - 9;
echo "<a href=\"?side=galleri/index&map=$mappe&visfra=$back\">Forrige</a> ";
}
while($a < $antal_sider) {
echo "<a href=\"?side=galleri/index&map=$mappe&visfra=$vs\">$a</a> ";
$vs = $vs + 9;
$a++;
}
if($_GET[visfra] != $as){
$next = $vis_fra1 + 9;
echo " <a href=\"?side=galleri/index&map=$mappe&visfra=$next\">Næste</a>";
}
echo '</div>';
?>
vis.php
<body leftmargin="0" topmargin="0" marginheight="0" marginwidth="0">
<a href="java script:window.close()"><img alt="Klik her for et lukke vinduet!" border="0" src="<? $mappe = $_GET[mappe]; echo "$mappe"; ?>/<? $billede = $_GET[billede]; echo "$billede"; ?>"></a>
