Ticket #933 -> Control de comentarios muy largos en la página de inicio

Ticket #932 -> Comportamiento de los comentarios en la página de inicio
Ticket #927 -> Cambiar los nombres de los usuarios por sus alias
Ticket #935 -> Escribir comentarios sin recargar página
Ticket #934 -> Paginación de comentarios sin recargar página

git-svn-id: https://192.168.0.254/svn/Proyectos.ASong2U_Web/trunk@37 cd1a4ea2-8c7f-e448-aada-19d1fee9e1d6
This commit is contained in:
David Arranz 2012-07-26 17:33:26 +00:00
parent a35720b7ea
commit 847d7638a0
19 changed files with 890 additions and 325 deletions

View File

@ -0,0 +1,12 @@
jQuery(document).ready(function($){
$('input[name="com_paging"]').eq(0).click(function(){
$('input[name="com_per_page"]').attr('disabled', false);
$('select[name="num_per_page"]').attr('disabled', false);
$('input[name="pager_pos"]').attr('disabled', false);
});
$('input[name="com_paging"]').eq(1).click(function(){
$('input[name="com_per_page"]').attr('disabled', true);
$('select[name="num_per_page"]').attr('disabled', true);
$('input[name="pager_pos"]').attr('disabled', true);
});
});

Binary file not shown.

After

Width:  |  Height:  |  Size: 422 B

View File

@ -0,0 +1,7 @@
/*
* jQuery autoResize (textarea auto-resizer)
* @copyright James Padolsey http://james.padolsey.com
* @version 1.04
*/
(function(a){a.fn.autoResize=function(j){var b=a.extend({onResize:function(){},animate:true,animateDuration:150,animateCallback:function(){},extraSpace:20,limit:1000},j);this.filter('textarea').each(function(){var c=a(this).css({resize:'none','overflow-y':'hidden'}),k=c.height(),f=(function(){var l=['height','width','lineHeight','textDecoration','letterSpacing'],h={};a.each(l,function(d,e){h[e]=c.css(e)});return c.clone().removeAttr('id').removeAttr('name').css({position:'absolute',top:0,left:-9999}).css(h).attr('tabIndex','-1').insertBefore(c)})(),i=null,g=function(){f.height(0).val(a(this).val()).scrollTop(10000);var d=Math.max(f.scrollTop(),k)+b.extraSpace,e=a(this).add(f);if(i===d){return}i=d;if(d>=b.limit){a(this).css('overflow-y','');return}b.onResize.call(this);b.animate&&c.css('display')==='block'?e.stop().animate({height:d},b.animateDuration,b.animateCallback):e.height(d)};c.unbind('.dynSiz').bind('keyup.dynSiz',g).bind('keydown.dynSiz',g).bind('change.dynSiz',g)});return this}})(jQuery);

View File

@ -0,0 +1,23 @@
.yjl-pager{
margin:0px 0 10px;
}
span.page-number,span.yjl-more,span.yjl-prev,span.yjl-next,.gray{
margin:0 4px 0 4px;
padding:3px 5px 3px 5px;
border:1px solid #dedede;
}
span.page-number:hover,span.yjl-more:hover,span.yjl-prev:hover,span.yjl-next:hover{
cursor:pointer;
border:1px solid #666;
}
.currentPager{
background:blue;
color:white;
}
.gray{
color:#aaa;
}
.yjl-mes{
color:#c22;
font-size:14px;
}

View File

@ -0,0 +1,177 @@
var $pager=jQuery('<div class="yjl-pager"></div>');
var $cPager=jQuery('<div class="yjl-pager"></div>');
var $prev=jQuery('<span class="yjl-prev">'+ (yjlSettings.prev==''? 'Prev':yjlSettings.prev) +'</span>');
var $next=jQuery('<span class="yjl-next">'+ (yjlSettings.next==''? 'Next':yjlSettings.next) +'</span>');
var $moreFront=jQuery('<span></span>');
var $moreEnd=jQuery('<span></span>');
var $commentlist=jQuery('.commentlist');
var $respond=jQuery('#respond');
var $message=jQuery('<span class="yjl-mes"></span>').appendTo("#commentform");;
var $list=$commentlist.children();
var totalCom=$list.length;
var $textarea=$respond.find('#comment').attr('rows','4');
var comPerPage=parseInt((yjlSettings.comPerpage==''? '5':yjlSettings.comPerpage),10);
var currentPage=0,$number,numPerPage,totalPage,$reply;
//repostion comment form if enabled
if(yjlSettings.repForm!='disable'){
$respond.insertBefore($commentlist.prev());
}
function getTotal($comlist){
$list=$comlist.children();
totalCom=$list.length;
totalPage=Math.ceil(totalCom/comPerPage);
}
if(yjlSettings.pagination!='disable')pagination();
function pagination(){
getTotal($commentlist);
numPerPage=parseInt((yjlSettings.numPerpage==''? '5':yjlSettings.numPerpage),10);
if(totalPage<numPerPage)numPerPage=totalPage;
$moreFront.add($moreEnd).empty();
if(yjlSettings.pagerPos!='after')$pager.empty().insertBefore($commentlist);
else $pager.empty().insertAfter($commentlist);
if(comPerPage<totalCom){
for (var i=0;i<totalPage;i++){
jQuery('<span class="page-number"></span>').text(i+1)
.bind('click',{newPage:i}, function(event){
currentPage=event.data['newPage'];
$number.eq(currentPage).addClass('currentPager').siblings().removeClass('currentPager');
rePagCom();
rePager();
}).appendTo($pager);
}
//select a set of page-numbers for later uses
$number=$pager.find('span.page-number');
//if there are more page-numbers front
jQuery('<span class="yjl-more"></span>').appendTo($moreFront)
.text('1').click(function(){$number.eq(0).trigger('click');});
$moreFront.append(' ... ').prependTo($pager);
$prev.prependTo($pager).click(function(){
if(currentPage>0)$number.eq(currentPage).prev().trigger('click');
});
$moreEnd.append(' ... ').appendTo($pager);
jQuery('<span class="yjl-more"></span>').appendTo($moreEnd)
.text(totalPage+'').click(function(){$number.eq(totalPage-1).trigger('click');});
$next.appendTo($pager).click(function(){
if(currentPage<totalPage-1)$number.eq(currentPage).next().trigger('click');
});
rePager();
rePagCom();
}
}//end of pagination function
/*
*repage all comments
*/
function rePagCom(){
$list.hide().slice(currentPage*comPerPage,(currentPage+1)*comPerPage).fadeIn();
}
/*
*show and hide page-numbers
*/
function rePager(){
$number.eq(currentPage).addClass('currentPager');
if(currentPage<(numPerPage+1)/2){
$number.hide().slice(0,numPerPage).show();
}
else if(currentPage+1>totalPage-(numPerPage+1)/2){
$number.hide().slice(totalPage-numPerPage,totalPage+1).show();
}
else{
$number.hide().slice(currentPage-(numPerPage-1)/2 ,currentPage+(numPerPage-1)/2+1).show();
}
if(currentPage==0)$prev.removeClass('yjl-prev').addClass('gray');
else $prev.addClass('yjl-prev').removeClass('gray');
if(currentPage==totalPage-1)$next.removeClass('yjl-next').addClass('gray');
else $next.addClass('yjl-next').removeClass('gray');
if(currentPage+(numPerPage-1)/2<totalPage-1 && numPerPage!=totalPage)
$moreEnd.show();else $moreEnd.hide();
if(currentPage-(numPerPage-1)/2>0 && numPerPage!=totalPage)
$moreFront.show();else $moreFront.hide();
if(yjlSettings.pagerPos=='both')
$cPager.insertAfter($commentlist).empty().append($pager.children().clone(true));
}
//track a reply comment
jQuery('.comment-reply-link').live('click',function(){
$reply=true;
});
var $cancel=jQuery('#cancel-comment-reply-link').click(function(){
$reply=false;
});
/*
*if Ajax comment posting is eanbled
*/
jQuery('#commentform').submit(function(){
jQuery.ajax({
beforeSend:function(xhr){
xhr.setRequestHeader("If-Modified-Since","0");
$message.empty().append('<img src="'+yjlSettings.gifUrl+'" alt="processing...">');
},
type:'post',
url:jQuery(this).attr('action'),
data:jQuery(this).serialize(),
dataType:'html',
error:function(xhr){
if(xhr.status==500){
$message.empty().append(xhr.responseText.split('<p>')[1].split('</p>')[0]);
}
else if(xhr.status=='timeout'){
$message.empty().append((yjlSettings.timeOut!=''?yjlSettings.timeOut:'Error:Server time out,try again!'));
}
else{
$message.empty().append((yjlSettings.fast!=''?yjlSettings.fast:'Please slow down,you are posting to fast!'));
}
},
success:function(data){
$message.empty().append((yjlSettings.thank!=''?yjlSettings.thank:'Thank you for your comment!'));
$newComList=jQuery(data).find('.commentlist');
if(totalCom>0){
if($reply)$cancel.trigger('click');
else {
if(yjlSettings.order=='desc')currentPage=0;
else { getTotal($newComList);currentPage=totalPage-1;}
}
if(yjlSettings.pagination=='disable' || yjlSettings.pagerPos=='after')
$commentlist.prev().replaceWith($newComList.prev());
else $commentlist.prev().prev().replaceWith($newComList.prev());
$commentlist.replaceWith($newComList);
}else{
if(yjlSettings.repForm=='disable')$newComList.prev().andSelf().insertBefore($respond);
else $newComList.prev().andSelf().insertAfter($respond);
}
$commentlist=$newComList;
if(yjlSettings.pagination!='disable')pagination();
$textarea.val('');
}
});//end of ajax
return false;
});//end of submit function
if(yjlSettings.autoGrow!='disable'){
$textarea.autoResize({
// On resize:
onResize : function() {
jQuery(this).css({opacity:0.8});
},
// After resize:
animateCallback : function() {
jQuery(this).css({opacity:1});
},
// Quite slow animation:
animateDuration : 300,
// More extra space:
extraSpace : 20
});
}

