tribulant

gallery.php

Apr 26th, 2011
3,037
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 6.31 KB | None | 0 0
  1. <?php if (!empty($slides)) : ?>
  2.     <ul id="slideshow" style="display:none;">
  3.         <?php if ($frompost) : ?>
  4.             <?php foreach ($slides as $slide) : ?>
  5.                 <li>
  6.                     <h3><?php echo $slide -> post_title; ?></h3>
  7.                     <?php $full_image_href = wp_get_attachment_image_src($slide -> ID, 'full', false); ?>
  8.                     <span><?php echo $full_image_href[0]; ?></span>
  9.                     <p><?php echo $slide -> post_content; ?></p>
  10.                     <?php $thumbnail_link = wp_get_attachment_image_src($slide -> ID, 'thumbnail', false); ?>
  11.                     <?php if ($this -> get_option('thumbnails') == "Y") : ?>
  12.                         <?php if (!empty($slide -> guid)) : ?>
  13.                             <a href="<?php echo $slide -> guid; ?>" title="<?php echo $slide -> post_title; ?>"><img style="height:75px;" src="<?php echo $thumbnail_link[0]; ?>" alt="<?php echo $this -> Html -> sanitize($slide -> post_title); ?>" /></a>
  14.                         <?php else : ?>
  15.                             <img style="height:75px;" src="<?php echo $thumbnail_link[0]; ?>" alt="<?php echo $this -> Html -> sanitize($slide -> post_title); ?>" />
  16.                         <?php endif; ?>
  17.                     <?php else : ?>
  18.                         <a href="<?php echo $slide -> guid; ?>" title="<?php echo $slide -> post_title; ?>"></a>
  19.                     <?php endif; ?>
  20.                 </li>
  21.             <?php endforeach; ?>
  22.         <?php else : ?>
  23.             <?php foreach ($slides as $slide) : ?>     
  24.                 <li>
  25.                     <h3><?php echo $slide -> title; ?></h3>
  26.                     <span><?php echo rtrim(get_bloginfo('wpurl'), '/'); ?>/wp-content/uploads/<?php echo $this -> plugin_name; ?>/<?php echo $slide -> image; ?></span>
  27.                     <p><?php echo $slide -> description; ?></p>
  28.                     <?php if ($this -> get_option('thumbnails') == "Y") : ?>
  29.                         <?php if ($slide -> uselink == "Y" && !empty($slide -> link)) : ?>
  30.                             <a href="<?php echo $slide -> link; ?>" title="<?php echo $slide -> title; ?>"><img style="height:75px;" src="<?php echo $this -> Html -> image_url($this -> Html -> thumbname($slide -> image)); ?>" alt="<?php echo $this -> Html -> sanitize($slide -> title); ?>" /></a>
  31.                         <?php else : ?>
  32.                             <img style="height:75px;" src="<?php echo $this -> Html -> image_url($this -> Html -> thumbname($slide -> image)); ?>" alt="<?php echo $this -> Html -> sanitize($slide -> title); ?>" />
  33.                         <?php endif; ?>
  34.                     <?php else : ?>
  35.                         <a href="<?php echo $slide -> link; ?>" title="<?php echo $slide -> title; ?>"></a>
  36.                     <?php endif; ?>
  37.                 </li>
  38.             <?php endforeach; ?>
  39.         <?php endif; ?>
  40.     </ul>
  41.    
  42.     <div id="slideshow-wrapper">
  43.         <?php if ($this -> get_option('thumbnails') == "Y" && $this -> get_option('thumbposition') == "top") : ?>
  44.             <div id="thumbnails" class="thumbstop">
  45.                 <div id="slideleft" title="<?php _e('Slide Left', $this -> plugin_name); ?>"></div>
  46.                 <div id="slidearea">
  47.                     <div id="slider"></div>
  48.                 </div>
  49.                 <div id="slideright" title="<?php _e('Slide Right', $this -> plugin_name); ?>"></div>
  50.                 <br style="clear:both; visibility:hidden; height:1px;" />
  51.             </div>
  52.         <?php endif; ?>
  53.    
  54.         <div id="fullsize">
  55.             <div id="imgprev" class="imgnav" title="Previous Image"></div>
  56.             <div id="imglink"><!-- link --></div>
  57.             <div id="imgnext" class="imgnav" title="Next Image"></div>
  58.             <div id="image"></div>
  59.             <?php if ($this -> get_option('information') == "Y") : ?>
  60.                 <div id="information">
  61.                     <h3></h3>
  62.                     <p></p>
  63.                 </div>
  64.             <?php endif; ?>
  65.         </div>
  66.        
  67.         <?php if ($this -> get_option('thumbnails') == "Y" && $this -> get_option('thumbposition') == "bottom") : ?>
  68.             <div id="thumbnails" class="thumbsbot">
  69.                 <div id="slideleft" title="<?php _e('Slide Left', $this -> plugin_name); ?>"></div>
  70.                 <div id="slidearea">
  71.                     <div id="slider"></div>
  72.                 </div>
  73.                 <div id="slideright" title="<?php _e('Slide Right', $this -> plugin_name); ?>"></div>
  74.                 <br style="clear:both; visibility:hidden; height:1px;" />
  75.             </div>
  76.         <?php endif; ?>
  77.     </div>
  78.    
  79.     <script type="text/javascript">
  80.     jQuery.noConflict();
  81.     tid('slideshow').style.display = "none";
  82.     tid('slideshow-wrapper').style.display = 'block';
  83.     tid('slideshow-wrapper').style.visibility = 'hidden';  
  84.  
  85.  
  86.     /**
  87.      * issue #2: Bugfix for WebKit. Safari and similar browsers aren't capable to handle jQuery.ready() right. The problem
  88.      * here was, that sometimes the event was fired (if js is not available in browsers cache) too early, so that not all
  89.      * pictures were displayed in the thumbnail bar. I added a timeout to give the browser time to load the pictures.
  90.      * During that time I found it nice to display a spinner icon to give the visitor a hint that "somethings going on there".
  91.      * For this to display correctly I've added some lines to the css file too.
  92.      */
  93.  
  94.     // append the spinner
  95.     jQuery("#fullsize").append('<div id="spinner"><img src="<?php echo $this -> url(); ?>/images/spinner.gif"></div>');
  96.     tid('spinner').style.visibility = 'visible';
  97.  
  98.     var slideshow = new TINY.slideshow("slideshow");
  99.     jQuery(document).ready(function() {
  100.         // set a timeout before launching the slideshow
  101.         window.setTimeout(function() {
  102.             <?php if ($this -> get_option('autoslide')) : ?>slideshow.auto = true;<?php else : ?>slideshow.auto = false;<?php endif; ?>
  103.             slideshow.speed = <?php echo $this -> get_option('autospeed'); ?>;
  104.             slideshow.imgSpeed = <?php echo $this -> get_option('fadespeed'); ?>;
  105.             slideshow.navOpacity = <?php echo $this -> get_option('navopacity'); ?>;
  106.             slideshow.navHover = <?php echo $this -> get_option('navhover'); ?>;
  107.             slideshow.letterbox = "#000000";
  108.             slideshow.linkclass = "linkhover";
  109.             slideshow.info = "<?php echo ($this -> get_option('information') == "Y") ? 'information' : ''; ?>";
  110.             slideshow.infoSpeed = <?php echo $this -> get_option('infospeed'); ?>;
  111.             slideshow.thumbs = "<?php echo ($this -> get_option('thumbnails') == "Y") ? 'slider' : ''; ?>";
  112.             slideshow.thumbOpacity = <?php echo $this -> get_option('thumbopacity'); ?>;
  113.             slideshow.left = "slideleft";
  114.             slideshow.right = "slideright";
  115.             slideshow.scrollSpeed = <?php echo $this -> get_option('thumbscrollspeed'); ?>;
  116.             slideshow.spacing = <?php echo $this -> get_option('thumbspacing'); ?>;
  117.             slideshow.active = "<?php echo $this -> get_option('thumbactive'); ?>";
  118.             slideshow.imagesthickbox = "<?php echo ($this -> get_option('imagesthickbox') == "Y") ? 'true' : 'false'; ?>";
  119.             jQuery("#spinner").remove();
  120.             slideshow.init("slideshow","image","imgprev","imgnext","imglink");
  121.             tid('slideshow-wrapper').style.visibility = 'visible';
  122.         }, 1000);
  123.     });
  124.     </script>
  125. <?php endif; ?>
Advertisement
Add Comment
Please, Sign In to add comment