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.

88 lines
3.0 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. sciezka = 'http://' + '<?= $_SERVER['HTTP_HOST']; ?>' + '/sg/robocze/';
  25. </script>
  26. <script type="text/javascript" src="script.js"><!-- AJAX Library by chp1994(c) //--></script>
  27. </head>
  28. <body onload="javascipt:init()">
  29. <div id="page">
  30. <div id="images_outer">
  31. <table id="images"><tr>
  32. <?php
  33. //$sql = "SELECT * FROM `photos` LIMIT ".($page*$per_page).", $per_page";
  34. $sql = "SELECT * FROM `photos` $limit";
  35. if (!$result = $DB->query($sql))
  36. {
  37. blad('Nie mozna pobrac zdjec uzytkownikow!');
  38. }
  39. for($i=$page*$per_page; $row = $result->fetch_assoc(); $i++)
  40. {
  41. echo '<td class="image_outer" onclick="javascript:previewImage('.($row['id']).')"><img alt="'.$row['photo_name'].'" src="images/upload/'.$row['thumb_name'].'" class="image" /></td>';
  42. if($i%3==2 && $i!=$count-1) echo '</tr><tr>';
  43. }
  44. while($i%3) {
  45. $i++;
  46. echo '<td class="image_outer_black">&nbsp;</td>';
  47. }
  48. ?>
  49. </tr>
  50. </table>
  51. </div>
  52. <div id="pages_outer">
  53. <div id="pages">Strony:
  54. <?php
  55. GenerujListeStron();
  56. ?>
  57. </div>
  58. </div>
  59. <div id="disp">
  60. <div id="disp_middle">
  61. <div id="disp_inner">
  62. <div><h3 id="disp_name"> </h3></div>
  63. <div id="disp_top">
  64. <img id="disp_prev" src="images/prev.png" onclick="javascript:prev()" alt="Poprzedni"></img>
  65. <a id="disp_a" href=""><img id="disp_img" src="" alt="Zdjecie" /></a>
  66. <img id="disp_next" src="images/next.png" onclick="javascript:next()" alt="Nastepny"></img>
  67. </div>
  68. <div id="disp_info"></div>
  69. <div><b>Autor:</b> <a id="disp_author"> </a></div>
  70. <a id="disp_close" onclick="javascript:closeDisp()">Zamknij</a>
  71. </div>
  72. </div>
  73. </div>
  74. <div id="icons">
  75. <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>
  76. <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>
  77. </div>
  78. </div>
  79. </body>
  80. </html>