Hi, zrobiłem sobie powiększenie zdjęcia w galerii (w JS). No i chciałem, aby było nad zdjęciem takie napisy:
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


Plik img-gallery.php (ten plik wyświetla się jako POPUP):
  1. <html>
  2. <head>
  3. <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
  4. <style type="text/css">
  5. a{ text-decoration: none; color: #007981; }
  6. a:link { text-decoration: none; color: #007981; }
  7. a:visited { text-decoration: none; color: #007981; }
  8. a:active { text-decoration: none; color: #007981; }
  9. a:hover { color: #fea00a; }
  10. </style>
  11. </head>
  12. <body>
  13. <?php
  14.  
  15. include("config.php");
  16. $id = (int)$_GET['id'];
  17. $id_gallery = (int)$_GET['id_gallery'];
  18. //echo $id_gallery;
  19.  
  20. $query = mysql_query("SELECT * FROM page_gallery WHERE id = $id AND status = '1'");
  21. $row = mysql_fetch_array($query);
  22.  
  23. $size=getimagesize("galeria/{$row['folder']}/{$row['sciezka']}");
  24. $height = $size[1]+220;
  25. $width = $size[0]+50;
  26.  
  27.  
  28. echo "<script language='JavaScript' type='text/javascript'>
  29.  window.resizeTo({$width},{$height});
  30. </script>";
  31.  
  32. echo '<center><p style="color: #007981;"><strong>< Poprzednia&nbsp;&nbsp;&nbsp;&nbsp;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&nbsp;&nbsp;&nbsp;&nbsp;Następne ></strong></p></center>';
  33.  
  34. ?>
  35. </body>
  36. </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



Z góry dziękuje za pomoc smile.gif