public
anonymous / gist:4165936
Created

DeTube Author Page

  • Download Gist
gistfile1.txt
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78
<?php
/**
* Author Template
*
* The template for displaying Author Profile pages.
*
* @package deTube
* @subpackage Template
* @since deTube 1.0
*/
 
/* Loads the "Author Filter Template" based on the query var "filter_type"
* If current page has variable key "filter_type" in the query, load the appropriate template and return.
*/
$filter_type = get_query_var('filter_type');
if($filter_type == 'user_added') {
get_template_part('author-added');
return;
} elseif($filter_type == 'user_liked') {
get_template_part('author-liked');
return;
}
 
// Get the ID of current user so we can use it later.
$user_id = dp_get_queried_user_id();
 
 
get_header(); ?>
 
<div id="main"><div class="wrap cf">
 
<div id="content" role="main">
<?php // Author Box ?>
<div id="item-header" role="complementary">
 
<?php locate_template( array( 'members/single/member-header.php' ), true ); ?>
 
</div><!-- #item-header -->
<?php // Recently Added
$link = add_query_arg('filter_type', 'user_added', get_author_posts_url($user_id));
$args = array(
'view' => 'grid-medium',
'title' => __('Recently Added', 'dp'),
'link' => $link,
'author' => $user_id,
'post_type' => 'post',
'ignore_sticky_posts' => true,
'posts_per_page' => 2
);
dp_section_box($args);
?>
<?php // Liked Videos
$link = add_query_arg('filter_type', 'user_liked', get_author_posts_url($user_id));
$args = array(
'view' => 'grid-small',
'title' => __('Liked Videos', 'dp'),
'link' => $link,
'post_type' => 'post',
'ignore_sticky_posts' => true,
'posts_per_page' => 6,
'filter_type' => 'user_liked',
'filter_user' => $user_id
);
dp_section_box($args);
?>
</div><!-- end #content -->
<!-- DO NOT REMOVE! <?php bp_profile_field_data( array('user_id'=>get_the_author_meta( 'ID' ),'field'=>'About Me' )); ?>-->
<?php get_sidebar(); ?>
 
</div></div><!-- end #main -->
 
<?php get_footer(); ?>

Please sign in to comment on this gist.

Something went wrong with that request. Please try again.