本文整理汇总了PHP中ap_user_link函数的典型用法代码示例。如果您正苦于以下问题:PHP ap_user_link函数的具体用法?PHP ap_user_link怎么用?PHP ap_user_link使用的例子?那么, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了ap_user_link函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: ap_get_all_parti
function ap_get_all_parti($avatar_size = 40, $post_id = false)
{
if (!$post_id) {
$post_id = get_the_ID();
}
$parti = ap_get_parti($post_id);
echo '<h3 class="ap-question-side-title">' . sprintf(_n('<span>1</span> Participant', '<span>%d</span> Participants', count($parti), 'ap'), count($parti)) . '</h3>';
echo '<ul class="ap-participants-list ap-inline-list clearfix">';
foreach ($parti as $p) {
?>
<li>
<?php
echo '<a title="' . ap_user_display_name($p->apmeta_userid, true) . '" href="' . ap_user_link($p->apmeta_userid) . '">';
?>
<?php
echo get_avatar($p->apmeta_userid, $avatar_size);
?>
<?php
echo '</a>';
?>
</li>
<?php
}
echo '</ul>';
}
示例2: ap_comment
function ap_comment($comment)
{
$GLOBALS['comment'] = $comment;
?>
<li <?php
comment_class();
?>
id="li-comment-<?php
comment_ID();
?>
">
<article id="comment-<?php
comment_ID();
?>
" class="comment">
<div class="ap-avatar">
<a href="<?php
echo ap_user_link($comment->user_id);
?>
">
<?php
echo get_avatar($comment, ap_opt('avatar_size_qcomment'));
?>
</a>
</div>
<div class="comment-content">
<?php
if ('0' == $comment->comment_approved) {
?>
<p class="comment-awaiting-moderation"><?php
_e('Your comment is awaiting moderation.', 'ap');
?>
</p>
<?php
}
?>
<p class="ap-comment-texts">
<?php
echo get_comment_text();
?>
<?php
printf(' - <time datetime="%1$s">%2$s %3$s</time>', get_comment_time('c'), ap_human_time(get_comment_time('U')), __('ago', 'ap'));
?>
</p>
<div class="comment-meta">
<?php
if (ap_user_can_edit_comment(get_comment_ID())) {
echo '<a class="comment-edit-btn" href="#" data-button="ap-edit-comment" data-args="' . get_comment_ID() . '-' . wp_create_nonce('comment-' . get_comment_ID()) . '"><i class="aicon-pencil"></i> ' . __('Edit', 'ap') . '</a>';
}
if (ap_user_can_delete_comment(get_comment_ID())) {
echo '<a class="comment-delete-btn" href="#" data-button="ap-delete-comment" data-confirm="' . __('Are you sure? It cannot be undone!', 'ap') . '" data-args="' . get_comment_ID() . '-' . wp_create_nonce('delete-comment-' . get_comment_ID()) . '"><i class="aicon-close"></i> ' . __('Delete', 'ap') . '</a>';
}
?>
</div>
</div>
</article>
<?php
}
示例3: ap_get_all_parti
/**
* Print all particpants of a question
* @param integer $avatar_size
* @param boolean $post_id
* @return void
* @since 0.4
*/
function ap_get_all_parti($avatar_size = 40, $post_id = false)
{
if (!$post_id) {
$post_id = get_question_id();
}
$parti = ap_get_parti($post_id);
echo '<span class="ap-widget-title">' . sprintf(_n('<span>1</span> Participant', '<span>%d</span> Participants', count($parti), 'ap'), count($parti)) . '</span>';
echo '<div class="ap-participants-list clearfix">';
foreach ($parti as $p) {
echo '<a title="' . ap_user_display_name($p->apmeta_userid, true) . '" href="' . ap_user_link($p->apmeta_userid) . '" class="ap-avatar">';
echo get_avatar($p->apmeta_userid, $avatar_size);
echo '</a>';
}
echo '</div>';
}
示例4: ap_question_subscribers
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>';
}
}
示例5: get_avatar
">
<?php
echo get_avatar(get_the_author_meta('user_email'), ap_opt('avatar_size_qquestion'));
?>
</a>
</div>
<div class="ap-content-inner no-overflow">
<div class="ap-qmainc">
<div class="ap-user-meta">
<div class="ap-single-vote"><?php
ap_vote_html();
?>
</div>
<div class="ap-meta">
<?php
printf(__('<a href="' . ap_user_link(get_the_author_meta('ID')) . '?rel=author" class="author"><span itemprop="author">%s</span></a> <span class="when">asked about %s ago</span>', 'ap'), ap_user_display_name(false, true), ap_human_time(get_the_time('U')));
?>
</div>
</div>
<div class="question-content" itemprop="text">
<?php
the_content();
?>
</div>
<ul class="ap-user-actions clearfix">
<li><?php
ap_edit_q_btn_html();
?>
</li>
示例6: the_pagination
public function the_pagination()
{
$base = ap_user_link($this->args['user_id'], 'notification') . '/%_%';
ap_pagination($this->paged, $this->total_pages, $base);
}
示例7: ap_get_latest_history_html
function ap_get_latest_history_html($post_id, $initial = false, $avatar = false, $icon = false)
{
$post = get_post($post_id);
$history = get_post_meta($post_id, '__ap_history', true);
if (!$history && $initial) {
$history['date'] = get_the_time('c', $post_id);
$history['user_id'] = $post->post_author;
$history['type'] = 'new_' . $post->post_type;
}
$html = '';
if ($history) {
if ($icon) {
$html .= '<span class="' . ap_icon($history['type']) . ' ap-tlicon"></span>';
}
if ($avatar) {
$html .= '<a class="ap-avatar" href="' . ap_user_link($history['user_id']) . '">' . get_avatar($history['user_id'], 22) . '</a>';
}
$title = ap_history_title($history['type']);
$html .= '<span class="ap-post-history">' . ap_icon('history', true) . sprintf(__(' %s %s %s ago', 'ap'), ap_user_display_name($history['user_id']), $title, '<time datetime="' . mysql2date('c', $history['date']) . '">' . ap_human_time($history['date'], false) . '</time>') . '</span>';
}
if ($html) {
return apply_filters('ap_latest_history_html', $html);
}
return false;
}
示例8: ap_answer_get_the_author_link
/**
* Return the author profile link
* @return string
* @since 2.1
*/
function ap_answer_get_the_author_link()
{
return ap_user_link(ap_answer_get_author_id());
}
示例9: ap_get_breadcrumbs
function ap_get_breadcrumbs()
{
$current_page = get_query_var('ap_page');
$title = ap_page_title();
$a = array();
$a['base'] = array('title' => ap_opt('base_page_title'), 'link' => ap_base_page_link(), 'order' => 0);
if (is_question_tag()) {
$a['tag'] = array('title' => __('Tags', 'ap'), 'link' => '', 'order' => 10);
} elseif (is_question()) {
$a['page'] = array('title' => substr($title, 0, 30) . (strlen($title) > 30 ? __('..', 'ap') : ''), 'link' => get_permalink(get_question_id()), 'order' => 10);
} elseif ($current_page != 'base' && $current_page != '') {
if ($current_page == 'user') {
$a['page'] = array('title' => __('User', 'ap'), 'link' => ap_user_link(ap_get_displayed_user_id()), 'order' => 10);
$a['user_page'] = array('title' => substr($title, 0, 30) . (strlen($title) > 30 ? __('..', 'ap') : ''), 'link' => ap_user_link(ap_get_displayed_user_id(), get_query_var('user_page')), 'order' => 10);
} else {
$a['page'] = array('title' => substr($title, 0, 30) . (strlen($title) > 30 ? __('..', 'ap') : ''), 'link' => ap_get_link_to($current_page), 'order' => 10);
}
}
$a = apply_filters('ap_breadcrumbs', $a);
return ap_sort_array_by_order($a);
}
示例10: ap_latest_post_activity_html
/**
* Get latest activity of question or answer.
* @param integer $post_id Question or answer ID.
* @return string
*/
function ap_latest_post_activity_html($post_id = false)
{
if (false === $post_id) {
$post_id = get_the_ID();
}
$post = get_post($post_id);
$activity = ap_post_activity_meta($post_id);
if (!$activity) {
$activity['date'] = get_the_time('c', $post_id);
$activity['user_id'] = $post->post_author;
$activity['type'] = 'new_' . $post->post_type;
}
$html = '';
if ($activity) {
$title = ap_activity_short_title($activity['type']);
$html .= '<span class="ap-post-history">';
$html .= sprintf(__(' %s %s %s ago', 'ap'), '<a href="' . ap_user_link($activity['user_id']) . '">' . ap_user_display_name($activity['user_id']) . '</a>', $title, '<a href="' . get_permalink($post) . '"><time datetime="' . mysql2date('c', $activity['date']) . '">' . ap_human_time($activity['date'], false) . '</time></a>');
$html .= '</span>';
}
if ($html) {
return apply_filters('ap_latest_post_activity_html', $html);
}
return false;
}
示例11: ap_user_link
" class="clearfix">
<div class="ap-avatar ap-pull-left">
<a href="<?php
echo ap_user_link($comment->user_id);
?>
">
<!-- TODO: OPTION - Avatar size -->
<?php
echo get_avatar($comment->user_id, 30);
?>
</a>
</div><!-- close .ap-avatar -->
<div class="ap-comment-content no-overflow">
<div class="ap-comment-header">
<a href="<?php
echo ap_user_link($comment->user_id);
?>
" class="ap-comment-author"><?php
echo ap_user_display_name($comment->user_id);
?>
</a>
<?php
$a = ' e ';
$b = ' ';
$time = get_option('date_format') . $b . get_option('time_format') . $a . get_option('gmt_offset');
printf(' - <a title="%3$s" href="#li-comment-%4$s" class="ap-comment-time"><time datetime="%1$s">%2$s</time></a>', get_comment_time('c'), ap_human_time(get_comment_time('U')), get_comment_time($time), get_comment_ID());
// Comment actions
ap_comment_actions_buttons();
?>
</div><!-- close .ap-comment-header -->
示例12: ap_user_link_avatar
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>';
}
示例13: update_menu_url
/**
* Update AnsPress pages URL dynimacally
* @param array $items Menu item.
* @return array
*/
public function update_menu_url($items)
{
// If this is admin then we dont want to update url.
if (is_admin()) {
return $items;
}
/**
* Define default AnsPress pages
* So that default pages should work properly after
* Changing categories page slug.
* @var array
*/
$default_pages = array('profile' => array('title' => __('My profile', 'anspress-question-answer'), 'show_in_menu' => true, 'logged_in' => true), 'notification' => array('title' => __('My notification', 'anspress-question-answer'), 'show_in_menu' => true, 'logged_in' => true), 'ask' => array(), 'question' => array(), 'users' => array(), 'user' => array());
/**
* FILTER: ap_default_pages
* @var array
*/
$this->pages = array_merge(anspress()->pages, apply_filters('ap_default_pages', $default_pages));
$this->page_urls();
if (!empty($items) && is_array($items)) {
foreach ($items as $key => $item) {
$slug = array_search(str_replace(array('http://', 'https://'), '', $item->url), $this->page_url);
if (false !== $slug) {
if (isset($this->pages[$slug]['logged_in']) && $this->pages[$slug]['logged_in'] && !is_user_logged_in()) {
unset($items[$key]);
}
if (!ap_is_profile_active() && ('profile' == $slug || 'notification' == $slug)) {
unset($items[$key]);
}
if ('profile' == $slug) {
$item->url = is_user_logged_in() ? ap_user_link(get_current_user_id()) : wp_login_url();
} else {
$item->url = ap_get_link_to($slug);
}
$item->classes[] = 'anspress-page-link';
$item->classes[] = 'anspress-page-' . $slug;
if (get_query_var('ap_page') == $slug) {
$item->classes[] = 'anspress-active-menu-link';
}
}
}
}
return $items;
}
示例14: ap_message_btn_html
function ap_message_btn_html($userid, $display_name)
{
echo '<a class="btn ap-btn ap-follow-btn ap-icon-paperplane" href="' . ap_user_link(get_current_user_id(), 'messages/?to=' . $userid . '&dname=' . $display_name) . '">' . __('Message', 'ap') . '</a>';
}
示例15: update_menu_url
/**
* Update AnsPress pages URL dynimacally
* @param array $items
* @return array
*/
public function update_menu_url($items)
{
if (is_admin()) {
return $items;
}
$pages = anspress()->pages;
$pages['profile'] = array('title' => __('My profile', 'ap'), 'show_in_menu' => true, 'logged_in' => true);
$pages['notification'] = array('title' => __('My notification', 'ap'), 'show_in_menu' => true, 'logged_in' => true);
$pages['ask'] = array();
$pages['question'] = array();
$pages['users'] = array();
$pages['user'] = array();
$page_url = array();
foreach ($pages as $slug => $args) {
$page_url[$slug] = 'ANSPRESS_PAGE_URL_' . strtoupper($slug);
}
if (!empty($items) && is_array($items)) {
foreach ($items as $key => $item) {
if (false !== ($slug = array_search(str_replace(array('http://', 'https://'), '', $item->url), $page_url))) {
$page = $pages[$slug];
if (isset($page['logged_in']) && $page['logged_in'] && !is_user_logged_in()) {
unset($items[$key]);
}
if ($slug == 'profile') {
$item->url = is_user_logged_in() ? ap_user_link(get_current_user_id()) : wp_login_url();
} else {
$item->url = ap_get_link_to($slug);
}
$item->classes[] = 'anspress-page-link';
$item->classes[] = 'anspress-page-' . $slug;
if (get_query_var('ap_page') == $slug) {
$item->classes[] = 'anspress-active-menu-link';
}
}
}
}
return $items;
}