1. <?php
  2. /**
  3. * Author Template
  4. *
  5. * The template for displaying Author Profile pages.
  6. *
  7. * @package deTube
  8. * @subpackage Template
  9. * @since deTube 1.0
  10. */
  11.  
  12. /* Loads the "Author Filter Template" based on the query var "filter_type"
  13. * If current page has variable key "filter_type" in the query, load the appropriate template and return.
  14. */
  15. $filter_type = get_query_var('filter_type');
  16. if($filter_type == 'user_added') {
  17. get_template_part('author-added');A
  18. return;
  19. } elseif($filter_type == 'user_liked') {
  20. get_template_part('author-liked');
  21. return;
  22. }
  23.  
  24. // Get the ID of current user so we can use it later.
  25. $user_id = dp_get_queried_user_id();
  26.  
  27. get_header(); ?>
  28.  
  29. <div id="main"><div class="wrap cf">
  30.  
  31. <div id="content" role="main">
  32.  
  33. <?php // Author Box ?>
  34. <div class="author-box cf">
  35. <?php echo get_avatar($user_id, 150); ?>
  36.  
  37. <div class="data">
  38. <h1 class="display-name"><?php the_author_meta( 'display_name', $user_id ); ?></h1>
  39.  
  40. <div class="meta">
  41. <?php
  42. if($user_registered = get_the_author_meta( 'user_registered', $user_id ))
  43.  
  44. if($location = get_the_author_meta('location', $user_id))
  45. echo ' <span class="sep">/</span> <span class="location">'.$location.'</span>';
  46. ?>
  47. </div>
  48.  
  49. <?php if ( $desc = get_the_author_meta( 'description', $user_id ) ) echo '<div class="desc">'.wpautop($desc).'</div>'; ?>
  50.  
  51. <div class="links">
  52. <?php
  53. if($twitter = get_the_author_meta('twitter', $user_id))
  54. echo '<a class="twitter" href="'.$twitter.'"target="_blank">'.__('Twitter', 'dp').'</a> ';
  55. if($facebook = get_the_author_meta('facebook', $user_id))
  56. echo '<a class="facebook" href="'.$facebook.'"target="_blank">'.__('Facebook', 'dp').'</a> ';
  57. if($leaguepedia = get_the_author_meta('leaguepedia', $user_id))
  58. echo '<a class="leaguepedia" href="'.$leaguepedia.'"target="_blank">'.__('Leaguepedia', 'dp').'</a> ';
  59. if($twitch = get_the_author_meta('twitch', $user_id))
  60. echo '<a class="twitch" href="'.$twitch.'"target="_blank">'.__('Twitch', 'dp').'</a> ';
  61. if($own3d = get_the_author_meta('own3d', $user_id))
  62. echo '<a class="own3d" href="'.$own3d.'"target="_blank">'.__('Own3D', 'dp').'</a> ';
  63. if($website = get_the_author_meta('url', $user_id))
  64. echo '<a class="website" href="'.$website.'">'.preg_replace('[http://|https://]', '', $website).'</a> ';
  65. ?>
  66. </div>
  67.  
  68. </div><!-- #author-box .data -->
  69. </div><!-- #author-box -->
  70.  
  71. <?php
  72. $cats = get_option('dp_gamer_cats');
  73. if($cats) {
  74. $cats = explode(',', $cats);
  75. foreach($cats as $cat) {
  76. $link = add_query_arg(array('cat'=>$cat, 'author'=>$user_id));
  77.  
  78. $args = array(
  79. 'view' => 'grid-small',
  80. 'cat' => $cat,
  81. 'link' => $link,
  82. 'author' => $user_id,
  83. 'post_type' => 'post',
  84. 'ignore_sticky_posts' => true,
  85. 'posts_per_page' => 3
  86. );
  87. dp_section_box($args);
  88. }} ?>
  89. </div><!-- end #content -->
  90.  
  91. <?php get_sidebar(); ?>
  92.  
  93. </div></div><!-- end #main -->
  94.  
  95. <?php get_footer(); ?>