View File

@ -0,0 +1,103 @@
=== Plugin Name ===
Contributors: bingjie2680
Donate link: http://example.com/
Tags: wordpress Comments, ajax comment, ajax comment posting,comment pager,comment pagination,ajax commenting,AjAX comment paging,comment paging,paged comments,paginated comments,AJAX comment page,AJAX comments
Requires at least: 2.8
Tested up to: 3.1.3
Stable tag: 1.7
== Description ==
Are you looking for a real AJAX comment posting plugin?
Are you seeking for a better solution to present the long-list comments to your site visitors?
Then this plugin is for you.
WP-comment-master is developed mainly in jQuery to enhance the experience of commenting for your site visitors. it has two main features:AJAX comment posting and comment pagination. the AJAX comment posting enables the commenters to post and view the comment instantly without refreshing the page, while the comment pagination paginates all comments into pages with a well presented and structured navigation. if you does not need either of these two features, you can simply disable it.
= Something to note: =
* SEO:pagination still enables your comment to be indexed by Search Engine Crawler
* Minimize Dom traversal to optimize the performance(this is crucial when you use many plugins)
* Compatible up to the newest verson
* Tested with many themes and in all major browsers
* Custom settings eanbled
Please note that this plugin should work with most wordpress themes, but may not work with some themes due to your different theme css construct, in this case, you can leave a comment to me and I will help you get it to work.
See it in action [here](http://yjlblog.com/?p=11#comments)
== Installation ==
1. Go to your site admin->plugins->add new, and search for wp-comment-master.
1. Install it directly and activate it
= or =
1. Download the 'wp-comment-master' plugin from [plugin site](http://yjlblog.com/?p=11)
1. Upload `wp-comment-master` to the `/wp-content/plugins/` directory
1. Activate the plugin through the 'Plugins' menu in WordPress
In order for the comment pagination to work in a best outcome, it is suggested to do the following settings:
go to site admin panel->settings->discussion, and check that the option below is not ticked:
* Break comments into pages with top level comments per page and the last first page displayed by default
Comments should be displayed with the oldernewer comments at the top of each page
and now you are ready to go...
== Screenshots ==
Screenshot and Demo see [here](http://yjlblog.com/?p=11#comments)
== Changelog ==
= 1.7 =
* correct depreciated api
= 1.6 =
* removed settings for dysfuncational AJAX comment
* javascript code remain beautified, so you can make any changes
= 1.5 =
*Small adjustment of css pager number, should be a bit better user-friendly now
= 1.4 =
* comment form textarea auto grow function added(this feature is based on [James Padolsey's](http://james.padolsey.com) plugin
* fiexed the bug that it didn't work with Atahualpa theme
* corrected some spelling errors
= 1.3 =
* code optimized(less code) and absolutly even better performance
* enabled the comment form position back to the top or bottom of comment list after a reply
* enabled custom output text
* attempt to recover dysfunction AJAX posting added for some themes that have a diffrent css construct
* the option to enable or disable AJAX posting is removed
* After AJAX posting, pagination will always locate where the new comment is
= 1.2 =
* Solved the problem that 'unlogged' in user can not view post instantly in IE, now very visitor can experience the AJAX commenting.
* Fixed the bug that comment from disappeared after posting when page-number is positioned after commentlist
* load the script in footer instead of head to decrease your site loading time.
* 'Thank you' message displyed after successful submission of comment.
= 1.1 =
* Fixed the bug that comment form disappeared after posting a reply when pagination is disabled
* Fixed some logic to be compatible with more themes.
* fnables page-number to be positioned both before and after commentlist
* Animation effect is enabled during AJAX loading
* Fixed the bug that after a reply, the page-number jump back to the first page.
== Upgrade Notice ==
= 1.4 =
textarea auto grow featured added
= 1.3 =
less code, custom text output enabled, please notice some changes to Css construce and setting panel.
= 1.2 =
Sloved the problem of compatiable issue with IE, decrease your site loading time, AJAx commenting more friendly.
= 1.1 =
Compatiable with more themes, correct some confusions
== Frequently Asked Questions ==
none

View File

@ -0,0 +1,182 @@
<?php
/*
Plugin Name: wp-comment-master
Plugin URI: http://yjlblog.com
Description: an elegant and must-have comment plugin to better satisfy your visitors, it has two main features: AJAX comment posting and comment paginitaion.
Version: 1.7
Author: Yijie Li
Author URI: http://yjlblog.com
Copyright 2010 Yijie Li (email: bingjie2680@gmail.com)
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License, version 2, as
published by the Free Software Foundation.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
*/
add_action('wp_enqueue_scripts', 'wpcm');
function wpcm(){
if(!is_admin()){
if(get_option('autogrow')!='disable'){
wp_enqueue_script('autosize_js', WP_PLUGIN_URL.'/wp-comment-master/autoresize.jquery.min.js',array('jquery'),'',true);
}
if(is_single())wp_enqueue_script('paginating_js', WP_PLUGIN_URL.'/wp-comment-master/cm.js',array('jquery'),'',true);
wp_enqueue_style('paginating_css', WP_PLUGIN_URL.'/wp-comment-master/cm.css');
wp_localize_script('paginating_js','yjlSettings',array(
'pagination'=>get_option('com_paging'),
'comPerpage'=>get_option('com_per_page'),
'numPerpage'=>get_option('num_per_page'),
'pagerPos'=>get_option('pager_pos'),
'repForm'=>get_option('rep_form'),
'gifUrl'=>WP_PLUGIN_URL.'/wp-comment-master/ajax-loader.gif',
'prev'=>get_option('yjlprev'),
'next'=>get_option('yjlnext'),
'timeOut'=>get_option('yjltimeout'),
'fast'=>get_option('yjlfast'),
'thank'=>get_option('yjlthank'),
'order'=>get_option('comment_order'),
'autoGrow'=>get_option('autogrow')
));
}
}
add_action('admin_init', 'wpcm_admin_init');
function wpcm_admin_init(){
wp_enqueue_script('admin_js', WP_PLUGIN_URL.'/wp-comment-master/admin.js',array('jquery'),'',true);
}
add_action('admin_menu', 'mt_add_pages');
// action function for above hook
function mt_add_pages() {
add_options_page('WP-comment-master','WP-comment-master', 'level_4', 'WP-comment-master', 'YJL_options');
add_action( 'admin_init', 'register_mysettings' );
}
function register_mysettings() {
//register our settings
register_setting( 'YJL-settings-group', 'com_paging' );
register_setting( 'YJL-settings-group', 'com_per_page' );
register_setting( 'YJL-settings-group', 'num_per_page' );
register_setting( 'YJL-settings-group', 'pager_pos' );
register_setting( 'YJL-settings-group', 'rep_form' );
register_setting( 'YJL-settings-group', 'yjlprev' );
register_setting( 'YJL-settings-group', 'yjlnext' );
register_setting( 'YJL-settings-group', 'yjltimeout' );
register_setting( 'YJL-settings-group', 'yjlfast' );
register_setting( 'YJL-settings-group', 'yjlthank' );
register_setting( 'YJL-settings-group', 'autogrow' );
}
function YJL_options() { ?>
<div class="wrap">
<h2>WP-Comment-Master Settings:</h2>
<form method="post" action="options.php">
<?php settings_fields( 'YJL-settings-group' ); ?>
<table class="form-table">
<tr valign="top" >
<th scope="row">Reposition the comment form before all comments</th>
<td>
<?php $rep_form=get_option('rep_form');?>
<input type="radio" name="rep_form" value="enable" <?php if( $rep_form!='disable')echo 'checked';?> >Enable
<input type="radio" name="rep_form" value="disable" <?php if( $rep_form=='disable')echo 'checked';?> >Disable
</td></tr>
<tr valign="top">
<th scope="row">Textarea autogrow</th>
<td>
<?php $autogrow=get_option('autogrow');?>
<input type="radio" name="autogrow" value="enable" <?php if( $autogrow!='disable')echo 'checked';?> >Enable
<input type="radio" name="autogrow" value="disable" <?php if( $autogrow=='disable')echo 'checked';?> >Disable
<br>
</td>
</tr>
<tr valign="top">
<th scope="row"><strong>Pagination settings:</strong></th>
<td></td>
</tr>
<tr valign="top">
<th scope="row">Comment Pagination</th>
<td>
<?php $com_paging=get_option('com_paging');?>
<input type="radio" name="com_paging" value="enable" <?php if( $com_paging!='disable')echo 'checked';?> >Enable
<input type="radio" name="com_paging" value="disable" <?php if( $com_paging=='disable')echo 'checked';?> >Disable
</td>
</tr>
<tr valign="top">
<th scope="row">Comments per page</th>
<td><input name="com_per_page" id="com-per-page" value="<?php echo get_option('com_per_page'); ?>" /><br>(If you enable threaded comments,threaded comments does not count towards this number.)</td>
</tr>
<tr valign="top">
<th scope="row">Number of page-number to show</th>
<td> <select id="num_per_page" name="num_per_page">
<?php $num_per_page=get_option('num_per_page');?>
<option value="5" <?php if($num_per_page==5)echo 'selected';?> >5</option>
<option value="3" <?php if($num_per_page==3)echo 'selected';?> >3</option>
<option value="7" <?php if($num_per_page==7)echo 'selected';?> >7</option>
<option value="9" <?php if($num_per_page==9)echo 'selected';?> >9</option>
<option value="11" <?php if($num_per_page==11)echo 'selected';?> >11</option>
<option value="13" <?php if($num_per_page==13)echo 'selected';?> >13</option>
</select>(default 5)
</td>
</tr>
<tr valign="top">
<th scope="row">Page-number position</th>
<td>
<?php $pager_pos=get_option('pager_pos');?>
<input type="radio" name="pager_pos" value="before" <?php if( $pager_pos!='after'&& $pager_pos!='both')echo 'checked';?> >Before comments<br>
<input type="radio" name="pager_pos" value="after" <?php if( $pager_pos=='after')echo 'checked';?> >After comments<br>
<input type="radio" name="pager_pos" value="both" <?php if( $pager_pos=='both')echo 'checked';?> >Both before and after comments
</td>
</tr>
<tr valign="top">
<th scope="row"><strong>Custom output Text:</stong></th>
<td></td>
</tr>
<tr valign="top">
<th scope="row">Default Text:</th>
<td>Custom Text:</td>
</tr>
<tr valign="top">
<th scope="row">'Prev'</th>
<td><input name="yjlprev" id="yjlprev" value="<?php echo get_option('yjlprev'); ?>" /></td>
</tr>
<tr valign="top">
<th scope="row">'Next'</th>
<td><input name="yjlnext" id="yjlnext" value="<?php echo get_option('yjlnext'); ?>" /></td>
</tr>
<tr valign="top">
<th scope="row">'Error:Server time out,try again!'</th>
<td><input name="yjltimeout" id="yjltimeout" value="<?php echo get_option('yjltimeout'); ?>" /></td>
</tr>
<tr valign="top">
<th scope="row">'Please slow down,you are posting to fast!'</th>
<td><input name="yjlfast" id="yjlfast" value="<?php echo get_option('yjlfast'); ?>" /></td>
</tr>
<tr valign="top">
<th scope="row">'Thank you for your comment!'</th>
<td><input name="yjlthank" id="yjlthank" value="<?php echo get_option('yjlthank'); ?>" /></td>
</tr>
</table>
<p class="submit">
<input type="submit" class="button-primary" value="Save Changes" />
</p>
</form>
<p>Thank you for using wp-comment-master, if you have any suggestion,you are very welcom to <a href="http://yjlblog.com/wp-comment-master">visit me</a></p>
</div>
<?php } ?>

View File

@ -0,0 +1,205 @@
<?php
// Do not delete these lines
if (!empty($_SERVER['SCRIPT_FILENAME']) && 'comments.php' == basename($_SERVER['SCRIPT_FILENAME']))
die ('Please do not load this page directly. Thanks!');
if(post_password_required()) { ?>
<?php
return;
}
?>
<?php
/*************************** Comment Template ***************************/
global $current_user, $gp_settings;
require(ghostpool_inc . 'options.php');
if($gp_settings['user_comments'] == "One Comment") {
$comment_number = "1";
} else {
$comment_number = "999999999";
}
$args = array('post_id' => $post->ID, 'user_id' => $current_user->ID);
$usercomment = get_comments($args);
function comment_template($comment, $args, $depth) {
$GLOBALS['comment'] = $comment;
global $post, $gp_settings;
require(ghostpool_inc . 'options.php');
?>
<li <?php comment_class(); ?> id="li-comment-<?php comment_ID() ?>">
<div id="comment-<?php comment_ID() ?>" class="comment-box">
<div class="comment-avatar">
<?php echo get_avatar($comment,$size='32'); ?>
</div>
<div class="comment-meta">
<span class="comment-author">
<?php printf(__('%s', 'gp_lang'), comment_author_link()) ?>
</span>
<span class="post-author">(<?php _e('Author', 'gp_lang'); ?>)</span>
<div class="clear"></div>
<div class="comment-date">
<?php comment_time(get_option('date_format')); ?>, <?php comment_time(get_option('time_format')); ?>
</div>
<div class="reply-link">&nbsp;&nbsp;/&nbsp;
<?php comment_reply_link(array_merge($args, array('reply_text' => __('Reply', 'gp_lang').' &rarr;', 'add_below' => 'comment', 'depth' => $depth, 'max_depth' => $args['max_depth']))); ?>
</div>
</div>
<?php if(defined("STARRATING_INSTALLED")) { ?>
<div class="comment-user-score">
<?php wp_gdsr_comment_integrate_standard_result(get_comment_ID(), '', 16); ?>
</div>
<?php } ?>
<div class="clear"></div>
<div class="comment-text">
<?php comment_text(); ?>
<?php if($comment->comment_approved == '0') { ?>
<div class="moderation">
<?php _e('Your comment is awaiting moderation.', 'gp_lang'); ?>
</div>
<?php } ?>
</div>
<?php if(defined('STARRATING_INSTALLED') && $gp_settings['post_type'] == "Review" && $gp_settings['comment_thumbs'] == "Users can rate other comments") {
wp_gdsr_render_comment_thumbs(48, 0, '');
// Calls GDSR Data
//if(defined('STARRATING_INSTALLED')) { $gp_gdsrc = wp_gdsr_rating_comment(); }
?>
<!--<div class="thumb-rating">
<div class="left"><?php //echo $gp_gdsrc->thumb_votes; ?> found this helpful</div>
<div class="right">
<div class="left">Was this review helpful?</div>
<?php //wp_gdsr_render_comment_thumbs(); ?>
</div>
</div><div class="clear"></div>-->
<?php } ?>
</div>
<?php } ?>
<!--Begin Comments-->
<?php if('open' == $post->comment_status OR have_comments()) { ?>
<div id="comments">
<h3 class="comments"><?php comments_number(__('No Comments', 'gp_lang'), __('1 Comment', 'gp_lang'), __('% Comments', 'gp_lang')); ?></h3>
<?php } ?>
<?php if(have_comments()) { // If there are comments ?>
<ol id="commentlist">
<?php wp_list_comments('callback=comment_template'); ?>
</ol>
<?php $total_pages = get_comment_pages_count(); if($total_pages > 1) { ?>
<div class="wp-pagenavi"><?php paginate_comments_links(); ?></div>
<?php } ?>
<?php if('open' == $post->comment_status) { // If comments are open, but there are no comments yet ?>
<?php } else { // If comments are closed ?>
<strong><?php _e('Comments are now closed on this post.', 'gp_lang'); ?></strong>
<?php } ?>
<?php } else { // If there are no comments yet ?>
<?php } ?>
<?php if('open' == $post->comment_status) { ?>
<!--Begin Comment Form-->
<div id="commentform"<?php if(count($usercomment) >= $comment_number) { ?> class="hidden"<?php } ?>>
<!--Begin Respond-->
<div id="respond">
<h3><?php comment_form_title(__('Leave a Reply', 'gp_lang'), __('Respond to %s', 'gp_lang')); ?> <?php cancel_comment_reply_link(__('Cancel Reply', 'gp_lang')); ?></h3>
<?php if(get_option('comment_registration') && !$user_ID) { ?>
<p><?php _e('You must be logged in to post a comment.', 'gp_lang'); ?></p>
<?php } else { ?>
<form action="<?php echo get_option('siteurl'); ?>/wp-comments-post.php" method="post">
<?php if(defined('STARRATING_INSTALLED') && $gp_settings['post_type'] == "Review" && ($gp_settings['user_voting'] == "Vote with or without posting a comment" OR $gp_settings['user_voting'] == "Vote only when posting a comment")) { ?>
<div class="comment-score">
<div class="comment-score-title"><?php _e('Rate This Item', 'gp_lang'); ?></div>
<div class="comment-score-stars">
<?php wp_gdsr_comment_integrate_standard_rating(); ?>
</div>
</div>
<?php } ?>
<?php if ($user_ID) {} else { ?>
<p><input type="text" name="author" id="author" value="<?php echo $comment_author; ?>" size="22" tabindex="1" <?php if ($req) echo "aria-required='true'"; ?> /> <label for="author"><?php _e('Name', 'gp_lang'); ?> <span class="required"><?php if ($req) echo "*"; ?></span></label></p>
<p><input type="text" name="email" id="email" value="<?php echo $comment_author_email; ?>" size="22" tabindex="2" <?php if ($req) echo "aria-required='true'"; ?> /> <label for="email"><?php _e('Email', 'gp_lang'); ?> <span class="required"><?php if ($req) echo "*"; ?></span></label></p>
<p><input type="text" name="url" id="url" value="<?php echo $comment_author_url; ?>" size="22" tabindex="3" /> <label for="url"><?php _e('Website', 'gp_lang'); ?></label></p>
<?php } ?>
<p><textarea name="comment" id="comment" cols="5" rows="7" tabindex="4"></textarea></p>
<input name="submit" type="submit" id="submit" tabindex="5" value="<?php _e('Post', 'gp_lang'); ?> &rarr;" />
<?php comment_id_fields(); ?>
<?php do_action('comment_form', $post->ID); ?>
</form>
<?php } ?>
</div>
<!--End Respond-->
</div>
<!--End Comment Form-->
<?php } ?>
<?php if(count($usercomment) >= $comment_number) { ?>
<div class="clear"></div>
<strong><?php _e('You have already reviewed this item.', 'gp_lang'); ?></strong>
<?php } ?>
<?php if('open' == $post->comment_status OR have_comments()) { ?>
</div>
<?php } ?>
<!--End Comments-->

View File

@ -64,12 +64,6 @@ require(ghostpool_inc . 'options.php');
</div>
<?php if(defined("STARRATING_INSTALLED")) { ?>
<div class="comment-user-score">
<?php wp_gdsr_comment_integrate_standard_result(get_comment_ID(), '', 16); ?>
</div>
<?php } ?>
<div class="clear"></div>
<div class="comment-text">
@ -81,125 +75,70 @@ require(ghostpool_inc . 'options.php');
<?php } ?>
</div>
<?php if(defined('STARRATING_INSTALLED') && $gp_settings['post_type'] == "Review" && $gp_settings['comment_thumbs'] == "Users can rate other comments") {
wp_gdsr_render_comment_thumbs(48, 0, '');
// Calls GDSR Data
//if(defined('STARRATING_INSTALLED')) { $gp_gdsrc = wp_gdsr_rating_comment(); }
?>
<!--<div class="thumb-rating">
<div class="left"><?php //echo $gp_gdsrc->thumb_votes; ?> found this helpful</div>
<div class="right">
<div class="left">Was this review helpful?</div>
<?php //wp_gdsr_render_comment_thumbs(); ?>
</div>
</div><div class="clear"></div>-->
<?php } ?>
</div>
<?php } ?>
<!--Begin Comments-->
<?php if('open' == $post->comment_status OR have_comments()) { ?>
<div id="comments">
<h3 class="comments"><?php comments_number(__('No Comments', 'gp_lang'), __('1 Comment', 'gp_lang'), __('% Comments', 'gp_lang')); ?></h3>
<?php } ?>
<div id="comments">
<?php if('open' == $post->comment_status OR have_comments()) : ?>
<?php if(have_comments()) { // If there are comments ?>
<ol id="commentlist">
<?php wp_list_comments('callback=comment_template'); ?>
</ol>
<?php $total_pages = get_comment_pages_count(); if($total_pages > 1) { ?>
<div class="wp-pagenavi"><?php paginate_comments_links(); ?></div>
<?php } ?>
<h3 class="comments"><?php comments_number(__('No Comments', 'gp_lang'), __('1 Comment', 'gp_lang'), __('% Comments', 'gp_lang')); ?></h3>
<ol class="commentlist" id="commentlist">
<?php wp_list_comments('callback=comment_template'); ?>
</ol>
<?php if('open' == $post->comment_status) { // If comments are open, but there are no comments yet ?>
<?php } else { // If comments are closed ?>
<strong><?php _e('Comments are now closed on this post.', 'gp_lang'); ?></strong>
<?php } ?>
<?php } else { // If there are no comments yet ?>
<?php } ?>
<?php if('open' == $post->comment_status) { ?>
<!--Begin Comment Form-->
<div id="commentform"<?php if(count($usercomment) >= $comment_number) { ?> class="hidden"<?php } ?>>
<!--Begin Respond-->
<div id="respond">
<h3><?php comment_form_title(__('Leave a Reply', 'gp_lang'), __('Respond to %s', 'gp_lang')); ?> <?php cancel_comment_reply_link(__('Cancel Reply', 'gp_lang')); ?></h3>
<?php else : // this is displayed if there are no comments so far ?>
<?php if(get_option('comment_registration') && !$user_ID) { ?>
<p><?php _e('You must be logged in to post a comment.', 'gp_lang'); ?></p>
<?php } else { ?>
<form action="<?php echo get_option('siteurl'); ?>/wp-comments-post.php" method="post">
<?php if ( comments_open() ) : ?>
<!-- If comments are open, but there are no comments. -->
<?php if(defined('STARRATING_INSTALLED') && $gp_settings['post_type'] == "Review" && ($gp_settings['user_voting'] == "Vote with or without posting a comment" OR $gp_settings['user_voting'] == "Vote only when posting a comment")) { ?>
<div class="comment-score">
<div class="comment-score-title"><?php _e('Rate This Item', 'gp_lang'); ?></div>
<div class="comment-score-stars">
<?php wp_gdsr_comment_integrate_standard_rating(); ?>
</div>
</div>
<?php } ?>
<?php if ($user_ID) {} else { ?>
<p><input type="text" name="author" id="author" value="<?php echo $comment_author; ?>" size="22" tabindex="1" <?php if ($req) echo "aria-required='true'"; ?> /> <label for="author"><?php _e('Name', 'gp_lang'); ?> <span class="required"><?php if ($req) echo "*"; ?></span></label></p>
<p><input type="text" name="email" id="email" value="<?php echo $comment_author_email; ?>" size="22" tabindex="2" <?php if ($req) echo "aria-required='true'"; ?> /> <label for="email"><?php _e('Email', 'gp_lang'); ?> <span class="required"><?php if ($req) echo "*"; ?></span></label></p>
<p><input type="text" name="url" id="url" value="<?php echo $comment_author_url; ?>" size="22" tabindex="3" /> <label for="url"><?php _e('Website', 'gp_lang'); ?></label></p>
<?php } ?>
<p><textarea name="comment" id="comment" cols="5" rows="7" tabindex="4"></textarea></p>
<input name="submit" type="submit" id="submit" tabindex="5" value="<?php _e('Post', 'gp_lang'); ?> &rarr;" />
<?php comment_id_fields(); ?>
<?php do_action('comment_form', $post->ID); ?>
</form>
<?php } ?>
</div>
<!--End Respond-->
</div>
<!--End Comment Form-->
<?php } ?>
<?php else : // comments are closed ?>
<!-- If comments are closed. -->
<p class="nocomments"><?php _e('Comments are closed.'); ?></p>
<?php if(count($usercomment) >= $comment_number) { ?>
<div class="clear"></div>
<strong><?php _e('You have already reviewed this item.', 'gp_lang'); ?></strong>
<?php } ?>
<?php if('open' == $post->comment_status OR have_comments()) { ?>
</div>
<?php } ?>
<!--End Comments-->
<?php endif; ?>
<?php endif; ?>
</div>
<?php if ( comments_open() ) : ?>
<div id="respond">
<h3><?php comment_form_title( __('Leave a Reply'), __('Leave a Reply to %s' ) ); ?></h3>
<div id="cancel-comment-reply">
<small><?php cancel_comment_reply_link() ?></small>
</div>
<?php if(get_option('comment_registration') && !$user_ID) : ?>
<p><?php _e('You must be logged in to post a comment.', 'gp_lang'); ?></p>
<?php else : ?>
<form action="<?php echo get_option('siteurl'); ?>/wp-comments-post.php" method="post" id="commentform">
<?php if ( is_user_logged_in() ) : ?>
<p><?php printf(__('Logged in as <a href="%1$s">%2$s</a>.'), get_option('siteurl') . '/wp-admin/profile.php', $user_identity); ?> <a href="<?php echo wp_logout_url(get_permalink()); ?>" title="<?php esc_attr_e('Log out of this account'); ?>"><?php _e('Log out &raquo;'); ?></a></p>
<?php else : ?>
<p><input type="text" name="author" id="author" value="<?php echo esc_attr($comment_author); ?>" size="22" tabindex="1" <?php if ($req) echo "aria-required='true'"; ?> />
<label for="author"><small><?php _e('Name'); ?> <?php if ($req) _e('(required)'); ?></small></label></p>
<p><input type="text" name="email" id="email" value="<?php echo esc_attr($comment_author_email); ?>" size="22" tabindex="2" <?php if ($req) echo "aria-required='true'"; ?> />
<label for="email"><small><?php _e('Mail (will not be published)'); ?> <?php if ($req) _e('(required)'); ?></small></label></p>
<p><input type="text" name="url" id="url" value="<?php echo esc_attr($comment_author_url); ?>" size="22" tabindex="3" />
<label for="url"><small><?php _e('Website'); ?></small></label></p>
<?php endif; ?>
<!--<p><small><?php printf(__('<strong>XHTML:</strong> You can use these tags: <code>%s</code>'), allowed_tags()); ?></small></p>-->
<p><textarea name="comment" id="comment" cols="58" rows="10" tabindex="4"></textarea></p>
<p><input name="submit" type="submit" id="submit" tabindex="5" value="<?php esc_attr_e('Submit Comment'); ?>" />
<?php comment_id_fields(); ?>
</p>
<?php do_action('comment_form', $post->ID); ?>
</form>
<div class="clear"></div>
<?php endif; // If registration required and not logged in ?>
</div>
<?php endif; // if you delete this the sky will fall on your head ?>

View File

@ -55,7 +55,7 @@
<?php } ?>
<ul class="navmenu">
<?php
$category_id = get_cat_ID( 'concerts' );
$category_id = get_cat_ID( CONCERTS_CATEGORY_SLUG );
$category_link = get_category_link( $category_id );
?>
<li><a title="<?php _e( 'Concerts', 'gp_lang' ); ?>" class="events" href="<?php echo esc_url( $category_link ); ?>"><span><?php _e( 'Concerts', 'gp_lang' ); ?></span></a></li>
@ -66,7 +66,7 @@
<?php endif; ?>
<?php if ( is_user_logged_in() ) : ?>
<?php if ( $bp->current_component == 'dedications' ) : ?>
<?php if ( $bp->current_component == BP_DEDICATION_SLUG ) : ?>
<div id="header-profile">
<?php locate_template( array( 'members/single/small-member-header.php' ), true ); ?>
</div>

View File

@ -20,6 +20,7 @@ require(ghostpool_inc . 'options.php');
$comment_array = array_reverse(get_approved_comments(get_the_ID()));
$count = 1;
?>
<?php if ($comment_array) { ?>
<div id="comments">
<ol id="commentlist">
@ -56,7 +57,7 @@ $count = 1;
<?php } ?>
<?php } ?>
</ol>
<?php if (count($comment_array) > 2) : ?>
<?php if (count($comment_array) > 0) : ?>
<div class="more-comments">
<a href="<?php the_permalink(); ?>" class="read-more" title="<?php _e('See More', 'gp_lang'); ?>"><?php _e('See More', 'gp_lang'); ?> &raquo;</a>
</div>
@ -64,7 +65,42 @@ $count = 1;
</div>
<?php } else { ?>
&nbsp;
<div id="respond" class="homepage">
<h3><?php comment_form_title( __('Leave a Reply'), __('Leave a Reply to %s' ) ); ?></h3>
<div id="cancel-comment-reply">
<small><?php cancel_comment_reply_link() ?></small>
</div>
<?php if(get_option('comment_registration') && !$user_ID) : ?>
<p><?php _e('You must be logged in to post a comment.', 'gp_lang'); ?></p>
<?php else : ?>
<form action="<?php echo get_option('siteurl'); ?>/wp-comments-post.php" method="post" id="commentform">
<?php if ( is_user_logged_in() ) : ?>
<p><?php printf(__('Logged in as <a href="%1$s">%2$s</a>.'), get_option('siteurl') . '/wp-admin/profile.php', $user_identity); ?> <a href="<?php echo wp_logout_url(get_permalink()); ?>" title="<?php esc_attr_e('Log out of this account'); ?>"><?php _e('Log out &raquo;'); ?></a></p>
<?php else : ?>
<p><input type="text" name="author" id="author" value="<?php echo esc_attr($comment_author); ?>" size="22" tabindex="1" <?php if ($req) echo "aria-required='true'"; ?> />
<label for="author"><small><?php _e('Name'); ?> <?php if ($req) _e('(required)'); ?></small></label></p>
<p><input type="text" name="email" id="email" value="<?php echo esc_attr($comment_author_email); ?>" size="22" tabindex="2" <?php if ($req) echo "aria-required='true'"; ?> />
<label for="email"><small><?php _e('Mail (will not be published)'); ?> <?php if ($req) _e('(required)'); ?></small></label></p>
<p><input type="text" name="url" id="url" value="<?php echo esc_attr($comment_author_url); ?>" size="22" tabindex="3" />
<label for="url"><small><?php _e('Website'); ?></small></label></p>
<?php endif; ?>
<p><textarea name="comment" id="comment" cols="58" rows="5" tabindex="4"></textarea></p>
<p><input name="submit" type="submit" id="submit" tabindex="5" value="<?php esc_attr_e('Submit Comment'); ?>" />
<?php comment_id_fields(); ?>
</p>
<?php do_action('comment_form', $post->ID); ?>
</form>
<div class="clear"></div>
<?php endif; // If registration required and not logged in ?>
</div>
<?php } ?>

