2 require_once("include/Contact.php");
4 function profiles_init(&$a) {
6 nav_set_selected('profiles');
12 if(($a->argc > 2) && ($a->argv[1] === "drop") && intval($a->argv[2])) {
13 $r = q("SELECT * FROM `profile` WHERE `id` = %d AND `uid` = %d AND `is-default` = 0 LIMIT 1",
18 notice( t('Profile not found.') . EOL);
23 check_form_security_token_redirectOnErr('/profiles', 'profile_drop', 't');
25 // move every contact using this profile as their default to the user default
27 $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 ",
32 $r = q("DELETE FROM `profile` WHERE `id` = %d AND `uid` = %d",
37 info(t('Profile deleted.').EOL);
47 if(($a->argc > 1) && ($a->argv[1] === 'new')) {
49 check_form_security_token_redirectOnErr('/profiles', 'profile_new', 't');
51 $r0 = q("SELECT `id` FROM `profile` WHERE `uid` = %d",
52 intval(local_user()));
53 $num_profiles = count($r0);
55 $name = t('Profile-') . ($num_profiles + 1);
57 $r1 = q("SELECT `name`, `photo`, `thumb` FROM `profile` WHERE `uid` = %d AND `is-default` = 1 LIMIT 1",
58 intval(local_user()));
60 $r2 = q("INSERT INTO `profile` (`uid` , `profile-name` , `name`, `photo`, `thumb`)
61 VALUES ( %d, '%s', '%s', '%s', '%s' )",
64 dbesc($r1[0]['name']),
65 dbesc($r1[0]['photo']),
66 dbesc($r1[0]['thumb'])
69 $r3 = q("SELECT `id` FROM `profile` WHERE `uid` = %d AND `profile-name` = '%s' LIMIT 1",
74 info( t('New profile created.') . EOL);
76 goaway('profiles/'.$r3[0]['id']);
81 if(($a->argc > 2) && ($a->argv[1] === 'clone')) {
83 check_form_security_token_redirectOnErr('/profiles', 'profile_clone', 't');
85 $r0 = q("SELECT `id` FROM `profile` WHERE `uid` = %d",
86 intval(local_user()));
87 $num_profiles = count($r0);
89 $name = t('Profile-') . ($num_profiles + 1);
90 $r1 = q("SELECT * FROM `profile` WHERE `uid` = %d AND `id` = %d LIMIT 1",
95 notice( t('Profile unavailable to clone.') . EOL);
100 $r1[0]['is-default'] = 0;
101 $r1[0]['publish'] = 0;
102 $r1[0]['net-publish'] = 0;
103 $r1[0]['profile-name'] = dbesc($name);
107 $r2 = dbq("INSERT INTO `profile` (`"
108 . implode("`, `", array_keys($r1[0]))
110 . implode("', '", array_values($r1[0]))
113 $r3 = q("SELECT `id` FROM `profile` WHERE `uid` = %d AND `profile-name` = '%s' LIMIT 1",
114 intval(local_user()),
117 info( t('New profile created.') . EOL);
119 goaway('profiles/'.$r3[0]['id']);
123 return; // NOTREACHED
127 if(($a->argc > 1) && (intval($a->argv[1]))) {
128 $r = q("SELECT id FROM `profile` WHERE `id` = %d AND `uid` = %d LIMIT 1",
133 notice( t('Profile not found.') . EOL);
138 profile_load($a,$a->user['nickname'],$r[0]['id']);
145 function profile_clean_keywords($keywords) {
146 $keywords = str_replace(","," ",$keywords);
147 $keywords = explode(" ", $keywords);
150 foreach ($keywords as $keyword) {
151 $keyword = trim(strtolower($keyword));
152 $keyword = trim($keyword, "#");
154 $cleaned[] = $keyword;
157 $keywords = implode(", ", $cleaned);
162 function profiles_post(&$a) {
165 notice( t('Permission denied.') . EOL);
169 $namechanged = false;
171 call_hooks('profile_post', $_POST);
173 if(($a->argc > 1) && ($a->argv[1] !== "new") && intval($a->argv[1])) {
174 $orig = q("SELECT * FROM `profile` WHERE `id` = %d AND `uid` = %d LIMIT 1",
179 notice( t('Profile not found.') . EOL);
183 check_form_security_token_redirectOnErr('/profiles', 'profile_edit');
185 $is_default = (($orig[0]['is-default']) ? 1 : 0);
187 $profile_name = notags(trim($_POST['profile_name']));
188 if(! strlen($profile_name)) {
189 notice( t('Profile Name is required.') . EOL);
193 $dob = $_POST['dob'] ? escape_tags(trim($_POST['dob'])) : '0000-00-00'; // FIXME: Needs to be validated?
195 $y = substr($dob,0,4);
196 if((! ctype_digit($y)) || ($y < 1900))
199 $ignore_year = false;
200 if($dob != '0000-00-00') {
201 if(strpos($dob,'0000-') === 0) {
203 $dob = substr($dob,5);
205 $dob = datetime_convert('UTC','UTC',(($ignore_year) ? '1900-' . $dob : $dob),(($ignore_year) ? 'm-d' : 'Y-m-d'));
207 $dob = '0000-' . $dob;
210 $name = notags(trim($_POST['name']));
212 if(! strlen($name)) {
216 if($orig[0]['name'] != $name)
221 $pdesc = notags(trim($_POST['pdesc']));
222 $gender = notags(trim($_POST['gender']));
223 $address = notags(trim($_POST['address']));
224 $locality = notags(trim($_POST['locality']));
225 $region = notags(trim($_POST['region']));
226 $postal_code = notags(trim($_POST['postal_code']));
227 $country_name = notags(trim($_POST['country_name']));
228 $pub_keywords = profile_clean_keywords(notags(trim($_POST['pub_keywords'])));
229 $prv_keywords = profile_clean_keywords(notags(trim($_POST['prv_keywords'])));
230 $marital = notags(trim($_POST['marital']));
231 $howlong = notags(trim($_POST['howlong']));
233 $with = ((x($_POST,'with')) ? notags(trim($_POST['with'])) : '');
235 if(! strlen($howlong))
236 $howlong = '0000-00-00 00:00:00';
238 $howlong = datetime_convert(date_default_timezone_get(),'UTC',$howlong);
240 // linkify the relationship target if applicable
242 $withchanged = false;
245 if($with != strip_tags($orig[0]['with'])) {
249 if(strpos($lookup,'@') === 0)
250 $lookup = substr($lookup,1);
251 $lookup = str_replace('_',' ', $lookup);
252 if(strpos($lookup,'@') || (strpos($lookup,'http://'))) {
254 $links = @lrdd($lookup);
256 foreach($links as $link) {
257 if($link['@attributes']['rel'] === 'http://webfinger.net/rel/profile-page') {
258 $prf = $link['@attributes']['href'];
265 /* if(strstr($lookup,' ')) {
266 $r = q("SELECT * FROM `contact` WHERE `name` = '%s' AND `uid` = %d LIMIT 1",
272 $r = q("SELECT * FROM `contact` WHERE `nick` = '%s' AND `uid` = %d LIMIT 1",
278 $r = q("SELECT * FROM `contact` WHERE `name` = '%s' AND `uid` = %d LIMIT 1",
283 $r = q("SELECT * FROM `contact` WHERE `nick` = '%s' AND `uid` = %d LIMIT 1",
290 $newname = $r[0]['name'];
295 $with = str_replace($lookup,'<a href="' . $prf . '">' . $newname . '</a>', $with);
296 if(strpos($with,'@') === 0)
297 $with = substr($with,1);
301 $with = $orig[0]['with'];
304 $sexual = notags(trim($_POST['sexual']));
305 $homepage = notags(trim($_POST['homepage']));
306 if ((strpos($homepage, 'http') !== 0) && (strlen($homepage))) {
307 // neither http nor https in URL, add them
308 $homepage = 'http://'.$homepage;
310 $hometown = notags(trim($_POST['hometown']));
311 $politic = notags(trim($_POST['politic']));
312 $religion = notags(trim($_POST['religion']));
314 $likes = fix_mce_lf(escape_tags(trim($_POST['likes'])));
315 $dislikes = fix_mce_lf(escape_tags(trim($_POST['dislikes'])));
317 $about = fix_mce_lf(escape_tags(trim($_POST['about'])));
318 $interest = fix_mce_lf(escape_tags(trim($_POST['interest'])));
319 $contact = fix_mce_lf(escape_tags(trim($_POST['contact'])));
320 $music = fix_mce_lf(escape_tags(trim($_POST['music'])));
321 $book = fix_mce_lf(escape_tags(trim($_POST['book'])));
322 $tv = fix_mce_lf(escape_tags(trim($_POST['tv'])));
323 $film = fix_mce_lf(escape_tags(trim($_POST['film'])));
324 $romance = fix_mce_lf(escape_tags(trim($_POST['romance'])));
325 $work = fix_mce_lf(escape_tags(trim($_POST['work'])));
326 $education = fix_mce_lf(escape_tags(trim($_POST['education'])));
328 $hide_friends = (($_POST['hide-friends'] == 1) ? 1: 0);
330 set_pconfig(local_user(),'system','detailled_profile', (($_POST['detailled_profile'] == 1) ? 1: 0));
335 if($marital != $orig[0]['marital']) {
336 $changes[] = '[color=#ff0000]♥[/color] ' . t('Marital Status');
340 $changes[] = '[color=#ff0000]♥[/color] ' . t('Romantic Partner');
341 $value = strip_tags($with);
343 if($likes != $orig[0]['likes']) {
344 $changes[] = t('Likes');
347 if($dislikes != $orig[0]['dislikes']) {
348 $changes[] = t('Dislikes');
351 if($work != $orig[0]['work']) {
352 $changes[] = t('Work/Employment');
354 if($religion != $orig[0]['religion']) {
355 $changes[] = t('Religion');
358 if($politic != $orig[0]['politic']) {
359 $changes[] = t('Political Views');
362 if($gender != $orig[0]['gender']) {
363 $changes[] = t('Gender');
366 if($sexual != $orig[0]['sexual']) {
367 $changes[] = t('Sexual Preference');
370 if($homepage != $orig[0]['homepage']) {
371 $changes[] = t('Homepage');
374 if($interest != $orig[0]['interest']) {
375 $changes[] = t('Interests');
378 if($address != $orig[0]['address']) {
379 $changes[] = t('Address');
380 // New address not sent in notifications, potential privacy issues
381 // in case this leaks to unintended recipients. Yes, it's in the public
382 // profile but that doesn't mean we have to broadcast it to everybody.
384 if($locality != $orig[0]['locality'] || $region != $orig[0]['region']
385 || $country_name != $orig[0]['country-name']) {
386 $changes[] = t('Location');
387 $comma1 = ((($locality) && ($region || $country_name)) ? ', ' : ' ');
388 $comma2 = (($region && $country_name) ? ', ' : '');
389 $value = $locality . $comma1 . $region . $comma2 . $country_name;
392 profile_activity($changes,$value);
396 $r = q("UPDATE `profile`
397 SET `profile-name` = '%s',
405 `postal-code` = '%s',
406 `country-name` = '%s',
415 `pub_keywords` = '%s',
416 `prv_keywords` = '%s',
430 WHERE `id` = %d AND `uid` = %d",
431 dbesc($profile_name),
440 dbesc($country_name),
449 dbesc($pub_keywords),
450 dbesc($prv_keywords),
463 intval($hide_friends),
469 info( t('Profile updated.') . EOL);
472 if($namechanged && $is_default) {
473 $r = q("UPDATE `contact` SET `name` = '%s', `name-date` = '%s' WHERE `self` = 1 AND `uid` = %d",
475 dbesc(datetime_convert()),
478 $r = q("UPDATE `user` set `username` = '%s' where `uid` = %d",
485 $location = formatted_location(array("locality" => $locality, "region" => $region, "country-name" => $country_name));
487 q("UPDATE `contact` SET `about` = '%s', `location` = '%s', `keywords` = '%s', `gender` = '%s' WHERE `self` AND `uid` = %d",
490 dbesc($pub_keywords),
495 // Update global directory in background
496 $url = $_SESSION['my_url'];
497 if($url && strlen(get_config('system','directory')))
498 proc_run('php',"include/directory.php","$url");
500 require_once('include/profile_update.php');
503 // Update the global contact for the user
504 update_gcontact_for_user(local_user());
510 function profile_activity($changed, $value) {
513 if(! local_user() || ! is_array($changed) || ! count($changed))
516 if($a->user['hidewall'] || get_config('system','block_public'))
519 if(! get_pconfig(local_user(),'system','post_profilechange'))
522 require_once('include/items.php');
524 $self = q("SELECT * FROM `contact` WHERE `self` = 1 AND `uid` = %d LIMIT 1",
533 $arr['guid'] = get_guid(32);
534 $arr['uri'] = $arr['parent-uri'] = item_new_uri($a->get_hostname(), local_user());
535 $arr['uid'] = local_user();
536 $arr['contact-id'] = $self[0]['id'];
538 $arr['type'] = 'wall';
541 $arr['author-name'] = $arr['owner-name'] = $self[0]['name'];
542 $arr['author-link'] = $arr['owner-link'] = $self[0]['url'];
543 $arr['author-avatar'] = $arr['owner-avatar'] = $self[0]['thumb'];
544 $arr['verb'] = ACTIVITY_UPDATE;
545 $arr['object-type'] = ACTIVITY_OBJ_PROFILE;
547 $A = '[url=' . $self[0]['url'] . ']' . $self[0]['name'] . '[/url]';
551 $t = count($changed);
553 foreach($changed as $ch) {
554 if(strlen($changes)) {
556 $changes .= t(' and ');
564 $prof = '[url=' . $self[0]['url'] . '?tab=profile' . ']' . t('public profile') . '[/url]';
566 if($t == 1 && strlen($value)) {
567 $message = sprintf( t('%1$s changed %2$s to “%3$s”'), $A, $changes, $value);
568 $message .= "\n\n" . sprintf( t(' - Visit %1$s\'s %2$s'), $A, $prof);
571 $message = sprintf( t('%1$s has an updated %2$s, changing %3$s.'), $A, $prof, $changes);
574 $arr['body'] = $message;
576 $arr['object'] = '<object><type>' . ACTIVITY_OBJ_PROFILE . '</type><title>' . $self[0]['name'] . '</title>'
577 . '<id>' . $self[0]['url'] . '/' . $self[0]['name'] . '</id>';
578 $arr['object'] .= '<link>' . xmlify('<link rel="alternate" type="text/html" href="' . $self[0]['url'] . '?tab=profile' . '" />' . "\n");
579 $arr['object'] .= xmlify('<link rel="photo" type="image/jpeg" href="' . $self[0]['thumb'] . '" />' . "\n");
580 $arr['object'] .= '</link></object>' . "\n";
581 $arr['last-child'] = 1;
583 $arr['allow_cid'] = $a->user['allow_cid'];
584 $arr['allow_gid'] = $a->user['allow_gid'];
585 $arr['deny_cid'] = $a->user['deny_cid'];
586 $arr['deny_gid'] = $a->user['deny_gid'];
588 $i = item_store($arr);
590 proc_run('php',"include/notifier.php","activity","$i");
595 function profiles_content(&$a) {
598 notice( t('Permission denied.') . EOL);
604 if(($a->argc > 1) && (intval($a->argv[1]))) {
605 $r = q("SELECT * FROM `profile` WHERE `id` = %d AND `uid` = %d LIMIT 1",
610 notice( t('Profile not found.') . EOL);
614 require_once('include/profile_selectors.php');
617 /* $editselect = 'textareas';
618 if( intval(get_pconfig(local_user(),'system','plaintext')) || !feature_enabled(local_user(),'richtext') )
619 $editselect = 'none';*/
620 $editselect = 'none';
621 if( feature_enabled(local_user(),'richtext') )
622 $editselect = 'textareas';
624 $a->page['htmlhead'] .= replace_macros(get_markup_template('profed_head.tpl'), array(
625 '$baseurl' => $a->get_baseurl(true),
626 '$editselect' => $editselect,
628 $a->page['end'] .= replace_macros(get_markup_template('profed_end.tpl'), array(
629 '$baseurl' => $a->get_baseurl(true),
630 '$editselect' => $editselect,
634 $opt_tpl = get_markup_template("profile-hide-friends.tpl");
635 $hide_friends = replace_macros($opt_tpl,array(
637 'hide-friends', //Name
638 t('Hide contacts and friends:'), //Label
639 !!$r[0]['hide-friends'], //Value
641 array(t('No'),t('Yes')) //Off - On strings
643 '$desc' => t('Hide your contact/friend list from viewers of this profile?'),
644 '$yes_str' => t('Yes'),
645 '$no_str' => t('No'),
646 '$yes_selected' => (($r[0]['hide-friends']) ? " checked=\"checked\" " : ""),
647 '$no_selected' => (($r[0]['hide-friends'] == 0) ? " checked=\"checked\" " : "")
650 $personal_account = !(in_array($a->user["page-flags"],
651 array(PAGE_COMMUNITY, PAGE_PRVGROUP)));
653 $detailled_profile = (get_pconfig(local_user(),'system','detailled_profile') AND $personal_account);
655 $f = get_config('system','birthday_input_format');
659 $is_default = (($r[0]['is-default']) ? 1 : 0);
660 $tpl = get_markup_template("profile_edit.tpl");
661 $o .= replace_macros($tpl,array(
662 '$personal_account' => $personal_account,
663 '$detailled_profile' => $detailled_profile,
666 'detailled_profile', //Name
667 t('Show more profile fields:'), //Label
668 $detailled_profile, //Value
670 array(t('No'),t('Yes')) //Off - On strings
673 '$multi_profiles' => feature_enabled(local_user(),'multi_profiles'),
674 '$form_security_token' => get_form_security_token("profile_edit"),
675 '$form_security_token_photo' => get_form_security_token("profile_photo"),
676 '$profile_clone_link' => 'profiles/clone/' . $r[0]['id'] . '?t=' . get_form_security_token("profile_clone"),
677 '$profile_drop_link' => 'profiles/drop/' . $r[0]['id'] . '?t=' . get_form_security_token("profile_drop"),
678 '$banner' => t('Edit Profile Details'),
679 '$submit' => t('Submit'),
680 '$profpic' => t('Change Profile Photo'),
681 '$viewprof' => t('View this profile'),
682 '$cr_prof' => t('Create a new profile using these settings'),
683 '$cl_prof' => t('Clone this profile'),
684 '$del_prof' => t('Delete this profile'),
685 '$lbl_basic_section' => t('Basic information'),
686 '$lbl_picture_section' => t('Profile picture'),
687 '$lbl_location_section' => t('Location'),
688 '$lbl_preferences_section' => t('Preferences'),
689 '$lbl_status_section' => t('Status information'),
690 '$lbl_about_section' => t('Additional information'),
691 '$lbl_interests_section' => t('Interests'),
692 '$lbl_profile_photo' => t('Upload Profile Photo'),
693 '$lbl_profname' => t('Profile Name:'),
694 '$lbl_fullname' => t('Your Full Name:'),
695 '$lbl_title' => t('Title/Description:'),
696 '$lbl_gender' => t('Your Gender:'),
697 '$lbl_bd' => t("Birthday :"),
698 '$lbl_address' => t('Street Address:'),
699 '$lbl_city' => t('Locality/City:'),
700 '$lbl_zip' => t('Postal/Zip Code:'),
701 '$lbl_country' => t('Country:'),
702 '$lbl_region' => t('Region/State:'),
703 '$lbl_marital' => t('<span class="heart">♥</span> Marital Status:'),
704 '$lbl_with' => t("Who: \x28if applicable\x29"),
705 '$lbl_ex1' => t('Examples: cathy123, Cathy Williams, cathy@example.com'),
706 '$lbl_howlong' => t('Since [date]:'),
707 '$lbl_sexual' => t('Sexual Preference:'),
708 '$lbl_homepage' => t('Homepage URL:'),
709 '$lbl_hometown' => t('Hometown:'),
710 '$lbl_politic' => t('Political Views:'),
711 '$lbl_religion' => t('Religious Views:'),
712 '$lbl_pubkey' => t('Public Keywords:'),
713 '$lbl_prvkey' => t('Private Keywords:'),
714 '$lbl_likes' => t('Likes:'),
715 '$lbl_dislikes' => t('Dislikes:'),
716 '$lbl_ex2' => t('Example: fishing photography software'),
717 '$lbl_pubdsc' => t("\x28Used for suggesting potential friends, can be seen by others\x29"),
718 '$lbl_prvdsc' => t("\x28Used for searching profiles, never shown to others\x29"),
719 '$lbl_about' => t('Tell us about yourself...'),
720 '$lbl_hobbies' => t('Hobbies/Interests'),
721 '$lbl_social' => t('Contact information and Social Networks'),
722 '$lbl_music' => t('Musical interests'),
723 '$lbl_book' => t('Books, literature'),
724 '$lbl_tv' => t('Television'),
725 '$lbl_film' => t('Film/dance/culture/entertainment'),
726 '$lbl_love' => t('Love/romance'),
727 '$lbl_work' => t('Work/employment'),
728 '$lbl_school' => t('School/education'),
729 '$disabled' => (($is_default) ? 'onclick="return false;" style="color: #BBBBFF;"' : ''),
730 '$baseurl' => $a->get_baseurl(true),
731 '$profile_id' => $r[0]['id'],
732 '$profile_name' => $r[0]['profile-name'],
733 '$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>' : ""),
734 '$name' => $r[0]['name'],
735 '$pdesc' => $r[0]['pdesc'],
736 '$dob' => dob($r[0]['dob']),
737 '$hide_friends' => $hide_friends,
738 '$address' => $r[0]['address'],
739 '$locality' => $r[0]['locality'],
740 '$region' => $r[0]['region'],
741 '$postal_code' => $r[0]['postal-code'],
742 '$country_name' => $r[0]['country-name'],
743 '$age' => ((intval($r[0]['dob'])) ? '(' . t('Age: ') . age($r[0]['dob'],$a->user['timezone'],$a->user['timezone']) . ')' : ''),
744 '$gender' => gender_selector($r[0]['gender']),
745 '$marital' => marital_selector($r[0]['marital']),
746 '$with' => strip_tags($r[0]['with']),
747 '$howlong' => ($r[0]['howlong'] === '0000-00-00 00:00:00' ? '' : datetime_convert('UTC',date_default_timezone_get(),$r[0]['howlong'])),
748 '$sexual' => sexpref_selector($r[0]['sexual']),
749 '$about' => $r[0]['about'],
750 '$homepage' => $r[0]['homepage'],
751 '$hometown' => $r[0]['hometown'],
752 '$politic' => $r[0]['politic'],
753 '$religion' => $r[0]['religion'],
754 '$pub_keywords' => $r[0]['pub_keywords'],
755 '$prv_keywords' => $r[0]['prv_keywords'],
756 '$likes' => $r[0]['likes'],
757 '$dislikes' => $r[0]['dislikes'],
758 '$music' => $r[0]['music'],
759 '$book' => $r[0]['book'],
760 '$tv' => $r[0]['tv'],
761 '$film' => $r[0]['film'],
762 '$interest' => $r[0]['interest'],
763 '$romance' => $r[0]['romance'],
764 '$work' => $r[0]['work'],
765 '$education' => $r[0]['education'],
766 '$contact' => $r[0]['contact']
769 $arr = array('profile' => $r[0], 'entry' => $o);
770 call_hooks('profile_edit', $arr);
778 //If we don't support multi profiles, don't display this list.
779 if(!feature_enabled(local_user(),'multi_profiles')){
781 "SELECT * FROM `profile` WHERE `uid` = %d AND `is-default`=1",
785 //Go to the default profile.
786 goaway('profiles/'.$r[0]['id']);
790 $r = q("SELECT * FROM `profile` WHERE `uid` = %d",
794 $tpl_header = get_markup_template('profile_listing_header.tpl');
795 $o .= replace_macros($tpl_header,array(
796 '$header' => t('Edit/Manage Profiles'),
797 '$chg_photo' => t('Change profile photo'),
798 '$cr_new' => t('Create New Profile'),
799 '$cr_new_link' => 'profiles/new?t=' . get_form_security_token("profile_new")
803 $tpl = get_markup_template('profile_entry.tpl');
806 $o .= replace_macros($tpl, array(
807 '$photo' => $a->remove_baseurl($rr['thumb']),
809 '$alt' => t('Profile Image'),
810 '$profile_name' => $rr['profile-name'],
811 '$visible' => (($rr['is-default']) ? '<strong>' . t('visible to everybody') . '</strong>'
812 : '<a href="'.'profperm/'.$rr['id'].'" />' . t('Edit visibility') . '</a>')