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.

90 lines
3.1 KiB

  1. <?php
  2. /**
  3. * @package Galeria Suczawa 2009
  4. * @file gallery.php
  5. * @version $Id$
  6. * @author chp1994 <chp1994@gmail.com>
  7. * @link http://suczawa.ath.cx/
  8. **/
  9. $page= (isset($_GET['page'])) ? intval($_GET['page']) : 0;
  10. $xhtml = preg_match('/application\/xhtml\+xml(?![+a-z])(;q=(0\.\d{1,3}|[01]))?/i',
  11. $_SERVER['HTTP_ACCEPT'], $xhtml) && (isset($xhtml[2])?$xhtml[2]:1) > 0 ||
  12. strpos($_SERVER["HTTP_USER_AGENT"], "W3C_Validator")!==false ||
  13. strpos($_SERVER["HTTP_USER_AGENT"], "WebKit")!==false;
  14. header('Content-Type: '.($xhtml ? 'application/xhtml+x' : 'text/ht').'ml; charset="utf-8"');
  15. require('./init.php');
  16. echo '<?xml version="1.0" encoding="utf-8"?>';
  17. ?>
  18. <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
  19. <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="pl">
  20. <head>
  21. <title>Galeria Suczawa 2009</title>
  22. <link type="text/css" href="style.css" rel="stylesheet" />
  23. <script type="text/javascript">
  24. <!--
  25. sciezka = 'http://' + '<?= $_SERVER['HTTP_HOST']; ?>' + '/sg/robocze/';
  26. //-->
  27. </script>
  28. <script type="text/javascript" src="script.js"><!-- AJAX Library by chp1994(c) //--></script>
  29. </head>
  30. <body onload="javascipt:init()">
  31. <div id="page">
  32. <div id="images_outer">
  33. <table id="images"><tr>
  34. <?php
  35. //$sql = "SELECT * FROM `photos` LIMIT ".($page*$per_page).", $per_page";
  36. $sql = "SELECT * FROM `photos` $limit";
  37. if (!$result = $DB->query($sql))
  38. {
  39. blad('Nie mozna pobrac zdjec uzytkownikow!');
  40. }
  41. for($i=$page*$per_page; $row = $result->fetch_assoc(); $i++)
  42. {
  43. echo '<td class="image_outer" onclick="javascript:previewImage('.($row['id']).')"><img alt="'.$row['photo_name'].'" src="images/upload/'.$row['thumb_name'].'" class="image" /></td>';
  44. if($i%3==2 && $i!=$count-1) echo '</tr><tr>';
  45. }
  46. while($i%3) {
  47. $i++;
  48. echo '<td class="image_outer_black">&nbsp;</td>';
  49. }
  50. ?>
  51. </tr>
  52. </table>
  53. </div>
  54. <div id="pages_outer">
  55. <div id="pages">Strony:
  56. <?php
  57. GenerujListeStron();
  58. ?>
  59. </div>
  60. </div>
  61. <div id="disp">
  62. <div id="disp_middle">
  63. <div id="disp_inner">
  64. <div><h3 id="disp_name"> </h3></div>
  65. <div id="disp_top">
  66. <img id="disp_prev" src="images/prev.png" onclick="javascript:prev()" alt="Poprzedni"></img>
  67. <a id="disp_a" href=""><img id="disp_img" src="" alt="Zdjecie" /></a>
  68. <img id="disp_next" src="images/next.png" onclick="javascript:next()" alt="Nastepny"></img>
  69. </div>
  70. <div id="disp_info"></div>
  71. <div><b>Autor:</b> <a id="disp_author"> </a></div>
  72. <a id="disp_close" onclick="javascript:closeDisp()">Zamknij</a>
  73. </div>
  74. </div>
  75. </div>
  76. <div id="icons">
  77. <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>
  78. <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>
  79. </div>
  80. </div>
  81. </body>
  82. </html>