- 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() { function setup_nav() {
$main_nav = array( $main_nav = array(
'name' => __('Dedications', 'bp-dedication'), 'name' => __('Dedications', 'bp-dedication'),
'slug' => bp_get_dedication_slug(), 'slug' => bp_get_dedication_slug(),
'position' => 80, 'position' => 80,
'screen_function' => 'bp_dedication_my_dedications', 'screen_function' => 'bp_dedication_index',
'default_subnav_slug' => 'my-dedications' 'default_subnav_slug' => 'dedication-profile'
); );
$dedication_link = trailingslashit(bp_displayed_user_domain() . bp_get_dedication_slug()); $dedication_link = trailingslashit(bp_displayed_user_domain() . bp_get_dedication_slug());
// Add a few subnav items under the main Example tab $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
);
$sub_nav[] = array( $sub_nav[] = array(
'name' => __('My dedications', 'bp-dedication'), 'name' => __('My dedications', 'bp-dedication'),
'slug' => 'my-dedications', 'slug' => 'my-dedications',
'parent_url' => $dedication_link, 'parent_url' => $dedication_link,
'parent_slug' => bp_get_dedication_slug(), 'parent_slug' => bp_get_dedication_slug(),
'screen_function' => 'bp_dedication_my_dedications', 'screen_function' => 'bp_dedication_my_dedications',
'position' => 10 'position' => 20
); );
// Add the subnav items to the friends nav item
$sub_nav[] = array( $sub_nav[] = array(
'name' => __('Dedicated 2u', 'bp-dedication'), 'name' => __('Dedicated 2u', 'bp-dedication'),
'slug' => 'dedicated-2u', 'slug' => 'dedicated-2u',
'parent_url' => $dedication_link, 'parent_url' => $dedication_link,
'parent_slug' => bp_get_dedication_slug(), 'parent_slug' => bp_get_dedication_slug(),
'screen_function' => 'bp_dedication_dedications_to_me', 'screen_function' => 'bp_dedication_dedications_to_me',
'position' => 20 'position' => 30
); );
if (bp_displayed_user_id() == bp_loggedin_user_id()) { if (bp_displayed_user_id() == bp_loggedin_user_id()) {
@ -144,7 +161,7 @@ class BP_Dedication extends BP_Component {
'parent_url' => $dedication_link, 'parent_url' => $dedication_link,
'parent_slug' => bp_get_dedication_slug(), 'parent_slug' => bp_get_dedication_slug(),
'screen_function' => 'bp_dedication_new_dedication', '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' ); 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() { function bp_dedication_my_dedications() {
global $bp; global $bp;

View File

@ -10,41 +10,19 @@
<?php get_header( 'buddypress' ); ?> <?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 id="content<?php if ( !bp_is_current_action( 'new-dedication' ) ) { ?> fullwidth<?php } ?>">
<div class="padder"> <div class="padder">
<?php do_action('bp_before_member_plugin_template'); ?> <?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"> <div id="item-body" role="main">
<?php do_action( 'bp_before_member_body' ); ?> <?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> <h3><?php do_action( 'bp_template_title' ); ?></h3>
<?php do_action( 'bp_template_content' ); ?> <?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> </ul>
<?php endif; ?> <?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--> <!--Begin Header Bottom-->
<div id="header-bottom"> <div id="header-bottom">
<?php if ( is_user_logged_in() ) : ?> <?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> <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 } ?>
<?php if($theme_search_form == "0") { ?> <?php if($theme_search_form == "0") { ?>
<div id="search-panel" class="columns onethird last"> <div id="search-panel" class="columns onethird last">

View File

@ -261,6 +261,23 @@ $options = array(
), ),
"type" => "select"), "type" => "select"),
array("type" => "close"), 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'), array("name" => __('Slider Settings', 'gp_lang'),
"type" => "title"), "type" => "title"),
array("type" => "open", array("type" => "open",
@ -314,6 +331,8 @@ $options = array(
"type" => "text", "type" => "text",
"size" => "small"), "size" => "small"),
array("type" => "close"), array("type" => "close"),
array("name" => __('Homepage Settings', 'gp_lang'), array("name" => __('Homepage Settings', 'gp_lang'),
"type" => "title"), "type" => "title"),
array("type" => "open", array("type" => "open",

View File

@ -3,6 +3,10 @@
// Load the default BuddyPress AJAX functions // Load the default BuddyPress AJAX functions
require_once(BP_PLUGIN_DIR . '/bp-themes/bp-default/_inc/ajax.php'); 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( $countries_array = array(
'AF' => 'Afghanistan', 'AF' => 'Afghanistan',
'AX' => 'Aland Islands', 'AX' => 'Aland Islands',
@ -453,6 +457,9 @@ function remove_xprofile_links() {
add_action('bp_init', 'remove_xprofile_links'); add_action('bp_init', 'remove_xprofile_links');
function check_country_field() { function check_country_field() {
global $wpdb; global $wpdb;
global $countries_array; global $countries_array;

View File

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

View File

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

View File

@ -10,39 +10,33 @@
?> ?>
<?php if ( bp_is_my_profile() ) : ?> <?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> <ul>
<?php bp_get_options_nav(); ?> <?php bp_get_options_nav(); ?>
</ul> </ul>
</div><!-- .item-list-tabs --> </div><!-- .item-list-tabs -->
<?php endif; ?> <?php endif; ?>
<?php do_action( 'bp_before_profile_content' ); ?> <?php do_action( 'bp_before_profile_content' ); ?>
<div class="profile" role="main"> <div class="profile" role="main">
<?php
// Profile Edit
if ( bp_is_current_action( 'edit' ) )
locate_template( array( 'members/single/profile/edit.php' ), true );
<?php // Change Avatar
// Profile Edit elseif ( bp_is_current_action( 'change-avatar' ) )
if ( bp_is_current_action( 'edit' ) ) locate_template( array( 'members/single/profile/change-avatar.php' ), true );
locate_template( array( 'members/single/profile/edit.php' ), true );
// Change Avatar // Display XProfile
elseif ( bp_is_current_action( 'change-avatar' ) ) elseif ( bp_is_active( 'xprofile' ) )
locate_template( array( 'members/single/profile/change-avatar.php' ), true ); locate_template( array( 'members/single/profile/profile-loop.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 WordPress profile (fallback)
else
locate_template( array( 'members/single/profile/profile-wp.php' ), true );
?>
</div><!-- .profile --> </div><!-- .profile -->
<?php do_action( 'bp_after_profile_content' ); ?> <?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 */ /* Text Styling */
a { a {
color: #4b8cc6; color: #576a7b; /*#4b8cc6;*/
} }
a:hover { a:hover {
color: #325670; color: #325670;
@ -59,6 +59,25 @@ input[type="submit"]:hover, input[type="reset"]:hover, input[type="button"]:hove
overflow: hidden; overflow: hidden;
height: 42px; 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 */
#logo span { #logo span {
} }
@ -287,7 +306,7 @@ ul.navmenu li a.profile {
height: 100%; height: 100%;
} }
#dedicationFooter_container .last .button { #dedicationFooter_container .button {
float: right; float: right;
margin-left: 5px; margin-left: 5px;
margin-top: 48px; margin-top: 48px;
@ -295,6 +314,7 @@ ul.navmenu li a.profile {
font-size: 13px; font-size: 13px;
font-weight: bold; font-weight: bold;
padding: 3px 0; padding: 3px 0;
line-height: 19px;
} }
#dedicationFooter_container h3 { #dedicationFooter_container h3 {
@ -575,7 +595,6 @@ ul.navmenu li a.profile {
.widget.top_members .post-loop, .widget.top_members .post-loop,
.widget.sidebarposts .post-loop { .widget.sidebarposts .post-loop {
width: 100% !important; width: 100% !important;
max-height: 150px;
min-height: 150px; min-height: 150px;
margin: 0; margin: 0;
padding-bottom: 0; padding-bottom: 0;
@ -833,8 +852,8 @@ h3.comments {
.messages.bp-wrapper .avatar, .messages.bp-wrapper .avatar,
.bp-wrapper .thread-avatar .avatar, .bp-wrapper .thread-avatar .avatar,
.item-list li .avatar { .item-list li .avatar {
width: 150px; width: 50px;
height: 150px; height: 50px;
} }
.activity-comments .avatar, .activity-comments .avatar,
@ -844,6 +863,14 @@ h3.comments {
height: 50px; height: 50px;
} }
#members-list .item-avatar .avatar,
#groups-list .item-avatar .avatar {
width: 150px;
height: 150px;
}
.activity-comments .ac-reply-content { .activity-comments .ac-reply-content {
margin-left: 85px; margin-left: 85px;
} }
@ -878,13 +905,15 @@ h3.comments {
font-size: 12px; font-size: 12px;
} }
#header-bottom #item-header-avatar { #header-profile #item-header-avatar {
width: 80px; width: 80px;
margin-right: 15px;
} }
#header-bottom #item-header-avatar .avatar { #header-profile #item-header-avatar .avatar {
height: 50px; height: 77px;
width: 50px; width: 77px;
} }
#sidebar .my-groups-list .item-avatar .avatar { #sidebar .my-groups-list .item-avatar .avatar {
@ -909,7 +938,7 @@ color: #325670;
.bbPress #content div#item-header .updated { .bbPress #content div#item-header .updated {
color: #077dc8; 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="submit"],
#content-wrapper .widget input[type="reset"], #content-wrapper .widget input[type="reset"],
#content-wrapper .widget input[type="file"], #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 div.item-list-tabs ul li a:hover span,
.bp-wrapper #content-wrapper .activity-meta a span { .bp-wrapper #content-wrapper .activity-meta a span {
background: #273138; background: #273138;
} }*/
#members-list li { #members-list li {
width: 50%; width: 50%;

View File

@ -1,15 +1,18 @@
<!--Begin Slider--> <!--Begin Slider-->
<?php <?php
require(ghostpool_inc . 'options.php');
if ( is_user_logged_in() ): if ( is_user_logged_in() ):
global $gp_settings, $current_user, $bp; global $gp_settings, $current_user, $bp;
get_currentuserinfo(); get_currentuserinfo();
if (is_home() || is_front_page()) { //if (is_home() || is_front_page()) {
$posts_per_page = $theme_video_slides;
$dedication_orderby = "date"; $dedication_orderby = "date";
$dedication_order = "DESC"; $dedication_order = "DESC";
$posts_per_page = 5;
$category_name = 'dedication'; $category_name = 'dedication';
$post_status = array('publish', 'private'); $post_status = array('publish', 'private');
@ -17,13 +20,15 @@ if (is_home() || is_front_page()) {
'post_type' => array('post'), 'post_type' => array('post'),
'order' => $dedication_order, 'order' => $dedication_order,
'orderby' => $dedication_orderby, 'orderby' => $dedication_orderby,
'posts_per_page' => $posts_per_page, 'posts_per_page' => -1,
'post_status' => $post_status, 'post_status' => $post_status,
'category_name' => $category_name, 'category_name' => $category_name,
); );
query_posts($args);
} //}
query_posts($args);
if (have_posts()) { if (have_posts()) {
@ -51,6 +56,11 @@ if (have_posts()) {
<?php <?php
while (have_posts()) : the_post(); 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'); $from_user_id = get_the_author_meta('ID');
$to_user_email = get_post_meta($post->ID, 'ghostpool_destination_user_email', true); $to_user_email = get_post_meta($post->ID, 'ghostpool_destination_user_email', true);
$to_user = get_post_meta($post->ID, 'ghostpool_destination_user', true); $to_user = get_post_meta($post->ID, 'ghostpool_destination_user', true);
@ -62,6 +72,14 @@ if (have_posts()) {
} }
} }
// 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); $video = get_post_meta($post->ID, 'ghostpool_dedication_url', true);
$artist = get_post_meta($post->ID, 'ghostpool_dedication_artist', true); $artist = get_post_meta($post->ID, 'ghostpool_dedication_artist', true);
$song = get_post_meta($post->ID, 'ghostpool_dedication_song', true); $song = get_post_meta($post->ID, 'ghostpool_dedication_song', true);