I've been told to wrap the comments function on a funcionality the plugin has.
I search for the function on the plugin and it's this one:
//Private Tag with AND statement Account Type
case 'private_and':
if (ym_user_has_access() && strtolower($argument) == strtolower($ym_user->account_type)){
$return = $matches;
}
I need help recognizing where is the comment loop, I'm not really a php ninja.
<?php
/**
* @package WordPress
* @subpackage Default_Theme
*/
// 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() ) { ?>
<p class="nocomments"><?php _e('Essa postagem é protegida por senha, se você errá-la, seu computador irá explodir.', 'framework') ?></p>
<?php
return;
}
?>
<!-- You can start editing here. -->
<div id="comments">
<?php if ( have_comments() ) : ?>
<?php if ( ! empty($comments_by_type['comment']) ) : ?>
<h3 id="comments-h3">
<?php comments_number(__('Deixe na conta do Papa', 'framework'), __('1 na conta do Papa', 'framework'), __('% na conta do Papa', 'framework') );?>
</h3>
<ol class="commentlist">
<?php wp_list_comments('type=comment&avatar_size=50&callback=custom_comment_fun'); ?>
</ol>
<?php endif; ?>
<?php if ( ! empty($comments_by_type['pings']) ) : ?>
<div class="trackbacks">
<h3 id="pings">Trackbacks/Pings</h3>
<ul>
<?php wp_list_comments('type=pings&callback=list_pings'); ?>
</ul>
</div>
<?php endif; ?>
<div class="navigation">
<div class="alignleft">
<?php previous_comments_link() ?>
</div>
<div class="alignright">
<?php next_comments_link() ?>
</div>
</div>
<?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. -->
<?php endif; ?>
<?php endif; ?>
<?php if ( comments_open() ) : ?>
<div id="respond">
<h3>
<?php comment_form_title( __('Deixar na conta do Papa', 'framework'), __('Deixe um comentário para %', 'framework') ); ?>
</h3>
<br/>
Quer ver seu avatar nos comentários? Faça uma conta gratuita no <strong><a target="_blank" href="http://pt.gravatar.com"/><span style="color: #dd2221;">Gravatar</a></span></strong>.<br/> Os comentários são um espaço para conversarmos. Concordar ou discordar não faz diferença, mas educação, sim. Se você sabe dialogar, concordando ou discordando educadamente, seja bem-vindo.<br/><br/>
<div class="cancel-comment-reply">
<?php cancel_comment_reply_link(); ?>
</div>
<?php if ( get_option('comment_registration') && !is_user_logged_in() ) : ?>
<p><?php _e('You must be', 'framework') ?> <a href="<?php echo wp_login_url( get_permalink() ); ?>"><?php _e('logged in', 'framework') ?></a> <?php _e('para deixar na conta do Papa.', 'framework') ?></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 _e('Logado como', 'framework') ?> <a href="<?php echo get_option('siteurl'); ?>/wp-admin/profile.php"><?php echo $user_identity; ?></a>. <a href="<?php echo wp_logout_url(get_permalink()); ?>" title="<?php _e('Deslogar dessa conta', 'framework') ?>"><?php _e('Deslogar »', 'framework') ?></a></p>
<?php else : ?>
<p>
<label for="author"><small><?php _e('Nome', 'framework') ?>
<?php if ($req) _e('(required)', 'framework'); ?>
</small></label>
<br />
<input type="text" name="author" id="author" value="<?php echo esc_attr($comment_author); ?>" size="22" tabindex="1"/>
</p>
<p>
<label for="email"><small><?php _e('e-mail (não será publicado)', 'framework') ?>
<?php if ($req) _e('(Obrigatório)', 'framework'); ?>
</small></label>
<br />
<input type="text" name="email" id="email" value="<?php echo esc_attr($comment_author_email); ?>" size="22" tabindex="2" />
</p>
<p>
<label for="url"><small><?php _e('Website', 'framework') ?></small></label>
<br />
<input type="text" name="url" id="url" value="<?php echo esc_attr($comment_author_url); ?>" size="22" tabindex="3" />
</p>
<?php endif; ?>
<!--<p><small><strong>XHTML:</strong> You can use these tags: <code><?php echo allowed_tags(); ?></code></small></p>-->
<p>
<label for="comment"><small><?php _e('Digite abaixo o seu comentário', 'framework') ?></small></label>
<br />
<textarea name="comment" id="comment" cols="58" rows="10" tabindex="4"></textarea>
</p>
<p>
<input name="submit" type="submit" id="submit" tabindex="20" value="<?php _e('ENVIAR', 'framework') ?>" />
<?php comment_id_fields(); ?>
</p>
<?php do_action('comment_form', $post->ID); ?>
</form>
</div>
<?php endif; // If registration required and not logged in ?>
<?php endif; // if you delete this the sky will fall on your head ?>
</div>
I got a tip from a developer over there saying that I should do this:
if (ym_user_has_access()) {
// comment submit form
}
But like I said, I'm no php programmer, I'm really new to it, I just need a bit of pointing "this is what you are looking for". I hope it's not to much to ask for. A problem when you don't know what you are talking about is not knowing the limits too from "too much" or "too little". I guess.
Thank you