View File

@ -1,6 +1,8 @@
<?php get_header();
global $gp_settings, $post;
global $gp_settings, $post, $current_user;
get_currentuserinfo();
$_ishome = (is_home() OR is_front_page());
?>
@ -21,11 +23,11 @@ $urls_video = array();
break;
}
$displayed_id = bp_displayed_user_id();
//$displayed_id = bp_displayed_user_id();
// Usuario actual puede ver la dedicatoria?
if ($post->post_status == 'private') {
if (($displayed_id != $gp_settings['from_user_id']) && ($displayed_id != $gp_settings['to_user_id'])) {
if (($current_user->ID != $gp_settings['from_user_id']) && ($current_user->ID != $gp_settings['to_user_id'])) {
continue; // me salto esta dedicatoria
}
}
@ -68,7 +70,16 @@ $urls_video = array();
</div>
<?php endwhile; ?>
<?php if($gp_settings['pagination'] == "0") { gp_pagination(); } ?>
<?php
if($gp_settings['pagination'] == "0") { gp_pagination(); } else { ?>
<div class="more-posts">
<?php
$category_id = get_cat_ID( DEDICATION_CATEGORY_SLUG );
$category_link = get_category_link( $category_id );
?>
<a href="<?php echo esc_url( $category_link ); ?>" class="read-more" title="<?php _e('See More', 'gp_lang'); ?>"><?php _e('See More', 'gp_lang'); ?> &raquo;</a>
</div>
<?php } ?>
<?php if($gp_settings['dropdown_filter'] == "0") { require_once('dropdown-filter.php'); } ?>

View File

@ -18,6 +18,7 @@ if(get_post_meta($post->ID, 'ghostpool_thumbnail_height', true) && get_post_meta
}
// Song data
$gp_settings['video'] = get_post_meta($post->ID, 'ghostpool_dedication_url', true);
$gp_settings['artist'] = get_post_meta($post->ID, 'ghostpool_dedication_artist', true);
$gp_settings['song'] = get_post_meta($post->ID, 'ghostpool_dedication_song', true);
$gp_settings['artist_song'] = $gp_settings['artist'] . '. ' . $gp_settings['song'];

View File

@ -16,7 +16,7 @@
<div class="columns threefourths last text-left">
<span class="user-nicename"><a href="<?php echo bp_displayed_user_link(); ?>" title="<?php bp_displayed_user_fullname(); ?>"><?php bp_displayed_user_fullname(); ?> (<?php bp_displayed_user_username(); ?>)</a></span>
<div id="item-meta">
<?php if (bp_is_active('dedications')) : ?>
<?php if (bp_is_active(BP_DEDICATION_SLUG)) : ?>
<div class="my-dedications"><?php _e('My dedications:'); ?>&nbsp;<?php echo $bp->dedications->get_count_dedications_from_user(bp_displayed_user_id()); ?></div>
<div class="dedicated-to-me"><?php _e('Dedicated to me:'); ?>&nbsp;<?php echo $bp->dedications->get_count_dedications_to_user(bp_displayed_user_id()); ?></div>
<?php endif; ?>

View File

@ -1,25 +0,0 @@
<?php if($gp_settings['title'] == "Show") { ?><h1><?php the_title(); ?></h1><?php } ?>
<?php require_once('post-meta.php'); ?>
<?php if($post->post_content) { ?>
<?php the_content(); ?>
<div class="sc-divider"></div>
<?php } ?>
<?php $args = array('post_type' => 'attachment', 'post_mime_type' => 'image', 'numberposts' => -1, 'post_mime_type' => 'image', 'orderby' => 'menu_order', 'order' => 'ASC', 'post_parent' => $post->ID); $attachments = get_children($args); if ($attachments) { foreach ($attachments as $attachment) { ?>
<a href="<?php echo wp_get_attachment_url($attachment->ID); ?>" rel="prettyPhoto[gallery]" title="<?php echo $attachment->post_excerpt ?>">
<?php $image = vt_resize($attachment->ID, '', 137, 100, true); ?>
<img src="<?php echo $image[url]; ?>" width="<?php echo $image[width]; ?>" height="<?php echo $image[height]; ?>" alt="<?php echo $attachment->post_title ?>" class="review-image " />
</a>
<?php }} ?>
<?php wp_link_pages('before=<div class="clear"></div><div class="wp-pagenavi post-navi">&pagelink=<span>%</span>&after=</div>'); ?>
<?php if($gp_settings['author_info'] == "0") { ?><div class="clear"></div><?php echo do_shortcode('[author]'); } ?>
<?php if($gp_settings['related_items'] == "0") { require('related-items.php'); } ?>
<?php comments_template(); ?>

View File

@ -1,127 +0,0 @@
<?php global $gp_settings;
?>
<!--Begin Review Links-->
<?php if(get_post_meta($post->ID, 'ghostpool_link_title_1', true)) { ?>
<div id="review-links">
<ul>
<li class="tab-link tab-active"><a href="#0"><?php echo $gp_settings['review_tab']; ?></a></li>
<?php for($i = 1; $i < 11; $i++) { if(get_post_meta($post->ID, 'ghostpool_link_title_'.$i, true)) { // Begins Links ?>
<li<?php if(!preg_match("/http:/", get_post_meta($post->ID, 'ghostpool_link_url_'.$i, true))) { ?> class="tab-link"<?php } ?>><a href="<?php if(preg_match("/http:/", get_post_meta($post->ID, 'ghostpool_link_url_'.$i, true))) { echo(get_post_meta($post->ID, 'ghostpool_link_url_'.$i, true)); } else { ?>#<?php echo $i; } ?>"><?php echo(get_post_meta($post->ID, 'ghostpool_link_title_'.$i, true)); ?></a></li>
<?php }} ?>
</ul>
</div>
<?php } ?>
<!--End Review Links-->
<!--Begin Review Container-->
<div id="review-container">
<!--Begin Review Left-->
<div id="review-left" style="width: <?php echo $gp_settings['review_left_width']; ?>px;">
<!--Begin Image-->
<?php if(has_post_thumbnail() && $gp_settings['show_image'] == "Show") { ?>
<div class="post-thumbnail">
<?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(); } ?>" />
</div>
<!--Begin More Images-->
<?php $args = array('post_type' => 'attachment', 'post_parent' => $post->ID, 'numberposts' => -1, 'orderby' => 'menu_order', 'order' => 'ASC'); $attachments = get_children($args); if($attachments) { foreach ($attachments as $attachment) { if($attachment->menu_order >= 1) { $attachment_counter++; ?>
<a href="<?php if(get_post_meta($attachment->ID, '_ghostpool_video_url', true)) { ?>file=<?php echo get_post_meta($attachment->ID, '_ghostpool_video_url', true); ?>&image=<?php echo wp_get_attachment_url($attachment->ID); } else { echo wp_get_attachment_url($attachment->ID); } ?>" id="more-images-link" rel="prettyPhoto[large]"<?php if($attachment_counter > 1) { ?> style="display: none"<?php } ?>><?php if($attachment_counter == 1) { _e('More Images', 'gp_lang'); } else {} ?></a>
<?php }}} ?>
<!--End More Images-->
<?php } ?>
<!--End Image-->
<!--Begin Review Details-->
<div id="review-details">
<?php if(function_exists('wpfp_link')) { wpfp_link(); } ?>
<?php if((defined('STARRATING_INSTALLED') && ($gp_settings['user_voting'] != "Users cannot vote") OR $gp_settings['gp_gdsr']->review > 0)) { ?>
<?php echo nl2br(do_shortcode(get_post_meta($post->ID, 'ghostpool_review_details', true))); ?>
<?php } ?>
</div>
<!--End Review Details-->
</div>
<!--End Review Left-->
<!--Begin Review Right-->
<div id="review-right" style="width: <?php echo $gp_settings['review_right_width']; ?>px;">
<?php if($gp_settings['title'] == "Show") { ?><h1><?php the_title(); ?></h1><?php } ?>
<!--Begin Post Meta-->
<?php require_once('post-meta.php'); ?>
<!--End Post Meta-->
<!--Begin Scores-->
<?php if($gp_settings['gp_gdsr']->review > 0 OR $gp_settings['user_voting'] != "Users cannot vote") { ?>
<!--Begin Site Score-->
<?php if(defined('STARRATING_INSTALLED') && $gp_settings['gp_gdsr']->review > 0) { ?>
<div class="site-score"<?php echo $site_score_color; ?>>
<div class="site-score-title"><?php _e('Site Score', 'gp_lang'); ?></div>
<?php echo $gp_settings['gp_gdsr']->review; ?>
</div>
<?php } ?>
<!--End Site Score-->
<!--Begin Good/Bad-->
<?php if(get_post_meta($post->ID, 'ghostpool_good_point', true) OR get_post_meta($post->ID, 'ghostpool_bad_point', true)) { ?>
<div class="good-bad-panel" style="width: <?php echo $gp_settings['good_bad_width']; ?>px;">
<div class="good-point"><strong><?php _e('Good', 'gp_lang'); ?>:</strong> <?php echo get_post_meta($post->ID, 'ghostpool_good_point', true); ?></div>
<div class="bad-point"><strong><?php _e('Bad', 'gp_lang'); ?>:</strong> <?php echo get_post_meta($post->ID, 'ghostpool_bad_point', true); ?></div>
</div>
<?php } ?>
<!--End Good/Bad-->
<div class="clear"></div>
<!--Begin User Score-->
<?php if(defined('STARRATING_INSTALLED') && $gp_settings['user_voting'] != "Users cannot vote") { ?>
<div class="user-score"<?php echo $user_score_color; ?>>
<div class="user-score-title"><?php _e('User Score', 'gp_lang'); ?></div>
<?php echo $gp_settings['gp_gdsr']->rating; ?>
<div class="user-votes">(<?php echo $gp_settings['gp_gdsr']->votes; ?> <?php _e('votes' ,'gp_lang'); ?>)</div>
</div>
<div class="user-voting">
<?php if($gp_settings['user_voting'] == "Vote only when posting a comment") {} else { ?><div class="user-voting-text"><?php _e('Click to vote', 'gp_lang'); ?></div><div class="clear"></div><?php } ?>
<div class="user-score-stars">
<?php if($gp_settings['user_voting'] == "Vote only when posting a comment") { wp_gdsr_render_article(0, true); } else { wp_gdsr_render_article(0, false); } ?>
</div>
</div>
<?php } ?>
<!--End User Score-->
<?php } else { ?>
<!--Begin Review Details-->
<div id="review-details">
<?php echo nl2br(do_shortcode(get_post_meta($post->ID, 'ghostpool_review_details', true))); ?>
</div>
<!--End Review Details-->
<?php } ?>
<!--End Scores-->
</div>
<!--End Review Right-->
</div>
<!--End Review Container-->
<?php require_once('review-tabs.php'); ?>

