[ Index ]

PHP Cross Reference of BuddyPress

title

Body

[close]

/src/bp-activity/classes/ -> class-bp-akismet.php (summary)

Akismet support for BuddyPress' Activity Stream.

File Size: 694 lines (25 kb)
Included or required:0 times
Referenced: 0 times
Includes or requires: 0 files

Defines 1 class

BP_Akismet:: (21 methods):
  __construct()
  setup_actions()
  comment_row_action()
  add_activity_stream_nonce()
  check_member_activity_update()
  add_activity_spam_button()
  add_activity_comment_spam_button()
  get_activity_types()
  mark_as_spam()
  mark_as_ham()
  build_akismet_data_package()
  check_activity()
  update_activity_spam_meta()
  update_activity_ham_meta()
  update_activity_akismet_meta()
  send_akismet_request()
  buddypress_ua()
  add_history_metabox()
  history_metabox()
  update_activity_history()
  get_activity_history()


Class: BP_Akismet  - X-Ref

Akismet support for the Activity component.

__construct()   X-Ref
Constructor.

since: 1.6.0

setup_actions()   X-Ref
Hook Akismet into the activity stream.

since: 1.6.0

comment_row_action( $actions, $activity )   X-Ref
Add a history item to the hover links in an activity's row.

This function lifted with love from the Akismet WordPress plugin's
akismet_comment_row_action() function. Thanks!

return: array The hover links.
param: array $actions  The hover links.
param: array $activity The activity for the current row being processed.
since: 1.6.0

add_activity_stream_nonce()   X-Ref
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.

since: 1.6.0

check_member_activity_update( $content, $user_id, $activity_id )   X-Ref
Clean up the bp_latest_update usermeta in case of spamming.

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.
since: 1.6.0

add_activity_spam_button()   X-Ref
Adds a "mark as spam" button to each activity item for site admins.

This function is intended to be used inside the activity stream loop.

since: 1.6.0

add_activity_comment_spam_button()   X-Ref
Adds a "mark as spam" button to each activity COMMENT item for site admins.

This function is intended to be used inside the activity stream loop.

since: 1.6.0

get_activity_types()   X-Ref
Get a filterable list of activity types that Akismet should automatically check for spam.

return: array $value List of activity types.
since: 1.6.0

mark_as_spam( $activity, $source )   X-Ref
Mark activity item as spam.

param: BP_Activity_Activity $activity Activity item being spammed.
param: string               $source   Either "by_a_person" (e.g. a person has
since: 1.6.0

mark_as_ham( $activity, $source )   X-Ref
Mark activity item as ham.

param: BP_Activity_Activity $activity Activity item being hammed.
param: string               $source   Either "by_a_person" (e.g. a person has
since: 1.6.0

build_akismet_data_package( $activity )   X-Ref
Build a data package for the Akismet service to inspect.

return: array $activity_data
param: BP_Activity_Activity $activity Activity item data.
since: 1.6.0

check_activity( $activity )   X-Ref
Check if the activity item is spam or ham.

param: BP_Activity_Activity $activity The activity item to check.
since: 1.6.0

update_activity_spam_meta( $activity )   X-Ref
Update activity meta after a manual spam change (user-initiated).

param: BP_Activity_Activity $activity The activity to check.
since: 1.6.0

update_activity_ham_meta( $activity )   X-Ref
Update activity meta after a manual ham change (user-initiated).

param: BP_Activity_Activity $activity The activity to check.
since: 1.6.0

update_activity_akismet_meta( $activity )   X-Ref
Update activity meta after an automatic spam check (not user-initiated).

param: BP_Activity_Activity $activity The activity to check.
since: 1.6.0

send_akismet_request( $activity_data, $check = 'check', $spam = 'spam' )   X-Ref
Contact Akismet to check if this is spam or ham.

Props to WordPress core Akismet plugin for a lot of this.

return: array $activity_data Activity data, with Akismet data added.
param: array  $activity_data Packet of information to submit to Akismet.
param: string $check         "check" or "submit".
param: string $spam          "spam" or "ham".
since: 1.6.0

buddypress_ua( $user_agent )   X-Ref
Filters user agent when sending to Akismet to add BuddyPress info.

return: string $user_agent Modified user agent string.
param: string $user_agent User agent string, as generated by Akismet.
since: 1.6.0

add_history_metabox( $screen_action )   X-Ref
Adds a "History" meta box to the activity edit screen.

param: string $screen_action The type of screen that has been requested.
since: 1.6.0

history_metabox( $item )   X-Ref
History meta box for the Activity admin edit screen.

param: object $item Activity item.
since: 1.6.0

update_activity_history( $activity_id = 0, $message = '', $event = '' )   X-Ref
Update an activity item's Akismet history.

param: int    $activity_id Activity item ID.
param: string $message     Human-readable description of what's changed.
param: string $event       The type of check we were carrying out.
since: 1.6.0

get_activity_history( $activity_id = 0 )   X-Ref
Get an activity item's Akismet history.

return: array The activity item's Akismet history.
param: int $activity_id Activity item ID.
since: 1.6.0



Generated: Thu Nov 21 01:00:57 2024 Cross-referenced by PHPXref 0.7.1