Skip to:
Content

BuddyPress.org


Ignore:
Timestamp:
11/05/2011 09:31:05 PM (13 years ago)
Author:
djpaul
Message:

Tidy up phpdoc and use bp_get_option for BuddyPress options in bp-core-moderation

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/bp-core/bp-core-moderation.php

    r5274 r5278  
    11<?php
    2 
    32/**
    43 * BuddyPress Moderation Functions
     
    2019 * of time.
    2120 *
    22  * @since BuddyPress (1.6)
    23  *
    2421 * @param int $user_id User id to check for flood
    25  * @uses get_option() To get the throttle time
     22 * @return bool True if there is no flooding, true if there is
     23 * @since 1.6
     24 * @uses current_user_can() To check if the current user can throttle
     25 * @uses bp_get_option() To get the throttle time
    2626 * @uses get_transient() To get the last posted transient of the ip
    2727 * @uses get_user_meta() To get the last posted meta of the user
    28  * @uses current_user_can() To check if the current user can throttle
    29  * @return bool True if there is no flooding, true if there is
    3028 */
    3129function bp_core_check_for_flood( $user_id = 0 ) {
    3230
    3331    // Option disabled. No flood checks.
    34     if ( !$throttle_time = get_option( '_bp_throttle_time' ) )
     32    if ( !$throttle_time = bp_get_option( '_bp_throttle_time' ) )
    3533        return true;
    3634
     
    4947 * Check for moderation keys and too many links
    5048 *
    51  * @since BuddyPress (1.6)
    52  *
    5349 * @param int $user_id Topic or reply author ID
    5450 * @param string $title The title of the content
    5551 * @param string $content The content being posted
     52 * @return bool True if test is passed, false if fail
     53 * @since 1.6
     54 * @uses bp_current_author_ip() To get current user IP address
     55 * @uses bp_current_author_ua() To get current user agent
    5656 * @uses is_super_admin() Allow super admins to bypass blacklist
    57  * @uses bbp_current_author_ip() To get current user IP address
    58  * @uses bbp_current_author_ua() To get current user agent
    59  * @return bool True if test is passed, false if fail
    6057 */
    6158function bp_core_check_for_moderation( $user_id = 0, $title = '', $content = '' ) {
     
    156153 * Checks for blocked keys
    157154 *
    158  * @since bbPress (r3446)
    159  *
    160155 * @param int $user_id Topic or reply author ID
    161156 * @param string $title The title of the content
    162157 * @param string $content The content being posted
    163  * @uses is_super_admin() Allow super admins to bypass blacklist
     158 * @return bool True if test is passed, false if fail
    164159 * @uses bp_current_author_ip() To get current user IP address
    165160 * @uses bp_current_author_ua() To get current user agent
    166  * @return bool True if test is passed, false if fail
     161 * @uses is_super_admin() Allow super admins to bypass blacklist
     162 * @since 1.6
    167163 */
    168164function bp_core_check_for_blacklist( $user_id = 0, $title = '', $content = '' ) {
     
    222218        if ( empty( $word ) ) { continue; }
    223219
    224         // Do some escaping magic so that '#' chars in the
    225         // spam words don't break things:
     220        // Do some escaping magic so that '#' chars in the spam words don't break things:
    226221        $word    = preg_quote( $word, '#' );
    227222        $pattern = "#$word#i";
     
    246241 * Get the current-user IP address
    247242 *
    248  * @since BuddyPress (1.6)
    249  *
    250243 * @return string
     244 * @since 1.6
    251245 */
    252246function bp_core_current_user_ip() {
     
    259253 * Get the current-user user-agent
    260254 *
    261  * @since BuddyPress (1.6)
    262  *
    263255 * @return string
     256 * @since 1.6
    264257 */
    265258function bp_core_current_user_ua() {
     
    273266    return apply_filters( 'bp_core_current_user_ua', $retval );
    274267}
    275 
    276268?>
Note: See TracChangeset for help on using the changeset viewer.