View File

@ -5,7 +5,7 @@ global $gp_settings;
?>
<?php $main_query = new WP_Query($query_string); if ($main_query->have_posts()) : while ($main_query->have_posts()) : $main_query->the_post(); ?>
<?php if (in_category('dedication')) { $is_video = true; ?>
<?php if (in_category(DEDICATION_CATEGORY_SLUG)) { $is_video = true; ?>
<?php require_once('single-video.php'); ?>
<?php } ?>
<?php endwhile; endif; ?>
@ -16,15 +16,7 @@ global $gp_settings;
<?php $main_query = new WP_Query($query_string); if ($main_query->have_posts()) : while ($main_query->have_posts()) : $main_query->the_post(); ?>
<?php if($gp_settings['post_type'] == "Review") { ?>
<?php require_once('single-review.php'); ?>
<?php } elseif($gp_settings['post_type'] == "Image Gallery") { ?>
<?php require_once('single-image-gallery.php'); ?>
<?php } else { ?>
<?php if(1) { ?>
<?php if($gp_settings['title'] == "Show") { ?><h1><?php the_title(); ?></h1><?php } ?>

View File

@ -356,10 +356,12 @@ ul.navmenu li a.profile:hover {
#dedicationFooter_container h3 {
margin: 10px 0 5px 8px;
font-size: 24px;
white-space: nowrap;
}
#dedicationFooter_container h4 {
margin: 0px 0 0 8px;
white-space: nowrap;
}
#slider-wrapper {
@ -973,7 +975,7 @@ h3.comments {
}
.comment-text {
padding: 0;
padding: 0 25px 10px 0 ;
font-size: 14px;
}
@ -997,11 +999,38 @@ h3.comments {
font-weight: bold;
}
#commentform {
margin: 0;
}
#respond {
padding: 0 25px 0 0;
}
#respond form {
padding: 0;
}
#respond.homepage textarea {
height: 90px !important;
}
#respond h3 {
margin: 0;
border-bottom: none;
}
.yjl-pager {
margin: 20px 0;
clear: both;
}
.yjl-pager .currentPager {
background: #576A7B;
color: white;
}
/*************************** Page/Post ***************************/

