SHARE
TWEET

r-a-y

a guest May 12th, 2010 54 Never
  1. foreach ( $bpcpspamlist as $spammer_id ) {
  2.         if ($bp->loggedin_user->id == $spammer_id ) {  
  3.                 // we create a boolean variable to store if the logged-in user matches any spammer id
  4.                 // since it matches, we mark the variable as "true"
  5.                 $is_spammer = true;
  6.                
  7.                 // this line stops the foreach loop and proceeds to the next statement
  8.                 break;
  9.         }
  10.         else {
  11.                 // if the spammer doesn't match the spammer id, we mark the variable as "false"
  12.                 $is_spammer = false;
  13.         }
  14. }
  15.  
  16. // this part of the code runs after we've finished the foreach loop
  17. if ($is_spammer == false) {
  18.         // add your CubePoints code here
  19. }
RAW Paste Data
Top