upload.php 4.4 KB

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