| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142 |
- <?php
- $http_host = $_SERVER["HTTP_HOST"];
- include("../functions.php");
- $con = startdb();
- $proto = getProtocol();
- $server = "$proto$http_host";
- //Language
- $lang = selectLanguage();
- include("../lang/lang_$lang.php");
-
- //Get photo data
- $path = mysqli_real_escape_string($con, $_GET["path"]);
- $q = mysqli_query($con, "SELECT id, file, permalink, title_$lang AS title, description_$lang AS description, uploaded, size, user, username FROM photo WHERE file = '$path' AND approved = 1");
- if (mysqli_num_rows($q) == 0){
- exit(0);
- }
- else{
- $r = mysqli_fetch_array($q);
- // Get album name
- $q_album = mysqli_query($con, "SELECT album.title_$lang AS title FROM album, photo_album WHERE album = album.id AND photo = $r[id]");
- $r_album = mysqli_fetch_array($q_album);
- ?>
- <h3 class='section_title'>
- <?php
- if (strlen($r["title"]) > 0){
- echo($r["title"]);
- }
- else{
- echo($r_album["title"]);
- }
- ?>
- <div id='viewer_close_container'>
- <img id='viewer_close' class='pointer' alt=' ' src='<?=$server?>/img/misc/close.png' onClick='closeViewer();'/>
- </div>
- </h3>
- <div id='viewer_container'>
- <div id='viewer_table'>
- <div class='viewer_row'>
- <div class='viewer_cell' id='cell_image'>
- <div class='entry' id='photo_data'>
- <table>
- <tr>
- <td class='arrow'>
- <img id='viewer_arrow_left' class='viewer_arrow pointer' alt=' ' src='<?=$server?>/img/misc/slid-left.png' onClick='scrollPhoto(-1);'/>
- </td>
- <td id='image'>
- <div id='photo_viewer_image_container'>
- <img id='photo_viewer_image' src='/img/galeria/preview/<?=$r["file"]?>'/>
- </div>
- </td>
- <td class='arrow'>
- <img id='viewer_arrow_right' class='viewer_arrow pointer' alt=' ' src='<?=$server?>/img/misc/slid-right.png' onClick='scrollPhoto(1);'/>
- </td>
- </tr>
- </table>
- <?php
- if (strlen($r["description"]) > 0){
- ?>
- <span id='photo_description'><?=$r["description"]?></span>
- <?php
- }
- ?>
- <span id='photo_date'><?=formatDate($r["uploaded"], $lang)?></span>
- <?php
- if (strlen($r["username"]) > 0){
- ?>
- <span id='photo_user'><?=$lng["gallery_user"]?><?=$r["username"]?></span>
- <?php
- }
- ?>
- </div> <!-- #photo_data -->
- </div> <!-- #cell_image -->
- <div class='viewer_cell' id='cell_comments'>
- <div id='photo_viewer_details'>
- <?php
- $q_comment = mysqli_query($con, "SELECT * FROM photo_comment WHERE photo = $r[id];");
- $comment_count = mysqli_num_rows($q_comment);
- ?>
- <div class='entry' id='comments_section'>
- <div id='photo_viewer_comment_counter'>
- <?php
- switch ($comment_count){
- case 0:
- ?>
- <h3 class='entry_title'>
- <meta itemprop='interactionCount' content='0'/><?=$lng["gallery_comment_count_0"]?>
- </h3>
- <?php
- break;
- case 1:
- ?>
- <h3 class='entry_title'>
- <span itemprop='interactionCount'>1 </span><?=$lng["gallery_comment_count_1"]?>
- </h3>
- <?php
- break;
- default:
- ?>
- <h3 class='entry_title'>
- <span itemprop='interactionCount'><?=$comment_count?></span> <?=$lng["gallery_comment_count_several"]?>
- </h3>
- <?php
- }
- ?>
- </div> <!-- #photo_viewer_comment_counter -->
- <div id='comment_list'>
- <?php
- while ($r_comment = mysqli_fetch_array($q_comment)){
- ?>
- <div itemprop='comment' itemscope itemtype='http://schema.org/UserComments' id='comment_<?=$r_comment["id"]?>' class='comment'>
- <span itemprop='creator' class='comment_user'><?=$r_comment["username"]?></span>
- <span class='comment_date date'><meta itemprop='commentTime' content='<?=$r_comment["isodate"]?>'/><?=formatDate($r_comment["dtime"], $lang)?></span>
- <p itemprop='commentText' class='comment_text'><?=$r_comment["text"]?></p>
- <hr class='comment_line'/>
- </div>
- <?php
- }
- ?>
- </div> <!-- #comment_list -->
- <!-- Comment form -->
- <div class='comment' id='comment_new'>
- <form id='comment_form' method='post' action='/' onsubmit='event.preventDefault();postComment(<?=$r["id"]?>, "<?=$lang?>");'>
- <textarea id='new_comment_text' name='text' maxlength='1800' onChange='defaultInputBorder(this);' onKeyDown='defaultInputBorder(this);' placeholder='<?=$lng[blog_placeholder_text]?>'></textarea>
- <div id='identification_form'>
- <br/>
- <input id='new_comment_user' name='user' maxlength='50' type='text' placeholder='<?=$lng["blog_placeholder_name"]?>' onChange='defaultInputBorder(this);' onKeyDown='defaultInputBorder(this);'/>
- <input type='submit' value='<?=$lng["blog_send"]?>'/>
- </div> <!-- #identification_form -->
- </form>
- </div> <!-- #comment_new -->
- </div> <!-- #comments_section -->
- </div> <!-- $photo_viewer_details -->
- </div> <!-- #cell_comments -->
- </div> <!-- #viewer_row -->
- </div> <!-- #viewer_table -->
- </div> <!-- #viewer_container -->
- <?php
- stats(-1, 0, "photo", "$r[id]");
- }
- ?>
|