Advertisement
Guest User

Makaja

a guest
Aug 21st, 2014
54
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 23.17 KB | None | 0 0
  1. <?php if(!defined('access') or !access) die('This file cannot be directly accessed.'); ?>
  2. <?php G\Render\include_theme_header(); ?>
  3.  
  4. <?php
  5. $share_element = [
  6.     'referer'       => G\get_base_url(),
  7.     'url'           => get_image()['url_viewer'],
  8.     'image'         => get_image()['url'],
  9.     'title'         => get_doctitle()
  10. ];
  11. $share_element['HTML'] = '<a href="'.$share_element["url"].'" title="'.$share_element["title"].'"><img src="'.$share_element["image"].'" /></a>';
  12. $share_links_array = CHV\render\get_share_links($share_element);
  13.  
  14. ?>
  15.  
  16. <div class="top-bar-placeholder background-black"></div>
  17.  
  18. <div id="image-viewer" class="image-viewer full-viewer margin-bottom-10">
  19.     <?php
  20.         if(!get_image()['nsfw'] or (get_image()['nsfw'] and CHV\get_chv_setting('show_banners_in_nsfw'))) {
  21.             CHV\Render\show_banner('image_image-viewer_top');
  22.         }
  23.     ?>
  24.     <?php
  25.         $image_url =  get_image()["medium"] ? get_image()["medium"]["url"] : get_image()["large"]["url"];
  26.     ?>
  27.     <div id="image-viewer-container" class="image-viewer-main image-viewer-container"><img src="<?php echo $image_url; ?>" alt="" width="<?php echo get_image()["width"]; ?>" height="<?php echo get_image()["height"]; ?>" <?php if(get_image()["medium"]) { ?> data-load="full"<?php } ?>></div>
  28.     <?php
  29.         if(get_image()["user"]["id"] !== NULL) {
  30.     ?>
  31.     <div class="image-viewer-navigation arrow-navigator">
  32.         <?php
  33.             if(get_image_album_slice()["prev"] !== NULL) {
  34.         ?>
  35.         <a class="left-0" data-action="prev" href="<?php echo get_image_album_slice()["prev"]["url_viewer"]; ?>"><span class="icon-prev-alt"></span></a>
  36.         <?php
  37.             }
  38.             if(get_image_album_slice()["next"] !== NULL) {
  39.         ?>
  40.         <a class="right-0" data-action="next" href="<?php echo get_image_album_slice()["next"]["url_viewer"]; ?>"><span class="icon-next-alt"></span></a>
  41.         <?php
  42.             }
  43.         ?>
  44.     </div>
  45.     <?php
  46.         }
  47.     ?>
  48.     <?php
  49.         if(!get_image()['nsfw'] or (get_image()['nsfw'] and CHV\get_chv_setting('show_banners_in_nsfw'))) {
  50.             CHV\Render\show_banner('image_image-viewer_foot');
  51.         }
  52.     ?>
  53. </div>
  54. <script>
  55.     // Fix the image-viewer height (or width) asap with native js
  56.     image_viewer_full_fix = function() {
  57.  
  58.         var viewer = document.getElementById("image-viewer"),
  59.             viewer_container = document.getElementById("image-viewer-container"),
  60.             top = document.getElementById("top-bar"),
  61.             ratio = <?php echo number_format(get_image()['ratio'], 2, '.', ''); ?>;
  62.        
  63.         viewer_container.className = viewer_container.className.replace(/\bcursor-zoom-(in|out)\b/, "");
  64.  
  65.         var canvas = {
  66.                 height: window.innerHeight - (typeof top !== "undefined" ? top.clientHeight : 0),
  67.                 width: viewer.clientWidth
  68.             },
  69.             imgSource = {
  70.                 width: <?php echo get_image()["width"]; ?>,
  71.                 height: <?php echo get_image()["height"]; ?>
  72.             },
  73.             img = {width: imgSource.width, height: imgSource.height};
  74.        
  75.         var viewer_banner_top = <?php echo CHV\get_chv_setting('banner_image_image-viewer_top') ? 1 : 0; ?>,
  76.             viewer_banner_foot = <?php echo CHV\get_chv_setting('banner_image_image-viewer_foot') ? 1 : 0; ?>;
  77.        
  78.         var viewer_banner_height = 90;
  79.        
  80.         if(viewer_banner_top) {
  81.             canvas.height -= viewer_banner_height + 20;
  82.         }
  83.         if(viewer_banner_foot) {
  84.             canvas.height -= viewer_banner_height + 20;
  85.         }
  86.        
  87.         var hasClass = function(element, cls) {
  88.             return (" " + element.className + " ").indexOf(" " + cls + " ") > -1;
  89.         }
  90.        
  91.         if(hasClass(document.documentElement, "phone") || hasClass(document.documentElement, "phablet")) {
  92.             if(img.width > canvas.width) {
  93.                 img.width = canvas.width;
  94.             }
  95.             img.height = Math.round(img.width/ratio);
  96.         } else {
  97.             if(img.height > canvas.height && (img.height/img.width) < 3) {
  98.                 img.height = canvas.height;
  99.             }
  100.             if(img.height == canvas.height) {
  101.                 img.width = Math.round(img.height * ratio);
  102.             }
  103.         }
  104.        
  105.         if(img.width > canvas.width) {
  106.             img.width = canvas.width;
  107.             img.height = Math.round(img.width/ratio);
  108.         } else if((img.height/img.width) > 3) { // wow, very tall. such heights
  109.             img = imgSource;
  110.             if(img.width > canvas.width) {
  111.                 img.width = canvas.width * 0.8;
  112.             }
  113.             img.height = Math.round(img.width/ratio);
  114.         }
  115.        
  116.         if(imgSource.width > img.width && img.width < canvas.width) {
  117.             viewer_container.className += " cursor-zoom-in";
  118.         }
  119.        
  120.         img = {
  121.             width: img.width + "px",
  122.             height: img.height + "px",
  123.             display: "block"
  124.         }
  125.        
  126.         for(var k in img) {
  127.             viewer_container.style[k] = img[k];
  128.         }
  129.     }
  130.    
  131.     image_viewer_full_fix();
  132.    
  133.     // Bind the native fn to the CHV object
  134.     $(document).ready(function() {
  135.        
  136.         CHV.obj.image_viewer.image = {
  137.             width: <?php echo get_image()["width"]; ?>,
  138.             height: <?php echo get_image()["height"]; ?>,
  139.             ratio: <?php echo number_format(get_image()['ratio'], 2, '.', ''); ?>,
  140.             url: "<?= get_image()["large"]["url"] ? get_image()["large"]["url"] : get_image()["url"] ?>",
  141.             medium: {
  142.                 url: "<?php echo get_image()["medium"]["url"]; ?>"
  143.             },
  144.             url_viewer: "<?php echo get_image()["url_viewer"]; ?>"
  145.         };
  146.         CHV.obj.image_viewer.album = {
  147.             id_encoded: "<?php echo get_image()["album"]["id_encoded"]; ?>"
  148.         }; 
  149.        
  150.         image_viewer_full_fix();
  151.        
  152.         CHV.fn.image_viewer_full_fix = window["image_viewer_full_fix"];
  153.        
  154.     });
  155. </script>
  156.  
  157. <?php
  158.     if(!get_image()['nsfw'] or (get_image()['nsfw'] and CHV\get_chv_setting('show_banners_in_nsfw'))) {
  159.         CHV\Render\show_banner('image_after_image-viewer');
  160.     }
  161. ?>
  162.  
  163. <div class="content-width">
  164.    
  165.     <div class="header header-content margin-bottom-10">
  166.         <div class="header-content-left">
  167.             <div class="header-content-breadcrum">
  168.                 <?php
  169.                     if(get_image()["user"]["id"]) {
  170.                         global $owner;
  171.                         $owner = get_image()["user"];
  172.                         G\Render\include_theme_file("snippets/breadcrum_owner_card");
  173.                     } else {
  174.                 ?>
  175.                 <div class="breadcrum-item">
  176.                     <div class="user-image default-user-image"><span class="icon icon-user"></span></div>
  177.                     <span class="breadcrum-text float-left"><span class="user-link"><?php _se('Guest'); ?></span></span>
  178.                 </div>
  179.                 <?php
  180.                     }
  181.                 ?>
  182.                 <div class="breadcrum-item">
  183.                     <span class="breadcrum-text"><span class="icon icon-eye-blocked margin-right-5 <?php if(!get_image()["album"] or get_image()["album"]["privacy"] == "public") echo "soft-hidden"; ?>" data-content="privacy-private" title="<?php _se('This content is private'); ?>" rel="tooltip"></span>
  184.                 </div>
  185.                 <?php
  186.                     if(is_owner() or is_admin()) {
  187.                 ?>
  188.                 <div class="breadcrum-item">
  189.                     <a class="edit-link" data-modal="edit"><span class="icon-edit"></span><span><?php _se('Edit image details'); ?></span></a>
  190.                 </div>
  191.                 <div class="breadcrum-item">
  192.                     <a class="delete-link" data-confirm="<?php _se("Do you really want to delete this image? This can't be undone."); ?>" data-submit-fn="CHV.fn.submit_resource_delete" data-ajax-deferred="CHV.fn.complete_resource_delete" data-ajax-url="<?php echo G\get_base_url("json"); ?>"><?php _se('Delete image'); ?></a>
  193.                 </div>
  194.                 <?php
  195.                     }
  196.                 ?>
  197.             </div>
  198.         </div>
  199.  
  200.         <div class="header-content-right">
  201.             <?php
  202.                 if(CHV\get_chv_setting('theme_peafowl_download_button')) {
  203.             ?>
  204.             <a href="<?php echo get_image()["url"]; ?>" download="<?php echo get_image()["filename"]; ?>" class="btn btn-download default" rel="tooltip" title="<?php echo strtoupper(get_image()["extension"]); ?> <?php echo get_image()["size_formatted"]; ?>"><span class="btn-icon icon-download"></span><span class="btn-text phone-hide"><?php echo get_image()["width"]; ?> x <?php echo get_image()["height"]; ?></span></a>
  205.             <?php
  206.                 }
  207.             ?>
  208.             <a class="btn red" data-modal="simple" data-target="modal-share"><span class="btn-icon icon-share"></span><span class="btn-text"><?php _se('Share'); ?></span></a>
  209.         </div>
  210.        
  211.     </div>
  212.    
  213.     <?php
  214.         if(!get_image()['description']) {
  215.     ?>
  216.     <h1 class="viewer-title soft-hidden" data-text="image-description"><?php echo get_pre_doctitle(); ?></h1>
  217.     <?php
  218.         } else {
  219.     ?>
  220.     <h1 class="viewer-title" data-text="image-description"><?php echo nl2br(get_image_safe_html()['description']); ?></h1>
  221.     <?php
  222.         }
  223.     ?>
  224.    
  225.     <?php
  226.         if(!get_image()['nsfw'] or (get_image()['nsfw'] and CHV\get_chv_setting('show_banners_in_nsfw'))) {
  227.             CHV\Render\show_banner('image_before_header');
  228.         }
  229.     ?>
  230.    
  231.     <div class="header">
  232.         <?php
  233.             global $tabs; // Define it as a global to bind it on the included tab.php
  234.             $tabs = [
  235.                 0 => [
  236.                     "label"     => _s('About'),
  237.                     "id"        => "tab-about",
  238.                     "current"   => true,
  239.                 ],
  240.                 1 => [
  241.                     "label"     => _s('Embed codes'),
  242.                     "id"        => "tab-codes",
  243.                 ]
  244.             ];
  245.             if(is_admin()) {
  246.                 $tabs[2] = [
  247.                     "label"     => _s('Full info'),
  248.                     "id"        => "tab-full-info"
  249.                 ];
  250.             }
  251.            
  252.             G\Render\include_theme_file("snippets/tabs");
  253.         ?>
  254.        
  255.         <div class="header-content-right phone-hide">
  256.             <div class="number-figures float-left"><?php echo get_image()["views"]; ?> <span><?php echo get_image()["views_label"]; ?></span></div>
  257.         </div>
  258.     </div>
  259.    
  260.     <?php
  261.         if(!get_image()['nsfw'] or (get_image()['nsfw'] and CHV\get_chv_setting('show_banners_in_nsfw'))) {
  262.             CHV\Render\show_banner('image_after_header');
  263.         }
  264.     ?>
  265.    
  266.     <div id="tabbed-content-group">
  267.        
  268.         <div id="tab-about" class="tabbed-content visible">
  269.             <div class="c9 phablet-c1 fluid-column grid-columns">
  270.                 <div class="panel-description default-margin-bottom">
  271.                     <p class="description-meta margin-bottom-5">
  272.                     <?php
  273.                         $category = get_categories()[get_image()['category_id']];
  274.                         $category_link = '<a href="'.$category['url'].'" rel="tag">'.$category['name'].'</a>';
  275.                         if(get_image()['album']['id']) {
  276.                             $album_link = '<a href="'.get_image()['album']['url'].'">'.get_image()['album']['name'].'</a>';
  277.                             if($category) {
  278.                                 echo _s('Added to %a and categorized in %c', ['%a' => $album_link, '%c' => $category_link]);
  279.                             } else {
  280.                                 echo _s('Added to %s', $album_link);
  281.                             }
  282.                             echo ' — ' .  CHV\time_elapsed_string(get_image()['date_gmt']);
  283.                         } else {
  284.                             if($category) {
  285.                                 echo _s('Uploaded to %s', $category_link) . ' — ' .  CHV\time_elapsed_string(get_image()['date_gmt']);
  286.                             } else {
  287.                                 _se('Uploaded %s', CHV\time_elapsed_string(get_image()['date_gmt']));
  288.                             }
  289.                            
  290.                         }
  291.                     ?>
  292.                     </p>
  293.                     <?php
  294.                         $image_exif = CHV\Render\getFriendlyExif(get_image()["original_exifdata"]);
  295.                         if($image_exif) {
  296.                     ?>
  297.                     <p class="exif-meta"><span class="icon-camera"></span><?php echo $image_exif->camera; ?> <span class="exif-data"><?php echo $image_exif->capture; ?></span></p>
  298.                     <?php
  299.                         }
  300.                     ?>
  301.                 </div>
  302.                
  303.                 <div class="phone-show phablet-show hidden panel-share-networks margin-bottom-30">
  304.                     <h4 class="title"><?php _se('Share image'); ?></h4>
  305.                     <ul>
  306.                     <?php echo '<li>'.join("</li><li>"."\n", $share_links_array); ?>
  307.                     </ul>
  308.                 </div>
  309.                
  310.                 <?php
  311.                     if(is_admin()) {
  312.                 ?>
  313.                 <div class="tabbed-content-section margin-bottom-30">
  314.                     <ul class="tabbed-content-list table-li">
  315.                         <?php
  316.                             $image_list_values = [
  317.                                 [
  318.                                     'label'     => _s('Image ID'),
  319.                                     'content'   => get_image()['id'] . ' ('.get_image()['id_encoded'].')'
  320.                                 ],
  321.                                 [
  322.                                     'label'     => _s('Uploader IP'),
  323.                                     'content'   => sprintf(str_replace('_IP_','%1$s', '<a href="http://whatismyipaddress.com/ip/_IP_" target="_blank">_IP_</a> &middot; <a href="'.G\get_base_url('search/images/?q=IP:_IP_').'">'._s('search content').'</a>'), get_image()['uploader_ip'])
  324.                                 ],
  325.                                 [
  326.                                     'label'     => _s('Upload date'),
  327.                                     'content'   => get_image()['date']
  328.                                 ],
  329.                                 [
  330.                                     'label'     => '',
  331.                                     'content'   => get_image()['date_gmt'] . ' (GMT)'
  332.                                 ]
  333.                             ];
  334.                            
  335.                             if(!is_null(get_image()['album']['id'])) {
  336.                                 $album_values = [
  337.                                     'label'     => _s('Album ID'),
  338.                                     'content'   => get_image()['album']['id'] . ' ('.get_image()['album']['id_encoded'].')'
  339.                                 ];
  340.                                 $image_list_values = array_slice($image_list_values, 0, 1, true) +
  341.                                     ['album' =>
  342.                                         [
  343.                                             'label'     => _s('Album ID'),
  344.                                             'content'   => get_image()['album']['id'] . ' ('.get_image()['album']['id_encoded'].')'
  345.                                         ]
  346.                                     ] +
  347.                                     array_slice($image_list_values, 1, count($image_list_values) - 1, true) ;
  348.                             }
  349.                            
  350.                             foreach($image_list_values as $v) {
  351.                         ?>
  352.                         <li><span class="c4 display-table-cell padding-right-10"><?php echo $v['label']; ?></span> <span class="display-table-cell"><?php echo $v['content']; ?></span></li>
  353.                         <?php
  354.                             }
  355.                         ?>
  356.                     </ul>                  
  357.                 </div>
  358.                 <?php
  359.                     }
  360.                 ?>
  361.                
  362.                 <?php
  363.                     if(!get_image()['nsfw'] or (get_image()['nsfw'] and CHV\get_chv_setting('show_banners_in_nsfw'))) {
  364.                         CHV\Render\show_banner('content_before_comments');
  365.                     }
  366.                 ?>
  367.                
  368.                 <div class="default-margin-bottom">
  369.                     <?php echo CHV\get_chv_setting('comment_code'); ?>
  370.                 </div>
  371.                
  372.             </div>
  373.            
  374.             <div class="tablet-show laptop-show desktop-show hidden c15 phablet-c1 fluid-column grid-columns default-margin-bottom margin-left-10 panel-share-networks">
  375.                 <h4 class="title c4 grid-columns"><?php _se('Share image'); ?></h4>
  376.                 <ul>
  377.                 <?php echo '<li>'.join("</li><li>"."\n", $share_links_array); ?>
  378.                 </ul>
  379.             </div>
  380.        
  381.            
  382.             <?php
  383.                 if(get_image()["user"]["id"] != NULL) {
  384.             ?>
  385.             <div class="c15 phablet-c1 fluid-column grid-columns margin-left-10 phablet-margin-left-0">
  386.                 <h4 class="title c4 phablet-c1 grid-columns"><span data-content="album-panel-title"<?php if(get_image()["album"]["id"] == NULL) echo ' class="soft-hidden"'?>><?php _se('In this album'); ?></span></h4>
  387.                 <ul class="panel-thumb-list grid-columns" data-content="album-slice">
  388.                     <?php
  389.                         global $image_album_slice, $image_id;
  390.                         $image_album_slice = get_image_album_slice();
  391.                         $image_id = get_image()["id"];
  392.                         G\Render\include_theme_file("snippets/image_album_slice");
  393.                     ?>
  394.                 </ul>
  395.             </div>
  396.             <?php
  397.                 }
  398.             ?>
  399.            
  400.             <div class="c15 phablet-c1 fluid-column grid-columns margin-left-10 phablet-margin-left-0">
  401.                 <?php
  402.                     if(!get_image()['nsfw'] or (get_image()['nsfw'] and CHV\get_chv_setting('show_banners_in_nsfw'))) {
  403.                         CHV\Render\show_banner('content_tab-about_column');
  404.                     }
  405.                 ?>
  406.             </div>
  407.            
  408.         </div>
  409.        
  410.         <div id="tab-codes" class="tabbed-content">
  411.            
  412.             <div class="growl static text-align-center margin-bottom-30 clear-both<?php if(get_image()["album"]["privacy"] == "public" or get_image()["album"]["privacy"] == NULL) echo " soft-hidden"; ?>" data-content="privacy-private"><?php _se('Note: This content is private. Change privacy to "public" to share.'); ?></div>
  413.            
  414.             <div class="panel-share c15 phablet-c1 grid-columns margin-right-10">
  415.            
  416.                 <div class="panel-share-item">
  417.                     <h4 class="pre-title"><?php _se('Image links'); ?></h4>
  418.                     <div class="panel-share-input-label">
  419.                         <h4 class="title c5 grid-columns"><?php _se('Image URL'); ?></h4>
  420.                         <div class="c10 phablet-c1 grid-columns">
  421.                             <input type="text" class="text-input" value="<?php echo get_image()["url"]; ?>" data-focus="select-all">
  422.                         </div>
  423.                     </div>
  424.                     <div class="panel-share-input-label">
  425.                         <h4 class="title c5 grid-columns"><?php _se('Image link'); ?></h4>
  426.                         <div class="c10 phablet-c1 grid-columns">
  427.                             <input type="text" class="text-input" value="<?php echo get_image()["url_viewer"]; ?>" data-focus="select-all">
  428.                         </div>
  429.                     </div>
  430.                     <div class="panel-share-input-label">
  431.                         <h4 class="title c5 grid-columns"><?php _se('Thumbnail URL'); ?></h4>
  432.                         <div class="c10 phablet-c1 grid-columns">
  433.                             <input type="text" class="text-input" value="<?php echo get_image()["thumb"]["url"]; ?>" data-focus="select-all">
  434.                         </div>
  435.                     </div>
  436.                     <?php
  437.                         if(get_image()["medium"]) {
  438.                     ?>
  439.                     <div class="panel-share-input-label">
  440.                         <h4 class="title c5 grid-columns"><?php _se('Medium URL'); ?></h4>
  441.                         <div class="c10 phablet-c1 grid-columns">
  442.                             <input type="text" class="text-input" value="<?php echo get_image()["medium"]["url"]; ?>" data-focus="select-all">
  443.                         </div>
  444.                     </div>
  445.                     <?php
  446.                         }
  447.                     ?>
  448.                 </div>
  449.  
  450.                 <?php
  451.                     $image_embed = array(
  452.                         "html" => '<img src="'.get_image()["url"].'" alt="'.get_image()["filename"].'" border="0" />'
  453.                     );
  454.                     $image_embed["bbcode"] = G\html_to_bbcode($image_embed["html"]);
  455.                 ?>
  456.  
  457.                 <div class="panel-share-item">
  458.                     <h4 class="pre-title"><?php _se('Image embed codes'); ?></h4>
  459.                     <div class="panel-share-input-label">
  460.                         <h4 class="title c5 grid-columns">HTML</h4>
  461.                         <div class="c10 phablet-c1 grid-columns">
  462.                             <input type="text" class="text-input" value="<?php echo htmlentities($image_embed["html"]); ?>" data-focus="select-all">
  463.                         </div>
  464.                     </div>
  465.                     <div class="panel-share-input-label">
  466.                         <h4 class="title c5 grid-columns">BBCode</h4>
  467.                         <div class="c10 phablet-c1 grid-columns">
  468.                             <input type="text" class="text-input" value="<?php echo $image_embed["bbcode"]; ?>" data-focus="select-all">
  469.                         </div>
  470.                     </div>
  471.                 </div>
  472.                
  473.                 <?php
  474.                     $image_embed_full['html'] = '<a href="'.get_image()["url_viewer"].'">'.$image_embed['html'].'</a>';
  475.                     $image_embed_full['bbcode'] = G\html_to_bbcode($image_embed_full["html"]);
  476.                 ?>
  477.                 <div class="panel-share-item">
  478.                     <h4 class="pre-title"><?php _se('Linked image'); ?> + <?php _se('Image embed codes'); ?></h4>
  479.                     <div class="panel-share-input-label">
  480.                         <h4 class="title c5 grid-columns">HTML</h4>
  481.                         <div class="c10 phablet-c1 grid-columns">
  482.                             <input type="text" class="text-input" value="<?php echo htmlentities($image_embed_full["html"]); ?>" data-focus="select-all">
  483.                         </div>
  484.                     </div>
  485.                     <div class="panel-share-input-label">
  486.                         <h4 class="title c5 grid-columns">BBCode</h4>
  487.                         <div class="c10 phablet-c1 grid-columns">
  488.                             <input type="text" class="text-input" value="<?php echo $image_embed_full["bbcode"]; ?>" data-focus="select-all">
  489.                         </div>
  490.                     </div>
  491.                 </div>
  492.                
  493.                 <?php
  494.                     if(get_image()["medium"]) {
  495.                         $image_embed_medium = array(
  496.                             "html" => '<a href="'.get_image()["url_viewer"].'"><img src="'.get_image()["medium"]["url"].'" alt="'.get_image()["filename"].'" border="0" /></a>'
  497.                         );
  498.                         $image_embed_medium["bbcode"] = G\html_to_bbcode($image_embed_medium["html"]);
  499.                 ?>
  500.                 <div class="panel-share-item">
  501.                     <h4 class="pre-title"><?php _se('Linked medium'); ?> + <?php _se('Image embed codes'); ?></h4>
  502.                     <div class="panel-share-input-label">
  503.                         <h4 class="title c5 grid-columns">HTML</h4>
  504.                         <div class="c10 phablet-c1 grid-columns">
  505.                             <input type="text" class="text-input" value="<?php echo htmlentities($image_embed_medium["html"]); ?>" data-focus="select-all">
  506.                         </div>
  507.                     </div>
  508.                     <div class="panel-share-input-label">
  509.                         <h4 class="title c5 grid-columns">BBCode</h4>
  510.                         <div class="c10 phablet-c1 grid-columns">
  511.                             <input type="text" class="text-input" value="<?php echo $image_embed_medium["bbcode"]; ?>" data-focus="select-all">
  512.                         </div>
  513.                     </div>
  514.                 </div>
  515.                 <?php
  516.                     }
  517.                 ?>
  518.                
  519.                 <?php
  520.                     $image_embed_thumbnail = array(
  521.                         "html" => '<a href="'.get_image()["url_viewer"].'"><img src="'.get_image()["thumb"]["url"].'" alt="'.get_image()["filename"].'" border="0" /></a>'
  522.                     );
  523.                     $image_embed_thumbnail["bbcode"] = G\html_to_bbcode($image_embed_thumbnail["html"]);
  524.                 ?>
  525.                 <div class="panel-share-item">
  526.                     <h4 class="pre-title"><?php _se('Linked thumbnail'); ?> + <?php _se('Image embed codes'); ?></h4>
  527.                     <div class="panel-share-input-label">
  528.                         <h4 class="title c5 grid-columns">HTML</h4>
  529.                         <div class="c10 phablet-c1 grid-columns">
  530.                             <input type="text" class="text-input" value="<?php echo htmlentities($image_embed_thumbnail["html"]); ?>" data-focus="select-all">
  531.                         </div>
  532.                     </div>
  533.                     <div class="panel-share-input-label">
  534.                         <h4 class="title c5 grid-columns">BBCode</h4>
  535.                         <div class="c10 phablet-c1 grid-columns">
  536.                             <input type="text" class="text-input" value="<?php echo $image_embed_thumbnail["bbcode"]; ?>" data-focus="select-all">
  537.                         </div>
  538.                     </div>
  539.                 </div>
  540.                
  541.             </div>
  542.            
  543.         </div>
  544.        
  545.         <?php
  546.             if(is_admin()) {
  547.         ?>
  548.         <div id="tab-full-info" class="tabbed-content">
  549.             <?php echo CHV\Render\arr_printer(get_image(), '<li><div class="c4 display-table-cell padding-right-10 font-weight-bold">%K</div> <div class="display-table-cell">%V</div></li>', ['<ul class="tabbed-content-list table-li">', '</ul>']); ?>
  550.         </div>
  551.         <?php
  552.             }
  553.         ?>
  554.        
  555.     </div>
  556.    
  557.     <?php
  558.         if(!get_image()['nsfw'] or (get_image()['nsfw'] and CHV\get_chv_setting('show_banners_in_nsfw'))) {
  559.             CHV\Render\show_banner('image_footer');
  560.         }
  561.     ?>
  562.    
  563. </div>
  564.  
  565. <!--googleoff: index-->
  566. <?php
  567.     if(is_owner() or is_admin()) {
  568. ?>
  569. <div data-modal="form-modal" class="hidden" data-submit-fn="CHV.fn.submit_image_edit" data-before-fn="CHV.fn.before_image_edit" data-ajax-deferred="CHV.fn.complete_image_edit" data-ajax-url="<?php echo G\get_base_url("json"); ?>">
  570.     <h1><?php _se('Edit image details'); ?></h1>
  571.     <div class="modal-form">
  572.         <?php
  573.             global $user_items_editor;
  574.             $user_items_editor = [
  575.                 'user_albums'   => get_image()['user']['albums'],
  576.                 'type'          => 'image',
  577.                 'album'         => get_image()['album'],
  578.                 'category_id'   => get_image()['category_id']
  579.             ];
  580.             G\Render\include_theme_file('snippets/form_image');
  581.         ?>
  582.     </div>
  583. </div>
  584. <?php
  585.     }
  586.  
  587.     global $share_modal;
  588.     $share_modal = array(
  589.         'type'          => 'image',
  590.         'url'           => get_image()['url_viewer'],
  591.         'links_array'   => $share_links_array,
  592.         'privacy'       => get_image()['album']['privacy']
  593.     );
  594.     G\Render\include_theme_file('snippets/modal_share');
  595.    
  596. ?>
  597. <!--googleon: index-->
  598.  
  599. <?php G\Render\include_theme_footer(); ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement