本文整理汇总了PHP中userpro_show_badges函数的典型用法代码示例。如果您正苦于以下问题:PHP userpro_show_badges函数的具体用法?PHP userpro_show_badges怎么用?PHP userpro_show_badges使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了userpro_show_badges函数的11个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的PHP代码示例。
示例1: userpro_admin_users_badges
function userpro_admin_users_badges($value, $column_name, $user_id)
{
global $userpro;
$user = get_userdata($user_id);
if (userpro_get_option('backend_users_change')) {
if ('userpro_username' == $column_name) {
$res = '<div class="upadmin-avatar">' . get_avatar($user_id, 40) . '</div>';
$res .= '<strong><a href="' . $userpro->permalink($user_id) . '" target="_blank" title="' . __('View Profile', 'userpro') . '">' . $user->user_login . '</a></strong><br />';
$res .= '<span class="upadmin-small-name">(' . userpro_profile_data('display_name', $user_id) . ')</span>';
$res .= '<div class="row-actions"><span class="edit"><a href="' . $userpro->permalink($user_id, 'edit') . '" target="_blank">' . __('Edit Profile', 'userpro') . '</a></span></div>';
return $res;
}
}
if ('userpro_admin_badges' == $column_name) {
$res = userpro_show_badges($user_id, true);
return $res;
}
if ('userpro_verify' == $column_name) {
$res = '<div class="upadmin-verify-v2">';
if ($userpro->get_verified_status($user_id) == 0) {
$res .= '<a href="#" class="button upadmin-verify-u" data-user="' . $user_id . '">' . userpro_get_badge('unverified') . '</a>';
} else {
if (userpro_is_admin($user_id)) {
$res .= '<a href="#" class="button button-primary upadmin-unverify-u" data-user="' . $user_id . '">' . userpro_get_badge('verified') . '</a>';
} else {
$res .= '<a href="#" class="button button-primary upadmin-unverify-u" data-user="' . $user_id . '">' . userpro_get_badge('verified') . '</a>';
}
}
if ($userpro->get_verified_status($user_id) == 0) {
if ($userpro->invited_to_verify($user_id)) {
$res .= ' ' . __('Invitation sent!', 'userpro');
} else {
$res .= '<a href="#" class="button upadmin-invite-u" data-user="' . $user_id . '">' . __('Verified Invite', 'userpro') . '</a>';
}
}
$res .= '</div>';
return $res;
}
if ('block_users' == $column_name) {
$res = '<div class="upadmin-block-v2">';
if ($userpro->get_account_status($user_id) == 0) {
$res .= '<a href="#" class="button upadmin-block-u" data-user="' . $user_id . '">' . userpro_get_badge('unblocked') . '</a>';
} else {
if (userpro_is_admin($user_id)) {
$res .= '<a href="#" class="button upadmin-unblock-u" data-user="' . $user_id . '">' . userpro_get_badge('blocked') . '</a>';
} else {
$res .= '<a href="#" class="button upadmin-unblock-u" data-user="' . $user_id . '">' . userpro_get_badge('blocked') . '</a>';
}
}
if ($userpro->get_account_status($user_id) == 1) {
$res .= '<span class="button" data-user="' . $user_id . '">' . __('Account Blocked', 'userpro') . '</span>';
}
$res .= '</div>';
$res .= '</div>';
return $res;
}
return $value;
}
开发者ID:Darciro,项目名称:PPM,代码行数:58,代码来源:admin-users.php
示例2: get_avatar
<div class="userpro-msg-user">
<div class="userpro-msg-user-thumb"><?php
echo get_avatar(get_current_user_id(), 50);
?>
</div>
<div class="userpro-msg-user-info">
<div class="userpro-msg-user-name">
<a href="<?php
echo $userpro->permalink(get_current_user_id());
?>
"><?php
echo userpro_profile_data('display_name', get_current_user_id());
?>
</a><?php
echo userpro_show_badges(get_current_user_id(), $inline = true);
?>
</div>
<div class="userpro-msg-user-tab"><i class="userpro-icon-comment-alt"></i><?php
_e('Message History', 'userpro-msg');
?>
</div>
</div>
<a href="#" class="userpro-back-to-inbox" data-user_id="<?php
echo get_current_user_id();
?>
"><i class="userpro-icon-angle-left"></i><?php
_e('Back', 'userpro-msg');
?>
</a>
开发者ID:fritzdenim,项目名称:pangMoves,代码行数:31,代码来源:message_list.php
示例3: do_action
<?php
do_action('bbp_theme_after_reply_author_details');
?>
</div><!-- .bbp-reply-author -->
<div class="bbp-reply-content">
<div class="mom-bbp-reply-author mom-main-font">
<span class="mom-main-color">
<?php
if (class_exists('userpro_api')) {
/* Integrating UserPro */
global $userpro;
$link = preg_replace("/(?<=href=(\"|'))[^\"']+(?=(\"|'))/", $userpro->permalink(bbp_get_reply_author_id()), bbp_get_reply_author_link(array('sep' => '', 'size' => 0)));
echo $link . userpro_show_badges(bbp_get_reply_author_id());
} else {
bbp_reply_author_link(array('sep' => '', 'show_role' => false, 'type' => 'name'));
}
?>
</span> <?php
_e('on:', 'framework');
?>
<?php
bbp_reply_post_date();
?>
<a href="<?php
bbp_reply_url();
?>
" class="bbp-reply-permalink alignright">#<?php
bbp_reply_id();
开发者ID:justinwool,项目名称:vortago,代码行数:31,代码来源:loop-single-reply.php
示例4: _e
</a>
</div>
<div class="emd-user-info">
<div class="emd-user-left"><a href="<?php
echo $userpro->permalink($user_id);
?>
" title="<?php
_e('View Full Profile', 'userpro');
?>
"><?php
echo userpro_profile_data('display_name', $user_id);
?>
</a></div>
<div class="emd-user-right"><?php
echo userpro_show_badges($user_id, true);
?>
</div>
<div class="userpro-clear"></div>
<?php
do_action('userpro_after_profile_img', $user_id);
?>
</div>
<?php
if ($emd_bio) {
?>
<div class="emd-user-bio"><?php
echo $userpro->shortbio($user_id);
?>
</div>
开发者ID:fritzdenim,项目名称:pangMoves,代码行数:31,代码来源:emd.php
示例5: log_action
function log_action($action, $user_id, $var1 = null, $var2 = null, $var3 = null)
{
global $userpro, $userpro_social;
$activity = get_option('userpro_activity');
$timestamp = isset($gmt) ? time() : time() + get_option('gmt_offset') * 3600;
$status = '';
switch ($action) {
case 'verified':
$status .= '<div class="userpro-sc-img" data-key="profilepicture"><a href="' . $userpro->permalink($user_id) . '">' . get_avatar($user_id, '50') . '</a></div><div class="userpro-sc-i"><div class="userpro-sc-i-name"><a href="' . $userpro->permalink($user_id) . '" title="' . __('View Profile', 'userpro') . '">' . userpro_profile_data('display_name', $user_id) . '</a>' . userpro_show_badges($user_id);
$status .= '<span class="userpro-sc-i-info">';
$status .= __('is now a verified account.', 'userpro');
$status .= '</span>';
$status .= '</div><div class="userpro-sc-i-time">' . gmdate("d M Y H:i:s", $timestamp) . '</div></div><div class="userpro-clear"></div>';
$activity[$user_id][$timestamp] = array('user_id' => $user_id, 'status' => $status);
break;
case 'new_post':
$status .= '<div class="userpro-sc-img" data-key="profilepicture"><a href="' . $userpro->permalink($user_id) . '">' . get_avatar($user_id, '50') . '</a></div><div class="userpro-sc-i"><div class="userpro-sc-i-name"><a href="' . $userpro->permalink($user_id) . '" title="' . __('View Profile', 'userpro') . '">' . userpro_profile_data('display_name', $user_id) . '</a>' . userpro_show_badges($user_id);
$status .= '<span class="userpro-sc-i-info">';
$status .= sprintf(__('has published a <a href="%s">new %s</a>.', 'userpro'), get_permalink($var1), $var3);
if ($var2 != '') {
$status .= '<span class="userpro-sc-i-sp">"' . $var2 . '"</span>';
}
$status .= '</span>';
$status .= '</div><div class="userpro-sc-i-time">' . gmdate("d M Y H:i:s", $timestamp) . '</div></div><div class="userpro-clear"></div>';
$activity[$user_id][$timestamp] = array('user_id' => $user_id, 'status' => $status);
break;
case 'update_post':
$status .= '<div class="userpro-sc-img" data-key="profilepicture"><a href="' . $userpro->permalink($user_id) . '">' . get_avatar($user_id, '50') . '</a></div><div class="userpro-sc-i"><div class="userpro-sc-i-name"><a href="' . $userpro->permalink($user_id) . '" title="' . __('View Profile', 'userpro') . '">' . userpro_profile_data('display_name', $user_id) . '</a>' . userpro_show_badges($user_id);
$status .= '<span class="userpro-sc-i-info">';
$status .= sprintf(__('has updated a <a href="%s">%s</a>.', 'userpro'), get_permalink($var1), $var3);
if ($var2 != '') {
$status .= '<span class="userpro-sc-i-sp">"' . $var2 . '"</span>';
}
$status .= '</span>';
$status .= '</div><div class="userpro-sc-i-time">' . gmdate("d M Y H:i:s", $timestamp) . '</div></div><div class="userpro-clear"></div>';
$activity[$user_id][$timestamp] = array('user_id' => $user_id, 'status' => $status);
break;
case 'new_comment':
$status .= '<div class="userpro-sc-img" data-key="profilepicture"><a href="' . $userpro->permalink($user_id) . '">' . get_avatar($user_id, '50') . '</a></div><div class="userpro-sc-i"><div class="userpro-sc-i-name"><a href="' . $userpro->permalink($user_id) . '" title="' . __('View Profile', 'userpro') . '">' . userpro_profile_data('display_name', $user_id) . '</a>' . userpro_show_badges($user_id);
$status .= '<span class="userpro-sc-i-info">';
$status .= __('has posted a new comment on:', 'userpro');
$status .= '<span class="userpro-sc-i-sp">"<a href="' . get_permalink($var1) . '">' . $var2 . '</a>"</span>';
$status .= '</span>';
$status .= '</div><div class="userpro-sc-i-time">' . gmdate("d M Y H:i:s", $timestamp) . '</div></div><div class="userpro-clear"></div>';
$activity[$user_id][$timestamp] = array('user_id' => $user_id, 'status' => $status);
break;
case 'new_follow':
$dest = get_userdata($var1);
$status .= '<div class="userpro-sc-img" data-key="profilepicture"><a href="' . $userpro->permalink($user_id) . '">' . get_avatar($user_id, '50') . '</a></div><div class="userpro-sc-i"><div class="userpro-sc-i-name"><a href="' . $userpro->permalink($user_id) . '" title="' . __('View Profile', 'userpro') . '">' . userpro_profile_data('display_name', $user_id) . '</a>' . userpro_show_badges($user_id);
$status .= '<span class="userpro-sc-i-info">';
$status .= sprintf(__('has started following <a href="%s">%s</a>', 'userpro'), $userpro->permalink($dest->ID), userpro_profile_data('display_name', $dest->ID));
$status .= '</span>';
$status .= '</div><div class="userpro-sc-i-time">' . gmdate("d M Y H:i:s", $timestamp) . '</div></div><div class="userpro-clear"></div>';
$activity[$user_id][$timestamp] = array('user_id' => $user_id, 'status' => $status);
/* notification */
if (userpro_sc_get_option('notification_on_follow')) {
$this->new_notification($dest, $user_id, 'new_follow');
}
break;
case 'stop_follow':
$dest = get_userdata($var1);
$status .= '<div class="userpro-sc-img" data-key="profilepicture"><a href="' . $userpro->permalink($user_id) . '">' . get_avatar($user_id, '50') . '</a></div><div class="userpro-sc-i"><div class="userpro-sc-i-name"><a href="' . $userpro->permalink($user_id) . '" title="' . __('View Profile', 'userpro') . '">' . userpro_profile_data('display_name', $user_id) . '</a>' . userpro_show_badges($user_id);
$status .= '<span class="userpro-sc-i-info">';
$status .= sprintf(__('has stopped following <a href="%s">%s</a>', 'userpro'), $userpro->permalink($dest->ID), userpro_profile_data('display_name', $dest->ID));
$status .= '</span>';
$status .= '</div><div class="userpro-sc-i-time">' . gmdate("d M Y H:i:s", $timestamp) . '</div></div><div class="userpro-clear"></div>';
$activity[$user_id][$timestamp] = array('user_id' => $user_id, 'status' => $status);
break;
case 'new_user':
$status .= '<div class="userpro-sc-img" data-key="profilepicture"><a href="' . $userpro->permalink($user_id) . '">' . get_avatar($user_id, '50') . '</a></div><div class="userpro-sc-i"><div class="userpro-sc-i-name"><a href="' . $userpro->permalink($user_id) . '" title="' . __('View Profile', 'userpro') . '">' . userpro_profile_data('display_name', $user_id) . '</a>' . userpro_show_badges($user_id);
$status .= '<span class="userpro-sc-i-info">';
$status .= __('has just registered!', 'userpro');
$status .= '</span>';
$status .= '</div><div class="userpro-sc-i-time">' . gmdate("d M Y H:i:s", $timestamp) . '</div></div><div class="userpro-clear"></div>';
$activity[$user_id][$timestamp] = array('user_id' => $user_id, 'status' => $status);
break;
}
update_option('userpro_activity', $activity);
}
开发者ID:ingridlima,项目名称:userpro-custom,代码行数:79,代码来源:api.php
示例6: get_avatar
<div class="userpro-msg-user">
<div class="userpro-msg-user-thumb"><?php
echo get_avatar($user_id, 50);
?>
</div>
<div class="userpro-msg-user-info">
<div class="userpro-msg-user-name">
<a href="<?php
echo $userpro->permalink($user_id);
?>
"><?php
echo userpro_profile_data('display_name', $user_id);
?>
</a><?php
echo userpro_show_badges($user_id, $inline = true);
?>
</div>
<div class="userpro-msg-user-tab"><a href="<?php
echo $userpro->permalink($user_id);
?>
" class="userpro-flat-btn"><?php
_e('View Profile', 'userpro-msg');
?>
</a></div>
</div>
<div class="userpro-clear"></div>
</div>
<div class="userpro-msg-body">
开发者ID:fritzdenim,项目名称:pangMoves,代码行数:31,代码来源:broadcast.php
示例7: _e
?>
</a>
</div>
<div class="userpro-sc-i">
<div class="userpro-sc-i-name"><a href="<?php
echo $userpro->permalink($user);
?>
" title="<?php
_e('View Profile', 'userpro');
?>
"><?php
echo userpro_profile_data('display_name', $user);
?>
</a><?php
echo userpro_show_badges($user);
?>
</div>
<?php
if ($userpro->shortbio($user)) {
?>
<div class="userpro-sc-i-bio"><?php
echo $userpro->shortbio($user);
?>
</div><?php
}
?>
<div class="userpro-sc-i-icons"><?php
echo userpro_profile_icons($args, $user);
?>
</div>
开发者ID:Darciro,项目名称:PPM,代码行数:31,代码来源:following.php
示例8: _e
?>
</a></div>
<div class="userpro-profile-img-after">
<div class="userpro-profile-name">
<a href="<?php
echo $userpro->permalink();
?>
" title="<?php
_e('View/manage your profile', 'userpro');
?>
"><?php
echo userpro_profile_data('display_name', $user_id);
?>
</a><?php
echo userpro_show_badges($user_id);
?>
</div>
<div class="userpro-profile-img-btn">
<a href="<?php
echo $userpro->permalink();
?>
" class="userpro-button secondary"><?php
_e('View Profile', 'userpro');
?>
</a>
<a href="<?php
echo userpro_logout_url($user_id, $args['permalink'], $args['logout_redirect']);
?>
" class="userpro-button secondary"><?php
_e('Logout', 'userpro');
开发者ID:ingridlima,项目名称:userpro-custom,代码行数:31,代码来源:logout.php
示例9: get_avatar
<div class="userpro-msg-user">
<div class="userpro-msg-user-thumb"><?php
echo get_avatar($chat_with, 50);
?>
</div>
<div class="userpro-msg-user-info">
<div class="userpro-msg-user-name">
<a href="<?php
echo $userpro->permalink($chat_with);
?>
"><?php
echo userpro_profile_data('display_name', $chat_with);
?>
</a><?php
echo userpro_show_badges($chat_with, $inline = true);
?>
</div>
<div class="userpro-msg-user-tab"><a href="<?php
echo $userpro->permalink($chat_with);
?>
" class="userpro-flat-btn"><?php
_e('View Profile', 'userpro-msg');
?>
</a></div>
</div>
<div class="userpro-clear"></div>
</div>
<div class="userpro-msg-body">
开发者ID:fritzdenim,项目名称:pangMoves,代码行数:31,代码来源:new-message.php
示例10: log_action
function log_action($action, $user_id, $var1 = null, $var2 = null, $var3 = null)
{
global $userpro, $userpro_social;
$activity = get_option('userpro_activity');
$timestamp = current_time('timestamp');
$status = '';
switch ($action) {
case 'verified':
$status .= '<div class="userpro-sc-img" data-key="profilepicture"><a href="' . $userpro->permalink($user_id) . '">' . get_avatar($user_id, '50') . '</a></div><div class="userpro-sc-i"><div class="userpro-sc-i-name"><a href="' . $userpro->permalink($user_id) . '" title="' . __('View Profile', 'userpro') . '">' . userpro_profile_data('display_name', $user_id) . '</a>' . userpro_show_badges($user_id, false, array('custom'));
$status .= '<span class="userpro-sc-i-info">';
$status .= __('is now a verified account.', 'userpro');
$status .= '</span>';
$status .= '</div><div class="userpro-sc-i-time">{timestamp}</div></div><div class="userpro-clear"></div>';
$activity[$user_id][$timestamp] = array('user_id' => $user_id, 'status' => $status, 'timestamp' => $timestamp);
break;
case 'new_post':
$array = get_user_meta($user_id, '_userpro_followers_ids', true);
$status .= '<div class="userpro-sc-img" data-key="profilepicture"><a href="' . $userpro->permalink($user_id) . '">' . get_avatar($user_id, '50') . '</a></div><div class="userpro-sc-i"><div class="userpro-sc-i-name"><a href="' . $userpro->permalink($user_id) . '" title="' . __('View Profile', 'userpro') . '">' . userpro_profile_data('display_name', $user_id) . '</a>' . userpro_show_badges($user_id, false, array('custom'));
$status .= '<span class="userpro-sc-i-info">';
if ($var3 == "userpro_userwall") {
$status .= __("has published a {$var2} ", 'userpro');
} else {
$status .= sprintf(__('has published a <a href="%s">new %s</a>.', 'userpro'), get_permalink($var1), $var3);
}
if ($var2 != '') {
$status .= '<span class="userpro-sc-i-sp">"' . $var2 . '"</span>';
}
$status .= '</span>';
$status .= '</div><div class="userpro-sc-i-time">{timestamp}</div></div><div class="userpro-clear"></div>';
$activity[$user_id][$timestamp] = array('user_id' => $user_id, 'status' => $status, 'timestamp' => $timestamp);
if (userpro_sc_get_option('notification_on_follow_post') == 1) {
if (is_array($array)) {
foreach ($array as $key => $value) {
$user_info = get_userdata($key);
$headers = 'From: ' . userpro_get_option('mail_from_name') . ' <' . userpro_get_option('mail_from') . '>' . "\r\n";
$subject = "New Post";
$message = "Post Name {$var2}";
wp_mail($user_info->user_email, $subject, $message, $headers);
}
}
}
break;
case 'update_post':
$status .= '<div class="userpro-sc-img" data-key="profilepicture"><a href="' . $userpro->permalink($user_id) . '">' . get_avatar($user_id, '50') . '</a></div><div class="userpro-sc-i"><div class="userpro-sc-i-name"><a href="' . $userpro->permalink($user_id) . '" title="' . __('View Profile', 'userpro') . '">' . userpro_profile_data('display_name', $user_id) . '</a>' . userpro_show_badges($user_id, false, array('custom'));
$status .= '<span class="userpro-sc-i-info">';
$status .= sprintf(__('has updated a <a href="%s">%s</a>.', 'userpro'), get_permalink($var1), $var3);
if ($var2 != '') {
$status .= '<span class="userpro-sc-i-sp">"' . $var2 . '"</span>';
}
$status .= '</span>';
$status .= '</div><div class="userpro-sc-i-time">{timestamp}</div></div><div class="userpro-clear"></div>';
$activity[$user_id][$timestamp] = array('user_id' => $user_id, 'status' => $status, 'timestamp' => $timestamp);
break;
case 'new_comment':
$status .= '<div class="userpro-sc-img" data-key="profilepicture"><a href="' . $userpro->permalink($user_id) . '">' . get_avatar($user_id, '50') . '</a></div><div class="userpro-sc-i"><div class="userpro-sc-i-name"><a href="' . $userpro->permalink($user_id) . '" title="' . __('View Profile', 'userpro') . '">' . userpro_profile_data('display_name', $user_id) . '</a>' . userpro_show_badges($user_id, false, array('custom'));
$status .= '<span class="userpro-sc-i-info">';
$status .= __('has posted a new comment on:', 'userpro');
$status .= '<span class="userpro-sc-i-sp">"<a href="' . get_permalink($var1) . '">' . $var2 . '</a>"</span>';
$status .= '</span>';
$status .= '</div><div class="userpro-sc-i-time">{timestamp}</div></div><div class="userpro-clear"></div>';
$activity[$user_id][$timestamp] = array('user_id' => $user_id, 'status' => $status, 'timestamp' => $timestamp);
break;
case 'new_follow':
$dest = get_userdata($var1);
$status .= '<div class="userpro-sc-img" data-key="profilepicture"><a href="' . $userpro->permalink($user_id) . '">' . get_avatar($user_id, '50') . '</a></div><div class="userpro-sc-i"><div class="userpro-sc-i-name"><a href="' . $userpro->permalink($user_id) . '" title="' . __('View Profile', 'userpro') . '">' . userpro_profile_data('display_name', $user_id) . '</a>' . userpro_show_badges($user_id, false, array('custom'));
$status .= '<span class="userpro-sc-i-info">';
$status .= sprintf(__('has started following <a href="%s">%s</a>', 'userpro'), $userpro->permalink($dest->ID), userpro_profile_data('display_name', $dest->ID));
$status .= '</span>';
$status .= '</div><div class="userpro-sc-i-time">{timestamp}</div></div><div class="userpro-clear"></div>';
$activity[$user_id][$timestamp] = array('user_id' => $user_id, 'status' => $status, 'timestamp' => $timestamp);
/* notification */
$followers = get_user_meta($dest->ID, 'followers_email');
if (userpro_sc_get_option('notification_on_follow') && (isset($followers[0]) && $followers[0] == "unsubscribed")) {
$this->new_notification($dest, $user_id, 'new_follow');
}
break;
case 'stop_follow':
$dest = get_userdata($var1);
$status .= '<div class="userpro-sc-img" data-key="profilepicture"><a href="' . $userpro->permalink($user_id) . '">' . get_avatar($user_id, '50') . '</a></div><div class="userpro-sc-i"><div class="userpro-sc-i-name"><a href="' . $userpro->permalink($user_id) . '" title="' . __('View Profile', 'userpro') . '">' . userpro_profile_data('display_name', $user_id) . '</a>' . userpro_show_badges($user_id, false, array('custom'));
$status .= '<span class="userpro-sc-i-info">';
$status .= sprintf(__('has stopped following <a href="%s">%s</a>', 'userpro'), $userpro->permalink($dest->ID), userpro_profile_data('display_name', $dest->ID));
$status .= '</span>';
$status .= '</div><div class="userpro-sc-i-time">{timestamp}</div></div><div class="userpro-clear"></div>';
$activity[$user_id][$timestamp] = array('user_id' => $user_id, 'status' => $status, 'timestamp' => $timestamp);
break;
case 'new_user':
$status .= '<div class="userpro-sc-img" data-key="profilepicture"><a href="' . $userpro->permalink($user_id) . '">' . get_avatar($user_id, '50') . '</a></div><div class="userpro-sc-i"><div class="userpro-sc-i-name"><a href="' . $userpro->permalink($user_id) . '" title="' . __('View Profile', 'userpro') . '">' . userpro_profile_data('display_name', $user_id) . '</a>' . userpro_show_badges($user_id, false, array('custom'));
$status .= '<span class="userpro-sc-i-info">';
$status .= __('has just registered!', 'userpro');
$status .= '</span>';
$status .= '</div><div class="userpro-sc-i-time">{timestamp}</div></div><div class="userpro-clear"></div>';
$activity[$user_id][$timestamp] = array('user_id' => $user_id, 'status' => $status, 'timestamp' => $timestamp);
break;
}
// If disable activity is turned off
if (userpro_get_option('disable_activity_log') == 0) {
update_option('userpro_activity', $activity);
}
}
开发者ID:Darciro,项目名称:PPM,代码行数:99,代码来源:api.php
示例11: get_comment_template
/**
* @param type $comment the current comment object
* @param type $args
* @return single comment template
*/
public function get_comment_template($comment, $args, $depth)
{
global $current_user;
get_currentuserinfo();
$comment_content = wp_kses($comment->comment_content, $this->wc_helper->wc_allowed_tags);
$comment_content = $this->wc_helper->make_clickable($comment_content);
$comment_content = apply_filters('comment_text', $comment_content, $comment, $args);
$hide_avatar_style = $this->wc_options_serialized->wc_avatar_show_hide ? 'style = "margin-left : 0;"' : '';
$vote_cls = '';
$vote_title_text = '';
$user = get_user_by('id', $comment->user_id);
$wc_author_class = '';
$wc_comment_author_url = 'http://' == $comment->comment_author_url ? '' : $comment->comment_author_url;
$wc_comment_author_url = esc_url($wc_comment_author_url, array('http', 'https'));
$wc_comment_author_url = apply_filters('get_comment_author_url', $wc_comment_author_url, $comment->comment_ID, $comment);
if ($user) {
$wc_comment_author_url = $wc_comment_author_url ? $wc_comment_author_url : $user->user_url;
$post = get_post($comment->comment_post_ID);
if ($user->ID == $post->post_author) {
$wc_author_class = 'wc-post-author';
$author_title = $this->wc_options_serialized->wc_phrases['wc_user_title_author_text'];
} else {
if (in_array('administrator', $user->roles)) {
$wc_author_class = 'wc-blog-admin';
$author_title = $this->wc_options_serialized->wc_phrases['wc_user_title_admin_text'];
} else {
$wc_author_class = 'wc-blog-member';
$author_title = $this->wc_options_serialized->wc_phrases['wc_user_title_member_text'];
}
}
} else {
$wc_author_class = 'wc-blog-guest';
$author_title = $this->wc_options_serialized->wc_phrases['wc_user_title_guest_text'];
}
if ($this->wc_options_serialized->wc_simple_comment_date) {
$date_format = get_option('date_format');
$time_format = get_option('time_format');
if (WC_Helper::is_posted_today($comment)) {
$posted_date = $this->wc_options_serialized->wc_phrases['wc_posted_today_text'] . ' ' . mysql2date($time_format, $comment->comment_date);
} else {
$posted_date = get_comment_date($date_format, $comment->comment_ID);
}
} else {
$posted_date = $this->wc_helper->dateDiff(time(), strtotime($comment->comment_date_gmt), 2);
}
$reply_text = $this->wc_options_serialized->wc_phrases['wc_reply_text'];
$share_text = $this->wc_options_serialized->wc_phrases['wc_share_text'];
$comment_wrapper_class = $comment->comment_parent ? 'wc-comment wc-reply' : 'wc-comment';
$textarea_placeholder = $this->get_textarea_placeholder($comment);
$vote_count_meta = get_comment_meta($comment->comment_ID, 'wpdiscuz_votes', true);
$vote_count = $vote_count_meta ? $vote_count_meta : 0;
$unique_id = $this->get_unique_id($comment);
$wc_author_name = $this->get_author_name($comment);
$wc_profile_url = $this->get_profile_url($user);
if ($wc_profile_url) {
$wc_comm_author_avatar = "<a href='{$wc_profile_url}'>" . $this->wc_helper->get_comment_author_avatar($comment) . "</a>";
} else {
$wc_comm_author_avatar = $this->wc_helper->get_comment_author_avatar($comment);
}
if ($wc_comment_author_url) {
$wc_author_name = "<a rel='nofollow' href='{$wc_comment_author_url}'>" . $wc_author_name . "</a>";
} else {
if ($wc_profile_url) {
$wc_author_name = "<a href='{$wc_profile_url}'>" . $wc_author_name . "</a>";
}
}
$child_comments = get_comments(array('parent' => $comment->comment_ID, 'status' => 'approve'));
if (!$this->wc_options_serialized->wc_is_guest_can_vote && !is_user_logged_in()) {
$vote_cls = ' wc_tooltipster';
$vote_title_text = $this->wc_options_serialized->wc_phrases['wc_login_to_vote'];
$vote_up = $vote_title_text;
$vote_down = $vote_title_text;
} else {
$vote_cls = ' wc_vote wc_tooltipster';
$vote_up = $this->wc_options_serialized->wc_phrases['wc_vote_up'];
$vote_down = $this->wc_options_serialized->wc_phrases['wc_vote_down'];
}
$parent_comment = !$comment->comment_parent && count($child_comments) ? ' parnet_comment' : '';
$wc_visible_parent_comment_ids = isset($args['wc_visible_parent_comment_ids']) ? $args['wc_visible_parent_comment_ids'] : null;
$comment_content_class = $wc_visible_parent_comment_ids != null && !in_array($comment->comment_ID, $wc_visible_parent_comment_ids) ? ' wc_new_loaded_comment' : '';
$output = '<div id="wc-comm-' . $unique_id . '" class="' . $comment_wrapper_class . ' ' . $wc_author_class . ' ' . $parent_comment . ' wc_comment_level-' . $depth . '">';
if (!$this->wc_options_serialized->wc_avatar_show_hide) {
$output .= '<div class="wc-comment-left">' . $wc_comm_author_avatar;
if (!$this->wc_options_serialized->wc_author_titles_show_hide) {
$output .= '<div class="' . $wc_author_class . ' wc-comment-label">' . $author_title . '</div>';
}
if (class_exists('userpro_api') && $comment->user_id) {
$output .= userpro_show_badges($comment->user_id, $inline = true);
}
$output .= '</div>';
}
$output .= '<div id="comment-' . $comment->comment_ID . '" class="wc-comment-right ' . $comment_content_class . '" ' . $hide_avatar_style . '>';
$output .= '<div class="wc-comment-header"><div class="wc-comment-author">' . $wc_author_name . '</div><div class="wc-comment-date">' . $posted_date . '</div><div style="clear:both"></div></div>';
$output .= '<div class="wc-comment-text">' . $comment_content . '</div>';
$output .= '<div class="wc-comment-footer">';
//.........这里部分代码省略.........
开发者ID:VLabsInc,项目名称:WordPressPlatforms,代码行数:101,代码来源:tpl-comment.php
注:本文中的userpro_show_badges函数示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论