Boa tarde,
Quando posto novas perguntas no meu site http://askedu.com.br ele não está fazendo a contagem dos pontos. Ele estava funcionando, mas do nada parou. Se desejarem, por gentileza, entrem no site e façam os testes.
As respostas estão funcionando normalmente. Toda vez que algum membro do site responde alguma pergunta, a contagem funciona normalmente.
Segue abaixo os códigos que acredito que está o problema.
Qualquer dúvida, estou a disposição para maiores esclarecimentos.
ask-a-question.php
<?php
/**
* @package WordPress
* @subpackage Robust Q&A - WPQA
Template Name: Ask A Question
*/
?>
<?php
if (isset($_POST['ask_text'])) {
$ask_text = $_POST['ask_text'];
}
if ( isset($_POST['question_post']) == '1') {
$question_title = $_POST['question_title'];
$question_content = $_POST['question_content'];
$question_category = $_POST['cat'];
$question_tags = $_POST['question_tags'];
if (isset($_POST['notify_new_answers'])) {$new_answer_alerts = $_POST['notify_new_answers'];} else {$new_answer_alerts = '';}
if (isset($_POST['username'])) {$username = $_POST['username'];} else {$username = '';}
if (isset($_POST['password'])) {$password = $_POST['password'];} else {$password = '';}
if (isset($_POST['user_login'])) {$username2 = $_POST['user_login'];} else {$username2 = '';}
if (isset($_POST['password2'])) {$password2 = $_POST['password2'];} else {$password2 = '';}
if (isset($_POST['pass_confirm'])) {$confirm = $_POST['pass_confirm'];} else {$confirm = '';}
if (isset($_POST['user_email'])) {$email = $_POST['user_email'];} else {$email = '';}
if (isset($_POST['user_type'])) {$user_type = $_POST['user_type'];} else {$user_type = '';}
$question_data = array('title' => $question_title, 'content' => $question_content, 'tags' => $question_tags, 'cat' => $question_category, 'email_alert' => $new_answer_alerts);
$login_data = array('username' => $username, 'password' => $password);
$signup_data = array('username' => $username2, 'password' => $password2, 'confirm_pass' => $confirm, 'email' => $email);
$message = post_new_question($question_data, $login_data, $signup_data, $user_type);
}
get_header();
?>
<?php include (TEMPLATEPATH . '/translations.php'); ?>
<!-- Main Section -->
<div id="main">
<div class="mainContentTop"></div>
<div id="mainContent">
<!-- Center Column -->
<div id="centerCol" class="left">
<!-- Top Section -->
<div class="topSection">
<div class="introBox2">
<div class="greyBtn addQuestion"><a href="<?php echo home_url(); ?>/<?php echo $t_ask_a_question_permalink; ?>/"><span><?php echo $t_ask_question; ?> <img src="<?php echo get_template_directory_uri(); ?>/images/grey-add-btn-icon.jpg" alt="" /></span></a></div>
<?php include (TEMPLATEPATH . '/breadcrumb.php'); ?>
</div>
</div>
<!-- / Top Section -->
<!-- Left Inner Column -->
<div id="leftColInner" class="left">
<h1 class="pageTitle"><?php the_title(); ?></h1>
<?php if (have_posts()) : while (have_posts()) : the_post(); ?>
<?php
if (isset($message)) {
display_message($message);
} ?>
<?php the_content(); ?>
<!-- Ask a Question Form -->
<div class="post" id="post-<?php the_ID(); ?>">
<form method="post" action="" id="postNewQuestion" name="postNewQuestion">
<label><?php echo $t_ask_form_question_title;?>:<span class="asterixRequired">*</span></label>
<input type="text" name="question_title" id="question_title" size="30" value="<?php if(isset($ask_text)) {echo $ask_text;} if (isset($_POST['question_title'])) {echo stripslashes($_POST['question_title']);}?>" tabindex="1" autofocus />
<label><?php echo $t_ask_form_question_desc; ?>: <span class="asterixRequired">*</span></label>
<textarea rows="5" cols="40" name="question_content" id="question_content" class="question_content" tabindex="2"><?php if (isset($_POST['question_content'])) {echo stripslashes($_POST['question_content']);}?></textarea>
<label><?php echo $t_ask_form_question_tags; ?>: <span class="normal">(<?php echo $t_optional_text_tags;?>)</span></label>
<input type="text" name="question_tags" id="question_tags" size="250" value="<?php if (isset($_POST['question_tags'])) {echo stripslashes($_POST['question_tags']);}?>" tabindex="3" />
<label class="categorySelect"><?php echo $t_ask_form_question_select_cat; ?>:<span class="asterixRequired">*</span></label>
<?php
$cat_id = '';
if (isset($_POST['cat'])) {
$cat_id = $_POST['cat'];
} elseif ( isset($_GET['cat'])) {
$cat_id = $_GET['cat'];
}
?>
<?php wp_dropdown_categories('orderby=name&id=askQuestion&tab_index=4&hide_empty=0&exclude=1&hierarchical=1&selected='.$cat_id.'&show_option_none='.$t_select_category_dd.'') ?><br />
<div class="notifyMe">
<input type="checkbox" name="notify_new_answers" id="notify_new_answers" tabindex="5"/>
<label for="notify_new_answers" id="notifyNewAnswers"><?php echo $t_ask_form_notify_emails; ?></label>
</div>
<div class="clear"></div>
<?php if (!is_user_logged_in()) { ?>
<div class="divider"></div>
<!-- Log In Box -->
<div class="loginBox" id="loginBox">
<label><?php echo $t_login_mini_form_heading;?>:</label><br /><br />
<label class="loginLabel"><?php echo $t_username_text;?>:<span class="asterixRequired">*</span></label>
<div class="loginInput"><input type="text" name="username" value="<?php if (isset($username)) { echo $username;} elseif (isset($_POST['user_login'])) {echo $_POST['user_login']; }?>" tabindex="6" /></div>
<label class="loginLabel"><?php echo $t_password_text;?>:<span class="asterixRequired">*</span></label>
<div class="loginInput"><input type="password" name="password" id="user_password" class="input" value="" size="20" maxlength="40" tabindex="7" /></div>
<div class="clear"></div>
<p><?php echo $t_not_member_yet_text; ?> <a id="showSignUpBox"><?php echo $t_signup_text; ?></a></p>
</div>
<!-- / Log In Box -->
<!-- Sign Up Box -->
<div class="signUpBox" id="signUpBox" style="display:none;">
<label><?php echo $t_new_member_mini_form_heading; ?>:</label><br /><br />
<label class="loginLabel"><?php echo $t_choose_username_text; ?>:<span class="asterixRequired">*</span></label>
<input type="text" name="user_login" id="new_user_login" class="text" value="<?php if (isset($_POST['user_login'])) {echo $_POST['user_login'];} ?>" tabindex="8" />
<label class="loginLabel"><?php echo $t_choose_password_text; ?>:<span class="asterixRequired">*</span></label>
<input type="password" name="password2" id="password1" class="text" value="" tabindex="9"/>
<label class="loginLabel"><?php echo $t_reenter_password_text; ?>:<span class="asterixRequired">*</span></label><br />
<input type="password" name="pass_confirm" id="password2" class="text" value="" tabindex="10" />
<label class="loginLabel"><?php echo $t_email_address_text; ?>:<span class="asterixRequired">*</span></label><br />
<input type="text" class="text" name="user_email" id="user_email" value="<?php if(isset($_POST['user_email'])) {echo $_POST['user_email'];} ?>" tabindex="11" />
<div class="clear"></div>
<p><?php echo $t_already_member_text; ?> <a id="showLoginBox"><?php echo $t_login_text; ?></a></p>
</div>
<!-- / Sign Up Box -->
<input type="hidden" name="user_type" value="old" id="user_type" />
<?php } else { ?>
<?php } ?>
<input type="hidden" name="question_post" value="1" />
<?php if (is_user_logged_in()) { ?>
<input type="hidden" name="user_type" value="old" id="user_type" />
<?php } ?>
<div class="divider"></div>
<input type="submit" value="<?php echo $t_ask_form_submit_question_btn; ?>" class="left" />
<div class="clear"></div>
</form>
</div>
<!-- Ask a Question Form -->
<?php endwhile; endif; ?>
<div class="reset"></div>
</div>
<!-- / Left Inner Column -->
<?php get_sidebar(); ?>
</div>
<!-- / Center Column -->
<div class="clear"></div>
</div>
</div>
<div class="mainContentBottom"></div>
<!-- / Main Section -->
<?php get_footer(); ?>
comments.php
<?php
/**
* @package WordPress
* @subpackage Robust Q&A - WPQA
*/
// Do not delete these lines
global $current_user;
get_currentuserinfo();
$redir = $post->ID;
if (!empty($_SERVER['SCRIPT_FILENAME']) && 'comments.php' == basename($_SERVER['SCRIPT_FILENAME']))
die ('Please do not load this page directly. Thanks!');
if ( post_password_required() ) {
return;
}
?>
<?php include (TEMPLATEPATH . '/translations.php'); ?>
<?php if ( have_comments() ) : ?>
<?php foreach ($comments as $comment) :?>
<?php
// Get data for displaying avatar
$blog_url = get_template_directory_uri();
$selected_avatar_image = get_user_default_icon($comment->user_id);
$avatar_image = '/images/default-user-avatar-'.$selected_avatar_image.'.jpg';
$url = $blog_url . $avatar_image ;
// Get data for linking to member profile when clicking avatar image
$main_url = home_url();
$author_name = get_comment_author();
$profile_link = '/'. $t_profile_permalink.'/';
$author_profile_link = $main_url . $profile_link . $author_name;
?>
<!-- Best Answer -->
<?php if ( get_comment_meta($comment->comment_ID, 'best_answer', true ) == 'yes') { ?>
<div class="bestAnswer">
<h5><?php echo $t_best_answer_heading; ?></h5>
<div class="questionRow">
<div class="questionBox">
<div class="memberIcon memberIconSm"><a href="<?php echo $author_profile_link ?>">
<?php
$member_provided_avatar = get_user_meta($comment->user_id, 'member_provided_avatar', true);
if(isset($member_provided_avatar) && $member_provided_avatar != '') {
$thumb_url = get_custom_user_avatar($comment->user_id);
?>
<img src="<?php echo $thumb_url; ?>" class="avatar" />
<?php } else {
echo get_avatar($comment->comment_author_email, $size = '32', $url);
}
?>
</a></div>
<div class="contentText">
<p class="answer"><?php comment_text() ?></p>
<?php if (get_comment_meta($comment->comment_ID, 'answer_source_link', true) != NULL) { ?>
<p class="sourceLink"><span><?php echo $t_link_text;?>: </span><a href="<?php echo get_comment_meta($comment->comment_ID, 'answer_source_link', true) ?>" target="_blank"><?php echo get_comment_meta($comment->comment_ID, 'answer_source_link', true) ?></a></p>
<?php } ?>
<?php $comment_parent_id = $comment->comment_post_ID;
$question = get_post($comment_parent_id);
global $current_user;
get_currentuserinfo();
?>
</div>
<div class="clear"></div>
</div>
<div class="bylineBox otherBylineBox"><a href="<?php echo home_url(); ?>/<?php echo $t_profile_permalink; ?>/<?php echo $comment->comment_author ?>/"><span><?php echo $comment->comment_author ?><?php echo getPointLevel($comment->user_id, 'sm'); ?><?php $expert_user = get_user_meta($comment->user_id, 'expert', true); if($expert_user == 'yes') { ?><img src="<?php echo get_template_directory_uri(); ?>/images/expert-badge-icon.png" alt="<?php echo $t_expert_text;?>" class="expertImg" /><?php } ?></span></a></div>
<?php
if (is_user_logged_in()) {
?>
<!-- Report Answer Modal -->
<div class="reportPop hiddenContent" id="reportPopComment<?php echo get_comment_ID();?>">
<form action="" method="post" name="reportContent">
<p><?php echo $t_report_content_message_text;?></p>
<br />
<input type="hidden" value="<?php echo get_comment_ID(); ?>" name="reported_item_id" />
<input type="hidden" value="Answer" name="reported_type" />
<input type="hidden" value="<?php echo $post->ID; ?>" name="question_id" />
<input type="hidden" value="1" name="report_content" />
<input type="submit" class="process" value="<?php echo $t_report_answer;?>" />
</form
><div class="clear"></div>
</div>
<!-- / Report Answer Modal -->
<div class="bylineBoxFlag"><a href="#reportPopComment<?php echo get_comment_ID();?>" onclick="return; false" class="boxy" title="<?php echo $t_report_answer;?>"><span><img src="<?php echo get_template_directory_uri(); ?>/images/flag-this-icon.png" alt="<?php echo $t_report_answer;?>" /></span></a></div>
<?php } else { ?>
<div class="bylineBoxFlag"><a href="<?php echo home_url(); ?>/<?php echo $t_login_permalink; ?>/?redir=<?php echo $redir; ?>" title="<?php echo $t_login_signup_report_content_text; ?>"><span><img src="<?php echo get_template_directory_uri(); ?>/images/flag-this-icon.png" alt="<?php echo $t_report_answer;?>" /></span></a></div>
<?php } ?>
<span class="adminUrl" id="<?php echo admin_url(); ?>"></span>
<span class="templateURL" id="<?php echo get_template_directory_uri(); ?>"></span>
<?php $comment_id = $comment->comment_ID;?>
<?php $current_like_count = get_comment_meta($comment_id, 'like_count');?>
<?php if ($current_like_count[0] == NULL || $current_like_count[0] == 0){$current_like_count[0] = 0;}?>
<span class="likeCount-<?php echo $comment_id ?>" id="likeCountCurrent-<?php echo $current_like_count[0]?>"></span>
<?php
if (is_user_logged_in()) {
global $wpdb;
$current_user_id = get_current_user_id();
$user_liked_already = '';
$get_user_liked_question_value = "SELECT * FROM " . $wpdb->prefix . "rqa_liked_content WHERE user_id ='". $current_user_id . "' AND like_content_id ='". $comment_id . "'" ;
$users_liked_question_value = $wpdb->get_results($get_user_liked_question_value);
foreach ($users_liked_question_value as $user_liked) {
if ($user_liked->user_id == $current_user_id && $user_liked->like_content_id == $comment_id) {
$user_liked_already = "yes";
}
}
if ($user_liked_already == 'yes') {
?>
<div class="likeContent">
<div class="bylineBox right disabledLike"><a href="#" onclick="return false;" class="likeThisContent"><span><img src="<?php echo get_template_directory_uri(); ?>/images/like-icon.png" alt="<?php echo $t_like_text; ?>" /><?php if ($current_like_count[0] > 0) { echo $current_like_count[0];} else {echo $t_like_text;} ?></span></a></div>
</div>
<?php } else { ?>
<div class="likeContent">
<div class="bylineBox right likeThisLink" id="like-this-<?php echo get_comment_ID(); ?>"><a href="#" onclick="return false;" class="likeThisContent" id="type-comment"><span><img src="<?php echo get_template_directory_uri(); ?>/images/like-icon.png" alt="<?php echo $t_like_text; ?>" /><?php if ($current_like_count[0] > 0) { echo $current_like_count[0];} else {echo $t_like_text;} ?></span></a></div>
</div>
<?php } ?>
<?php } else { ?>
<div class="likeContent">
<div class="bylineBox right likeThisLink"><a href="<?php echo home_url(); ?>/<?php echo $t_login_permalink; ?>/?redir=<?php echo $redir; ?>" title="<?php echo $t_login_signup_like; ?>"><span><img src="<?php echo get_template_directory_uri(); ?>/images/like-icon.png" alt="<?php echo $t_like_text; ?>" /><?php if ($current_like_count[0] > 0) { echo $current_like_count[0];} else {echo $t_like_text;} ?></span></a></div>
</div>
<?php } ?>
<div class="clear"></div>
<div class="commentOnAnswer">
<?php
$answer_comments = get_answer_comments($comment->comment_ID);
$comment_count = count($answer_comments);
?>
<div class="commentHeader">
<?php if ($comment_count != 0) { ?>
<a class="togglecomments" id="<?php echo get_comment_ID(); ?>"><img src="<?php echo get_template_directory_uri(); ?>/images/open-comments-icon.png" alt="" /></a>
<a class="togglecomments" id="<?php echo get_comment_ID(); ?>">
<?php
if ($comment_count == 1) {
echo '1 '.$t_comment_text;
} elseif ($comment_count > 1) {
echo $comment_count.' '.$t_comments_text;
}
?>
</a>
<?php } else { ?>
<?php echo $t_no_comments; ?>
<?php } ?>
<span>|</span>
<a class="toggleaddcommentform" id="<?php echo get_comment_ID(); ?>"><?php echo $t_add_a_comment;?></a>
<?php if ( current_user_can('manage_options')) {?>
<span>|</span>
<?php edit_comment_link($t_edit_page_link); ?>
<?php } ?>
</div>
<div class="commentOnAnswerForm" id="commentForm<?php echo get_comment_ID(); ?>" style="display:none;">
<?php
// If logged in show data
if ( is_user_logged_in()) { ?>
<h6><?php echo $t_add_a_comment;?>:</h6>
<form action="" method="post" name="commentSubmitForm" id="commentSubmitForm">
<textarea name="comment_content"></textarea>
<input type="hidden" name="comment_parent_id" value="<?php echo get_comment_ID(); ?>" />
<input type="hidden" name="comment_on_answer_post" value="1" />
<input type="submit" value="<?php echo $t_add_a_comment; ?>" />
<div class="clear"></div>
</form>
<?php } else { ?>
<div class="loginNote"><a href="<?php echo home_url();?>/<?php echo $t_login_permalink; ?>/?redir=<?php echo $redir; ?>" title="<?php echo $t_login_text;?>"><?php echo $t_login_to_comment_on_answer;?></a></div>
<?php }?>
</div>
<div class="comments" id="commentSection<?php echo get_comment_ID(); ?>" style="display:none;">
<?php
foreach ($answer_comments as $answer_comment) :
?>
<!-- Report Comment on Answer Modal -->
<div class="reportPop hiddenContent" id="reportPopComment<?php echo $answer_comment->comment_ID;?>">
<form action="" method="post" name="reportContent">
<p><?php echo $t_report_content_message_text; ?></p>
<br />
<input type="hidden" value="<?php echo $answer_comment->comment_ID; ?>" name="reported_item_id" />
<input type="hidden" value="Comment" name="reported_type" />
<input type="hidden" value="<?php echo $post->ID; ?>" name="question_id" />
<input type="hidden" value="1" name="report_content" />
<input type="submit" class="process" value="<?php echo $t_report_comment;?>" />
</form
><div class="clear"></div>
</div>
<!-- / Report Comment on Answer Modal -->
<div class="comment">
<?php if ( is_user_logged_in()) { ?>
<p class="right"><a href="#reportPopComment<?php echo $answer_comment->comment_ID;?>" onclick="return; false" class="boxy" title="<?php echo $t_report_comment;?>"><img src="<?php echo get_template_directory_uri(); ?>/images/flag-this-icon.png" alt="<?php echo $t_report_comment;?>" /></a></p>
<?php } else { ?>
<p class="right"><a href="<?php echo home_url(); ?>/<?php echo $t_login_permalink; ?>/?redir=<?php echo $redir; ?>" title="<?php echo $t_login_signup_report_content_text; ?>"><img src="<?php echo get_template_directory_uri(); ?>/images/flag-this-icon.png" alt="<?php echo $t_report_comment;?>" /></a></p>
<?php } ?>
<p><?php echo $answer_comment->comment_content; ?></p>
<p><a href="<?php echo home_url(); ?>/<?php echo $t_profile_permalink; ?>/<?php echo $answer_comment->comment_author ?>"><?php echo $answer_comment->comment_author;?></a></p>
<div class="clear"></div>
</div>
<div class="clear"></div>
<?php endforeach; ?>
</div>
</div>
</div>
<?php $answer_count = sizeof($comments);
if ($answer_count > 1) { ?>
<h5 class="otherAnswers"><?php echo $t_more_answers;?></h5>
<?php } ?>
</div>
<!-- / Best Answer -->
<?php } ?>
<?php endforeach; ?>
<?php endif; ?>
<?php if ( have_comments() ) :
?>
<?php $comments_ordered_by_vote_count = get_comments_ordered_by_meta('like_count', 'desc', $post->ID); ?>
<?php foreach ($comments_ordered_by_vote_count as $comment) :?>
<?php $comment_author = get_userdata($comment->user_id);?>
<?php if ( get_comment_meta($comment->comment_ID, 'best_answer', true ) == 'no' || get_comment_meta($comment->comment_ID, 'best_answer', false ) == NULL) {?>
<!-- Other Answers Besides the Best Answer or All Answers if no best answer -->
<div class="answers">
<!-- Answer -->
<div class="questionRow" id="answer_id_<?php echo $comment->comment_ID ?>">
<div class="questionBox">
<div class="memberIcon memberIconSm"><a href="<?php echo home_url(); ?>/<?php echo $t_profile_permalink; ?>/<?php echo $comment_author->user_nicename; ?>/">
<?php
$member_provided_avatar = get_user_meta($comment->user_id, 'member_provided_avatar', true);
if(isset($member_provided_avatar) && $member_provided_avatar != '') {
$thumb_url = get_custom_user_avatar($comment->user_id);
?>
<img src="<?php echo $thumb_url; ?>" class="avatar" />
<?php } else {
echo get_avatar($comment->comment_author_email, $size = '32', $url);
}
?>
</a></div>
<div class="contentText">
<p class="answer"><?php comment_text(); ?></p>
<?php if (get_comment_meta($comment->comment_ID, 'answer_source_link', true) != NULL) { ?>
<p class="sourceLink"><span><?php echo $t_link_text;?>: </span><a href="<?php echo get_comment_meta($comment->comment_ID, 'answer_source_link', true) ?>" target="_blank"><?php echo get_comment_meta($comment->comment_ID, 'answer_source_link', true) ?></a></p>
<?php } ?>
<?php $comment_parent_id = $comment->comment_post_ID;
$question = get_post($comment_parent_id);
global $current_user;
get_currentuserinfo();
$answer_source_link = get_comment_meta($comment->comment_ID, 'answer_source_link', true);
?>
<!-- Select Best Answer Modal -->
<div class="reportPop hiddenContent" id="bestAnswerPop<?php echo $comment->comment_ID; ?>">
<form action="" method="post" name="bestAnswer">
<p><?php echo $t_select_as_best_answer_pop_text;?></p>
<br />
<input type="hidden" value="<?php echo $comment->comment_ID; ?>" name="best_answer_id" />
<input type="hidden" value="<?php echo $question->ID; ?>" name="best_answer_parent_question" />
<input type="hidden" value="1" name="best_answer_post" />
<input type="submit" class="process" value="<?php echo $t_select_as_best_answer;?>" />
</form
><div class="clear"></div>
</div>
<!-- / Select Best Answer Modal -->
<?php if ($question->post_author == $current_user->ID && $comment->user_id != $current_user->ID) { ?>
<p class="bylineCategory voteBestAnswer"><a href="#bestAnswerPop<?php echo $comment->comment_ID;?>" onclick="return; false" class="boxy" title="<?php echo $t_select_as_best_answer;?>"><?php echo $t_select_as_best_answer;?></a></p>
<?php } ?>
</div>
<div class="clear"></div>
</div>
<div class="bylineBox otherBylineBox"><a href="<?php echo home_url(); ?>/<?php echo $t_profile_permalink; ?>/<?php echo $comment_author->user_nicename; ?>"><span><?php echo $comment->comment_author; ?><?php echo getPointLevel($comment->user_id, 'sm'); ?><?php $expert_user = get_user_meta($comment->user_id, 'expert', true); if($expert_user == 'yes') { ?><img src="<?php echo get_template_directory_uri(); ?>/images/expert-badge-icon.png" alt="<?php echo $t_expert_text;?>" class="expertImg" /><?php } ?></span></a></div>
<?php
if (is_user_logged_in()) {
?>
<!-- Report Answer Modal -->
<div class="reportPop hiddenContent" id="reportPopComment<?php echo get_comment_ID();?>">
<form action="" method="post" name="reportContent">
<p><?php echo $t_report_content_message_text; ?></p>
<br />
<input type="hidden" value="<?php echo get_comment_ID(); ?>" name="reported_item_id" />
<input type="hidden" value="Answer" name="reported_type" />
<input type="hidden" value="<?php echo $post->ID; ?>" name="question_id" />
<input type="hidden" value="1" name="report_content" />
<input type="submit" class="process" value="<?php echo $t_report_answer;?>" />
</form
><div class="clear"></div>
</div>
<!-- / Report Answer Modal -->
<div class="bylineBoxFlag"><a href="#reportPopComment<?php echo get_comment_ID();?>" onclick="return; false" class="boxy" title="<?php echo $t_report_answer;?>"><span><img src="<?php echo get_template_directory_uri(); ?>/images/flag-this-icon.png" alt="<?php echo $t_report_answer;?>" /></span></a></div>
<?php } else { ?>
<div class="bylineBoxFlag"><a href="<?php echo home_url(); ?>/<?php echo $t_login_permalink; ?>/?redir=<?php echo $redir; ?>" title="<?php echo $t_report_answer;?>"><span><img src="<?php echo get_template_directory_uri(); ?>/images/flag-this-icon.png" alt="<?php echo $t_report_answer;?>" /></span></a></div>
<?php } ?>
<span class="adminURL" id="<?php echo admin_url(); ?>"></span>
<span class="templateURL" id="<?php echo get_template_directory_uri(); ?>"></span>
<?php $comment_id = $comment->comment_ID;?>
<?php $current_like_count = get_comment_meta($comment_id, 'like_count');?>
<?php if ($current_like_count[0] == NULL || $current_like_count[0] == 0){$current_like_count[0] = 0;}?>
<span class="likeCount-<?php echo $comment_id ?>" id="likeCountCurrent-<?php echo $current_like_count[0]?>"></span>
<?php
if (is_user_logged_in()) {
global $wpdb;
$current_user_id = get_current_user_id();
$get_user_liked_question_value = "SELECT * FROM " . $wpdb->prefix . "rqa_liked_content WHERE user_id ='". $current_user_id . "' AND like_content_id ='". $comment_id . "'" ;
$users_liked_question_value = $wpdb->get_results($get_user_liked_question_value);
if (isset($users_liked_question_value[0]->user_id) == $current_user_id && isset($users_liked_question_value[0]->like_content_id) == $comment_id) { ?>
<div class="likeContent">
<div class="bylineBox right disabledLike"><a href="#" onclick="return false;" class="likeThisContent"><span><img src="<?php echo get_template_directory_uri(); ?>/images/like-icon.png" alt="<?php echo $t_like_text;?>" />
<?php if ($current_like_count[0] > 0) { echo $current_like_count[0];} else {echo $t_like_text;} ?></span></a></div>
</div>
<?php } else { ?>
<div class="likeContent">
<div class="bylineBox right likeThisLink" id="like-this-<?php echo get_comment_ID(); ?>"><a href="#" onclick="return false;" class="likeThisContent" id="type-comment"><span><img src="<?php echo get_template_directory_uri(); ?>/images/like-icon.png" alt="<?php echo $t_like_text;?>" /><?php if ($current_like_count[0] > 0) { echo $current_like_count[0];} else {echo $t_like_text;} ?></span></a></div>
</div>
<?php } ?>
<?php } else { ?>
<div class="likeContent">
<div class="bylineBox right likeThisLink"><a href="<?php echo home_url(); ?>/<?php echo $t_login_permalink; ?>/?redir=<?php echo $redir; ?>" title="<?php echo $t_login_signup_like;?>"><span><img src="<?php echo get_template_directory_uri(); ?>/images/like-icon.png" alt="<?php echo $t_like_text;?>" /><?php if ($current_like_count[0] > 0) { echo $current_like_count[0];} else {echo $t_like_text;} ?></span></a></div>
</div>
<?php } ?>
<div class="clear"></div>
<div class="commentOnAnswer">
<?php
$answer_comments = get_answer_comments($comment->comment_ID);
$comment_count = count($answer_comments);
?>
<div class="commentHeader">
<?php if ($comment_count != 0) { ?>
<a class="togglecomments" id="<?php echo get_comment_ID(); ?>"><img src="<?php echo get_template_directory_uri(); ?>/images/open-comments-icon.png" alt="" /></a>
<a class="togglecomments" id="<?php echo get_comment_ID(); ?>">
<?php
if ($comment_count == 1) {
echo '1 '.$t_comment_text;
} elseif ($comment_count > 1) {
echo $comment_count.' '.$t_comments_text;
}
?>
</a>
<?php } else { ?>
<?php echo $t_no_comments; ?>
<?php } ?>
<span>|</span>
<a class="toggleaddcommentform" id="<?php echo get_comment_ID(); ?>"><?php echo $t_add_a_comment;?></a>
<?php if ( current_user_can('manage_options')) {?>
<span>|</span>
<?php edit_comment_link($t_edit_page_link); ?>
<?php } ?>
</div>
<div class="commentOnAnswerForm" id="commentForm<?php echo get_comment_ID(); ?>" style="display:none;">
<?php
// If logged in show data
if ( is_user_logged_in()) { ?>
<h6><?php echo $t_add_a_comment;?>:</h6>
<form action="" method="post" name="commentSubmitForm" id="commentSubmitForm">
<textarea name="comment_content"></textarea>
<input type="hidden" name="comment_parent_id" value="<?php echo get_comment_ID(); ?>" />
<input type="hidden" name="comment_on_answer_post" value="1" />
<input type="submit" value="<?php echo $t_add_a_comment; ?>" />
<div class="clear"></div>
</form>
<?php } else { ?>
<div class="loginNote"><a href="<?php echo home_url();?>/<?php echo $t_login_permalink; ?>/?redir=<?php echo $redir; ?>" title="<?php echo $t_login_text;?>"><?php echo $t_login_to_comment_on_answer;?></a></div>
<?php }?>
</div>
<div class="comments" id="commentSection<?php echo get_comment_ID(); ?>" style="display:none;">
<?php
foreach ($answer_comments as $answer_comment) :
?>
<!-- Report Comment on Answer Modal -->
<div class="reportPop hiddenContent" id="reportPopComment<?php echo $answer_comment->comment_ID;?>">
<form action="" method="post" name="reportContent">
<p><?php echo $t_report_content_message_text; ?></p>
<br />
<input type="hidden" value="<?php echo $answer_comment->comment_ID; ?>" name="reported_item_id" />
<input type="hidden" value="Comment" name="reported_type" />
<input type="hidden" value="<?php echo $post->ID; ?>" name="question_id" />
<input type="hidden" value="1" name="report_content" />
<input type="submit" class="process" value="<?php echo $t_report_comment;?>" />
</form
><div class="clear"></div>
</div>
<!-- / Report Comment on Answer Modal -->
<div class="comment">
<?php if ( is_user_logged_in()) { ?>
<p class="right"><a href="#reportPopComment<?php echo $answer_comment->comment_ID;?>" onclick="return; false" class="boxy" title="<?php echo $t_report_comment;?>"><img src="<?php echo get_template_directory_uri(); ?>/images/flag-this-icon.png" alt="<?php echo $t_report_comment;?>" /></a></p>
<?php } else { ?>
<p class="right"><a href="<?php echo home_url(); ?>/<?php echo $t_login_permalink; ?>/?redir=<?php echo $redir; ?>" title="<?php echo $t_login_signup_report_content_text; ?>"><img src="<?php echo get_template_directory_uri(); ?>/images/flag-this-icon.png" alt="<?php echo $t_report_comment;?>" /></a></p>
<?php } ?>
<p><?php echo $answer_comment->comment_content ?></p>
<p class=""><a href="<?php echo home_url(); ?>/<?php echo $t_profile_permalink; ?>/<?php echo $answer_comment->comment_author ?>"><?php echo $answer_comment->comment_author?></a></p>
</div>
<div class="clear"></div>
<?php endforeach; ?>
</div>
</div>
</div>
<!-- / Answer -->
</div>
<?php } ?>
<?php endforeach; ?>
<?php paginate_comments_links() ;?>
<?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"></p>
<?php endif; ?>
<?php endif; ?>
single.php
<?php
/**
* @package WordPress
* @subpackage Robust Q&A - WPQA
*/
?>
<?php
include (TEMPLATEPATH . '/translations.php');
// Define the Post Redirect
$redir = $post->ID;
/////////////////////////////
//$_COOKIE Checkers //
///////////////////////////
// Get Question Reported Cookie to Display Success Message
if (isset($_COOKIE['content_reported_'.$post->ID])) {
$reported_content = $_COOKIE['content_reported_'.$post->ID];
if(isset($reported_content) && $reported_content != NULL) {
$message = $t_message_sucsess_content_reported;
}
}
// Get Answer Posted to Question Cookie to Display Success Message
if (isset($_COOKIE['answer_posted_'.$post->ID])) {
$new_answer_posted = $_COOKIE['answer_posted_'.$post->ID];
if(isset($new_answer_posted) && $new_answer_posted != NULL) {
$message = $t_message_answer_success_posted;
}
}
// Get Comment Posted on Answer Cookie to Display Success Message
if (isset($_COOKIE['comment_posted_'.$post->ID])) {
$new_comment_posted = $_COOKIE['comment_posted_'.$post->ID];
if(isset($new_comment_posted) && $new_comment_posted != NULL) {
$message = $t_message_sucsess_comment_on_answer;
}
}
// Get Question Already Reported Cookie to Display Error Message
if (isset($_COOKIE['already_reported_'.$post->ID])) {
$already_reported_question = $_COOKIE['already_reported_'.$post->ID];
if(isset($already_reported_question) && $already_reported_question != NULL) {
$message = new WP_Error('already_reported_question', $t_message_already_reported_content);
}
}
// Get Forgot Question Note Cookie to Display Error Message
if (isset($_COOKIE['forgot_add_note_'.$post->ID])) {
$forgot_question_note = $_COOKIE['forgot_add_note_'.$post->ID];
if(isset($forgot_question_note) && $forgot_question_note != NULL) {
$message = new WP_Error('forgot_question_note', $t_message_forgot_note_text);
}
}
// Get Question Note Added Cookie to Display Success Message
if (isset($_COOKIE['question_note_added_'.$post->ID])) {
$question_note_added = $_COOKIE['question_note_added_'.$post->ID];
if(isset($question_note_added) && $question_note_added != NULL) {
$message = $t_message_note_added_to_question;
}
}
// Get Best Answer Selected Cookie to Display Success Message
if (isset($_COOKIE['best_answer_selected_'.$post->ID])) {
$best_answer_selected = $_COOKIE['best_answer_selected_'.$post->ID];
if(isset($best_answer_selected) && $best_answer_selected != NULL) {
$message = $t_message_best_answer_selected;
}
}
// Get Remove Question Email Alerts Cookie to Display Success Message
if (isset($_COOKIE['removed_question_email_alerts_'.$post->ID])) {
$remove_message_email_alerts = $_COOKIE['removed_question_email_alerts_'.$post->ID];
if(isset($remove_message_email_alerts) && $remove_message_email_alerts != NULL) {
$message = $t_message_email_alerts_removed;
}
}
if ( isset($_POST['answer_post']) == '1') {
$answer_content = $_POST['answer_content'];
$source_link = $_POST['source_link'];
$message = post_new_answer($answer_content, $source_link);
}
if ( isset($_POST['comment_on_answer_post']) == '1') {
$comment_content = $_POST['comment_content'];
$comment_parent_id = $_POST['comment_parent_id'];
$message = post_new_comment_to_answer($comment_content, $comment_parent_id);
}
if ( isset($_POST['best_answer_post']) == '1') {
$best_answer_id = $_POST['best_answer_id'];
$best_answer_parent_question = $_POST['best_answer_parent_question'];
$message = select_best_answer($best_answer_id, $best_answer_parent_question);
}
if ( isset($_POST['report_content']) == '1') {
$reported_item_id = $_POST['reported_item_id'];
$reported_type = $_POST['reported_type'];
$question_id = $_POST['question_id'];
$message = report_content_item($reported_item_id, $reported_type, $question_id);
}
if ( isset($_POST['add_note_to_question']) == '1') {
$add_note_text = $_POST['add_note_text'];
$question_id = $_POST['question_id'];
$message = add_note_to_question($add_note_text, $question_id);
}
if ( isset($_POST['remove_email_alerts']) == '1') {
$question_id = $_POST['remove_alerts_question'];
$message = remove_question_email_alerts($question_id);
}
get_header();?>
<script type='text/javascript'>
$(document).ready(function() {
$('.boxy').boxy({modal: true, closeText: '', draggable: false, unloadOnHide: false});
});
</script>
<!-- Main Section -->
<div id="main">
<div class="mainContentTop"></div>
<div id="mainContent">
<!-- Center Column -->
<div id="centerCol" class="left">
<!-- Top Section -->
<div class="topSection">
<!-- Search Form -->
<?php //get_search_form(); ?>
<!-- Search Form -->
<div class="introBox2">
<div class="greyBtn addQuestion"><a href="<?php echo home_url(); ?>/<?php echo $t_ask_a_question_permalink;?>/"><span><?php echo $t_ask_question; ?> <img src="<?php echo get_template_directory_uri(); ?>/images/grey-add-btn-icon.jpg" alt="" /></span></a></div>
<?php if ( current_user_can('manage_options')) {?>
<div class="editPageLink"><?php edit_post_link($t_edit_page_link); ?></div>
<?php } ?>
<?php include (TEMPLATEPATH . '/breadcrumb.php'); ?>
</div>
</div>
<!-- / Top Section -->
<!-- Left Inner Column -->
<?php if (have_posts()) : ?>
<?php query_posts($query_string . ""); ?>
<?php while (have_posts()) : the_post(); ?>
<div id="leftColInner" class="left">
<?php
if (isset($message)) {
display_message($message);
} ?>
<!-- Report Modal -->
<div class="reportPop hiddenContent" id="reportPop">
<form action="" method="post" name="reportContent">
<p><?php echo $t_report_content_message_text; ?></p>
<br />
<input type="hidden" value="<?php echo $post->ID ?>" name="reported_item_id" />
<input type="hidden" value="Question" name="reported_type" />
<input type="hidden" value="<?php echo $post->ID; ?>" name="question_id" />
<input type="hidden" value="1" name="report_content" />
<input type="submit" class="process" value="<?php echo $t_report_question;?>" />
</form
><div class="clear"></div>
</div>
<!-- / Report Modal -->
<!-- Question -->
<div class="questionPageBox">
<div class="questionQuestion">
<?php
// Get data for displaying avatar
$author = $authordata;
$blog_url = get_template_directory_uri();
$selected_avatar_image = get_user_default_icon($author->ID);
$avatar_image = '/images/default-user-avatar-'.$selected_avatar_image.'.jpg';
$url = $blog_url . $avatar_image ;
// Get data for linking to member profile when clicking avatar image
$main_url = home_url();
$author_name = get_the_author_meta('nicename');
$profile_link = '/'. $t_profile_permalink .'/';
$author_profile_link = $main_url . $profile_link . $author_name;
$email_question_asker = get_post_meta($post->ID, 'alert_asker_emails', true);
?>
<div class="questionBox" id="post-<?php the_ID(); ?>" <?php post_class(); ?>>
<div class="contentText">
<h1><?php the_title(); ?></h1>
<a name="<?php the_ID(); ?>"></a>
<p class="entry"><?php the_content(); ?></p>
<!-- Add Note to Question Modal -->
<div class="reportPop hiddenContent" id="addNotePop">
<form action="" method="post" name="addNoteToQuestion">
<label><?php echo $t_add_note_popup_heading_text; ?>:</label>
<textarea name="add_note_text"></textarea>
<br /><br />
<input type="hidden" value="<?php echo $post->ID ?>" name="question_id">
<input type="hidden" value="1" name="add_note_to_question" />
<input type="submit" class="process" value="<?php echo $t_add_a_note_link;?>" />
</form
><div class="clear"></div>
</div>
<!-- / Add Note to Question Modal -->
<!-- Remove Question Email Alerts -->
<div class="reportPop hiddenContent" id="removeEmailAlerts">
<form action="" method="post" name="removeEmailAlerts">
<p><?php echo $t_remove_email_alerts_text;?></p>
<br />
<input type="hidden" value="<?php echo $post->ID ?>" name="remove_alerts_question">
<input type="hidden" value="1" name="remove_email_alerts" />
<input type="submit" class="process" value="<?php echo $t_remove_email_alerts_link;?>" />
</form
><div class="clear"></div>
</div>
<!-- / Remove Question Email Alerts -->
<?php // Show Question Note if Set
$author_note = get_post_meta($post->ID, 'question_note', true);
if ($author_note != NULL) { ?>
<p class="questionNote"><span><?php echo $t_author_note_heading_text;?>: </span><br /><?php echo $author_note; ?></p>
<?php } ?>
<?php // Show Source Link Code if Set
if (isset($source_link) != NULL) { ?>
<p class="sourceLink"><span><?php echo $t_link_text;?>: </span><a href="#"><?php echo $source_link; ?></a></p>
<?php } ?>
<?php
$posttags = get_the_tags();
if ($posttags) {?>
<p class="tagRow"><?php the_tags($t_tags_text.' ' , ' ', ''); ?></p>
<?php } ?>
<p class="bylineCategory left"><?php echo $t_in_text;?>: <a href="<?php echo home_url(); ?>/<?php echo $t_category_permalink;?>/"><?php the_category(', ','multiple') ?></a> | <?php the_time(get_option( 'date_format' )); ?></p>
<?php // ADD Question Note
global $current_user;
get_currentuserinfo();
if ($post->post_author == $current_user->ID && $author_note == '') { ?>
<p class="addNote left"><span>|</span><a href="#addNotePop" onclick="return; false" class="boxy" title="<?php echo $t_add_a_note_link;?>"><?php echo $t_add_a_note_link;?></a></p>
<?php } ?>
<?php
$email_question_asker = get_post_meta($post->ID, 'alert_asker_emails',true);
if ($post->post_author == $current_user->ID && $email_question_asker == 'true') {?>
<p class="addNote"><span>|</span>
<a href="#removeEmailAlerts" onclick="return; false" class="boxy" title="<?php echo $t_remove_email_alerts_link;?>"><?php echo $t_remove_email_alerts_link;?></a></p>
<?php } ?>
</div>
<div class="clear"></div>
</div>
<div class="clear"></div>
<div class="bylineBox otherBylineBox"><a href="<?php echo home_url(); ?>/<?php echo $t_profile_permalink;?>/<?php echo $author->user_nicename; ?>/"><span><?php echo $author->display_name; ?><?php echo getPointLevel($author->ID, 'sm'); ?><?php $expert_user = get_user_meta($author->ID, 'expert', true); if($expert_user == 'yes') { ?><img src="<?php echo get_template_directory_uri(); ?>/images/expert-badge-icon.png" alt="<?php echo $t_expert_text;?>" class="expertImg" /><?php } ?></span></a></div>
<?php
if (is_user_logged_in()) {
?>
<div class="bylineBoxShare" id="report<?php echo $post->ID ?>"><a href="#reportPop" onclick="return; false" class="boxy" title="<?php echo $t_report_question;?>"><span><img src="<?php echo get_template_directory_uri(); ?>/images/flag-this-icon.png" alt="<?php echo $t_report_question;?>" /></span></a></div>
<?php } else { ?>
<div class="bylineBoxShare"><a href="<?php bloginfo('siteurl'); ?>/<?php echo $t_login_permalink;?>/?redir=<?php echo $redir; ?>" title="<?php echo $t_login_signup_report_content_text;?>"><span><img src="<?php echo get_template_directory_uri(); ?>/images/flag-this-icon.png" alt="<?php echo $t_report_question;?>" /></span></a></div>
<?php } ?>
<span class="adminURL" id="<?php echo admin_url();?>"></span>
<span class="templateURL" id="<?php echo get_template_directory_uri(); ?>"></span>
<?php $post_id = $post->ID;?>
<?php $current_like_count = get_post_meta($post_id, 'like_count');?>
<?php if (isset($current_like_count[0]) == NULL || $current_like_count[0] == 0){$current_like_count[0] = 0;}?>
<span class="likeCount-<?php echo $post_id ?>" id="likeCountCurrent-<?php echo $current_like_count[0]?>"></span>
<?php
if (is_user_logged_in()) {
global $wpdb;
$current_user_id = get_current_user_id();
$get_user_liked_question_value = "SELECT * FROM " . $wpdb->prefix . "rqa_liked_content WHERE user_id ='". $current_user_id . "' AND like_content_id ='". $post_id . "'" ;
$users_liked_question_value = $wpdb->get_results($get_user_liked_question_value);
if (isset($users_liked_question_value[0]->user_id) == $current_user_id && isset($users_liked_question_value[0]->like_content_id) == $post_id) {
?>
<div class="likeContent">
<div class="bylineBox right disabledLike"><a href="#" onclick="return false;" class="likeThisContent"><span><img src="<?php echo get_template_directory_uri(); ?>/images/like-icon.png" alt="<?php echo $t_like_text;?>" /><?php if ($current_like_count[0] > 0) { echo $current_like_count[0];} else {echo $t_like_text;} ?></span></a></div>
</div>
<?php } else { ?>
<div class="likeContent">
<div class="bylineBox right likeThisLink" id="like-this-<?php echo $post_id; ?>"><a href="#" onclick="return false;" class="likeThisContent" id="type-post"><span><img src="<?php echo get_template_directory_uri(); ?>/images/like-icon.png" alt="<?php echo $t_like_text;?>" /><?php if ($current_like_count[0] > 0) { echo $current_like_count[0];} else {echo $t_like_text;} ?></span></a></div>
</div>
<?php } ?>
<?php } else { ?>
<div class="likeContent">
<div class="bylineBox right likeThisLink"><a href="<?php bloginfo('siteurl'); ?>/<?php echo $t_login_permalink;?>/?redir=<?php echo $redir; ?>" title="<?php echo $t_login_signup_like;?>"><span><img src="<?php echo get_template_directory_uri(); ?>/images/like-icon.png" alt="<?php echo $t_like_text;?>" /><?php if ($current_like_count[0] > 0) { echo $current_like_count[0];} else {echo $t_like_text;} ?></span></a></div>
</div>
<?php } ?>
<div class="clear"></div>
</div>
</div>
<!-- / Question -->
<?php endwhile; ?>
<?php endif; ?>
<?php wp_reset_query();?>
<script async src="//pagead2.googlesyndication.com/pagead/js/adsbygoogle.js"></script>
<!-- Corpo-Responsivo -->
<ins class="adsbygoogle"
style="display:block"
data-ad-client="ca-pub-8145484678499842"
data-ad-slot="4093204017"
data-ad-format="auto"></ins>
<script>
(adsbygoogle = window.adsbygoogle || []).push({});
</script>
<br/>
<div class="answerBar" id="comments">
<div class="answerBarInner">
<?php
// List out the number of Answers - Exlcuding Comments on Answers
$answers_count = c_parent_comment_counter($post->ID);
// Var to show comments on answers count - not used
// $comments_on_answers_count = $post->comment_count - $number_of_parents;
if ($answers_count < 1) {?>
<h5><?php echo $t_no_answer_yet_answer_now_text;?> </h5>
<?php }
if ($answers_count == 1) {?>
<h5><?php echo $answers_count; ?> <?php echo $t_answer_text;?> </h5>
<?php }
if ($answers_count > 1) { ?>
<h5><?php echo $answers_count; ?> <?php echo $t_answers_text;?> </h5>
<?php } ?>
</div>
</div>
<?php comments_template(); ?>
<?php
// If logged in change nav to My Account and Log Out
if ( is_user_logged_in()) { ?>
<?php // Users cant post answers ?>
<?php $users_cant_answer = get_option('robust_qa_admin_answer_only');
if ($users_cant_answer == true && (!current_user_can('manage_options') && $current_user->expert == 'no')) {?>
<p class="bottomMessageBox footnote2"><b><?php echo $t_admins_answer_questions_only_text; ?> <a href="<?php echo home_url(); ?>/<?php echo $t_ask_a_question_permalink;?>/"><?php echo $t_admin_answer_link;?></a></b></p>
<?php } else {?>
<div class="addAnswer"><a name="answerQuestionForm"></a>
<h4><?php echo $t_answer_this_question_heading;?></h4>
<div class="answerSubmitForm">
<form action="" method="post" name="answerSubmitForm" id="answerSubmitForm">
<div class="clear"></div>
<fieldset><textarea rows="10" cols="40" name="answer_content" id="answer_content" ><?php if (isset($_POST['answer_content'])) { echo $_POST['answer_content']; }?></textarea></fieldset>
<label class="sourceLinkLabel"><?php echo $t_source_link_heading;?>: <span>(<?php echo $t_optional_text;?>)</span></label>
<input type="text" name="source_link" class="sourceLinkInput" value="http://" />
<input type="hidden" name="answer_post" value="1">
<input type="submit" value="<?php echo $t_add_answer_btn;?>" />
<div class="clear"></div>
</form>
</div>
</div>
<?php } ?>
<?php } else { ?>
<div class="clear"></div>
<div class="bottomMessageBox2">
<h4 class="subHeadh4"><?php echo $t_must_be_logged_in_to_answer;?></h4>
<h5><?php echo $t_already_a_member_text;?> <a href="<?php echo home_url();?>/<?php echo $t_login_permalink;?>/?redir=<?php echo $redir; ?>"><?php echo $t_login_text;?></a><br /><?php echo $t_not_member_yet_text;?> <a href="<?php echo home_url();?>/<?php echo $t_signup_permalink?>/?redir=<?php echo the_ID(); ?>"><?php echo $t_signup_text;?></a></h5>
</div>
<?php } ?>
<div class="relatedQuestions">
<div class="relatedHeader">
<?php
$single_cat = get_the_category();
$single_parent_cat = get_category($single_cat[0]->category_parent);
$main_question_id = get_the_ID();
if ($single_cat[0]->category_parent != 0) { ?>
<div class="backBtn"><a href="<?php echo home_url(); ?>/<?php echo $t_category_permalink;?>/<?php echo $single_parent_cat->slug; ?>/<?php echo $single_cat[0]->slug; ?>/"><span><?php echo $t_more_category_questions_heading;?></span></a></div>
<?php } elseif ($single_cat[0]->category_parent == 0) { ?>
<div class="backBtn"><a href="<?php echo home_url(); ?>/<?php echo $t_category_permalink;?>/<?php echo $single_cat[0]->slug; ?>/"><span><?php echo $t_more_category_questions_heading?></span></a></div>
<?php } ?>
<h5><?php echo $t_related_questions_heading;?>:</h5>
</div>
<div class="dashedDivider"></div>
<ul>
<?php
if (have_posts()) :
$args = array(
'posts_per_page' => 5,
'cat' => $single_cat[0]->cat_ID,
'orderby' => 'date',
);
query_posts($args);
?>
<?php while (have_posts()) : the_post();?>
<?php if ($post->ID != $main_question_id ) { ?>
<li><a href="<?php the_permalink(); ?> "><?php the_title(); ?></a></li>
<?php } ?>
<?php endwhile; ?>
<?php endif; ?>
<?php wp_reset_query();?>
</ul>
</div>
<div class="reset"></div>
</div>
<!-- / Left Inner Column -->
<?php get_sidebar(); ?>
</div>
<!-- / Center Column -->
<div class="clear"></div>
</div>
</div>
<div class="mainContentBottom"></div>
<!-- / Main Section -->
<?php get_footer(); ?>
<?php if ( is_singular() ) wp_enqueue_script( "comment-reply" ); ?>