Andreas: virtueller Rundgang

Beitrag lesen

Hallo,
habe jetzt eine Lösung gefunden, eigentlich sogar recht simple.
Pro Bild ein Case im Switch:

switch($action){
case 'b1':
echo '<img src="gfx/rundgang/1b1.jpg" width="300" alt=""></td></tr>';
navi(0,1,0,1,0,0,0,2,0,3,0,0);
break;

case 'b2':
echo '<img src="gfx/rundgang/1b2.jpg" width="300" alt=""></td></tr>';
navi(0,0,0,0,1,0,0,0,0,0,1,0);
break;

case 'b3':
echo '<img src="gfx/rundgang/1b4.jpg" width="300" alt=""></td></tr>';
navi(0,0,1,0,1,0,0,0,4,0,1,0);
break;

case 'b4':
echo '<img src="gfx/rundgang/1b3.jpg" width="300" alt=""></td></tr>';
navi(1,1,0,0,1,0,0,0,0,0,3,0);
break;

case 'b5':
echo '<img src="gfx/rundgang/1b5.jpg" width="300" alt=""></td></tr>';
navi(0,1,0,1,0,0,2,4,0,0,3,0);
break;

default:
echo '<img src="gfx/rundgang/1b1.jpg" width="300" alt=""></td></tr>';
navi(0,1,0,1,0,0,0,2,0,3,0,0);
}

...

Dann die Funktion für die Buttons:

function navi($bu1, $bu2, $bu3, $bu4, $bu5, $bu6, $li1, $li2, $li3, $li4, $li5, $li6){
echo '
<tr>
<td align="center" valign="top">';
if ($bu1==1)
echo '<a href="rundgang.php?action=b'.$li1.'">';
echo '<img src="gfx/rundgang/bild1'; if($bu1==1) echo 'a'; echo '.gif" alt="" width="32" height="32" border="0" hspace="2" vspace="2"></a>';

if ($bu2==1)
echo '<a href="rundgang.php?action=b'.$li2.'">';
echo '<img src="gfx/rundgang/bild2'; if($bu2==1) echo 'a'; echo '.gif" alt="" width="32" height="32" border="0" hspace="2" vspace="2"></a>';

if ($bu3==1)
echo '<a href="rundgang.php?action=b'.$li3.'">';
echo '<img src="gfx/rundgang/bild3';
if($bu3==1) echo 'a';
echo '.gif" alt="" width="32" height="32" border="0" hspace="2" vspace="2"></a>';
echo '</td>
</tr>
<tr>
<td align="center" valign="top">';
if ($bu4==1)
echo '<a href="rundgang.php?action=b'.$li4.'">';
echo '<img src="gfx/rundgang/bild4';
if($bu4==1) echo 'a';
echo '.gif" alt="" width="32" height="32" border="0" hspace="2" vspace="2"></a>';

if ($bu5==1)
echo '<a href="rundgang.php?action=b'.$li5.'">';
echo '<img src="gfx/rundgang/bild5';
if($bu5==1) echo 'a';
echo '.gif" alt="" width="32" height="32" border="0" hspace="2" vspace="2"></a>';

if ($bu6==1)
echo '<a href="rundgang.php?action=b'.$li6.'">';
echo '<img src="gfx/rundgang/bild6';
if($bu6==1) echo 'a';
echo '.gif" alt="" width="32" height="32" border="0" hspace="2" vspace="2"></a>';
echo '</td>
</tr>';
}

Für jeden Button wird also die Information ein/aus sowie die mit dem Link ausgelöste action.

Das Ergebnis noch mit Testbildern kann sich auch sehen lassen, siehe URL.

Gruß Andreas