Changeset 866
- Timestamp:
- 01/25/07 18:10:57 (2 years ago)
- Files:
-
- devel/profile/profile.class.php (modified) (5 diffs)
- devel/units/profile/function_actions.php (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
devel/profile/profile.class.php
r817 r866 159 159 160 160 // copy array element with default to '' 161 $flabel = !empty($field[0]) ? $field[0] : ''; 162 $fname = !empty($field[1]) ? $field[1] : ''; 163 $ftype = !empty($field[2]) ? $field[2] : ''; 164 $fblurb = !empty($field[3]) ? $field[3] : ''; 165 $fusertype = !empty($field[4]) ? $field[4] : ''; 161 162 // If we're dealing with the old-style profile fields 163 if (is_array($field)) { 164 $flabel = !empty($field[0]) ? $field[0] : ''; 165 $fname = !empty($field[1]) ? $field[1] : ''; 166 $ftype = !empty($field[2]) ? $field[2] : ''; 167 $fblurb = !empty($field[3]) ? $field[3] : ''; 168 $fusertype = !empty($field[4]) ? $field[4] : ''; 169 // Otherwise map things the new way! 170 } else { 171 $flabel = $field->name; 172 $fname = $field->internal_name; 173 $ftype = $field->field_type; 174 $fblurb = $field->description; 175 $fusertype = $field->user_type; 176 $finvisible = $field->invisible; 177 $frequired = $field->required; 178 } 166 179 167 180 if (!empty($fusertype) && $fusertype != $usertype) { … … 223 236 224 237 $run_result = ''; 238 239 // If we're dealing with the old-style profile fields 240 if (is_array($field)) { 241 $flabel = !empty($field[0]) ? $field[0] : ''; 242 $fname = !empty($field[1]) ? $field[1] : ''; 243 $ftype = !empty($field[2]) ? $field[2] : ''; 244 $fblurb = !empty($field[3]) ? $field[3] : ''; 245 $fusertype = !empty($field[4]) ? $field[4] : ''; 246 // Otherwise map things the new way! 247 } else { 248 $flabel = $field->name; 249 $fname = $field->internal_name; 250 $ftype = $field->field_type; 251 $fblurb = $field->description; 252 $fusertype = $field->user_type; 253 $finvisible = $field->invisible; 254 $frequired = $field->required; 255 } 225 256 226 257 if (sizeof($field) >= 2) { … … 229 260 230 261 foreach($allvalues as $curvalue) { 231 if ($curvalue->name == stripslashes($f ield[1])) {262 if ($curvalue->name == stripslashes($fname)) { 232 263 $value = $curvalue; 233 264 break; // found it, done! … … 239 270 } 240 271 241 if ((($value->value != "" && $value->value != "blank" ))272 if ((($value->value != "" && $value->value != "blank" && !$finvisible)) 242 273 && run("users:access_level_check", $value->access)) { 243 $name = $f ield[0];274 $name = $flabel; 244 275 $column1 = display_output_field(array($value->value,$field[2],$field[1],$field[0],$value->ident)); 245 276 $run_result .=templates_draw(array( … … 543 574 if ($allvalues = get_records('profile_data','owner',$this->id)) { 544 575 foreach($data['profile:details'] as $field) { 545 if (empty($field[4]) || $usertype == $field[4]) { 576 if (is_array($field)) { 577 $flabel = !empty($field[0]) ? $field[0] : ''; 578 $fname = !empty($field[1]) ? $field[1] : ''; 579 $ftype = !empty($field[2]) ? $field[2] : ''; 580 $fblurb = !empty($field[3]) ? $field[3] : ''; 581 $fusertype = !empty($field[4]) ? $field[4] : ''; 582 // Otherwise map things the new way! 583 } else { 584 $flabel = $field->name; 585 $fname = $field->internal_name; 586 $ftype = $field->field_type; 587 $fblurb = $field->description; 588 $fusertype = $field->user_type; 589 $finvisible = $field->invisible; 590 $frequired = $field->required; 591 } 592 if (empty($fusertype) || $usertype == $fusertype) { 546 593 // $field is an array, with the name 547 594 // of the field in $field[0] devel/units/profile/function_actions.php
r659 r866 29 29 30 30 foreach($data['profile:details'] as $datatype) { 31 if ($datatype[1] == $field && $datatype[2] == "keywords") { 31 if (is_array($datatype)) { 32 $flabel = !empty($datatype[0]) ? $datatype[0] : ''; 33 $fname = !empty($datatype[1]) ? $datatype[1] : ''; 34 $ftype = !empty($datatype[2]) ? $datatype[2] : ''; 35 $fblurb = !empty($datatype[3]) ? $datatype[3] : ''; 36 $fusertype = !empty($datatype[4]) ? $datatype[4] : ''; 37 // Otherwise map things the new way! 38 } else { 39 $flabel = $datatype->name; 40 $fname = $datatype->internal_name; 41 $ftype = $datatype->field_type; 42 $fblurb = $datatype->description; 43 $fusertype = $datatype->user_type; 44 $finvisible = $datatype->invisible; 45 $frequired = $datatype->required; 46 } 47 if ($fname == $field && $ftype == "keywords") { 32 48 delete_records('tags', 'tagtype', $field, 'owner', $page_owner); 33 49 $value = insert_tags_from_string ($value, $field, $insert_id, $access, $page_owner);
