Re: Trying to run some code based on a field with there user id
Tried going about this another way. Still not working correctly. Says user id 59 is not a spammer, but that user is marked as so. Any ideas?
I tried to echo it out. Nothing comes out for the user id ..
echo(‘User ID: ‘ . $bp->loggedin_user->id . “n”);
/* *********************** START Spammmer! ********************************* */
global $bp;
// 59 for testing
// if( $bp->loggedin_user->id == get_option(‘bp_spammer_cp_bp’)){
global $current_user;
global $user_id;
if ($userinfo->ID == 59) {
function my_bp_update_post_add_cppoints() {
if( function_exists(‘cp_alterPoints’) && is_user_logged_in() ){
cp_alterPoints(cp_currentUser(), 0 );
cp_log(‘Comment’, cp_currentUser(), 0, BuddyPress);
echo ‘spammer
‘;
echo(‘User ID: ‘ . $user_info->ID . “n”);
}
}
add_action(‘bp_activity_posted_update’,’my_bp_update_post_add_cppoints’);
} else {
// Add Points for a update
function my_bp_update_post_add_cppoints() {
if( function_exists(‘cp_alterPoints’) && is_user_logged_in() ){
cp_alterPoints(cp_currentUser(), get_option(‘bp_update_post_add_cp_bp’) );
cp_log(‘Comment’, cp_currentUser(), get_option(‘bp_update_post_add_cp_bp’), BuddyPress);
echo ‘spam free
‘;
echo(‘User ID: ‘ . $user_info->ID . “n”);
}
}
add_action(‘bp_activity_posted_update’,’my_bp_update_post_add_cppoints’);
}
/* *********************** END Spammmer! ********************************* */