Changeset 331

Show
Ignore:
Timestamp:
05/11/06 06:48:28 (3 years ago)
Author:
carmartin
Message:

profile.class: minor tidyups for the user profile page...

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • devel/profile/profile.class.php

    r316 r331  
    322322            // $value = get_record('profile_data','name',$field[1],'owner',$this->id); 
    323323         
    324             $value->value = ""; 
    325             $value->access = ""; 
    326324            foreach($allvalues as $curvalue) { 
    327325                if ($curvalue->name == stripslashes($field[1])) { 
    328326                    $value = $curvalue; 
    329                 } 
    330             } 
    331          
    332             /* if (isset($value[0])) { 
    333             $value = $value[0]; 
    334         } else { 
    335             $value->value = ""; 
    336             $value->access = ""; 
    337         } */ 
    338  
    339             if ((($value->value != "" && $value->value != "blank")) && run("users:access_level_check", $value->access)) { 
     327                    break; // found it, done! 
     328                } 
     329            } 
     330 
     331            if (!isset($value)) { 
     332                return ''; 
     333            } 
     334 
     335            if ((($value->value != "" && $value->value != "blank"))  
     336                && run("users:access_level_check", $value->access)) { 
    340337                $name = $field[0]; 
    341338                $column1 = display_output_field(array($value->value,$field[2],$field[1],$field[0],$value->ident)); 
     
    638635            if ($allvalues = get_records('profile_data','owner',$this->id)) { 
    639636                foreach($data['profile:details'] as $field) { 
     637                    // $field is an array, with the name 
     638                    // of the field in $field[0] 
    640639                    $run_result .= $this->field_display($field,$allvalues); 
    641640                }