escape( $text ); } } function aag_db_table( $table_name ) { global $wpdb; if ( isset( $wpdb->base_prefix ) ) { // WPMU $prefix = $wpdb->base_prefix; } else { $prefix = $wpdb->prefix; } return $prefix . trim( $table_name ); } require_once AAG_PLUGIN_DIR . '/includes/functions.php'; require_once AAG_PLUGIN_DIR . '/includes/capabilities.php'; require_once AAG_PLUGIN_DIR . '/includes/install.php'; if ( is_admin() ) require_once AAG_PLUGIN_DIR . '/admin/admin.php'; if ( version_compare( $wp_version, '2.8', '>=' ) ) // Using WordPress 2.8+ require_once AAG_PLUGIN_DIR . '/includes/widget.php'; function aag_load_plugin_textdomain() { load_plugin_textdomain( 'aag', 'wp-content/plugins/acts-as-group/languages', 'acts-as-group/languages' ); } add_action( 'init', 'aag_load_plugin_textdomain' ); /* Filters */ function aag_make_atmark_clickable( $text ) { if ( empty( $text ) ) return $text; return preg_replace_callback( '/(?<=^|\s)@([a-zA-Z0-9._-]+)(?=$|\s)/', 'aag_make_atmark_clickable_cb', $text ); } function aag_make_atmark_clickable_cb( $matches ) { $user_login = $matches[1]; if ( ! $user = get_userdatabylogin( $user_login ) ) return $matches[0]; $link_url = aag_admin_url( 'messages.php', array( 'author_id' => $user->ID ) ); return '@' . $matches[1] . ''; } add_filter( 'aag_message_content', 'wptexturize' ); add_filter( 'aag_message_content', 'make_clickable' ); add_filter( 'aag_message_content', 'links_add_target' ); add_filter( 'aag_message_content', 'convert_smilies' ); add_filter( 'aag_message_content', 'aag_make_atmark_clickable' ); ?>