Esempio n. 1
0
/**
 * Deprecated. Use bbp_reply_author_display_name() instead.
 *
 * Output the author of the reply
 *
 * @since bbPress (r2667)
 * @deprecated bbPress (r5119)
 *
 * @param int $reply_id Optional. Reply id
 * @uses bbp_get_reply_author() To get the reply author
 */
function bbp_reply_author($reply_id = 0)
{
    echo bbp_get_reply_author($reply_id);
}
Esempio n. 2
0
/**
 * Generate post report buttons
 * @version 2.0
 */
function apoc_report_post_button($type)
{
    // Only let members report stuff
    if (!is_user_logged_in()) {
        return false;
    }
    // Get the data by context
    switch ($type) {
        // Forum reply
        case 'reply':
            $post_id = bbp_get_reply_id();
            $reported_user = bbp_get_reply_author();
            $post_number = bbp_get_reply_position();
            break;
            // Article comment
        // Article comment
        case 'comment':
            global $comment, $comment_count;
            $post_id = $comment->comment_ID;
            $reported_user = $comment->comment_author;
            $post_number = $comment_count['count'];
            break;
            // Private message
        // Private message
        case 'message':
            global $thread_template;
            $post_id = $thread_template->message->thread_id;
            $reported_user = $thread_template->message->sender_id;
            $post_number = $thread_template->current_message + 1;
            break;
    }
    // Echo the button
    $button = '<a class="report-post" title="Report This Post" data-id="' . $post_id . '" data-number="' . $post_number . '" data-user="******" data-type="' . $type . '"><i class="fa fa-warning"></i></a>';
    echo $button;
}
/**
 * Custom function from bbp_get_author_link(), returns only author name
 * -------------------------------------------------------------------------------------------*/
function aq_get_author($post_id = 0)
{
    // Confirmed topic
    if (bbp_is_topic($post_id)) {
        return bbp_get_topic_author($post_id);
        // Confirmed reply
    } elseif (bbp_is_reply($post_id)) {
        return bbp_get_reply_author($post_id);
        // Get the post author and proceed
    } else {
        $user_id = get_post_field('post_author', $post_id);
    }
    // Neither a reply nor a topic, so could be a revision
    if (!empty($post_id)) {
        // Assemble some link bits
        $anonymous = bbp_is_reply_anonymous($post_id);
        // Add links if not anonymous
        if (empty($anonymous) && bbp_user_has_profile($user_id)) {
            $author_link = get_the_author_meta('display_name', $user_id);
            // No links if anonymous
        } else {
            $author_link = join('&nbsp;', $author_links);
        }
        // No post so link is empty
    } else {
        $author_link = '';
    }
    return $author_link;
}
 /**
  * @since 1.4
  */
 private function _build_email($type, $post_id)
 {
     $email_subject = get_option("bbpress_notify_new{$type}_email_subject");
     $email_body = get_option("bbpress_notify_new{$type}_email_body");
     $blogname = wp_specialchars_decode(get_option('blogname'), ENT_QUOTES);
     $excerpt_size = apply_filters('bpnns_excerpt_size', 100);
     // Replace shortcodes
     if ('topic' === $type) {
         $content = bbp_get_topic_content($post_id);
         $title = html_entity_decode(strip_tags(bbp_get_topic_title($post_id)), ENT_NOQUOTES, 'UTF-8');
         $excerpt = html_entity_decode(strip_tags(bbp_get_topic_excerpt($post_id, $excerpt_size)), ENT_NOQUOTES, 'UTF-8');
         $author = bbp_get_topic_author($post_id);
         $url = apply_filters('bbpnns_topic_url', bbp_get_topic_permalink($post_id), $post_id, $title);
         $forum = html_entity_decode(strip_tags(get_the_title(bbp_get_topic_forum_id($post_id))), ENT_NOQUOTES, 'UTF-8');
     } elseif ('reply' === $type) {
         $content = bbp_get_reply_content($post_id);
         $title = html_entity_decode(strip_tags(bbp_get_reply_title($post_id)), ENT_NOQUOTES, 'UTF-8');
         $excerpt = html_entity_decode(strip_tags(bbp_get_reply_excerpt($post_id, $excerpt_size)), ENT_NOQUOTES, 'UTF-8');
         $author = bbp_get_reply_author($post_id);
         $url = apply_filters('bbpnns_reply_url', bbp_get_reply_permalink($post_id), $post_id, $title);
         $forum = html_entity_decode(strip_tags(get_the_title(bbp_get_reply_forum_id($post_id))), ENT_NOQUOTES, 'UTF-8');
     } else {
         wp_die('Invalid type!');
     }
     $content = preg_replace('/<br\\s*\\/?>/is', PHP_EOL, $content);
     $content = preg_replace('/(?:<\\/p>\\s*<p>)/ism', PHP_EOL . PHP_EOL, $content);
     $content = html_entity_decode(strip_tags($content), ENT_NOQUOTES, 'UTF-8');
     $topic_reply = apply_filters('bbpnns_topic_reply', bbp_get_reply_url($post_id), $post_id, $title);
     $email_subject = str_replace('[blogname]', $blogname, $email_subject);
     $email_subject = str_replace("[{$type}-title]", $title, $email_subject);
     $email_subject = str_replace("[{$type}-content]", $content, $email_subject);
     $email_subject = str_replace("[{$type}-excerpt]", $excerpt, $email_subject);
     $email_subject = str_replace("[{$type}-author]", $author, $email_subject);
     $email_subject = str_replace("[{$type}-url]", $url, $email_subject);
     $email_subject = str_replace("[{$type}-replyurl]", $topic_reply, $email_subject);
     $email_subject = str_replace("[{$type}-forum]", $forum, $email_subject);
     $email_body = str_replace('[blogname]', $blogname, $email_body);
     $email_body = str_replace("[{$type}-title]", $title, $email_body);
     $email_body = str_replace("[{$type}-content]", $content, $email_body);
     $email_body = str_replace("[{$type}-excerpt]", $excerpt, $email_body);
     $email_body = str_replace("[{$type}-author]", $author, $email_body);
     $email_body = str_replace("[{$type}-url]", $url, $email_body);
     $email_body = str_replace("[{$type}-replyurl]", $topic_reply, $email_body);
     $email_body = str_replace("[{$type}-forum]", $forum, $email_body);
     /**
      * Allow subject and body modifications
      * @since 1.6.6
      */
     $email_subject = apply_filters('bbpnns_filter_email_subject_in_build', $email_subject, $type, $post_id);
     $email_body = apply_filters('bbpnns_filter_email_body_in_build', $email_body, $type, $post_id);
     return array($email_subject, $email_body);
 }
			<?php do_action( 'bbp_theme_after_topic_author_admin_details' ); ?>

		<?php endif; ?>

		<?php do_action( 'bbp_theme_after_topic_author_details' ); */
