本文整理汇总了PHP中bp_activity_id函数的典型用法代码示例。如果您正苦于以下问题:PHP bp_activity_id函数的具体用法?PHP bp_activity_id怎么用?PHP bp_activity_id使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了bp_activity_id函数的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: bp_reshare_add_reshare_button
function bp_reshare_add_reshare_button()
{
global $bp;
if (!is_user_logged_in()) {
return false;
}
$activity_types_resharable = bp_reshare_activity_types();
if (!in_array(bp_get_activity_type(), $activity_types_resharable)) {
return false;
}
if (bp_reshare_activity_is_hidden()) {
return false;
}
if (bp_reshare_is_user_profile_reshares() && $bp->displayed_user->id != $bp->loggedin_user->id) {
return false;
}
$activity_first_id = bp_get_activity_id();
if ('reshare_update' == bp_get_activity_type()) {
$activity_first_id = bp_get_activity_secondary_item_id();
}
$rs_count = bp_activity_get_meta($activity_first_id, 'reshared_count');
$rs_count = !empty($rs_count) ? $rs_count : 0;
if ($bp->loggedin_user->id == bp_get_activity_user_id() || bp_reshare_user_did_reshared($activity_first_id)) {
$reshared_class = 'reshared';
}
$action_url = wp_nonce_url(bp_get_root_domain() . '/' . bp_get_activity_root_slug() . '/?to_reshare=' . $activity_first_id, '_reshare_update');
if ($_POST['scope'] == 'reshares' || bp_reshare_is_user_profile_reshares() || bp_is_activity_component() && !bp_displayed_user_id() && $_COOKIE['bp-activity-scope'] == 'reshares') {
$extra_class = 'unshare';
$action_url = wp_nonce_url(bp_get_root_domain() . '/' . bp_get_activity_root_slug() . '/?delete_reshare=' . bp_get_activity_id(), '_reshare_delete');
}
?>
<a href="<?php
echo $action_url;
?>
" class="button bp-primary-action bp-agu-reshare" id="bp-agu-reshare-<?php
bp_activity_id();
?>
" rel="<?php
echo $activity_first_id;
?>
"><span class="bp-agu-reshare-img <?php
echo $reshared_class . ' ' . $extra_class;
?>
"></span><span class="rs-count"><?php
echo $rs_count;
?>
</span></a>
<?php
}
示例2: bp_activity_id
<textarea id="ac-input-<?php
bp_activity_id();
?>
" class="ac-input" name="ac_input_<?php
bp_activity_id();
?>
"></textarea>
</div>
<input type="submit" class="btn btn-primary btn-sm" name="ac_form_submit" value="<?php
_e('Post', 'firmasite');
?>
" /> <?php
_e('or press esc to cancel.', 'firmasite');
?>
<input type="hidden" name="comment_form_id" value="<?php
bp_activity_id();
?>
" />
</div>
<?php
do_action('bp_activity_entry_comments');
?>
<?php
wp_nonce_field('new_activity_comment', '_wpnonce_new_activity_comment');
?>
</form>
<?php
示例3: show_comment_form
function show_comment_form() {
$activity_id = get_post_meta($this->id, 'bp_media_child_activity', true);
if (bp_has_activities(array(
'display_comments' => 'stream',
'include' => $activity_id,
'max' => 1
))) :
while (bp_activities()) : bp_the_activity();
do_action('bp_before_activity_entry');
?>
<div class="activity">
<ul id="activity-stream" class="activity-list item-list">
<li class="activity activity_update" id="activity-<?php echo $activity_id; ?>">
<div class="activity-content">
<?php do_action('bp_activity_entry_content'); ?>
<?php if (is_user_logged_in()) : ?>
<div class="activity-meta no-ajax">
<?php if (bp_activity_can_comment()) : ?>
<a href="<?php bp_get_activity_comment_link(); ?>" class="button acomment-reply bp-primary-action" id="acomment-comment-<?php bp_activity_id(); ?>"><?php printf(__('Comment <span>%s</span>', 'buddypress'), bp_activity_get_comment_count()); ?></a>
<?php endif; ?>
<?php if (bp_activity_can_favorite()) : ?>
<?php if (!bp_get_activity_is_favorite()) : ?>
<a href="<?php bp_activity_favorite_link(); ?>" class="button fav bp-secondary-action" title="<?php esc_attr_e('Mark as Favorite', 'buddypress'); ?>"><?php _e('Favorite', 'buddypress') ?></a>
<?php else : ?>
<a href="<?php bp_activity_unfavorite_link(); ?>" class="button unfav bp-secondary-action" title="<?php esc_attr_e('Remove Favorite', 'buddypress'); ?>"><?php _e('Remove Favorite', 'buddypress') ?></a>
<?php endif; ?>
<?php endif; ?>
<?php if (bp_activity_user_can_delete()) bp_activity_delete_link(); ?>
<?php do_action('bp_activity_entry_meta'); ?>
</div>
<?php endif; ?>
</div>
<?php do_action('bp_before_activity_entry_comments'); ?>
<?php if (( is_user_logged_in() && bp_activity_can_comment() ) || bp_activity_get_comment_count()) : ?>
<div class="activity-comments">
<?php bp_activity_comments(); ?>
<?php if (is_user_logged_in()) : ?>
<form action="<?php bp_activity_comment_form_action(); ?>" method="post" id="ac-form-<?php bp_activity_id(); ?>" class="ac-form"<?php bp_activity_comment_form_nojs_display(); ?>>
<div class="ac-reply-avatar"><?php bp_loggedin_user_avatar('width=' . BP_AVATAR_THUMB_WIDTH . '&height=' . BP_AVATAR_THUMB_HEIGHT); ?></div>
<div class="ac-reply-content">
<div class="ac-textarea">
<textarea id="ac-input-<?php bp_activity_id(); ?>" class="ac-input" name="ac_input_<?php bp_activity_id(); ?>"></textarea>
</div>
<input type="submit" name="ac_form_submit" value="<?php _e('Post', 'buddypress'); ?>" /> <?php _e('or press esc to cancel.', 'buddypress'); ?>
<input type="hidden" name="comment_form_id" value="<?php bp_activity_id(); ?>" />
</div>
<?php do_action('bp_activity_entry_comments'); ?>
<?php wp_nonce_field('new_activity_comment', '_wpnonce_new_activity_comment'); ?>
</form>
<?php endif; ?>
</div>
<?php endif; ?>
<?php do_action('bp_after_activity_entry_comments'); ?>
</li>
</ul>
</div>
<?php
endwhile;
else: ?>
<div class="activity">
<ul id="activity-stream" class="activity-list item-list">
<li class="activity activity_update" id="activity-<?php echo $activity_id; ?>">
<div class="activity-content">
<?php do_action('bp_activity_entry_content'); ?>
<?php if (is_user_logged_in()) : ?>
<div class="activity-meta no-ajax">
<a href="<?php echo $this->get_delete_url(); ?>" class="button item-button bp-secondary-action delete-activity-single confirm" rel="nofollow">Delete</a>
</div>
<?php endif; ?>
</div>
</li>
</ul>
</div>
<?
endif;
}
示例4: do_action
echo BP_VERSION;
?>
</generator>
<language>en_US</language>
<?php
do_action('bp_activity_personal_comment_feed_head');
?>
<?php
if (bp_has_activities(bebop_activity_args())) {
while (bp_activities()) {
bp_the_activity();
?>
<item>
<dbid><?php
echo bp_activity_id();
?>
</dbid>
<guid><?php
echo bp_activity_thread_permalink();
?>
</guid>
<type><?php
echo bp_activity_action_name();
?>
</type>
<title><?php
bp_activity_feed_item_title();
?>
</title>
<link><![CDATA[
示例5: bp_like_button
/**
* bp_like_button()
*
* Outputs the 'Like/Unlike' and 'View likes/Hide likes' buttons.
*
*/
function bp_like_button($id = '', $type = '')
{
$users_who_like = 0;
$liked_count = 0;
/* Set the type if not already set, and check whether we are outputting the button on a blogpost or not. */
if (!$type && !is_single()) {
$type = 'activity';
} elseif (!$type && is_single()) {
$type = 'blogpost';
}
if ($type == 'activity') {
$activity = bp_activity_get_specific(array('activity_ids' => bp_get_activity_id()));
$activity_type = $activity['activities'][0]->type;
if (is_user_logged_in() && $activity_type !== 'activity_liked') {
if (bp_activity_get_meta(bp_get_activity_id(), 'liked_count', true)) {
$users_who_like = array_keys(bp_activity_get_meta(bp_get_activity_id(), 'liked_count', true));
$liked_count = count($users_who_like);
}
if (!bp_like_is_liked(bp_get_activity_id(), 'activity')) {
?>
<a href="#" class="like" id="like-activity-<?php
bp_activity_id();
?>
" title="<?php
echo bp_like_get_text('like_this_item');
?>
"><?php
echo bp_like_get_text('like');
if ($liked_count) {
echo ' (' . $liked_count . ')';
}
?>
</a>
<?php
} else {
?>
<a href="#" class="unlike" id="unlike-activity-<?php
bp_activity_id();
?>
" title="<?php
echo bp_like_get_text('unlike_this_item');
?>
"><?php
echo bp_like_get_text('unlike');
if ($liked_count) {
echo ' (' . $liked_count . ')';
}
?>
</a>
<?php
}
if ($users_who_like) {
?>
<a href="#" class="view-likes" id="view-likes-<?php
bp_activity_id();
?>
"><?php
echo bp_like_get_text('view_likes');
?>
</a>
<p class="users-who-like" id="users-who-like-<?php
bp_activity_id();
?>
"></p>
<?php
}
}
} elseif ($type == 'blogpost') {
global $post;
if (!$id && is_single()) {
$id = $post->ID;
}
if (is_user_logged_in() && get_post_meta($id, 'liked_count', true)) {
$liked_count = count(get_post_meta($id, 'liked_count', true));
}
if (!bp_like_is_liked($id, 'blogpost')) {
?>
<div class="like-box"><a href="#" class="like_blogpost" id="like-blogpost-<?php
echo $id;
?>
" title="<?php
echo bp_like_get_text('like_this_item');
?>
"><?php
echo bp_like_get_text('like');
if ($liked_count) {
echo ' (' . $liked_count . ')';
}
?>
</a></div>
<?php
} else {
//.........这里部分代码省略.........
示例6: swa_activity_entry
function swa_activity_entry($show_avatar = false)
{
?>
<?php
do_action('bp_before_activity_entry');
?>
<li class="<?php
bp_activity_css_class();
?>
" id="activity-<?php
bp_activity_id();
?>
">
<?php
if ($show_avatar == "yes") {
?>
<div class="swa-activity-avatar">
<a href="<?php
bp_activity_user_link();
?>
">
<?php
bp_activity_avatar('type=thumb&width=50&height=50');
?>
</a>
</div>
<?php
}
?>
<div class="swa-activity-content">
<div class="swa-activity-header">
<?php
bp_activity_action();
?>
</div>
<?php
if (bp_activity_has_content()) {
?>
<div class="swa-activity-inner">
<?php
bp_activity_content_body();
?>
</div>
<?php
}
?>
<?php
do_action('bp_activity_entry_content');
?>
<div class="swa-activity-meta">
<?php
if (is_user_logged_in() && bp_activity_can_comment()) {
?>
<a href="<?php
bp_activity_comment_link();
?>
" class="acomment-reply" id="acomment-comment-<?php
bp_activity_id();
?>
"><?php
_e('Reply', 'buddypress');
?>
(<span><?php
bp_activity_comment_count();
?>
</span>)</a>
<?php
}
?>
<?php
if (is_user_logged_in()) {
?>
<?php
if (!bp_get_activity_is_favorite()) {
?>
<a href="<?php
bp_activity_favorite_link();
?>
" class="fav" title="<?php
_e('Mark as Favorite', 'swa');
?>
"><?php
_e('Favorite', 'swa');
?>
</a>
<?php
} else {
?>
<a href="<?php
bp_activity_unfavorite_link();
?>
" class="unfav" title="<?php
_e('Remove Favorite', 'swa');
?>
"><?php
_e('Remove Favorite', 'swa');
?>
//.........这里部分代码省略.........
示例7: bp_dtheme_new_activity_comment
function bp_dtheme_new_activity_comment() {
global $bp;
/* Check the nonce */
check_admin_referer( 'new_activity_comment', '_wpnonce_new_activity_comment' );
if ( !is_user_logged_in() ) {
echo '-1';
return false;
}
if ( empty( $_POST['content'] ) ) {
echo '-1<div id="message" class="error"><p>' . __( 'Please do not leave the comment area blank.', 'buddypress' ) . '</p></div>';
return false;
}
if ( empty( $_POST['form_id'] ) || empty( $_POST['comment_id'] ) || !is_numeric( $_POST['form_id'] ) || !is_numeric( $_POST['comment_id'] ) ) {
echo '-1<div id="message" class="error"><p>' . __( 'There was an error posting that reply, please try again.', 'buddypress' ) . '</p></div>';
return false;
}
$comment_id = bp_activity_new_comment( array(
'content' => $_POST['content'],
'activity_id' => $_POST['form_id'],
'parent_id' => $_POST['comment_id']
));
if ( !$comment_id ) {
echo '-1<div id="message" class="error"><p>' . __( 'There was an error posting that reply, please try again.', 'buddypress' ) . '</p></div>';
return false;
}
if ( bp_has_activities ( 'include=' . $comment_id ) ) : ?>
<?php while ( bp_activities() ) : bp_the_activity(); ?>
<li id="acomment-<?php bp_activity_id() ?>">
<div class="acomment-avatar">
<?php bp_activity_avatar() ?>
</div>
<div class="acomment-meta">
<?php echo bp_core_get_userlink( bp_get_activity_user_id() ) ?> · <?php printf( __( '%s ago', 'buddypress' ), bp_core_time_since( bp_core_current_time() ) ) ?> ·
<a class="acomment-reply" href="#acomment-<?php bp_activity_id() ?>" id="acomment-reply-<?php echo esc_attr( $_POST['form_id'] ) ?>"><?php _e( 'Reply', 'buddypress' ) ?></a>
· <a href="<?php echo wp_nonce_url( $bp->root_domain . '/' . $bp->activity->slug . '/delete/' . bp_get_activity_id() . '?cid=' . $comment_id, 'bp_activity_delete_link' ) ?>" class="delete acomment-delete confirm"><?php _e( 'Delete', 'buddypress' ) ?></a>
</div>
<div class="acomment-content">
<?php bp_activity_content_body() ?>
</div>
</li>
<?php endwhile; ?>
<?php endif;
}
示例8: do_action
</div>
<?php endif; ?>
<?php do_action( 'bp_before_activity_entry_comments' ) ?>
<?php if ( bp_activity_can_comment() ) : ?>
<div class="activity-comments">
<?php bp_activity_comments() ?>
<?php if ( is_user_logged_in() ) : ?>
<form action="<?php bp_activity_comment_form_action() ?>" method="post" id="ac-form-<?php bp_activity_id() ?>" class="ac-form"<?php bp_activity_comment_form_nojs_display() ?>>
<div class="ac-reply-avatar"><?php bp_loggedin_user_avatar( 'width=' . BP_AVATAR_THUMB_WIDTH . '&height=' . BP_AVATAR_THUMB_HEIGHT ) ?></div>
<div class="ac-reply-content">
<div class="ac-textarea">
<textarea id="ac-input-<?php bp_activity_id() ?>" class="ac-input" name="ac_input_<?php bp_activity_id() ?>"></textarea>
</div>
<input type="submit" name="ac_form_submit" value="<?php _e( 'Post', 'buddypress' ) ?> →" /> <?php _e( 'or press esc to cancel.', 'buddypress' ) ?>
<input type="hidden" name="comment_form_id" value="<?php bp_activity_id() ?>" />
</div>
<?php wp_nonce_field( 'new_activity_comment', '_wpnonce_new_activity_comment' ) ?>
</form>
<?php endif; ?>
</div>
<?php endif; ?>
<?php do_action( 'bp_after_activity_entry_comments' ) ?>
</li>
<?php do_action( 'bp_after_activity_entry' ) ?>