[ Index ]

PHP Cross Reference of PageLines Framework

title

Body

[close]

/sections/postsinfo/ -> section.php (source)

   1  <?php
   2  /*
   3      Section: Posts Info
   4      Author: PageLines
   5      Author URI: http://www.pagelines.com
   6      Description: Shows information about posts being viewed (e.g. "Currently Viewing Archives from...")
   7      Class Name: PageLinesPostsInfo
   8      Workswith: main
   9  */
  10  
  11  /**
  12   * Posts Info Section
  13   *
  14   * @package PageLines Framework
  15   * @author PageLines
  16   */
  17  class PageLinesPostsInfo extends PageLinesSection {
  18  
  19      /**
  20      * Section template.
  21      */
  22     function section_template() {
  23  
  24          if( is_category() || is_archive() || is_search() || is_author() ):
  25              echo '<div class="current_posts_info">';
  26              if( is_search() ):
  27                  printf( '%s <strong>"%s"</strong>', __( 'Search results for', 'pagelines' ), get_search_query() );
  28              elseif( is_category() ):
  29                  printf( '%s <strong>"%s"</strong>', __( 'Currently viewing the category:', 'pagelines' ), single_cat_title( false, false ) );
  30              elseif( is_tag() ):
  31                  printf( '%s <strong>"%s"</strong>', __( 'Currently viewing the tag:', 'pagelines' ), single_tag_title( false, false ) );
  32              elseif( is_archive() ):
  33  
  34                  if (is_author()) {
  35                      global $author;
  36                      global $author_name;
  37                      $curauth = ( isset( $_GET['author_name'] ) ) ? get_user_by( 'slug', $author_name ) : get_userdata( intval( $author ) );
  38                      printf( '%s <strong>"%s"</strong>', __( 'Posts by:', 'pagelines' ), $curauth->display_name );
  39                  } elseif ( is_day() ) {
  40                      printf( '%s <strong>"%s"</strong>', __( 'From the daily archives:', 'pagelines' ), get_the_time('l, F j, Y') );
  41                  } elseif ( is_month() ) {
  42                      printf( '%s <strong>"%s"</strong>', __( 'From the monthly archives:', 'pagelines' ), get_the_time('F Y') );
  43                  } elseif ( is_year() ) {
  44                      printf( '%s <strong>"%s"</strong>', __( 'From the yearly archives:', 'pagelines' ), get_the_time('Y') );
  45                  } else {
  46                      if ( is_post_type_archive() )
  47                          $title =  post_type_archive_title( null,false );
  48                      if ( ! isset( $title ) ) {
  49                          $o = get_queried_object();
  50                          if ( isset( $o->name ) )
  51                              $title = $o->name;
  52                      }
  53                      if ( ! isset( $title ) )
  54                          $title = the_date();
  55                      printf( '%s <strong>"%s"</strong>', __( 'Viewing archives for ', 'pagelines'), $title );
  56                  }
  57                  endif;
  58              echo '</div>';
  59          endif;
  60      }
  61  }


Generated: Sat Apr 6 23:00:27 2013 Cross-referenced by PHPXref 0.7.1