View File

@ -14,7 +14,7 @@ get_currentuserinfo();
?>
<?php
if ($_ishome || ( $bp->current_component == 'dedications' )) {
if ($_ishome || ( $bp->current_component == BP_DEDICATION_SLUG )) {
$posts_per_page = $theme_video_slides;
$dedication_orderby = "date";
@ -61,36 +61,40 @@ if (have_posts()) {
<ul id='playlist'>
<?php
while (have_posts()) : the_post();
while (have_posts()) : the_post(); include('loop-dedication-data.php');
// 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_id = get_post_meta($post->ID, 'ghostpool_destination_user_id', true);
$to_user = get_user_by('id', $to_user_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);*/
$displayed_id = bp_displayed_user_id();
// En el perfil del usuario sólo mostrar las dedicadas por él y para él. El resto se descartan.
if ( $bp->current_component == 'dedications' ) {
if (($displayed_id != $from_user_id) && ($displayed_id != $to_user_id)) {
// Perfil del usuario: sólo mostrar las dedicadas por él y para él. El resto se descartan.
if ( $bp->current_component == BP_DEDICATION_SLUG ) {
if (($displayed_id != $gp_settings['from_user_id']) && ($displayed_id != $gp_settings['to_user_id'])) {
continue; // me salto esta dedicatoria
}
}
// Usuario actual puede ver la dedicatoria?
// Página de inicio / página del video: Usuario actual puede ver la dedicatoria?
if ($post->post_status == 'private') {
if (($current_user->ID != $from_user_id) && ($current_user->ID != $to_user_id)) {
if (($current_user->ID != $gp_settings['from_user_id']) && ($current_user->ID != $gp_settings['to_user_id'])) {
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);
$song = get_post_meta($post->ID, 'ghostpool_dedication_song', true);
$song = get_post_meta($post->ID, 'ghostpool_dedication_song', true);*/
$video = $gp_settings['video'];
if ($_ishome) {
if ($theme_homepage_not_repeat_videos) {
@ -100,7 +104,8 @@ if (have_posts()) {
}
}
}
$urls_video[] = $video;
$urls_video[] = $videos;
// Video Type
$vimeo = strpos($video, "vimeo.com");
@ -124,31 +129,20 @@ if (have_posts()) {
$data_type = 'vimeo_single';
$data_path = 'http://vimeo.com/api/v2/video/' . $video_id . '.json';
}
?>
<li data-type='<?php echo $data_type; ?>' data-path='<?php echo $data_path; ?>'>
<span id="postdata-id-<?php echo $slide_counter; ?>"><?php the_ID(); ?></span>
<span id="postdata-title-<?php echo $slide_counter; ?>"><?php the_title(); ?></span>
<span id="postdata-artist-<?php echo $slide_counter; ?>"><?php echo $artist; ?></span>
<span id="postdata-song-<?php echo $slide_counter; ?>"><?php echo $song; ?></span>
<span id="postdata-title-<?php echo $slide_counter; ?>"><a href="<?php the_permalink(); ?>" title="<?php the_title(); ?>"><?php the_title(); ?></a></span>
<span id="postdata-artist-<?php echo $slide_counter; ?>"><?php echo $gp_settings['artist']; ?></span>
<span id="postdata-song-<?php echo $slide_counter; ?>"><?php echo $gp_settings['song']; ?></span>
<span id="postdata-comments-<?php echo $slide_counter; ?>">
<?php require('home-comments.php'); ?>
</span>
<span id="postdata-from-to-<?php echo $slide_counter; ?>">
<?php
gp_the_flag($from_user_id);
?>
<span>FROM:
<a href="<?php echo bp_core_get_userlink($from_user_id, false, true); ?>" title="<?php echo bp_core_get_username($from_user_id); ?>"><?php echo bp_core_get_username($from_user_id); ?></a>
</span>
<?php
if ($to_user) {
gp_the_flag($to_user->ID);
?><span>TO: <a href="<?php echo bp_core_get_userlink($to_user->ID, false, true); ?>" title="<?php echo bp_core_get_username($to_user->ID); ?>"><?php echo bp_core_get_username($to_user->ID); ?></a></span>
<?php } else { ?>
<?php gp_the_flag(); ?>
<span>TO: <?php echo get_post_meta($post->ID, 'ghostpool_destination_user_name', true); ?></span>
<?php } ?>
<?php echo $gp_settings['from_flag']; ?><span>FROM: <?php echo $gp_settings['from_user_link']; ?></span>&nbsp;
<?php echo $gp_settings['to_flag']; ?><span>TO: <?php echo $gp_settings['to_user_link']; ?></span>
</span>
</li>
<?php } $slide_counter++; ?>
@ -249,12 +243,18 @@ if (have_posts()) {
}
var the_id = jQuery('#postdata-id-' + id).text();
var new_title = jQuery('#postdata-title-' + id).text();
var new_title = jQuery('#postdata-title-' + id).html();
var from_to = jQuery('#postdata-from-to-' + id).html();
var artist = jQuery('#postdata-artist-' + id).html();
var song = jQuery('#postdata-song-' + id).html();
var comments = jQuery('#postdata-comments-' + id).html();
console.log('id => ' + id);
console.log('new_title => ' + new_title);
console.log('artist => ' + artist);
console.log('song => ' + song);
var nUrl = oUrl + 'id/' + the_id;
jQuery('#dedicate_this_song_button').attr("href", nUrl);
@ -278,7 +278,7 @@ if (have_posts()) {
);
jQuery('#dedicationTitle').html(new_title);
shrinkTitle();
jQuery('#dedicationTitle').jTypeWriter();
jQuery('#dedicationTitle a').jTypeWriter();
jQuery('#dedicationComments_container').slideUp(
'fast',