[ Index ]

PHP Cross Reference of PageLines DMS

title

Body

[close]

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

   1  <?php
   2  /*
   3      Section: PostAuthor
   4      Author: PageLines
   5      Author URI: http://www.pagelines.com
   6      Description: Adds author information to pages and posts.
   7      Class Name: PageLinesPostAuthor
   8      Workswith: main-single, author
   9      Failswith: archive, category, posts, tags, search, 404_page
  10      Filter: component
  11      Loading: active
  12  */
  13  
  14  /**
  15   * Post Author Section
  16   *
  17   * @package PageLines DMS
  18   * @author PageLines
  19   */
  20  class PageLinesPostAuthor extends PageLinesSection {
  21  
  22  	function section_opts(){
  23          global $post;
  24  
  25          if(!$post || !is_object($post))
  26              return '';
  27  
  28          $author_id = $post->post_author;
  29  
  30          $opts = array(
  31              array(
  32                  'key'    => 'author_setup',
  33                  'type'    => 'link',
  34                  'url'    => admin_url( 'user-edit.php?user_id='.$author_id ),
  35                  'title'    => __( 'Author Setup', 'pagelines' ),
  36                  'label'        => '<i class="icon-edit"></i> Edit Author Info',
  37                  'help'        => __( "This section uses the author's profile information. Set that in your admin.", 'pagelines' ),
  38              )
  39          );
  40  
  41          return $opts;
  42      }
  43  
  44      /**
  45      * Section template.
  46      */
  47     function section_template() {
  48      global $post;
  49      setup_postdata($post);
  50  
  51      ob_start();
  52          the_author_meta('url');
  53      $link = ob_get_clean();
  54  
  55          $default_avatar = PL_IMAGES . '/avatar_default.gif';
  56          $author_email = get_the_author_meta('email', $post->post_author);
  57          $author_name = get_the_author();
  58          $author_desc = get_the_author_meta('description', $post->post_author);
  59          $google_profile = get_the_author_meta( 'google_profile' );
  60  ?>
  61          <div class="media author-info">
  62              <div class="img thumbnail author-thumb">
  63                  <a class="thumbnail" href="<?php echo $link; ?>" target="_blank">
  64                      <?php echo get_avatar( $author_email, '120', $default_avatar); ?>
  65                  </a>
  66              </div>
  67              <div class="bd">
  68                  <small class="author-note"><?php _e('Author', 'pagelines');?></small>
  69                  <h2>
  70                      <?php echo $author_name ?>
  71                  </h2>
  72                  <p><?php echo $author_desc; ?></p>
  73                  <p class="author-details">
  74                      <?php
  75  
  76                      if( $link != '' )
  77                          printf( '<a href="%s" class="btn" target="_blank"><i class="icon-external-link"></i> %s</a> ', $link, __( 'Visit Authors Website &rarr;', 'pagelines') );
  78  
  79                      if ( $google_profile )
  80                          printf( '<a href="%s" class="btn" rel="me"><i class="icon-google-plus"></i> %s</a>',  $google_profile, __( 'Authors Google Profile &rarr;', 'pagelines' ) );
  81  
  82                      ?>
  83                  </p>
  84              </div>
  85  
  86          </div>
  87          <div class="clear"></div>
  88  <?php    }
  89  }


Generated: Sun Dec 1 19:43:16 2013 Cross-referenced by PHPXref 0.7.1