Exemple #1
0
/**
 * Question meta to display
 * @param  false|integer $question_id
 * @return string
 * @since 2.0.1
 */
function ap_display_question_metas($question_id = false)
{
    if (false === $question_id) {
        $question_id = get_the_ID();
    }
    $metas = array();
    if (!is_question()) {
        if (ap_question_best_answer_selected()) {
            $metas['solved'] = '<span class="ap-best-answer-label ap-tip" title="' . __('answer accepted', 'ap') . '">' . __('Solved', 'ap') . '</span>';
        }
        $view_count = ap_get_qa_views();
        $metas['views'] = sprintf(__('<i>%d views</i>', 'ap'), $view_count);
        $metas['history'] = ap_get_latest_history_html($question_id, true);
    }
    /**
     * FILTER: ap_display_question_meta
     * Used to filter question display meta
     */
    $metas = apply_filters('ap_display_question_metas', $metas, $question_id);
    $output = '';
    if (!empty($metas) && is_array($metas)) {
        foreach ($metas as $meta => $display) {
            $output .= "<span class='ap-display-meta-item {$meta}'>{$display}</span>";
        }
    }
    return $output;
}
Exemple #2
0
							<li class="ap-tip ap-ansslable" title="<?php 
    _e('Answer is accepted', 'ap');
    ?>
">
								<i class="ap-icon-answer"></i>
							</li>
						<?php 
}
?>
						<li class="list-meta ap-tip" title="<?php 
_e('Last activity', 'ap');
?>
">	
							<i class="ap-icon-clock ap-meta-icon"></i>
							<?php 
printf('<span class="when">%s %s ago</span>', ap_get_latest_history_html(get_the_ID()), ap_human_time(mysql2date('U', ap_last_active(get_question_id()))));
ap_user_display_name();
?>
						</li>
						<li class="ap-tip" title="<?php 
_e('Question category', 'ap');
?>
"><?php 
ap_question_categories_html(false, false);
?>
</li>
						<li class="ap-tip" title="<?php 
_e('Question tagged', 'ap');
?>
"><?php 
ap_question_tags_html(false, false);
Exemple #3
0
        ?>
</li>	
									<li><?php 
        ap_flag_btn_html();
        ?>
</li>
									<li><?php 
        ap_post_delete_btn_html();
        ?>
</li>
								</ul>
							</div>
							<div class="ap-qfooter">								
								<div class="ap-tlitem">
									<?php 
        echo ap_get_latest_history_html(get_the_ID(), true, true);
        ?>
								</div>
								<div class="ap-tlitem">
									<span class="ap-icon-hit ap-tlicon"></span>
									<ul class="ap-question-meta">
										<li>
											<?php 
        printf(__('<span>Asked</span><strong><time itemprop="datePublished" datetime="%s">%s Ago</time></strong>', 'ap'), get_the_time('c', get_question_id()), ap_human_time(get_the_time('U')));
        ?>
										</li>
										<li>
											<?php 
        $count = ap_count_ans(get_the_ID());
        printf(_n('<span>Answer</span><strong data-view="ap-answer-count-label">1 Answer</strong>', '<span>Answers</span><strong data-view="ap-answer-count-label">%d Answers</strong>', $count, 'ap'), $count);
        ?>
Exemple #4
0
function ap_question_get_the_active_time($question_id = false)
{
    $question_id = ap_parameter_empty($question_id, @ap_question_get_the_ID());
    return ap_get_latest_history_html($question_id);
}
Exemple #5
0
function ap_answer_get_the_active_time($answer_id = false)
{
    $answer_id = ap_parameter_empty($answer_id, @ap_answer_get_the_answer_id());
    return ap_get_latest_history_html($answer_id);
}
Exemple #6
0
			<ul class="list-taxo ap-inline-list clearfix">
				<?php 
    if ($post->selected) {
        ?>
							
					<li class="ap-ansslable"><span class="bullet-point">&bull;</span><?php 
        _e('answer accepted', 'ap');
        ?>
</li>
				<?php 
    }
    ?>
				<li class="list-meta">
					<span class="bullet-point">&bull;</span>
					<?php 
    echo ap_get_latest_history_html(get_the_ID());
    ?>
				</li>						
			</ul>
			<?php 
    if (ap_question_have_labels() || ap_question_have_category() || ap_question_have_tags()) {
        ?>
			<ul class="ap-other-meta ap-inline-list clearfix">
				<?php 
        if (ap_question_have_labels()) {
            ?>
				<li>
					<span class="bullet-point">&bull;</span>
					<?php 
            echo ap_get_question_label(null, true);
            ?>