- Subida a producción de la maqueta

- Inicio de página de perfil


git-svn-id: https://192.168.0.254/svn/Proyectos.ASong2U_Web/trunk@11 cd1a4ea2-8c7f-e448-aada-19d1fee9e1d6
This commit is contained in:
David Arranz 2012-07-17 16:19:40 +00:00
parent 7b86e371eb
commit 00eba73c22
13 changed files with 253 additions and 85 deletions

View File

@ -106,35 +106,52 @@ class BP_Dedication extends BP_Component {
} */
}
function get_count_dedications_from_user($user_id) {
$dedications = bp_dedication_get_dedications_from_user($user_id);
return count($dedications);
}
function get_count_dedications_to_user($user_id) {
$dedications = bp_dedication_get_dedications_to_user($user_id);
return count($dedications);
}
function setup_nav() {
$main_nav = array(
'name' => __('Dedications', 'bp-dedication'),
'slug' => bp_get_dedication_slug(),
'position' => 80,
'screen_function' => 'bp_dedication_my_dedications',
'default_subnav_slug' => 'my-dedications'
'screen_function' => 'bp_dedication_index',
'default_subnav_slug' => 'dedication-profile'
);
$dedication_link = trailingslashit(bp_displayed_user_domain() . bp_get_dedication_slug());
$sub_nav[] = array(
'name' => __('Profile', 'bp-dedication'),
'slug' => 'dedication-profile',
'parent_url' => $dedication_link,
'parent_slug' => bp_get_dedication_slug(),
'screen_function' => 'bp_dedication_index',
'position' => 10
);
// Add a few subnav items under the main Example tab
$sub_nav[] = array(
'name' => __('My dedications', 'bp-dedication'),
'slug' => 'my-dedications',
'parent_url' => $dedication_link,
'parent_slug' => bp_get_dedication_slug(),
'screen_function' => 'bp_dedication_my_dedications',
'position' => 10
'position' => 20
);
// Add the subnav items to the friends nav item
$sub_nav[] = array(
'name' => __('Dedicated 2u', 'bp-dedication'),
'slug' => 'dedicated-2u',
'parent_url' => $dedication_link,
'parent_slug' => bp_get_dedication_slug(),
'screen_function' => 'bp_dedication_dedications_to_me',
'position' => 20
'position' => 30
);
if (bp_displayed_user_id() == bp_loggedin_user_id()) {
@ -144,7 +161,7 @@ class BP_Dedication extends BP_Component {
'parent_url' => $dedication_link,
'parent_slug' => bp_get_dedication_slug(),
'screen_function' => 'bp_dedication_new_dedication',
'position' => 30
'position' => 40
);
}

View File

@ -14,6 +14,36 @@ function bp_dedication_directory_setup() {
}
add_action( 'bp_screens', 'bp_dedication_directory_setup' );
function bp_dedication_index() {
global $bp;
do_action( 'bp_dedication_index' );
add_action( 'bp_template_title', 'bp_dedication_index_title' );
add_action( 'bp_template_content', 'bp_dedication_index_content' );
bp_core_load_template( apply_filters( 'bp_core_template_plugin', 'dedications/index' ) );
}
function bp_dedication_index_title() {
?>
<h4><?php _e( 'My dedications', 'bp-dedication' ); ?>
<?php
}
function bp_dedication_index_content() {
if (!locate_template( 'dedications/single/home.php', true )) {
die();
}
/**
* For security reasons, we MUST use the wp_nonce_url() function on any actions.
* This will stop naughty people from tricking users into performing actions without their
* knowledge or intent.
*/
//$send_link = wp_nonce_url( $bp->displayed_user->domain . $bp->current_component . '/screen-one/send-h5', 'bp_example_send_high_five' );
}
function bp_dedication_my_dedications() {
global $bp;

View File

@ -9,42 +9,20 @@
<?php global $bp, $post, $gp_settings; ?>
<?php get_header( 'buddypress' ); ?>
<?php locate_template( array( 'video-slider.php' ), true ); ?>
<div id="content<?php if ( !bp_is_current_action( 'new-dedication' ) ) { ?> fullwidth<?php } ?>">
<div class="padder">
<?php do_action('bp_before_member_plugin_template'); ?>
<?php if (bp_displayed_user_id() != bp_loggedin_user_id()) { ?>
<div id="item-header">
<?php locate_template(array('members/single/member-header.php'), true); ?>
</div> <!-- #item-header -->
<?php } ?>
<div id="item-nav">
<div class="item-list-tabs no-ajax" id="object-nav" role="navigation">
<ul>
<?php bp_get_displayed_user_nav(); ?>
<?php do_action( 'bp_member_options_nav' ); ?>
</ul>
</div>
</div><!-- #item-nav -->
<div id="item-body" role="main">
<?php do_action( 'bp_before_member_body' ); ?>
<div class="item-list-tabs no-ajax" id="subnav">
<ul>
<?php bp_get_options_nav(); ?>
<?php do_action( 'bp_member_plugin_options_nav' ); ?>
</ul>
</div><!-- .item-list-tabs -->
<h3><?php do_action( 'bp_template_title' ); ?></h3>
<?php do_action( 'bp_template_content' ); ?>

View File

@ -0,0 +1,45 @@
<?php
global $bp, $post, $gp_settings;
require(ghostpool_inc . 'options.php');
$dedications = bp_dedication_get_dedications_from_user($bp->displayed_user->id);
?>
<?php foreach ($dedications as $post) : ?>
<?php setup_postdata($post); ?>
<?php
$gp_settings['thumbnail_width'] = $theme_cat_thumbnail_width;
$gp_settings['thumbnail_height'] = $theme_cat_thumbnail_height;
?>
<?php include(dirname(__FILE__).'/../../loop-dedication-data.php'); ?>
<div <?php post_class('post-loop'); ?>>
<!--Begin Image-->
<?php if (has_post_thumbnail()) { ?>
<div class="post-thumbnail<?php if ($gp_settings['image_wrap'] == "Disable") { ?> thumbnail-no-wrap<?php } ?>">
<a href="<?php the_permalink(); ?>" title="<?php the_title(); ?>">
<?php $image = vt_resize(get_post_thumbnail_id(), '', $gp_settings['image_width'], $gp_settings['image_height'], true); ?>
<img src="<?php echo $image[url]; ?>" alt="<?php if (get_post_meta(get_post_thumbnail_id(), '_wp_attachment_image_alt', true)) {
echo get_post_meta(get_post_thumbnail_id(), '_wp_attachment_image_alt', true);
} else {
echo get_the_title();
} ?>" />
</a>
</div>
<?php } ?>
<!--End Image-->
<!--Begin Post Text-->
<div class="post-text">
<h2><a href="<?php the_permalink(); ?>" title="<?php echo $gp_settings['artist_song']; ?>"><span><?php echo $gp_settings['artist']; ?></span>.&nbsp;<?php echo $gp_settings['song']; ?></a></h2>
<?php echo $gp_settings['to_flag']; ?>
<span>TO: <?php echo $gp_settings['to_user_link']; ?></span>
</div>
<!--End Post Text-->
</div>
<?php endforeach; ?>
<?php wp_reset_postdata(); ?>

View File

@ -64,13 +64,19 @@
</ul>
<?php endif; ?>
<?php if ( is_user_logged_in() ) : ?>
<?php if(bp_is_home() || bp_is_group()) : ?>
<div id="header-profile">
<?php locate_template( array( 'members/single/small-member-header.php' ), true ); ?>
</div>
<?php endif; ?>
<?php endif; ?>
<!--Begin Header Bottom-->
<div id="header-bottom">
<?php if ( is_user_logged_in() ) : ?>
<?php if(is_home() || is_front_page() || (is_single() && in_category('dedication'))) { ?>
<?php if(1) { /*is_home() || is_front_page() || (is_single() && in_category('dedication'))) {*/ ?>
<div id="dedication-data-panel" class="columns twothirds first text-left"></div>
<?php } else { ?>
<?php if(bp_is_home() || bp_is_group()) { locate_template( array( 'buddypress/member-header.php' ), true ); } ?>
<?php } ?>
<?php if($theme_search_form == "0") { ?>
<div id="search-panel" class="columns onethird last">

View File

@ -261,6 +261,23 @@ $options = array(
),
"type" => "select"),
array("type" => "close"),
array("name" => __('Video Slider Settings', 'gp_lang'),
"type" => "title"),
array("type" => "open",
"id" => $shortname . "_video_slider_settings"),
array(
"name" => __('Number Of Slides', 'gp_lang'),
"desc" => __('The number of slides to display (set to -1 to display all slides).', 'gp_lang'),
"id" => $shortname . "_video_slides",
"std" => "5",
"type" => "text",
"size" => "small"),
array("type" => "close"),
array("name" => __('Slider Settings', 'gp_lang'),
"type" => "title"),
array("type" => "open",
@ -314,6 +331,8 @@ $options = array(
"type" => "text",
"size" => "small"),
array("type" => "close"),
array("name" => __('Homepage Settings', 'gp_lang'),
"type" => "title"),
array("type" => "open",

View File

@ -3,6 +3,10 @@
// Load the default BuddyPress AJAX functions
require_once(BP_PLUGIN_DIR . '/bp-themes/bp-default/_inc/ajax.php');
if (bp_is_active('dedications')) :
define("BP_DEFAULT_COMPONENT","dedications");
endif;
$countries_array = array(
'AF' => 'Afghanistan',
'AX' => 'Aland Islands',
@ -453,6 +457,9 @@ function remove_xprofile_links() {
add_action('bp_init', 'remove_xprofile_links');
function check_country_field() {
global $wpdb;
global $countries_array;

View File

@ -17,19 +17,18 @@
<?php if (bp_displayed_user_id() != bp_loggedin_user_id()) { ?>
<div id="item-header" role="complementary">
<?php locate_template( array( 'members/single/member-header.php' ), true ); ?>
</div><!-- #item-header -->
</div>
<?php } ?>
<?php if (0) { ?>
<div id="item-nav">
<div class="item-list-tabs no-ajax" id="object-nav" role="navigation">
<ul>
<?php bp_get_displayed_user_nav(); ?>
<?php do_action( 'bp_member_options_nav' ); ?>
</ul>
</div>
<div class="item-list-tabs no-ajax" id="object-nav" role="navigation">
<ul>
<?php bp_get_displayed_user_nav(); ?>
<?php do_action( 'bp_member_options_nav' ); ?>
</ul>
</div>
</div><!-- #item-nav -->
<? } ?>
<div id="item-body">

View File

@ -19,6 +19,7 @@
</a>
</div><!-- #item-header-avatar -->
<div id="item-header-content">
<h2>

View File

@ -10,39 +10,33 @@
?>
<?php if ( bp_is_my_profile() ) : ?>
<div class="item-list-tabs no-ajax" id="subnav" role="navigation">
<div class="item-list-tabs no-ajax" id="subnav" role="navigation">
<ul>
<?php bp_get_options_nav(); ?>
</ul>
</div><!-- .item-list-tabs -->
<?php endif; ?>
<?php do_action( 'bp_before_profile_content' ); ?>
<div class="profile" role="main">
<?php
// Profile Edit
if ( bp_is_current_action( 'edit' ) )
locate_template( array( 'members/single/profile/edit.php' ), true );
<?php
// Profile Edit
if ( bp_is_current_action( 'edit' ) )
locate_template( array( 'members/single/profile/edit.php' ), true );
// Change Avatar
elseif ( bp_is_current_action( 'change-avatar' ) )
locate_template( array( 'members/single/profile/change-avatar.php' ), true );
// Change Avatar
elseif ( bp_is_current_action( 'change-avatar' ) )
locate_template( array( 'members/single/profile/change-avatar.php' ), true );
// Display XProfile
elseif ( bp_is_active( 'xprofile' ) )
locate_template( array( 'members/single/profile/profile-loop.php' ), true );
// Display WordPress profile (fallback)
else
locate_template( array( 'members/single/profile/profile-wp.php' ), true );
?>
// Display XProfile
elseif ( bp_is_active( 'xprofile' ) )
locate_template( array( 'members/single/profile/profile-loop.php' ), true );
// Display WordPress profile (fallback)
else
locate_template( array( 'members/single/profile/profile-wp.php' ), true );
?>
</div><!-- .profile -->
<?php do_action( 'bp_after_profile_content' ); ?>

View File

@ -0,0 +1,25 @@
<?php
/**
* BuddyPress - Users Header
*
* @package BuddyPress
* @subpackage bp-default
*/
?>
<?php global $bp; ?>
<div class="columns twothirds first text-left">
<div id="item-header-avatar" class="columns onefourth first text-left">
<a href="<?php echo bp_get_loggedin_user_link(); ?>"><?php bp_loggedin_user_avatar(array('width' => 77, 'height' => 77)); ?></a>
</div>
<div class="columns threefourths last text-left">
<span class="user-nicename"><a href="<?php echo bp_get_loggedin_user_link(); ?>"><?php bp_loggedin_user_fullname(); ?></a></span>
<div id="item-meta">
<?php if (bp_is_active('dedications')) : ?>
<div class="my-dedications"><?php _e('My dedications:'); ?>&nbsp;<?php echo $bp->dedications->get_count_dedications_from_user(bp_current_user_id()); ?></div>
<div class="dedicated-to-me"><?php _e('Dedicated to me:'); ?>&nbsp;<?php echo $bp->dedications->get_count_dedications_to_user(bp_current_user_id()); ?></div>
<?php endif; ?>
</div><!-- #item-meta -->
</div>
</div>

View File

@ -9,7 +9,7 @@ body {
/* Text Styling */
a {
color: #4b8cc6;
color: #576a7b; /*#4b8cc6;*/
}
a:hover {
color: #325670;
@ -59,6 +59,25 @@ input[type="submit"]:hover, input[type="reset"]:hover, input[type="button"]:hove
overflow: hidden;
height: 42px;
}
#header-profile {
clear: both;
background: none;
padding: 0;
width: 100%;
overflow: hidden;
height: 85px;
font-size: 13px;
line-height: 110%;
}
#header-profile .user-nicename {
font-weight: bold;
font-size: 13px !important;
}
/* Logo */
#logo span {
}
@ -287,7 +306,7 @@ ul.navmenu li a.profile {
height: 100%;
}
#dedicationFooter_container .last .button {
#dedicationFooter_container .button {
float: right;
margin-left: 5px;
margin-top: 48px;
@ -295,6 +314,7 @@ ul.navmenu li a.profile {
font-size: 13px;
font-weight: bold;
padding: 3px 0;
line-height: 19px;
}
#dedicationFooter_container h3 {
@ -575,7 +595,6 @@ ul.navmenu li a.profile {
.widget.top_members .post-loop,
.widget.sidebarposts .post-loop {
width: 100% !important;
max-height: 150px;
min-height: 150px;
margin: 0;
padding-bottom: 0;
@ -833,8 +852,8 @@ h3.comments {
.messages.bp-wrapper .avatar,
.bp-wrapper .thread-avatar .avatar,
.item-list li .avatar {
width: 150px;
height: 150px;
width: 50px;
height: 50px;
}
.activity-comments .avatar,
@ -844,6 +863,14 @@ h3.comments {
height: 50px;
}
#members-list .item-avatar .avatar,
#groups-list .item-avatar .avatar {
width: 150px;
height: 150px;
}
.activity-comments .ac-reply-content {
margin-left: 85px;
}
@ -878,13 +905,15 @@ h3.comments {
font-size: 12px;
}
#header-bottom #item-header-avatar {
#header-profile #item-header-avatar {
width: 80px;
margin-right: 15px;
}
#header-bottom #item-header-avatar .avatar {
height: 50px;
width: 50px;
#header-profile #item-header-avatar .avatar {
height: 77px;
width: 77px;
}
#sidebar .my-groups-list .item-avatar .avatar {
@ -909,7 +938,7 @@ color: #325670;
.bbPress #content div#item-header .updated {
color: #077dc8;
}
#content-wrapper .widget input[type="button"],
/*#content-wrapper .widget input[type="button"],
#content-wrapper .widget input[type="submit"],
#content-wrapper .widget input[type="reset"],
#content-wrapper .widget input[type="file"],
@ -938,7 +967,7 @@ color: #077dc8;
.bp-wrapper #content-wrapper div.item-list-tabs ul li a:hover span,
.bp-wrapper #content-wrapper .activity-meta a span {
background: #273138;
}
}*/
#members-list li {
width: 50%;

View File

@ -1,15 +1,18 @@
<!--Begin Slider-->
<?php
require(ghostpool_inc . 'options.php');
if ( is_user_logged_in() ):
global $gp_settings, $current_user, $bp;
get_currentuserinfo();
if (is_home() || is_front_page()) {
//if (is_home() || is_front_page()) {
$posts_per_page = $theme_video_slides;
$dedication_orderby = "date";
$dedication_order = "DESC";
$posts_per_page = 5;
$category_name = 'dedication';
$post_status = array('publish', 'private');
@ -17,13 +20,15 @@ if (is_home() || is_front_page()) {
'post_type' => array('post'),
'order' => $dedication_order,
'orderby' => $dedication_orderby,
'posts_per_page' => $posts_per_page,
'posts_per_page' => -1,
'post_status' => $post_status,
'category_name' => $category_name,
);
query_posts($args);
}
//}
query_posts($args);
if (have_posts()) {
@ -51,16 +56,29 @@ if (have_posts()) {
<?php
while (have_posts()) : the_post();
// Si ya hemos visto más de 'posts_per_page' dedicatorias, salgo del buble
if ($slide_counter == $posts_per_page) {
break;
}
$from_user_id = get_the_author_meta('ID');
$to_user_email = get_post_meta($post->ID, 'ghostpool_destination_user_email', true);
$to_user = get_post_meta($post->ID, 'ghostpool_destination_user', true);
// Usuario actual puede ver la dedicatoria?
if (get_post_status($post-ID) == 'private') {
if (($current_user->ID != $from_user_id) && ($current_user->user_email != $to_user_email)) {
continue; // me salto esta dedicatoria
}
}
// En el perfil del usuario sólo mostrar las dedicadas por él y para él. El resto se descartan.
if ( bp_is_my_profile() ) {
if (($current_user->ID != $from_user_id) && ($current_user->user_email != $to_user_email)) {
continue; // me salto esta dedicatoria
}
}
$video = get_post_meta($post->ID, 'ghostpool_dedication_url', true);
$artist = get_post_meta($post->ID, 'ghostpool_dedication_artist', true);