Kod
Poprzednie zdjęcie || Następne zdjęcie
(jeżeli jest pierwsza fota to brak tego napisu o poprzednie, a jak jest ostatnia to brak napisu o następne)Struktura bazy:
Kod
`id` int(11) NOT NULL auto_increment,
`nazwa` text NOT NULL,
`sciezka` text NOT NULL,
`folder` text NOT NULL,
`opis` text NOT NULL,
`rider` text NOT NULL,
`foto` text NOT NULL,
`status` int(11) NOT NULL default '0',
`data_dodania` int(11) NOT NULL default '0',
`id_gallery` int(11) NOT NULL default '0',
tabela ze zdjęciami
`id` int(11) NOT NULL auto_increment,
`nazwa` text NOT NULL,
`sciezka` text NOT NULL,
`opis` text NOT NULL,
`miejsce` text NOT NULL,
`data_dodania` int(11) NOT NULL default '0',
`status` int(11) NOT NULL default '0',
tabela z galeriami
`nazwa` text NOT NULL,
`sciezka` text NOT NULL,
`folder` text NOT NULL,
`opis` text NOT NULL,
`rider` text NOT NULL,
`foto` text NOT NULL,
`status` int(11) NOT NULL default '0',
`data_dodania` int(11) NOT NULL default '0',
`id_gallery` int(11) NOT NULL default '0',
tabela ze zdjęciami
`id` int(11) NOT NULL auto_increment,
`nazwa` text NOT NULL,
`sciezka` text NOT NULL,
`opis` text NOT NULL,
`miejsce` text NOT NULL,
`data_dodania` int(11) NOT NULL default '0',
`status` int(11) NOT NULL default '0',
tabela z galeriami
Plik img-gallery.php (ten plik wyświetla się jako POPUP):
<html> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <style type="text/css"> a{ text-decoration: none; color: #007981; } a:link { text-decoration: none; color: #007981; } a:visited { text-decoration: none; color: #007981; } a:active { text-decoration: none; color: #007981; } a:hover { color: #fea00a; } </style> </head> <body> <?php include("config.php"); $id = (int)$_GET['id']; $id_gallery = (int)$_GET['id_gallery']; //echo $id_gallery; $height = $size[1]+220; $width = $size[0]+50; echo "<script language='JavaScript' type='text/javascript'> window.resizeTo({$width},{$height}); </script>"; echo '<center><p style="color: #007981;"><strong>< Poprzednia Następne ></strong></p><table><tr><td bgcolor="#007981" style="border: 4px solid #007981; color: #FFFFFF; font-face: Verdana;" valign="top"><img src="galeria/'.$row['folder'].'/'.$row['sciezka'].'"><br />rider: '.$row['rider'].'<br />foto: '.$row['foto'].'<br />opis: '.$row ['opis'].'</td></tr></table><p style="color: #007981;"><strong>< Poprzednia Następne ></strong></p></center>'; ?> </body> </html>
I musi to też tak działać, że w bazie może być tak (czyli tak przeplatane):
Kod
id | id_galerii
1 | 1
2 | 1
3 | 1
4 | 2
5 | 2
6 | 1
7 | 2
8 | 2
9 | 1
1 | 1
2 | 1
3 | 1
4 | 2
5 | 2
6 | 1
7 | 2
8 | 2
9 | 1
Z góry dziękuje za pomoc
