function profile_questions_loop()
{
    global $dwqa_options;
    $submit_question_link = get_permalink($dwqa_options['pages']['submit-question']);
    $questions = get_posts(array('posts_per_page' => 1, 'author' => bp_displayed_user_id(), 'post_type' => 'dwqa-question'));
    if (!empty($questions)) {
        ?>
      <div class="dwqa-container">
        <div class="dwqa-list-question">
          <div class="dw-question" id="archive-question">
            <?php 
        foreach ($questions as $q) {
            ?>
            <article id="question-18267" class="dwqa-question">
                <header class="dwqa-header">
                    <a class="dwqa-title" href="<?php 
            echo get_post_permalink($q->ID);
            ?>
" title="Permalink to <?php 
            echo $q->post_title;
            ?>
" rel="bookmark"><?php 
            echo $q->post_title;
            ?>
</a>
                    <div class="dwqa-meta">
                        <?php 
            dwqa_question_print_status($q->ID);
            ?>
                        <span><?php 
            echo get_the_time('M d, Y, g:i a', $q->ID);
            ?>
</span>
                        &nbsp;&nbsp;&bull;&nbsp;&nbsp;
                        <?php 
            echo get_the_term_list($q->ID, 'dwqa-question_category', '<span>Category: ', ', ', '</span>');
            ?>
 
                    </div>
                </header>
            </article>
            <?php 
        }
        ?>
          </div>
        </div>
      </div>
    <?php 
    } else {
        ?>
    <div class="info" id="message">
      <?php 
        if (get_current_user_id() == bp_displayed_user_id()) {
            ?>
        Why don't you have question for us. <a href="<?php 
            echo $submit_question_link;
            ?>
">Start asking</a>!
      <?php 
        } else {
            ?>
        <p><strong><?php 
            bp_displayed_user_fullname();
            ?>
</strong> has not asked any question.</p>
      <?php 
        }
        ?>
    </div>
    <?php 
    }
}
 */
?>
<div class="dwqa-question-item <?php 
echo dwqa_is_sticky() ? 'dwqa-sticky' : '';
?>
">
	<header class="dwqa-question-title"><a href="<?php 
the_permalink();
?>
"><?php 
the_title();
?>
</a></header>
	<div class="dwqa-question-meta">
		<?php 
dwqa_question_print_status();
?>
		<?php 
global $post;
$user_id = get_post_field('post_author', get_the_ID()) ? get_post_field('post_author', get_the_ID()) : false;
$time = human_time_diff(get_post_time('U'));
$text = __('asked', 'dwqa');
$latest_answer = dwqa_get_latest_answer();
if ($latest_answer) {
    $time = human_time_diff(strtotime($latest_answer->post_date));
    $text = __('answered', 'dwqa');
}
?>
		<?php 
printf(__('<span><a href="%s">%s%s</a> %s %s ago</span>', 'dwqa'), dwqa_get_author_link($user_id), get_avatar($user_id, 48), dwqa_get_author(), $text, $time);
?>
Beispiel #3
0
    echo '<i class="fa fa-bookmark"></i>';
}
?>
			&nbsp;<a class="dwqa-title" href="<?php 
the_permalink();
?>
" title="<?php 
echo esc_attr(sprintf(__('Permalink to %s', 'dwqa'), the_title_attribute('echo=0')));
?>
" rel="bookmark"><?php 
the_title();
?>
</a>
			<div class="dwqa-meta">
				<?php 
dwqa_question_print_status($post_id);
echo dwqa_get_latest_action_date();
echo get_the_term_list($post_id, 'dwqa-question_category', '&nbsp;&nbsp;<strong>&sdot;</strong>&nbsp;&nbsp;<span>' . __('Category', 'dwqa') . ': ', ', ', '</span>');
do_action('dwqa_question_meta');
?>
  
			</div>
		</header>
		<footer class="dwqa-footer-meta">
			<div class="dwqa-view"><?php 
$views = dwqa_question_views_count();
?>
				<?php 
if ($views > 0) {
    printf('<strong>%d</strong> %s', $views, _n('view', 'views', $views, 'dwqa'));
    ?>