ASong2U_Web/wp-content/themes/score/comments.php
david 847d7638a0 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
2012-07-26 17:33:26 +00:00

145 lines
5.2 KiB
PHP

<?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>
<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>
</div>
<?php } ?>
<div id="comments">
<?php if('open' == $post->comment_status OR have_comments()) : ?>
<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 else : // this is displayed if there are no comments so far ?>
<?php if ( comments_open() ) : ?>
<!-- If comments are open, but there are no comments. -->
<?php else : // comments are closed ?>
<!-- If comments are closed. -->
<p class="nocomments"><?php _e('Comments are closed.'); ?></p>
<?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 ?>