]> git.mxchange.org Git - friendica.git/blob - mod/profiles.php
send link directly to profile tab
[friendica.git] / mod / profiles.php
1 <?php
2
3
4 function profiles_post(&$a) {
5
6         if(! local_user()) {
7                 notice( t('Permission denied.') . EOL);
8                 return;
9         }
10
11         $namechanged = false;
12
13         call_hooks('profile_post', $_POST);
14
15         if(($a->argc > 1) && ($a->argv[1] !== "new") && intval($a->argv[1])) {
16                 $orig = q("SELECT * FROM `profile` WHERE `id` = %d AND `uid` = %d LIMIT 1",
17                         intval($a->argv[1]),
18                         intval(local_user())
19                 );
20                 if(! count($orig)) {
21                         notice( t('Profile not found.') . EOL);
22                         return;
23                 }
24                 
25                 check_form_security_token_redirectOnErr('/profiles', 'profile_edit');
26                 
27                 $is_default = (($orig[0]['is-default']) ? 1 : 0);
28
29                 $profile_name = notags(trim($_POST['profile_name']));
30                 if(! strlen($profile_name)) {
31                         notify( t('Profile Name is required.') . EOL);
32                         return;
33                 }
34         
35                 $year = intval($_POST['year']);
36                 if($year < 1900 || $year > 2100 || $year < 0)
37                         $year = 0;
38                 $month = intval($_POST['month']);
39                         if(($month > 12) || ($month < 0))
40                                 $month = 0;
41                 $mtab = array(0,31,29,31,30,31,30,31,31,30,31,30,31);
42                 $day = intval($_POST['day']);
43                         if(($day > $mtab[$month]) || ($day < 0))
44                                 $day = 0;
45                 $dob = '0000-00-00';
46                 $dob = sprintf('%04d-%02d-%02d',$year,$month,$day);
47
48                         
49                 $name = notags(trim($_POST['name']));
50
51                 if($orig[0]['name'] != $name)
52                         $namechanged = true;
53
54
55                 $pdesc = notags(trim($_POST['pdesc']));
56                 $gender = notags(trim($_POST['gender']));
57                 $address = notags(trim($_POST['address']));
58                 $locality = notags(trim($_POST['locality']));
59                 $region = notags(trim($_POST['region']));
60                 $postal_code = notags(trim($_POST['postal_code']));
61                 $country_name = notags(trim($_POST['country_name']));
62                 $pub_keywords = notags(trim($_POST['pub_keywords']));
63                 $prv_keywords = notags(trim($_POST['prv_keywords']));
64                 $marital = notags(trim($_POST['marital']));
65
66                 $with = ((x($_POST,'with')) ? notags(trim($_POST['with'])) : '');
67
68                 // linkify the relationship target if applicable
69
70                 if(strlen($with)) {
71                         if($with != strip_tags($orig[0]['with'])) {
72                                 $prf = '';
73                                 $lookup = $with;
74                                 if(strpos($lookup,'@') === 0)
75                                         $lookup = substr($lookup,1);
76                                 $lookup = str_replace('_',' ', $lookup);
77                                 if(strpos($lookup,'@') || (strpos($lookup,'http://'))) {
78                                         $newname = $lookup;
79                                         $links = @lrdd($lookup);
80                                         if(count($links)) {
81                                                 foreach($links as $link) {
82                                                         if($link['@attributes']['rel'] === 'http://webfinger.net/rel/profile-page') {
83                                         $prf = $link['@attributes']['href'];
84                                                         }
85                                                 }
86                                         }
87                                 }
88                                 else {
89                                         $newname = $lookup;
90                                         if(strstr($lookup,' ')) {
91                                                 $r = q("SELECT * FROM `contact` WHERE `name` = '%s' AND `uid` = %d LIMIT 1",
92                                                         dbesc($newname),
93                                                         intval(local_user())
94                                                 );
95                                         }
96                                         else {
97                                                 $r = q("SELECT * FROM `contact` WHERE `nick` = '%s' AND `uid` = %d LIMIT 1",
98                                                         dbesc($lookup),
99                                                         intval(local_user())
100                                                 );
101                                         }
102                                         if(count($r)) {
103                                                 $prf = $r[0]['url'];
104                                                 $newname = $r[0]['name'];
105                                         }
106                                 }
107         
108                                 if($prf) {
109                                         $with = str_replace($lookup,'<a href="' . $prf . '">' . $newname        . '</a>', $with);
110                                         if(strpos($with,'@') === 0)
111                                                 $with = substr($with,1);
112                                 }
113                         }
114                         else
115                                 $with = $orig[0]['with'];
116                 }
117
118                 $sexual = notags(trim($_POST['sexual']));
119                 $homepage = notags(trim($_POST['homepage']));
120                 $politic = notags(trim($_POST['politic']));
121                 $religion = notags(trim($_POST['religion']));
122
123                 $about = fix_mce_lf(escape_tags(trim($_POST['about'])));
124                 $interest = fix_mce_lf(escape_tags(trim($_POST['interest'])));
125                 $contact = fix_mce_lf(escape_tags(trim($_POST['contact'])));
126                 $music = fix_mce_lf(escape_tags(trim($_POST['music'])));
127                 $book = fix_mce_lf(escape_tags(trim($_POST['book'])));
128                 $tv = fix_mce_lf(escape_tags(trim($_POST['tv'])));
129                 $film = fix_mce_lf(escape_tags(trim($_POST['film'])));
130                 $romance = fix_mce_lf(escape_tags(trim($_POST['romance'])));
131                 $work = fix_mce_lf(escape_tags(trim($_POST['work'])));
132                 $education = fix_mce_lf(escape_tags(trim($_POST['education'])));
133
134                 $hide_friends = (($_POST['hide-friends'] == 1) ? 1: 0);
135
136
137
138                 $changes = array();
139                 if($is_default) {
140                         if($marital != $orig[0]['marital']) $changes[] = '&hearts; ' . t('Marital Status');
141                         if($work != $orig[0]['work']) $changes[] = t('Work/Employment');
142                         if($religion != $orig[0]['religion']) $changes[] = t('Religion');
143                         if($politic != $orig[0]['politic']) $changes[] = t('Political Views');
144                         
145                         if($address != $orig[0]['address'] || $locality != $orig[0]['locality'] || $region != $orig[0]['region']
146                                 || $country_name != $orig[0]['country_name'])
147                                 $changes[] = t('Location');
148
149                         profile_activity($changes);
150
151                 }                       
152                         
153                 $r = q("UPDATE `profile` 
154                         SET `profile-name` = '%s',
155                         `name` = '%s',
156                         `pdesc` = '%s',
157                         `gender` = '%s',
158                         `dob` = '%s',
159                         `address` = '%s',
160                         `locality` = '%s',
161                         `region` = '%s',
162                         `postal-code` = '%s',
163                         `country-name` = '%s',
164                         `marital` = '%s',
165                         `with` = '%s',
166                         `sexual` = '%s',
167                         `homepage` = '%s',
168                         `politic` = '%s',
169                         `religion` = '%s',
170                         `pub_keywords` = '%s',
171                         `prv_keywords` = '%s',
172                         `about` = '%s',
173                         `interest` = '%s',
174                         `contact` = '%s',
175                         `music` = '%s',
176                         `book` = '%s',
177                         `tv` = '%s',
178                         `film` = '%s',
179                         `romance` = '%s',
180                         `work` = '%s',
181                         `education` = '%s',
182                         `hide-friends` = %d
183                         WHERE `id` = %d AND `uid` = %d LIMIT 1",
184                         dbesc($profile_name),
185                         dbesc($name),
186                         dbesc($pdesc),
187                         dbesc($gender),
188                         dbesc($dob),
189                         dbesc($address),
190                         dbesc($locality),
191                         dbesc($region),
192                         dbesc($postal_code),
193                         dbesc($country_name),
194                         dbesc($marital),
195                         dbesc($with),
196                         dbesc($sexual),
197                         dbesc($homepage),
198                         dbesc($politic),
199                         dbesc($religion),
200                         dbesc($pub_keywords),
201                         dbesc($prv_keywords),
202                         dbesc($about),
203                         dbesc($interest),
204                         dbesc($contact),
205                         dbesc($music),
206                         dbesc($book),
207                         dbesc($tv),
208                         dbesc($film),
209                         dbesc($romance),
210                         dbesc($work),
211                         dbesc($education),
212                         intval($hide_friends),
213                         intval($a->argv[1]),
214                         intval(local_user())
215                 );
216
217                 if($r)
218                         info( t('Profile updated.') . EOL);
219
220
221                 if($namechanged && $is_default) {
222                         $r = q("UPDATE `contact` SET `name-date` = '%s' WHERE `self` = 1 AND `uid` = %d LIMIT 1",
223                                 dbesc(datetime_convert()),
224                                 intval(local_user())
225                         );
226                 }
227
228                 if($is_default) {
229                         // Update global directory in background
230                         $url = $_SESSION['my_url'];
231                         if($url && strlen(get_config('system','directory_submit_url')))
232                                 proc_run('php',"include/directory.php","$url");
233
234                         require_once('include/profile_update.php');
235                         profile_change();
236                 }
237         }
238 }
239
240
241 function profile_activity($changed) {
242         $a = get_app();
243
244         if(! local_user() || ! is_array($changed) || ! count($changed))
245                 return;
246
247         if($a->user['hidewall'] || get_config('system','block_public'))
248                 return;
249
250         if(! get_pconfig(local_user(),'system','post_profilechange'))
251                 return;
252
253         require_once('include/items.php');
254
255         $self = q("SELECT * FROM `contact` WHERE `self` = 1 AND `uid` = %d LIMIT 1",
256                 intval(local_user())
257         );
258
259         if(! count($self))
260                 return;
261
262         $arr = array();
263         $arr['uri'] = $arr['parent-uri'] = item_new_uri($a->get_hostname(), local_user()); 
264         $arr['uid'] = local_user();
265         $arr['contact-id'] = $self[0]['id'];
266         $arr['wall'] = 1;
267         $arr['type'] = 'wall';
268         $arr['gravity'] = 0;
269         $arr['origin'] = 1;
270         $arr['author-name'] = $arr['owner-name'] = $self[0]['name'];
271         $arr['author-link'] = $arr['owner-link'] = $self[0]['url'];
272         $arr['author-avatar'] = $arr['owner-avatar'] = $self[0]['thumb'];
273         $arr['verb'] = ACTIVITY_UPDATE;
274         $arr['object-type'] = ACTIVITY_OBJ_PROFILE;
275                                 
276         $A = '[url=' . $self[0]['url'] . ']' . $self[0]['name'] . '[/url]';
277
278
279         $changes = '';
280         $t = count($changed);
281         $z = 0;
282         foreach($changed as $ch) {
283                 if(strlen($changes)) {
284                         if ($z == ($t - 1))
285                                 $changes .= ' and ';
286                         else
287                                 $changes .= ', ';
288                 }
289                 $z ++;
290                 $changes .= $ch;
291         }
292
293         $prof = '[url=' . $self[0]['url'] . '?tab=profile' . ']' . t('public profile') . '[/url]';      
294
295         $arr['body'] =  sprintf( t('%1$s has an updated %2$s, changing %3$s.'), $A, $prof, $changes);
296
297         $arr['object'] = '<object><type>' . ACTIVITY_OBJ_PROFILE . '</type><title>' . $self[0]['name'] . '</title>'
298         . '<id>' . $self[0]['url'] . '/' . $self[0]['name'] . '</id>';
299         $arr['object'] .= '<link>' . xmlify('<link rel="alternate" type="text/html" href="' . $self[0]['url'] . '?tab=profile' . '" />' . "\n");
300         $arr['object'] .= xmlify('<link rel="photo" type="image/jpeg" href="' . $self[0]['thumb'] . '" />' . "\n");
301         $arr['object'] .= '</link></object>' . "\n";
302         $arr['last-child'] = 1;
303
304         $arr['allow_cid'] = $a->user['allow_cid'];
305         $arr['allow_gid'] = $a->user['allow_gid'];
306         $arr['deny_cid']  = $a->user['deny_cid'];
307         $arr['deny_gid']  = $a->user['deny_gid'];
308
309         $i = item_store($arr);
310         if($i)
311                 proc_run('php',"include/notifier.php","activity","$i");
312
313 }
314
315
316 function profiles_content(&$a) {
317
318         $o = '';
319         nav_set_selected('profiles');
320
321         if(! local_user()) {
322                 notice( t('Permission denied.') . EOL);
323                 return;
324         }
325
326         if(($a->argc > 2) && ($a->argv[1] === "drop") && intval($a->argv[2])) {
327                 $r = q("SELECT * FROM `profile` WHERE `id` = %d AND `uid` = %d AND `is-default` = 0 LIMIT 1",
328                         intval($a->argv[2]),
329                         intval(local_user())
330                 );
331                 if(! count($r)) {
332                         notice( t('Profile not found.') . EOL);
333                         goaway($a->get_baseurl(true) . '/profiles');
334                         return; // NOTREACHED
335                 }
336                 
337                 check_form_security_token_redirectOnErr('/profiles', 'profile_drop', 't');
338
339                 // move every contact using this profile as their default to the user default
340
341                 $r = q("UPDATE `contact` SET `profile-id` = (SELECT `profile`.`id` AS `profile-id` FROM `profile` WHERE `profile`.`is-default` = 1 AND `profile`.`uid` = %d LIMIT 1) WHERE `profile-id` = %d AND `uid` = %d ",
342                         intval(local_user()),
343                         intval($a->argv[2]),
344                         intval(local_user())
345                 );
346                 $r = q("DELETE FROM `profile` WHERE `id` = %d AND `uid` = %d LIMIT 1",
347                         intval($a->argv[2]),
348                         intval(local_user())
349                 );
350                 if($r)
351                         info( t('Profile deleted.') . EOL);
352
353                 goaway($a->get_baseurl(true) . '/profiles');
354                 return; // NOTREACHED
355         }
356
357
358
359
360
361         if(($a->argc > 1) && ($a->argv[1] === 'new')) {
362                 
363                 check_form_security_token_redirectOnErr('/profiles', 'profile_new', 't');
364
365                 $r0 = q("SELECT `id` FROM `profile` WHERE `uid` = %d",
366                         intval(local_user()));
367                 $num_profiles = count($r0);
368
369                 $name = t('Profile-') . ($num_profiles + 1);
370
371                 $r1 = q("SELECT `name`, `photo`, `thumb` FROM `profile` WHERE `uid` = %d AND `is-default` = 1 LIMIT 1",
372                         intval(local_user()));
373                 
374                 $r2 = q("INSERT INTO `profile` (`uid` , `profile-name` , `name`, `photo`, `thumb`)
375                         VALUES ( %d, '%s', '%s', '%s', '%s' )",
376                         intval(local_user()),
377                         dbesc($name),
378                         dbesc($r1[0]['name']),
379                         dbesc($r1[0]['photo']),
380                         dbesc($r1[0]['thumb'])
381                 );
382
383                 $r3 = q("SELECT `id` FROM `profile` WHERE `uid` = %d AND `profile-name` = '%s' LIMIT 1",
384                         intval(local_user()),
385                         dbesc($name)
386                 );
387
388                 info( t('New profile created.') . EOL);
389                 if(count($r3) == 1)
390                         goaway($a->get_baseurl(true) . '/profiles/' . $r3[0]['id']);
391                 
392                 goaway($a->get_baseurl(true) . '/profiles');
393         } 
394
395         if(($a->argc > 2) && ($a->argv[1] === 'clone')) {
396                 
397                 check_form_security_token_redirectOnErr('/profiles', 'profile_clone', 't');
398
399                 $r0 = q("SELECT `id` FROM `profile` WHERE `uid` = %d",
400                         intval(local_user()));
401                 $num_profiles = count($r0);
402
403                 $name = t('Profile-') . ($num_profiles + 1);
404                 $r1 = q("SELECT * FROM `profile` WHERE `uid` = %d AND `id` = %d LIMIT 1",
405                         intval(local_user()),
406                         intval($a->argv[2])
407                 );
408                 if(! count($r1)) {
409                         notice( t('Profile unavailable to clone.') . EOL);
410                         return;
411                 }
412                 unset($r1[0]['id']);
413                 $r1[0]['is-default'] = 0;
414                 $r1[0]['publish'] = 0;  
415                 $r1[0]['net-publish'] = 0;      
416                 $r1[0]['profile-name'] = dbesc($name);
417
418                 dbesc_array($r1[0]);
419
420                 $r2 = dbq("INSERT INTO `profile` (`" 
421                         . implode("`, `", array_keys($r1[0])) 
422                         . "`) VALUES ('" 
423                         . implode("', '", array_values($r1[0])) 
424                         . "')" );
425
426                 $r3 = q("SELECT `id` FROM `profile` WHERE `uid` = %d AND `profile-name` = '%s' LIMIT 1",
427                         intval(local_user()),
428                         dbesc($name)
429                 );
430                 info( t('New profile created.') . EOL);
431                 if(count($r3) == 1)
432                         goaway($a->get_baseurl(true) . '/profiles/' . $r3[0]['id']);
433                 
434                 goaway($a->get_baseurl(true) . '/profiles');
435                 
436                 return; // NOTREACHED
437         }
438
439
440         if(($a->argc > 1) && (intval($a->argv[1]))) {
441                 $r = q("SELECT * FROM `profile` WHERE `id` = %d AND `uid` = %d LIMIT 1",
442                         intval($a->argv[1]),
443                         intval(local_user())
444                 );
445                 if(! count($r)) {
446                         notice( t('Profile not found.') . EOL);
447                         return;
448                 }
449
450                 profile_load($a,$a->user['nickname'],$r[0]['id']);
451
452                 require_once('include/profile_selectors.php');
453
454
455                 $editselect = 'textareas';
456                 if(intval(get_pconfig(local_user(),'system','plaintext')))
457                         $editselect = 'none';
458
459                 $a->page['htmlhead'] .= replace_macros(get_markup_template('profed_head.tpl'), array(
460                         '$baseurl' => $a->get_baseurl(true),
461                         '$editselect' => $editselect,
462                 ));
463
464
465                 $opt_tpl = get_markup_template("profile-hide-friends.tpl");
466                 $hide_friends = replace_macros($opt_tpl,array(
467                         '$desc' => t('Hide your contact/friend list from viewers of this profile?'),
468                         '$yes_str' => t('Yes'),
469                         '$no_str' => t('No'),
470                         '$yes_selected' => (($r[0]['hide-friends']) ? " checked=\"checked\" " : ""),
471                         '$no_selected' => (($r[0]['hide-friends'] == 0) ? " checked=\"checked\" " : "")
472                 ));
473
474                 $a->page['htmlhead'] .= "<script type=\"text/javascript\" src=\"js/country.js\" ></script>";
475
476
477
478
479
480                 $f = get_config('system','birthday_input_format');
481                 if(! $f)
482                         $f = 'ymd';
483
484                 $is_default = (($r[0]['is-default']) ? 1 : 0);
485                 $tpl = get_markup_template("profile_edit.tpl");
486                 $o .= replace_macros($tpl,array(
487                         '$form_security_token' => get_form_security_token("profile_edit"),
488                         '$profile_clone_link' => 'profiles/clone/' . $r[0]['id'] . '?t=' . get_form_security_token("profile_clone"),
489                         '$profile_drop_link' => 'profiles/drop/' . $r[0]['id'] . '?t=' . get_form_security_token("profile_drop"),
490                         '$banner' => t('Edit Profile Details'),
491                         '$submit' => t('Submit'),
492                         '$viewprof' => t('View this profile'),
493                         '$cr_prof' => t('Create a new profile using these settings'),
494                         '$cl_prof' => t('Clone this profile'),
495                         '$del_prof' => t('Delete this profile'),
496                         '$lbl_profname' => t('Profile Name:'),
497                         '$lbl_fullname' => t('Your Full Name:'),
498                         '$lbl_title' => t('Title/Description:'),
499                         '$lbl_gender' => t('Your Gender:'),
500                         '$lbl_bd' => sprintf( t("Birthday \x28%s\x29:"),datesel_format($f)),
501                         '$lbl_address' => t('Street Address:'),
502                         '$lbl_city' => t('Locality/City:'),
503                         '$lbl_zip' => t('Postal/Zip Code:'),
504                         '$lbl_country' => t('Country:'),
505                         '$lbl_region' => t('Region/State:'),
506                         '$lbl_marital' => t('<span class="heart">&hearts;</span> Marital Status:'),
507                         '$lbl_with' => t("Who: \x28if applicable\x29"),
508                         '$lbl_ex1' => t('Examples: cathy123, Cathy Williams, cathy@example.com'),
509                         '$lbl_sexual' => t('Sexual Preference:'),
510                         '$lbl_homepage' => t('Homepage URL:'),
511                         '$lbl_politic' => t('Political Views:'),
512                         '$lbl_religion' => t('Religious Views:'),
513                         '$lbl_pubkey' => t('Public Keywords:'),
514                         '$lbl_prvkey' => t('Private Keywords:'),
515                         '$lbl_ex2' => t('Example: fishing photography software'),
516                         '$lbl_pubdsc' => t("\x28Used for suggesting potential friends, can be seen by others\x29"),
517                         '$lbl_prvdsc' => t("\x28Used for searching profiles, never shown to others\x29"),
518                         '$lbl_about' => t('Tell us about yourself...'),
519                         '$lbl_hobbies' => t('Hobbies/Interests'),
520                         '$lbl_social' => t('Contact information and Social Networks'),
521                         '$lbl_music' => t('Musical interests'),
522                         '$lbl_book' => t('Books, literature'),
523                         '$lbl_tv' => t('Television'),
524                         '$lbl_film' => t('Film/dance/culture/entertainment'),
525                         '$lbl_love' => t('Love/romance'),
526                         '$lbl_work' => t('Work/employment'),
527                         '$lbl_school' => t('School/education'),
528                         '$disabled' => (($is_default) ? 'onclick="return false;" style="color: #BBBBFF;"' : ''),
529                         '$baseurl' => $a->get_baseurl(true),
530                         '$profile_id' => $r[0]['id'],
531                         '$profile_name' => $r[0]['profile-name'],
532                         '$default' => (($is_default) ? '<p id="profile-edit-default-desc">' . t('This is your <strong>public</strong> profile.<br />It <strong>may</strong> be visible to anybody using the internet.') . '</p>' : ""),
533                         '$name' => $r[0]['name'],
534                         '$pdesc' => $r[0]['pdesc'],
535                         '$dob' => dob($r[0]['dob']),
536                         '$hide_friends' => $hide_friends,
537                         '$address' => $r[0]['address'],
538                         '$locality' => $r[0]['locality'],
539                         '$region' => $r[0]['region'],
540                         '$postal_code' => $r[0]['postal-code'],
541                         '$country_name' => $r[0]['country-name'],
542                         '$age' => ((intval($r[0]['dob'])) ? '(' . t('Age: ') . age($r[0]['dob'],$a->user['timezone'],$a->user['timezone']) . ')' : ''),
543                         '$gender' => gender_selector($r[0]['gender']),
544                         '$marital' => marital_selector($r[0]['marital']),
545                         '$with' => strip_tags($r[0]['with']),
546                         '$sexual' => sexpref_selector($r[0]['sexual']),
547                         '$about' => $r[0]['about'],
548                         '$homepage' => $r[0]['homepage'],
549                         '$politic' => $r[0]['politic'],
550                         '$religion' => $r[0]['religion'],
551                         '$pub_keywords' => $r[0]['pub_keywords'],
552                         '$prv_keywords' => $r[0]['prv_keywords'],
553                         '$music' => $r[0]['music'],
554                         '$book' => $r[0]['book'],
555                         '$tv' => $r[0]['tv'],
556                         '$film' => $r[0]['film'],
557                         '$interest' => $r[0]['interest'],
558                         '$romance' => $r[0]['romance'],
559                         '$work' => $r[0]['work'],
560                         '$education' => $r[0]['education'],
561                         '$contact' => $r[0]['contact']
562                 ));
563
564                 $arr = array('profile' => $r[0], 'entry' => $o);
565                 call_hooks('profile_edit', $arr);
566
567                 return $o;
568         }
569         else {
570
571                 $r = q("SELECT * FROM `profile` WHERE `uid` = %d",
572                         local_user());
573                 if(count($r)) {
574
575                         $tpl_header = get_markup_template('profile_listing_header.tpl');
576                         $o .= replace_macros($tpl_header,array(
577                                 '$header' => t('Edit/Manage Profiles'),
578                                 '$chg_photo' => t('Change profile photo'),
579                                 '$cr_new' => t('Create New Profile'),
580                                 '$cr_new_link' => 'profiles/new?t=' . get_form_security_token("profile_new")
581                         ));
582
583
584                         $tpl = get_markup_template('profile_entry.tpl');
585
586                         foreach($r as $rr) {
587                                 $o .= replace_macros($tpl, array(
588                                         '$photo' => $rr['thumb'],
589                                         '$id' => $rr['id'],
590                                         '$alt' => t('Profile Image'),
591                                         '$profile_name' => $rr['profile-name'],
592                                         '$visible' => (($rr['is-default']) ? '<strong>' . t('visible to everybody') . '</strong>' 
593                                                 : '<a href="' . $a->get_baseurl(true) . '/profperm/' . $rr['id'] . '" />' . t('Edit visibility') . '</a>')
594                                 ));
595                         }
596                 }
597                 return $o;
598         }
599
600 }