Commit 6cdf0efa authored by lechuck's avatar lechuck Committed by lucha

Upgrade buddypress to 2.0

parent df817e1c
......@@ -74,4 +74,7 @@
}
#bp-activities-primaryid {
margin-bottom: 1em;
}
.column-action {
width: 12%;
}
\ No newline at end of file
.akismet-status{float:right}.akismet-status a{color:#AAA;font-style:italic}.akismet-history{margin:13px}.akismet-history div{margin-bottom:13px}.akismet-history span{color:#999}#wp-bp-activities-wrap{padding:5px 0}#bp-activities{height:120px}#bp-replyhead{font-size:1em;line-height:1.4em;margin:0}#bp-replysubmit{margin:0;padding:0 0 3px;text-align:center}#bp-replysubmit .error{color:red;line-height:21px;text-align:center;vertical-align:center}#bp-replysubmit img.waiting{float:right;padding:4px 10px 0;vertical-align:top}#bp-activities-form .column-response img{float:left;margin-right:10px;margin-top:1px}.activity-errors{list-style-type:disc;margin-left:2em}#bp_activity_action div.inside,#bp_activity_content div.inside{line-height:0}#bp_activity_action h3,#bp_activity_content h3{cursor:auto}#bp_activity_action td.mceIframeContainer,#bp_activity_content td.mceIframeContainer{background-color:white}#post-body #bp-activities-action_resize,#post-body #bp-activities-content_resize{position:inherit;margin-top:-2px}#bp_activity_link input{width:99%}#bp-activities-primaryid{margin-bottom:1em}
\ No newline at end of file
.akismet-status{float:right}.akismet-status a{color:#AAA;font-style:italic}.akismet-history{margin:13px}.akismet-history div{margin-bottom:13px}.akismet-history span{color:#999}#wp-bp-activities-wrap{padding:5px 0}#bp-activities{height:120px}#bp-replyhead{font-size:1em;line-height:1.4em;margin:0}#bp-replysubmit{margin:0;padding:0 0 3px;text-align:center}#bp-replysubmit .error{color:red;line-height:21px;text-align:center;vertical-align:center}#bp-replysubmit img.waiting{float:right;padding:4px 10px 0;vertical-align:top}#bp-activities-form .column-response img{float:left;margin-right:10px;margin-top:1px}.activity-errors{list-style-type:disc;margin-left:2em}#bp_activity_action div.inside,#bp_activity_content div.inside{line-height:0}#bp_activity_action h3,#bp_activity_content h3{cursor:auto}#bp_activity_action td.mceIframeContainer,#bp_activity_content td.mceIframeContainer{background-color:white}#post-body #bp-activities-action_resize,#post-body #bp-activities-content_resize{position:inherit;margin-top:-2px}#bp_activity_link input{width:99%}#bp-activities-primaryid{margin-bottom:1em}.column-action{width:12%}
\ No newline at end of file
......@@ -162,6 +162,11 @@ $(document).ready( function () {
// On the edit screen, unload the close/open toggle js for the action & content metaboxes
$( '#bp_activity_action h3, #bp_activity_content h3' ).unbind( 'click' );
// redo the post box toggles to reset the one made by comment.js in favor
// of activity administration page id so that metaboxes are still collapsible
// in single Activity Administration screen.
postboxes.add_postbox_toggles( bp_activity_admin_vars.page );
});
})(jQuery);
\ No newline at end of file
(function(b){var a={init:function(){b(document).on("click",".row-actions a.reply",a.open);b(document).on("click","#bp-activities-container a.cancel",a.close);b(document).on("click","#bp-activities-container a.save",a.send);b(document).on("keyup","#bp-activities:visible",function(c){if(27==c.which){a.close()}})},open:function(d){var c=b("#bp-activities-container").hide();b(this).parents("tr").after(c);c.fadeIn("300");b("#bp-activities").focus();return false},close:function(c){b("#bp-activities-container").fadeOut("200",function(){b("#bp-activities").val("").blur();b("#bp-replysubmit .error").html("").hide();b("#bp-replysubmit .waiting").hide()});return false},send:function(d){b("#bp-replysubmit .error").hide();b("#bp-replysubmit .waiting").show();var c={};c["_ajax_nonce-bp-activity-admin-reply"]=b('#bp-activities-container input[name="_ajax_nonce-bp-activity-admin-reply"]').val();c.action="bp-activity-admin-reply";c.content=b("#bp-activities").val();c.parent_id=b("#bp-activities-container").prev().data("parent_id");c.root_id=b("#bp-activities-container").prev().data("root_id");b.ajax({data:c,type:"POST",url:ajaxurl,error:function(e){a.error(e)},success:function(e){a.show(e)}});return false},error:function(c){var d=c.statusText;b("#bp-replysubmit .waiting").hide();if(c.responseText){d=c.responseText.replace(/<.[^<>]*?>/g,"")}if(d){b("#bp-replysubmit .error").html(d).show()}},show:function(d){var e,f,c;if(typeof(d)=="string"){a.error({responseText:d});return false}c=wpAjax.parseAjaxResponse(d);if(c.errors){a.error({responseText:wpAjax.broken});return false}c=c.responses[0];b("#bp-activities-container").fadeOut("200",function(){b("#bp-activities").val("").blur();b("#bp-replysubmit .error").html("").hide();b("#bp-replysubmit .waiting").hide();b("#bp-activities-container").before(c.data);f=b("#activity-"+c.id);e=f.closest(".widefat").css("backgroundColor");f.animate({backgroundColor:"#CEB"},300).animate({backgroundColor:e},300)})}};b(document).ready(function(){a.init();b("#bp_activity_action h3, #bp_activity_content h3").unbind("click")})})(jQuery);
\ No newline at end of file
(function(b){var a={init:function(){b(document).on("click",".row-actions a.reply",a.open);b(document).on("click","#bp-activities-container a.cancel",a.close);b(document).on("click","#bp-activities-container a.save",a.send);b(document).on("keyup","#bp-activities:visible",function(c){if(27==c.which){a.close()}})},open:function(d){var c=b("#bp-activities-container").hide();b(this).parents("tr").after(c);c.fadeIn("300");b("#bp-activities").focus();return false},close:function(c){b("#bp-activities-container").fadeOut("200",function(){b("#bp-activities").val("").blur();b("#bp-replysubmit .error").html("").hide();b("#bp-replysubmit .waiting").hide()});return false},send:function(d){b("#bp-replysubmit .error").hide();b("#bp-replysubmit .waiting").show();var c={};c["_ajax_nonce-bp-activity-admin-reply"]=b('#bp-activities-container input[name="_ajax_nonce-bp-activity-admin-reply"]').val();c.action="bp-activity-admin-reply";c.content=b("#bp-activities").val();c.parent_id=b("#bp-activities-container").prev().data("parent_id");c.root_id=b("#bp-activities-container").prev().data("root_id");b.ajax({data:c,type:"POST",url:ajaxurl,error:function(e){a.error(e)},success:function(e){a.show(e)}});return false},error:function(c){var d=c.statusText;b("#bp-replysubmit .waiting").hide();if(c.responseText){d=c.responseText.replace(/<.[^<>]*?>/g,"")}if(d){b("#bp-replysubmit .error").html(d).show()}},show:function(d){var e,f,c;if(typeof(d)=="string"){a.error({responseText:d});return false}c=wpAjax.parseAjaxResponse(d);if(c.errors){a.error({responseText:wpAjax.broken});return false}c=c.responses[0];b("#bp-activities-container").fadeOut("200",function(){b("#bp-activities").val("").blur();b("#bp-replysubmit .error").html("").hide();b("#bp-replysubmit .waiting").hide();b("#bp-activities-container").before(c.data);f=b("#activity-"+c.id);e=f.closest(".widefat").css("backgroundColor");f.animate({backgroundColor:"#CEB"},300).animate({backgroundColor:e},300)})}};b(document).ready(function(){a.init();b("#bp_activity_action h3, #bp_activity_content h3").unbind("click");postboxes.add_postbox_toggles(bp_activity_admin_vars.page)})})(jQuery);
\ No newline at end of file
......@@ -13,7 +13,7 @@
if ( !defined( 'ABSPATH' ) ) exit;
/**
* Allow core components and dependent plugins to register activity actions
* Allow core components and dependent plugins to register activity actions.
*
* @since BuddyPress (1.2)
*
......@@ -25,7 +25,7 @@ function bp_register_activity_actions() {
add_action( 'bp_init', 'bp_register_activity_actions', 8 );
/**
* Allow core components and dependent plugins to register activity actions
* Catch and route requests for single activity item permalinks.
*
* @since BuddyPress (1.2)
*
......@@ -38,11 +38,11 @@ add_action( 'bp_init', 'bp_register_activity_actions', 8 );
* @uses bp_core_get_user_domain()
* @uses groups_get_group()
* @uses bp_get_group_permalink()
* @uses apply_filters_ref_array() To call the 'bp_activity_permalink_redirect_url' hook
* @uses apply_filters_ref_array() To call the 'bp_activity_permalink_redirect_url' hook.
* @uses bp_core_redirect()
* @uses bp_get_root_domain()
*
* @return bool False on failure
* @return bool False on failure.
*/
function bp_activity_action_permalink_router() {
......@@ -124,7 +124,7 @@ add_action( 'bp_actions', 'bp_activity_action_permalink_router' );
* @uses do_action() Calls 'bp_activity_action_delete_activity' hook to allow actions to be taken after the activity is deleted.
* @uses bp_core_redirect()
*
* @return bool False on failure
* @return bool False on failure.
*/
function bp_activity_action_delete_activity( $activity_id = 0 ) {
......@@ -169,12 +169,13 @@ function bp_activity_action_delete_activity( $activity_id = 0 ) {
add_action( 'bp_actions', 'bp_activity_action_delete_activity' );
/**
* Mark specific activity item as spam and redirect to previous page
* Mark specific activity item as spam and redirect to previous page.
*
* @since BuddyPress (1.6)
*
* @global object $bp BuddyPress global settings
* @param int $activity_id Activity id to be deleted. Defaults to 0.
* @return bool False on failure
* @since BuddyPress (1.6)
* @return bool False on failure.
*/
function bp_activity_action_spam_activity( $activity_id = 0 ) {
global $bp;
......@@ -241,7 +242,7 @@ add_action( 'bp_actions', 'bp_activity_action_spam_activity' );
* @uses bp_core_redirect()
* @uses apply_filters() To call 'bp_activity_custom_update' hook.
*
* @return bool False on failure
* @return bool False on failure.
*/
function bp_activity_action_post_update() {
......@@ -253,9 +254,15 @@ function bp_activity_action_post_update() {
check_admin_referer( 'post_update', '_wpnonce_post_update' );
// Get activity info
$content = apply_filters( 'bp_activity_post_update_content', $_POST['whats-new'] );
$object = apply_filters( 'bp_activity_post_update_object', $_POST['whats-new-post-object'] );
$item_id = apply_filters( 'bp_activity_post_update_item_id', $_POST['whats-new-post-in'] );
$content = apply_filters( 'bp_activity_post_update_content', $_POST['whats-new'] );
if ( ! empty( $_POST['whats-new-post-object'] ) ) {
$object = apply_filters( 'bp_activity_post_update_object', $_POST['whats-new-post-object'] );
}
if ( ! empty( $_POST['whats-new-post-in'] ) ) {
$item_id = apply_filters( 'bp_activity_post_update_item_id', $_POST['whats-new-post-in'] );
}
// No activity content so provide feedback and redirect
if ( empty( $content ) ) {
......@@ -305,7 +312,7 @@ add_action( 'bp_actions', 'bp_activity_action_post_update' );
* @uses bp_activity_new_comment()
* @uses wp_get_referer()
*
* @return bool False on failure
* @return bool False on failure.
*/
function bp_activity_action_post_comment() {
......@@ -353,7 +360,7 @@ add_action( 'bp_actions', 'bp_activity_action_post_comment' );
* @uses bp_core_redirect()
* @uses wp_get_referer()
*
* @return bool False on failure
* @return bool False on failure.
*/
function bp_activity_action_mark_favorite() {
......@@ -387,7 +394,7 @@ add_action( 'bp_actions', 'bp_activity_action_mark_favorite' );
* @uses bp_core_redirect()
* @uses wp_get_referer()
*
* @return bool False on failure
* @return bool False on failure.
*/
function bp_activity_action_remove_favorite() {
......@@ -407,18 +414,17 @@ function bp_activity_action_remove_favorite() {
add_action( 'bp_actions', 'bp_activity_action_remove_favorite' );
/**
* Load the sitewide feed.
* Load the sitewide activity feed.
*
* @since BuddyPress (1.0)
*
* @global object $bp BuddyPress global settings
* @global object $wp_query
* @uses bp_is_activity_component()
* @uses bp_is_current_action()
* @uses bp_is_user()
* @uses status_header()
*
* @return bool False on failure
* @return bool False on failure.
*/
function bp_activity_action_sitewide_feed() {
global $bp;
......@@ -441,16 +447,15 @@ function bp_activity_action_sitewide_feed() {
add_action( 'bp_actions', 'bp_activity_action_sitewide_feed' );
/**
* Load a user's personal feed.
* Load a user's personal activity feed.
*
* @since BuddyPress (1.0)
*
* @global object $wp_query
* @uses bp_is_user_activity()
* @uses bp_is_current_action()
* @uses status_header()
*
* @return bool False on failure
* @return bool False on failure.
*/
function bp_activity_action_personal_feed() {
if ( ! bp_is_user_activity() || ! bp_is_current_action( 'feed' ) ) {
......@@ -472,11 +477,10 @@ function bp_activity_action_personal_feed() {
add_action( 'bp_actions', 'bp_activity_action_personal_feed' );
/**
* Load a user's friends feed.
* Load a user's friends' activity feed.
*
* @since BuddyPress (1.0)
*
* @global object $wp_query
* @uses bp_is_active()
* @uses bp_is_user_activity()
* @uses bp_is_current_action()
......@@ -484,7 +488,7 @@ add_action( 'bp_actions', 'bp_activity_action_personal_feed' );
* @uses bp_is_action_variable()
* @uses status_header()
*
* @return bool False on failure
* @return bool False on failure.
*/
function bp_activity_action_friends_feed() {
if ( ! bp_is_active( 'friends' ) || ! bp_is_user_activity() || ! bp_is_current_action( bp_get_friends_slug() ) || ! bp_is_action_variable( 'feed', 0 ) ) {
......@@ -506,11 +510,10 @@ function bp_activity_action_friends_feed() {
add_action( 'bp_actions', 'bp_activity_action_friends_feed' );
/**
* Load a user's my groups feed.
* Load the activity feed for a user's groups.
*
* @since BuddyPress (1.2)
*
* @global object $wp_query
* @uses bp_is_active()
* @uses bp_is_user_activity()
* @uses bp_is_current_action()
......@@ -518,7 +521,7 @@ add_action( 'bp_actions', 'bp_activity_action_friends_feed' );
* @uses bp_is_action_variable()
* @uses status_header()
*
* @return bool False on failure
* @return bool False on failure.
*/
function bp_activity_action_my_groups_feed() {
if ( ! bp_is_active( 'groups' ) || ! bp_is_user_activity() || ! bp_is_current_action( bp_get_groups_slug() ) || ! bp_is_action_variable( 'feed', 0 ) ) {
......@@ -552,13 +555,12 @@ add_action( 'bp_actions', 'bp_activity_action_my_groups_feed' );
*
* @since BuddyPress (1.2)
*
* @global object $wp_query
* @uses bp_is_user_activity()
* @uses bp_is_current_action()
* @uses bp_is_action_variable()
* @uses status_header()
*
* @return bool False on failure
* @return bool False on failure.
*/
function bp_activity_action_mentions_feed() {
if ( ! bp_activity_do_mentions() ) {
......@@ -590,13 +592,12 @@ add_action( 'bp_actions', 'bp_activity_action_mentions_feed' );
*
* @since BuddyPress (1.2)
*
* @global object $wp_query
* @uses bp_is_user_activity()
* @uses bp_is_current_action()
* @uses bp_is_action_variable()
* @uses status_header()
*
* @return bool False on failure
* @return bool False on failure.
*/
function bp_activity_action_favorites_feed() {
if ( ! bp_is_user_activity() || ! bp_is_current_action( 'favorites' ) || ! bp_is_action_variable( 'feed', 0 ) ) {
......@@ -622,10 +623,11 @@ function bp_activity_action_favorites_feed() {
add_action( 'bp_actions', 'bp_activity_action_favorites_feed' );
/**
* Loads Akismet
* Loads Akismet filtering for activity.
*
* @global object $bp BuddyPress global settings
* @since BuddyPress (1.6)
*
* @global object $bp BuddyPress global settings
*/
function bp_activity_setup_akismet() {
global $bp;
......
<?php
/**
* Akismet support for BuddyPress' Activity Stream
* Akismet support for BuddyPress' Activity Stream.
*
* @package BuddyPress
* @since BuddyPress (1.6)
......@@ -10,9 +10,14 @@
// Exit if accessed directly
if ( !defined( 'ABSPATH' ) ) exit;
/**
* Akismet support for the Activity component.
*
* @since BuddyPress (1.6)
*/
class BP_Akismet {
/**
* The activity last marked as spam
* The activity last marked as spam.
*
* @access protected
* @var BP_Activity_Activity
......@@ -21,7 +26,7 @@ class BP_Akismet {
protected $last_activity = null;
/**
* Constructor
* Constructor.
*
* @since BuddyPress (1.6)
*/
......@@ -30,7 +35,7 @@ class BP_Akismet {
}
/**
* Hook Akismet into the activity stream
* Hook Akismet into the activity stream.
*
* @since BuddyPress (1.6)
*/
......@@ -64,10 +69,11 @@ class BP_Akismet {
* This function lifted with love from the Akismet WordPress plugin's
* akismet_comment_row_action() function. Thanks!
*
* @param array $actions The hover links
* @param array $activity The activity for the current row being processed
* @return array The hover links
* @since BuddyPress (1.6)
*
* @param array $actions The hover links.
* @param array $activity The activity for the current row being processed.
* @return array The hover links.
*/
function comment_row_action( $actions, $activity ) {
$akismet_result = bp_activity_get_meta( $activity['id'], '_bp_akismet_result' );
......@@ -110,11 +116,15 @@ class BP_Akismet {
}
/**
* Adds a nonce to the member profile status form, and to the reply form of each activity stream item.
* This is used by Akismet to help detect spam activity.
* Generate nonces for activity forms.
*
* These nonces appear in the member profile status form, as well as in
* the reply form of each activity item. The nonces are, in turn, used
* by Akismet to help detect spam activity.
*
* @see http://plugins.trac.wordpress.org/ticket/1232
* @since BuddyPress (1.6)
*
* @see http://plugins.trac.wordpress.org/ticket/1232
*/
public function add_activity_stream_nonce() {
$form_id = '_bp_as_nonce';
......@@ -130,15 +140,24 @@ class BP_Akismet {
}
/**
* Check the member's latest (activity) update to see if it's the item that was (just) marked as spam.
* Clean up the bp_latest_update usermeta in case of spamming.
*
* This can't be done in BP_Akismet::check_activity() due to BP-Default's AJAX implementation; see bp_dtheme_post_update().
* Run just after an update is posted, this method check to see whether
* the newly created update has been marked as spam by Akismet. If so,
* the cached update is cleared from the user's 'bp_latest_update'
* usermeta, ensuring that it won't appear in the member header and
* elsewhere in the theme.
*
* This can't be done in BP_Akismet::check_activity() due to the
* default AJAX implementation; see bp_dtheme_post_update().
*
* @param string $content Activity update text
* @param int $user_id User ID
* @param int $activity_id Activity ID
* @see bp_dtheme_post_update()
* @since BuddyPress (1.6)
*
* @see bp_dtheme_post_update()
*
* @param string $content Activity update text.
* @param int $user_id User ID.
* @param int $activity_id Activity ID.
*/
public function check_member_activity_update( $content, $user_id, $activity_id ) {
// By default, only handle activity updates and activity comments.
......@@ -211,22 +230,25 @@ class BP_Akismet {
}
/**
* Get a list of filterable types of activity item that we want Akismet to automatically check for spam.
* Get a filterable list of activity types that Akismet should automatically check for spam.
*
* @return array List of activity types
* @since BuddyPress (1.6)
*
* @static
*
* @return array List of activity types.
*/
public static function get_activity_types() {
return apply_filters( 'bp_akismet_get_activity_types', array( 'activity_comment', 'activity_update' ) );
}
/**
* Mark activity item as spam
* Mark activity item as spam.
*
* @since BuddyPress (1.6)
*
* @param BP_Activity_Activity $activity
* @param string $source Either "by_a_person" (e.g. a person has manually marked the activity as spam) or "by_akismet" (automatically spammed).
* @since BuddyPress (1.6)
*/
public function mark_as_spam( $activity, $source ) {
// Record this item so we can do some tidyup in BP_Akismet::check_member_activity_update()
......@@ -236,11 +258,12 @@ class BP_Akismet {
}
/**
* Mark activity item as ham
* Mark activity item as ham.
*
* @since BuddyPress (1.6)
*
* @param BP_Activity_Activity $activity
* @param string $source Either "by_a_person" (e.g. a person has manually marked the activity as ham) or "by_akismet" (automatically hammed).
* @since BuddyPress (1.6)
*/
public function mark_as_ham( $activity, $source ) {
// If the activity was, originally, automatically marked as spam by Akismet, run the @mentions filter as it would have been skipped.
......@@ -251,12 +274,14 @@ class BP_Akismet {
}
/**
* Build a data package for the Akismet service to inspect
* Build a data package for the Akismet service to inspect.
*
* @param BP_Activity_Activity $activity
* @see http://akismet.com/development/api/#comment-check
* @since BuddyPress (1.6)
*
* @see http://akismet.com/development/api/#comment-check
* @static
*
* @param BP_Activity_Activity $activity Activity item data.
*/
public static function build_akismet_data_package( $activity ) {
$userdata = get_userdata( $activity->user_id );
......@@ -290,13 +315,15 @@ class BP_Akismet {
}
/**
* Check if the activity item is spam or ham
* Check if the activity item is spam or ham.
*
* @param BP_Activity_Activity $activity The activity item to check
* @see http://akismet.com/development/api/
* @since BuddyPress (1.6)
*
* @see http://akismet.com/development/api/
* @todo Spam counter?
* @todo Auto-delete old spam?
*
* @param BP_Activity_Activity $activity The activity item to check.
*/
public function check_activity( $activity ) {
// By default, only handle activity updates and activity comments.
......@@ -332,10 +359,11 @@ class BP_Akismet {
}
/**
* Update activity meta after a manual spam change (user initiated)
* Update activity meta after a manual spam change (user-initiated).
*
* @param BP_Activity_Activity $activity The activity to check
* @since BuddyPress (1.6)
*
* @param BP_Activity_Activity $activity The activity to check.
*/
public function update_activity_spam_meta( $activity ) {
// By default, only handle activity updates and activity comments.
......@@ -348,10 +376,11 @@ class BP_Akismet {
}
/**
* Update activity meta after a manual ham change (user initiated)
* Update activity meta after a manual ham change (user-initiated).
*
* @param BP_Activity_Activity $activity The activity to check
* @since BuddyPress (1.6)
*
* @param BP_Activity_Activity $activity The activity to check.
*/
public function update_activity_ham_meta( $activity ) {
// By default, only handle activity updates and activity comments.
......@@ -364,10 +393,11 @@ class BP_Akismet {
}
/**
* Update activity meta after an automatic spam check (not user initiated)
* Update activity meta after an automatic spam check (not user-initiated).
*
* @param BP_Activity_Activity $activity The activity to check
* @since BuddyPress (1.6)
*
* @param BP_Activity_Activity $activity The activity to check.
*/
public function update_activity_akismet_meta( $activity ) {
// Check we're dealing with what was last updated by Akismet
......@@ -399,16 +429,19 @@ class BP_Akismet {
}
/**
* Contact Akismet to check if this is spam or ham
* Contact Akismet to check if this is spam or ham.
*
* Props to WordPress core Akismet plugin for alot of this.
*
* Props to WordPress core Akismet plugin for alot of this
* @since BuddyPress (1.6)
*
* @global string $akismet_api_host
* @global string $akismet_api_port
* @param array $activity_data Packet of information to submit to Akismet
* @param string $check "check" or "submit"
* @param string $spam "spam" or "ham"
* @since BuddyPress (1.6)
*
* @param array $activity_data Packet of information to submit to Akismet.
* @param string $check "check" or "submit".
* @param string $spam "spam" or "ham".
* @return array $activity_data Activity data, with Akismet data added.
*/
public function send_akismet_request( $activity_data, $check = 'check', $spam = 'spam' ) {
global $akismet_api_host, $akismet_api_port;
......@@ -477,10 +510,12 @@ class BP_Akismet {
}
/**
* Filters user agent when sending to Akismet.
* Filters user agent when sending to Akismet to add BuddyPress info.
*
* @param string $user_agent
* @since BuddyPress (1.6)
*
* @param string $user_agent User agent string, as generated by Akismet.
* @return string $user_agent Modified user agent string.
*/
public function buddypress_ua( $user_agent ) {
$user_agent = 'BuddyPress/' . bp_get_version() . ' | Akismet/'. constant( 'AKISMET_VERSION' );
......@@ -490,8 +525,9 @@ class BP_Akismet {
/**
* Adds a "History" meta box to the activity edit screen.
*
* @param string $screen_action The type of screen that has been requested
* @since BuddyPress (1.6)
*
* @param string $screen_action The type of screen that has been requested.
*/
function add_history_metabox( $screen_action ) {
// Only proceed if we're on the edit screen
......@@ -503,12 +539,14 @@ class BP_Akismet {
}
/**
* History meta box for the Activity admin edit screen
* History meta box for the Activity admin edit screen.
*
* @param object $item Activity item
* @since BuddyPress (1.6)
* @todo Update activity meta to allow >1 record with the same key (iterate through $history).
*
* @see http://buddypress.trac.wordpress.org/ticket/3907
* @todo Update activity meta to allow >1 record with the same key (iterate through $history).
*
* @param object $item Activity item.
*/
function history_metabox( $item ) {
$history = BP_Akismet::get_activity_history( $item->id );
......@@ -522,12 +560,13 @@ class BP_Akismet {
}
/**
* Update an activity item's Akismet history
* Update an activity item's Akismet history.