Silnik strony + galerii zdjęć Suczawa 2009
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

75 lines
2.8 KiB

  1. <?php
  2. $page=(isset($_GET['page']))?intval($_GET['page']):0;
  3. $xhtml = preg_match('/application\/xhtml\+xml(?![+a-z])(;q=(0\.\d{1,3}|[01]))?/i',
  4. $_SERVER['HTTP_ACCEPT'], $xhtml) && (isset($xhtml[2])?$xhtml[2]:1) > 0 ||
  5. strpos($_SERVER["HTTP_USER_AGENT"], "W3C_Validator")!==false ||
  6. strpos($_SERVER["HTTP_USER_AGENT"], "WebKit")!==false;
  7. header('Content-Type: '.($xhtml?'application/xhtml+x':'text/ht').'ml; charset="utf-8"');
  8. require('init.php');
  9. echo '<?xml version="1.0" encoding="utf-8"?>'
  10. ?>
  11. <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
  12. <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="pl">
  13. <head>
  14. <title>Galeria</title>
  15. <link type="text/css" href="style.css" rel="stylesheet" />
  16. <script type="text/javascript" src="script.js"></script>
  17. </head>
  18. <body onload="javascipt:init()">
  19. <div id="page">
  20. <div id="images_outer">
  21. <table id="images"><tr>
  22. <?php
  23. $result = mysql_query('SELECT * FROM photos LIMIT '.($page*$per_page).', '.$per_page);
  24. for($i=$page*$per_page; $row = mysql_fetch_assoc($result); $i++) {
  25. echo '<td class="image_outer" onclick="javascript:previewImage('.$i.')"><img alt="'.$row['photo_name'].'" src="'.$row['thumb_name'].'" class="image" /></td>';
  26. if($i%3==2 && $i!=$count-1) echo '</tr><tr>';
  27. }
  28. while($i%3) {
  29. $i++;
  30. echo '<td class="image_outer_black">&nbsp;</td>';
  31. }
  32. ?>
  33. </tr>
  34. </table>
  35. </div>
  36. <div id="pages_outer">
  37. <div id="pages">Strony:
  38. <?php
  39. $pcount = ceil($count/$per_page)-1;
  40. for($i=0; $i<$page; $i++) {
  41. echo '<a href="?page='.$i.'">'.($i+1).'</a> | ';
  42. }
  43. if($page!=$pcount) echo ($page+1).' | ';
  44. else echo ($page+1);
  45. for($i=$page+1; $i<$pcount; $i++) {
  46. echo '<a href="?page='.$i.'">'.($i+1).'</a> | ';
  47. }
  48. if($page!=$pcount) echo '<a href="?page='.($pcount).'">'.($pcount+1).'</a>';
  49. ?>
  50. </div>
  51. </div>
  52. <div id="disp">
  53. <div id="disp_middle">
  54. <div id="disp_inner">
  55. <div><h3 id="disp_name"> </h3></div>
  56. <div id="disp_top">
  57. <img id="disp_prev" src="img/prev.png" onclick="javascript:prev()" alt="Poprzedni"></img>
  58. <a id="disp_a" href=""><img id="disp_img" src="" alt="Zdjęcie" /></a>
  59. <img id="disp_next" src="img/next.png" onclick="javascript:next()" alt="Następny"></img>
  60. </div>
  61. <div id="disp_info"></div>
  62. <div><b>Autor:</b> <a id="disp_author"> </a></div>
  63. <a id="disp_close" onclick="javascript:closeDisp()">Zamknij</a>
  64. </div>
  65. </div>
  66. </div>
  67. <div id="icons">
  68. <a href="http://validator.w3.org/check?uri=referer"><img src="http://www.w3.org/Icons/valid-xhtml11" alt="Valid XHTML 1.1" height="31" width="88" /></a>
  69. <a href="http://jigsaw.w3.org/css-validator/check/referer"><img width="88px" height="31px" src="http://jigsaw.w3.org/css-validator/images/vcss" alt="Poprawny CSS!" /></a>
  70. </div>
  71. </div>
  72. </body>
  73. </html>