?>

	</div><!-- .bbp-topic-author -->

	 <div class="edited-author">

    <div class="edited-author-name"><a href="<?php 
echo bbp_get_reply_author_url();
?>
"><?php 
echo bbp_get_reply_author();
?>
</a></div>
    <span class="bbp-reply-post-date"><?php 
bbp_reply_post_date();
?>
</span> | <a href="<?php 
bbp_reply_url();
?>
" class="bbp-reply-permalink"> #<?php 
bbp_reply_id();
?>
</a>
    </div>	

	<div class="bbp-topic-content">
 static function Add_fb_link_reply($reply)
 {
     // Get data
     $topic_id = bbp_get_reply_topic_id($reply->ID);
     $topic = bbp_get_topic($topic_id);
     $link_id = get_post_meta($topic->ID, c_al2fb_meta_link_id, true);
     if (empty($link_id)) {
         return;
     }
     if (get_post_meta($topic->ID, c_al2fb_meta_nointegrate, true)) {
         return;
     }
     $user_ID = WPAL2Facebook::Get_user_ID($topic);
     if (!get_user_meta($user_ID, c_al2fb_meta_fb_comments_postback, true)) {
         return;
     }
     // Build message
     $message = bbp_get_reply_author($reply->ID) . ' ' . __('commented on', c_al2fb_text_domain) . ' ';
     $message .= html_entity_decode(get_bloginfo('title'), ENT_QUOTES, get_bloginfo('charset')) . ":\n\n";
     $message .= $reply->post_content;
     $message = apply_filters('al2fb_reply', $message, $reply_id);
     // Do not disturb WordPress
     try {
         $url = 'https://graph.facebook.com/v2.2/' . $link_id . '/comments';
         $url = apply_filters('al2fb_url', $url);
         $query_array = array('access_token' => WPAL2Int::Get_access_token_by_post($topic), 'message' => $message);
         // http://developers.facebook.com/docs/reference/api/Comment/
         $query = http_build_query($query_array, '', '&');
         // Execute request
         $response = WPAL2Int::Request($url, $query, 'POST');
         // Process response
         $fb_comment = json_decode($response);
         add_post_meta($topic->ID, c_al2fb_meta_fb_comment_id, $fb_comment->id);
         // Remove previous errors
         $error = get_post_meta($topic->ID, c_al2fb_meta_error, true);
         if (strpos($error, 'Add reply: ') !== false) {
             delete_post_meta($topic->ID, c_al2fb_meta_error, $error);
             delete_post_meta($topic->ID, c_al2fb_meta_error_time);
         }
     } catch (Exception $e) {
         update_post_meta($topic->ID, c_al2fb_meta_error, 'Add reply: ' . $e->getMessage());
         update_post_meta($topic->ID, c_al2fb_meta_error_time, date('c'));
     }
 }