Subida a producción de la maqueta

git-svn-id: https://192.168.0.254/svn/Proyectos.ASong2U_Web/trunk@10 cd1a4ea2-8c7f-e448-aada-19d1fee9e1d6
This commit is contained in:
David Arranz 2012-07-17 10:34:42 +00:00
parent 8acf4ea66a
commit 7b86e371eb
16 changed files with 744 additions and 592 deletions

View File

@ -30,13 +30,11 @@ function bp_dedication_get_dedications_to_user( $user_id ) {
if ( !$user_id )
return false;
$user_info = get_userdata($user_id);
$args = array(
'numberposts' => -1,
'category' => 'dedication',
'meta_key' => 'ghostpool_destination_user_email',
'meta_value' => $user_info->user_email
'meta_key' => 'ghostpool_destination_user',
'meta_value' => $user_id
);
$posts_array = get_posts( $args );

View File

@ -55,13 +55,14 @@ function bp_dedication_create_new_dedication() {
$videoData = array();
$videoID = getVideoID($video_url);
if (checkYoutubeId($videoID) == 1) {
$xml = getVideoDetails($videoID);
if ($xml->title != 'YouTube Videos') {
$videoData['videoURL'] = $video_url;
$videoData['title'] = $xml->title;
$videoData['description'] = $xml->content;
$videoData['thumbnail'] = "http://i.ytimg.com/vi/" . $videoID . "/0.jpg";
$videoData['thumbnail'] = "http://i.ytimg.com/vi/" . $videoID . "/hqdefault.jpg";
}
}
@ -71,7 +72,6 @@ function bp_dedication_create_new_dedication() {
'post_title' => wp_strip_all_tags($title),
'post_content' => '',
'post_category' => array($category->term_id), //Dedication
'post_status' => 'publish',
'post_status' => $post_status,
'post_type' => 'post' //'post',page' or use a custom post type if you want to
);
@ -83,9 +83,9 @@ function bp_dedication_create_new_dedication() {
add_post_meta($post_id, 'ghostpool_dedication_artist', $artist_name);
add_post_meta($post_id, 'ghostpool_dedication_song', $song_name);
add_post_meta($post_id, 'ghostpool_dedication_url', $videoData['videoURL']);
$friend_info = get_userdata($friend_ids[1]);
add_post_meta($post_id, 'ghostpool_destination_user', $friend_info->ID);
add_post_meta($post_id, 'ghostpool_destination_user_name', $friend_info->user_login);
add_post_meta($post_id, 'ghostpool_destination_user_email', $friend_info->user_email);
@ -124,7 +124,7 @@ function bp_dedication_create_new_dedication() {
wp_update_attachment_metadata($attach_id, $attach_data);
update_post_meta($post_id, '_thumbnail_id', $attach_id);
} catch (Exception $e) {
$error = '<div id="message" class="error"><p>' . $e->getMessage() . '</p></div>';
throw new Exception('<div id="message" class="error"><p>' . $e->getMessage() . '</p></div>');
return false;
}

View File

@ -2,22 +2,11 @@
function getVideoID($url) {
$url = trim($url);
// make sure url has http on it
if (substr($url, 0, 4) != "http") {
$url = "http://" . $url;
}
// make sure it has the www on it
if (substr($url, 7, 4) != "www.") {
$url = str_replace('http://', 'http://www.', $url);
preg_match('#(\.be/|/embed/|/v/|/watch\?v=)([A-Za-z0-9_-]{5,11})#', $url, $matches);
if(isset($matches[2]) && $matches[2] != '') {
return $matches[2];
}
// extract the youtube ID from the url
if (substr($url, 0, 31) == "http://www.youtube.com/watch?v=") {
$id = substr($url, 31, 11);
}
return $id;
}
function checkYoutubeId($id) {

View File

@ -73,9 +73,10 @@ function bp_dedication_new_dedication() {
if (bp_dedication_create_new_dedication()) {
bp_core_add_message( __( 'Your dedication was created!', 'bp-dedication' ) );
bp_core_redirect( bp_loggedin_user_domain() . bp_get_dedication_slug());
} else {
}
bp_core_redirect( bp_loggedin_user_domain() . bp_get_dedication_slug());
}
do_action( 'bp_dedication_new_dedication' );

View File

@ -30,6 +30,12 @@ jQuery(document).ready(function(){
j("#dedicate_to_input").autocomplete(options);
j("#dedicate_to_input").change(function(){
if(j('#dedicate_to_input').val() == '') {
j('#friend_ids').val('');
}
});
var url = '';
j('#video_url').change(function(){

View File

@ -6,16 +6,20 @@ $dedications = bp_dedication_get_dedications_to_user( $bp->displayed_user->id );
<?php foreach ($dedications as $post) : ?>
<?php setup_postdata($post); ?>
<?php include(dirname(__FILE__).'/../../loop-dedication-data.php'); ?>
<?php $gp_settings['image_width'] = 280; ?>
<?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'], false); ?>
<?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 {

View File

@ -6,16 +6,21 @@ $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'); ?>
<?php $gp_settings['image_width'] = 280; ?>
<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'], false); ?>
<?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 {

View File

@ -34,8 +34,8 @@ query_posts($args);
<?php
$artist = get_post_meta($post->ID, 'ghostpool_dedication_artist', true);
$song = get_post_meta($post->ID, 'ghostpool_dedication_song', true);
$to_user_email = get_post_meta($post->ID, 'ghostpool_destination_user_email', true);
$to_user = get_user_by ('email', $to_user_email);
$to_user_id = get_post_meta($post->ID, 'ghostpool_destination_user', true);
$to_user = get_user_by ('id', $to_user_id);
?>
<h2><a href="<?php the_permalink(); ?>" title="<?php $artist.'. '.$song; ?>"><span><?php echo $artist;?></span>.&nbsp;<?php echo $song; ?></a></h2>
@ -43,7 +43,7 @@ query_posts($args);
<span>TO: <?php echo bp_core_get_userlink($to_user->ID); ?></span>
<?php } else { ?>
<?php gp_the_flag('', 24); ?>
<span>TO: <?php echo get_post_meta($post->ID, 'ghostpool_destination_user_name', true); ?></span>
<span>TO: <?php echo $to_user->user_nicename; ?></span>
<?php } ?>
</div>
<!--End Post Text-->

View File

@ -31,7 +31,7 @@ function gp_update_notifier_menu() {
}
}
}
add_action('admin_menu', 'gp_update_notifier_menu');
//add_action('admin_menu', 'gp_update_notifier_menu');
@ -51,7 +51,7 @@ function gp_update_notifier_bar_menu() {
}
}
}
add_action( 'admin_bar_menu', 'gp_update_notifier_bar_menu', 1000 );
//add_action( 'admin_bar_menu', 'gp_update_notifier_bar_menu', 1000 );

File diff suppressed because it is too large Load Diff

View File

@ -28,8 +28,9 @@ $gp_settings['from_user_link'] = bp_core_get_userlink($gp_settings['from_user_id
$gp_settings['from_flag'] = gp_get_the_flag($gp_settings['from_user_id']);
// to user
$gp_settings['to_user_id'] = get_post_meta($post->ID, 'ghostpool_destination_user', true);
$gp_settings['to_user_email'] = get_post_meta($post->ID, 'ghostpool_destination_user_email', true);
$gp_settings['to_user'] = get_user_by ('email', $gp_settings['to_user_email']);
$gp_settings['to_user'] = get_user_by ('id', $gp_settings['to_user_id']);
if ($gp_settings['to_user']) {
$gp_settings['to_flag'] = gp_get_the_flag($gp_settings['to_user']->ID, 24);

View File

@ -8,7 +8,6 @@
*/
?>
<?php get_header( 'buddypress' ); ?>
<div id="content" class="fullwidth">

View File

@ -30,7 +30,7 @@
<?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'], false); ?>
<?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>

View File

@ -360,6 +360,10 @@ ul.navmenu li a.profile {
/*************************** Page/Post ***************************/
.page-title {
border: none;
}
/* Share */
#share-review-link a {
color: #077dc8;
@ -527,8 +531,21 @@ ul.navmenu li a.profile {
float: left;
}
#sidebar-home .widget.top_members a {
color: #bf2d2d;
}
#sidebar-home .widget.top_members h3 {
color: #bf2d2d !important;
font-size: 12px;
text-transform: uppercase;
}
#sidebar-home .widget.top_members .post-text {
text-align: center;
font-size: 12px;
font-weight: bold;
float: none;
}
#sidebar-home .widget.top_members a.button {
@ -537,13 +554,15 @@ ul.navmenu li a.profile {
background: #f4d2e3;
border: 1px solid #eaa5ba;
display: inline-block;
font-size: 14px;
line-height: 14px;
font-weight: bold;
font-weight: bold;
}
/* Sidebarposts widget */
#sidebar-home .widget.sidebarposts {
float: right;
overflow: hidden;
}
.widget.top_members img,
@ -560,6 +579,7 @@ ul.navmenu li a.profile {
min-height: 150px;
margin: 0;
padding-bottom: 0;
border: none;
}
.widget.top_members .post-loop .post-meta,
@ -580,7 +600,25 @@ ul.navmenu li a.profile {
.widget.sidebarposts h3,
.widget.sidebarposts .post-loop .post-text {
color: #34a089 !important;
text-align: center;
text-align: left;
font-size: 12px;
}
.widget.sidebarposts a {
color: #34a089 !important;
}
.widget.sidebarposts a span {
font-weight: bold;
}
.widget.sidebarposts .post-loop .post-meta {
color: #34a089;
white-space: nowrap;
}
.widget.sidebarposts .post-loop .post-meta span a {
font-weight: bold;
}
.widget.sidebarposts a.button {
@ -594,7 +632,24 @@ ul.navmenu li a.profile {
font-weight: bold;
}
.widget.sidebarposts .post-text .post-artist-song {
white-space: nowrap;
}
.widget.widget_specialrecentposts {
}
.widget.widget_specialrecentposts h4 {
font-size: 13px;
line-height: 110%;
font-family: Georgia, "Times New Roman", Times, serif;
}
.srp-widget-singlepost {
border: none !important;
margin: 0 !important;
}
/*************************** Page Navigation ***************************/
@ -723,11 +778,13 @@ h3.comments {
.category-dedication.post-loop {
text-align: left;
max-height:280px;
min-height:280px;
max-height:220px;
min-height:220px;
border-bottom: 0;
width: 32% !important;
padding-right: 1%;
margin: 0 0 10px 0;
padding: 0;
padding-right: 1%;
}
.home-page .post-loop {

View File

@ -53,6 +53,7 @@ if (have_posts()) {
$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') {
@ -102,7 +103,6 @@ if (have_posts()) {
?>
<span>FROM: <?php echo bp_core_get_userlink($from_user_id); ?></span>
<?php
$to_user = get_user_by ('email', $to_user_email);
if ($to_user) {
gp_the_flag($to_user->ID);
?><span>TO: <?php echo bp_core_get_userlink($to_user->ID); ?></span>

Binary file not shown.

Before

Width:  |  Height:  |  Size: 11 KiB

After

Width:  |  Height:  |  Size: 11 KiB