예제 #1
0
function ap_question_subscribers($action_id = false, $type = '', $avatar_size = 30)
{
    global $question_category, $question_tag;
    if (!$action_id) {
        if (is_question()) {
            $action_id = get_question_id();
        } elseif (is_question_category()) {
            $action_id = $question_category->term_id;
        } elseif (is_question_tag()) {
            $action_id = $question_tag->term_id;
        }
    }
    if ($type == '') {
        $type = is_question() ? '' : 'term';
    }
    $subscribe_type = $type != '' && $type != 'subscriber' ? $type : 'subscriber';
    $subscribers = ap_get_subscribers($action_id, $subscribe_type);
    if ($subscribers) {
        echo '<div class="ap-question-subscribers clearfix">';
        echo '<div class="ap-question-subscribers-inner">';
        foreach ($subscribers as $subscriber) {
            echo '<a href="' . ap_user_link($subscriber->apmeta_userid) . '"';
            ap_hover_card_attributes($subscriber->apmeta_userid);
            echo '>' . get_avatar($subscriber->apmeta_userid, $avatar_size) . '</a>';
        }
        echo '</div>';
        echo '</div>';
    }
}
예제 #2
0
ap_question_the_vote_button();
?>
</div>
				<?php 
/**
 * ACTION: ap_before_question_title
 * @since 	2.0
 */
do_action('ap_before_question_content');
?>
				<div class="ap-avatar">
					<a href="<?php 
ap_question_the_author_link();
?>
"<?php 
ap_hover_card_attributes(ap_question_get_author_id());
?>
>
						<?php 
ap_question_the_author_avatar(ap_opt('avatar_size_qquestion'));
?>
					</a>
				</div>
				<div class="ap-q-cells clearfix">
					<div class="ap-q-metas">
						<?php 
ap_user_display_meta(true, false, true);
?>
						<span><?php 
ap_question_the_time();
?>
예제 #3
0
 * @package AnsPress
 */
?>

<div id="ap-ask-page" class="clearfix">
	<?php 
if (ap_user_can_ask()) {
    ?>

		<div id="answer-form-c">
			<div class="ap-avatar ap-pull-left">
				<a href="<?php 
    echo ap_user_link(get_current_user_id());
    ?>
"<?php 
    ap_hover_card_attributes(get_current_user_id());
    ?>
>
					<?php 
    echo get_avatar(get_current_user_id(), ap_opt('avatar_size_qquestion'));
    ?>

				</a>
			</div>
			<div class="ap-a-cells clearfix">
				<div class="ap-form-head">
					<a href="#" class="apicon-screen-full pull-right ap-btn-fullscreen" data-action="ap_fullscreen_toggle"><?php 
    _e('Toggle fullscreen', 'ap');
    ?>
</a>
					<ul class="ap-form-head-tab ap-ul-inline clearfix ap-tab-nav">
예제 #4
0
?>
" itemprop="suggestedAnswer<?php 
echo ap_answer_is_best() ? ' acceptedAnswer' : '';
?>
" itemtype="http://schema.org/Answer" itemscope="">
	<div class="ap-content">
		<div class="ap-single-vote"><?php 
ap_answer_the_vote_button();
?>
</div>
		<div class="ap-avatar">
			<a href="<?php 
ap_answer_the_author_link();
?>
"<?php 
ap_hover_card_attributes(ap_answer_get_author_id());
?>
>
				<?php 
ap_answer_the_author_avatar();
?>
			</a>
		</div>
		<div class="ap-a-cells clearfix">
			<div class="ap-q-metas">
				<?php 
ap_user_display_meta(true, false, true);
?>
				<?php 
ap_answer_the_time();
?>
예제 #5
0
function ap_user_link_avatar($user_id, $size = 30)
{
    echo '<a href="' . ap_user_link($user_id) . '"';
    ap_hover_card_attributes($user_id);
    echo '>';
    echo get_avatar($user_id, $size);
    echo '</a>';
}
예제 #6
0
    /**
     * Render Meta Box content.
     */
    public function answers_meta_box_content()
    {
        global $answers;
        $answers = ap_get_answers(array('question_id' => get_the_ID()));
        if (ap_have_answers()) {
            while (ap_have_answers()) {
                ap_the_answer();
                ?>
            <div id="answer_<?php 
                the_ID();
                ?>
" data-id="<?php 
                the_ID();
                ?>
" class="ap-ansm clearfix">
                <div class="author">
					<a class="ap-ansm-avatar" href="<?php 
                ap_answer_the_author_link();
                ?>
"<?php 
                ap_hover_card_attributes(ap_answer_get_author_id());
                ?>
>
						<?php 
                ap_answer_the_author_avatar();
                ?>
					</a>
					<strong class="ap-ansm-name"><?php 
                echo ap_user_display_name(ap_answer_get_author_id());
                ?>
</strong>
                </div>

                <div class="ap-ansm-inner">
                    
                    <div class="ap-ansm-meta">
						<?php 
                ap_answer_the_active_time();
                ?>
					</div>
					
					<div class="ap-ansm-content"><?php 
                the_content();
                ?>
</div>
					
					<div class="answer-actions">

						<span><a href="<?php 
                echo get_edit_post_link(get_the_ID());
                ?>
"><?php 
                _e('Edit', 'ap');
                ?>
</a></span>
						<span class="delete vim-d vim-destructive"> | <a href="<?php 
                echo get_delete_post_link(get_the_ID());
                ?>
"><?php 
                _e('Trash', 'ap');
                ?>
</a></span>
					</div>

				</div>
			</div>
			<?php 
            }
        } else {
            ?>
            <div class="inside">
				<a href="#addanswerbtn" class="button"><?php 
            _e('Add answer', 'ap');
            ?>
</a>
				<?php 
            _e('No answers yet', 'ap');
            ?>
            </div>
            
			<?php 
        }
        wp_reset_postdata();
    }
예제 #7
0
파일: user.php 프로젝트: Byrlyne/anspress
/**
 * @param string $user_id
 */
function ap_user_link_anchor($user_id, $echo = true)
{
    $name = ap_user_display_name($user_id);
    if ($user_id < 1) {
        if ($echo) {
            echo $name;
        } else {
            return $name;
        }
    }
    $html = '<a href="' . ap_user_link($user_id) . '"' . ap_hover_card_attributes($user_id, false) . '>';
    $html .= $name;
    $html .= '</a>';
    if ($echo) {
        echo $html;
    }
    return $html;
}