Ejemplo n.º 1
0
 /**
  * LazyestFrontend::create_navigation()
  * Show the navigation breadcrumb trail
  * 
  * @uses apply_filters()
  * @uses get_bloginfo()
  * @uses get_the_title()
  * @uses trailingslashit()
  * @return void
  */
 function create_navigation()
 {
     global $post;
     $nav = explode('/', untrailingslashit($this->currentdir));
     $path = pathinfo($this->file);
     $current = '';
     $now_viewing = apply_filters('lazyest_now_viewing', __(' Now viewing: ', 'lazyest-gallery'));
     $sep = $this->_sep();
     $navigator = sprintf('<div class="top_navigator">%s <a href="%s">%s</a> <span class="raquo">%s</span> <a href="%s">%s</a>', $now_viewing, home_url(), get_bloginfo('name'), $sep, $this->uri(), get_the_title($post->ID));
     if ($nav[0] != '') {
         foreach ($nav as $n) {
             $current .= trailingslashit($n);
             $folder = new LazyestFrontendFolder($current);
             $folder->open();
             $navigator .= sprintf(' <span class="raquo">%s</span> <a href="%s">%s</a> ', $sep, $folder->uri(), $folder->title());
             unset($folder);
         }
     }
     if (!is_dir(untrailingslashit($this->root . $this->file))) {
         $folder = new LazyestFolder($this->currentdir);
         if ($folder->valid()) {
             $image = $folder->single_image($path['basename']);
             $navigator .= sprintf(' <span class="raquo">%s</span> <a href="%s">%s</a>', $sep, $image->uri(), $image->title());
         }
         unset($folder);
     }
     $navigator .= "</div>\n";
     echo apply_filters('lazyest_navigator', $navigator);
 }
Ejemplo n.º 2
0
 /**
  * LazyestCommentor::redirect_comment()
  * 
  * @return
  */
 function redirect_comment()
 {
     if (is_admin()) {
         return;
     }
     global $lg_gallery, $lg_comment;
     if (isset($lg_comment)) {
         $lg_gallery->comment = $lg_comment;
     } else {
         if (isset($_GET['lg_comment'])) {
             $lg_gallery->comment = $_GET['lg_comment'];
         }
     }
     if ('' != $lg_gallery->comment) {
         $comment_ID = $lg_gallery->comment;
         $filevar = urldecode($this->get_file_by_comment_id($comment_ID));
         $redirect = $lg_gallery->address;
         if ($lg_gallery->is_folder($filevar)) {
             $folder = new LazyestFrontendFolder($filevar);
             if ($folder->valid()) {
                 $redirect = $folder->uri();
             }
             unset($folder);
         }
         if ($lg_gallery->is_image($filevar)) {
             $folder = new LazyestFrontendFolder(dirname($filevar));
             if ($folder->valid()) {
                 $slide = $folder->single_image(basename($filevar), 'slides');
                 $redirect = $slide->uri();
                 unset($slide);
             }
         }
         wp_redirect($redirect);
         exit;
     }
 }