upload.php 4.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114
  1. <?php
  2. $http_host = $_SERVER['HTTP_HOST'];
  3. include("../functions.php");
  4. $con = startdb();
  5. //Language
  6. $lang = selectLanguage();
  7. include("../lang/lang_" . $lang . ".php");
  8. $cur_section = $lng['section_gallery'];
  9. //TODO: Set metadata
  10. ?>
  11. <!DOCTYPE html>
  12. <html>
  13. <head>
  14. <meta content="text/html; charset=utf-8" http-equiv="content-type"/>
  15. <meta charset="utf-8"/>
  16. <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, minimum-scale=1">
  17. <title><?php echo $lng['gallery_title'];?></title>
  18. <link rel="shortcut icon" href="<?php echo "http://$http_host/img/logo/favicon.ico";?>">
  19. <!-- CSS files -->
  20. <style>
  21. <?php
  22. include("../css/ui.css");
  23. include("../css/galeria.css");
  24. ?>
  25. </style>
  26. <!-- CSS for mobile version -->
  27. <style media="(max-width : 990px)">
  28. <?php
  29. include("../css/m/ui.css");
  30. include("../css/m/galeria.css");
  31. ?>
  32. </style>
  33. <!-- Script files -->
  34. <script type="text/javascript">
  35. <?php
  36. include("../script/ui.js");
  37. include("../script/galeria.js");
  38. ?>
  39. </script>
  40. <!-- Meta tags -->
  41. <link rel="canonical" href="<?php echo "http://$http_host"; ?>"/>
  42. <link rel="author" href="<?php echo "http://$http_host"; ?>"/>
  43. <link rel="publisher" href="<?php echo "http://$http_host"; ?>"/>
  44. <meta name="description" content="<?php echo $lng['gallery_description'];?>"/>
  45. <meta property="og:title" content="<?php echo $lng['gallery_title'];?>"/>
  46. <meta property="og:url" content="<?php echo "http://$http_host"; ?>"/>
  47. <meta property="og:description" content="<?php echo $lng['gallery_description'];?>"/>
  48. <meta property="og:image" content="<?php echo "http://$http_host/img/logo/logo.png";?>"/>
  49. <meta property="og:site_name" content="<?php echo $lng['gallery_title'];?>"/>
  50. <meta property="og:type" content="website"/>
  51. <meta property="og:locale" content="<?php echo $lang; ?>"/>
  52. <meta name="twitter:card" content="summary"/>
  53. <meta name="twitter:title" content="<?php echo $lng['gallery_title'];?>"/>
  54. <meta name="twitter:description" content="<?php echo $lng['gallery_description'];?>"/>
  55. <meta name="twitter:image" content="<?php echo "http://$http_host/img/logo/logo.png";?>"/>
  56. <meta name="twitter:url" content="<?php echo"http://$http_host"; ?>"/>
  57. <meta name="robots" content="noindex nofollow"/>
  58. </head>
  59. <body>
  60. <?php include("../header.php"); ?>
  61. <div id="content">
  62. <form onSubmit="event.preventDefault(); submitPhotos();">
  63. <div class="section">
  64. <div class="entry">
  65. <?php echo $lng["gallery_upload_header"]; ?>
  66. </div>
  67. </div>
  68. <br/>
  69. <div class="section">
  70. <div id="file_box" ondragover="event.preventDefault();" ondrop="dropFile(event, '<?php echo $lng['gallery_upload_placeholder_title'] ?>', '<?php echo $lng['gallery_upload_placeholder_description'] ?>');">
  71. <br/><br/><br/>
  72. <span id='drag'><?php echo $lng["gallery_upload_drag"]; ?></span>
  73. <input class='hidden' multiple accept='image/x-png, image/gif, image/jpeg' type='file' id='file_selector' onChange="selectFile(event, this, '<?php echo $lng['gallery_upload_placeholder_title'] ?>', '<?php echo $lng['gallery_upload_placeholder_description'] ?>');"/>
  74. <br/><br/>
  75. <span id='select' class='desktop'><a href='javascript:launchFileSelector();'><?php echo $lng["gallery_upload_select"];?></a></span>
  76. <br/><br/><br/>
  77. </div>
  78. </div>
  79. <br/><br/>
  80. <div class="section" id="photo_upload_preview">
  81. <div id="file_list">
  82. </div>
  83. <table>
  84. <tr>
  85. <td class='entry'>
  86. <?php echo $lng["gallery_upload_tooltip_album"]; ?>
  87. <br/><br/>
  88. <select id="album" type="select">
  89. <option value="-1" selected="selected"><?php echo $lng['gallery_upload_select_album'] ?></option>
  90. <?php
  91. $q_album = mysqli_query($con, "SELECT id, title_$lang AS title FROM album ORDER BY title;");
  92. while ($r_album = mysqli_fetch_array($q_album)){
  93. echo "<option value='$r_album[id]'>$r_album[title]</option>\n";
  94. }
  95. ?>
  96. </select>
  97. </td>
  98. <td class='entry'>
  99. <?php echo $lng["gallery_upload_tooltip_name"]; ?>
  100. <br/><br/>
  101. <input type='text' id='username'/>
  102. </td>
  103. </tr>
  104. </table>
  105. <input type="submit" id="photo_submit" value="<?php echo $lng["gallery_upload_submit"];?>">
  106. </div>
  107. </form>
  108. </div>
  109. </body>
  110. </html>