2 require_once("include/Contact.php");
3 require_once('include/Probe.php');
5 function profiles_init(App $a) {
7 nav_set_selected('profiles');
13 if (($a->argc > 2) && ($a->argv[1] === "drop") && intval($a->argv[2])) {
14 $r = q("SELECT * FROM `profile` WHERE `id` = %d AND `uid` = %d AND `is-default` = 0 LIMIT 1",
18 if (! dbm::is_result($r)) {
19 notice( t('Profile not found.') . EOL);
24 check_form_security_token_redirectOnErr('/profiles', 'profile_drop', 't');
26 // move every contact using this profile as their default to the user default
28 $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 ",
33 $r = q("DELETE FROM `profile` WHERE `id` = %d AND `uid` = %d",
37 if (dbm::is_result($r)) {
38 info(t('Profile deleted.').EOL);
45 if (($a->argc > 1) && ($a->argv[1] === 'new')) {
47 check_form_security_token_redirectOnErr('/profiles', 'profile_new', 't');
49 $r0 = q("SELECT `id` FROM `profile` WHERE `uid` = %d",
50 intval(local_user()));
52 $num_profiles = (dbm::is_result($r0) ? count($r0) : 0);
54 $name = t('Profile-') . ($num_profiles + 1);
56 $r1 = q("SELECT `name`, `photo`, `thumb` FROM `profile` WHERE `uid` = %d AND `is-default` = 1 LIMIT 1",
57 intval(local_user()));
59 $r2 = q("INSERT INTO `profile` (`uid` , `profile-name` , `name`, `photo`, `thumb`)
60 VALUES ( %d, '%s', '%s', '%s', '%s' )",
63 dbesc($r1[0]['name']),
64 dbesc($r1[0]['photo']),
65 dbesc($r1[0]['thumb'])
68 $r3 = q("SELECT `id` FROM `profile` WHERE `uid` = %d AND `profile-name` = '%s' LIMIT 1",
73 info( t('New profile created.') . EOL);
74 if (dbm::is_result($r3) && count($r3) == 1) {
75 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()));
88 $num_profiles = (dbm::is_result($r0) ? count($r0) : 0);
90 $name = t('Profile-') . ($num_profiles + 1);
91 $r1 = q("SELECT * FROM `profile` WHERE `uid` = %d AND `id` = %d LIMIT 1",
95 if(! dbm::is_result($r1)) {
96 notice( t('Profile unavailable to clone.') . EOL);
101 $r1[0]['is-default'] = 0;
102 $r1[0]['publish'] = 0;
103 $r1[0]['net-publish'] = 0;
104 $r1[0]['profile-name'] = dbesc($name);
106 dbm::esc_array($r1[0], true);
108 $r2 = dbq("INSERT INTO `profile` (`"
109 . implode("`, `", array_keys($r1[0]))
111 . implode(", ", array_values($r1[0]))
114 $r3 = q("SELECT `id` FROM `profile` WHERE `uid` = %d AND `profile-name` = '%s' LIMIT 1",
115 intval(local_user()),
118 info( t('New profile created.') . EOL);
119 if ((dbm::is_result($r3)) && (count($r3) == 1)) {
120 goaway('profiles/'.$r3[0]['id']);
125 return; // NOTREACHED
129 if (($a->argc > 1) && (intval($a->argv[1]))) {
130 $r = q("SELECT id FROM `profile` WHERE `id` = %d AND `uid` = %d LIMIT 1",
134 if (! dbm::is_result($r)) {
135 notice( t('Profile not found.') . EOL);
140 profile_load($a,$a->user['nickname'], $r[0]['id']);
147 function profile_clean_keywords($keywords) {
148 $keywords = str_replace(",", " ", $keywords);
149 $keywords = explode(" ", $keywords);
152 foreach ($keywords as $keyword) {
153 $keyword = trim(strtolower($keyword));
154 $keyword = trim($keyword, "#");
155 if ($keyword != "") {
156 $cleaned[] = $keyword;
160 $keywords = implode(", ", $cleaned);
165 function profiles_post(App $a) {
167 if (! local_user()) {
168 notice( t('Permission denied.') . EOL);
172 $namechanged = false;
174 call_hooks('profile_post', $_POST);
176 if (($a->argc > 1) && ($a->argv[1] !== "new") && intval($a->argv[1])) {
177 $orig = q("SELECT * FROM `profile` WHERE `id` = %d AND `uid` = %d LIMIT 1",
181 if (! dbm::is_result($orig)) {
182 notice( t('Profile not found.') . EOL);
186 check_form_security_token_redirectOnErr('/profiles', 'profile_edit');
188 $is_default = (($orig[0]['is-default']) ? 1 : 0);
190 $profile_name = notags(trim($_POST['profile_name']));
191 if (! strlen($profile_name)) {
192 notice( t('Profile Name is required.') . EOL);
196 $dob = $_POST['dob'] ? escape_tags(trim($_POST['dob'])) : '0000-00-00'; // FIXME: Needs to be validated?
198 $y = substr($dob, 0, 4);
199 if ((! ctype_digit($y)) || ($y < 1900)) {
202 $ignore_year = false;
204 if ($dob != '0000-00-00') {
205 if (strpos($dob, '0000-') === 0) {
207 $dob = substr($dob, 5);
209 $dob = datetime_convert('UTC', 'UTC', (($ignore_year) ? '1900-' . $dob : $dob), (($ignore_year) ? 'm-d' : 'Y-m-d'));
212 $dob = '0000-' . $dob;
216 $name = notags(trim($_POST['name']));
218 if (! strlen($name)) {
222 if ($orig[0]['name'] != $name) {
226 $pdesc = notags(trim($_POST['pdesc']));
227 $gender = notags(trim($_POST['gender']));
228 $address = notags(trim($_POST['address']));
229 $locality = notags(trim($_POST['locality']));
230 $region = notags(trim($_POST['region']));
231 $postal_code = notags(trim($_POST['postal_code']));
232 $country_name = notags(trim($_POST['country_name']));
233 $pub_keywords = profile_clean_keywords(notags(trim($_POST['pub_keywords'])));
234 $prv_keywords = profile_clean_keywords(notags(trim($_POST['prv_keywords'])));
235 $marital = notags(trim($_POST['marital']));
236 $howlong = notags(trim($_POST['howlong']));
238 $with = ((x($_POST,'with')) ? notags(trim($_POST['with'])) : '');
240 if (! strlen($howlong)) {
241 $howlong = NULL_DATE;
243 $howlong = datetime_convert(date_default_timezone_get(), 'UTC', $howlong);
245 // linkify the relationship target if applicable
247 $withchanged = false;
250 if ($with != strip_tags($orig[0]['with'])) {
254 if (strpos($lookup, '@') === 0) {
255 $lookup = substr($lookup, 1);
257 $lookup = str_replace('_',' ', $lookup);
258 if (strpos($lookup, '@') || (strpos($lookup, 'http://'))) {
260 $links = @Probe::lrdd($lookup);
262 foreach ($links as $link) {
263 if ($link['@attributes']['rel'] === 'http://webfinger.net/rel/profile-page') {
264 $prf = $link['@attributes']['href'];
271 $r = q("SELECT * FROM `contact` WHERE `name` = '%s' AND `uid` = %d LIMIT 1",
275 if (! dbm::is_result($r)) {
276 $r = q("SELECT * FROM `contact` WHERE `nick` = '%s' AND `uid` = %d LIMIT 1",
281 if (dbm::is_result($r)) {
283 $newname = $r[0]['name'];
288 $with = str_replace($lookup, '<a href="' . $prf . '">' . $newname . '</a>', $with);
289 if (strpos($with, '@') === 0) {
290 $with = substr($with, 1);
294 $with = $orig[0]['with'];
298 /// @TODO Not flexible enough for later expansion, let's have more OOP here
299 $sexual = notags(trim($_POST['sexual']));
300 $xmpp = notags(trim($_POST['xmpp']));
301 $homepage = notags(trim($_POST['homepage']));
302 if ((strpos($homepage, 'http') !== 0) && (strlen($homepage))) {
303 // neither http nor https in URL, add them
304 $homepage = 'http://'.$homepage;
306 $hometown = notags(trim($_POST['hometown']));
307 $politic = notags(trim($_POST['politic']));
308 $religion = notags(trim($_POST['religion']));
310 $likes = escape_tags(trim($_POST['likes']));
311 $dislikes = escape_tags(trim($_POST['dislikes']));
313 $about = escape_tags(trim($_POST['about']));
314 $interest = escape_tags(trim($_POST['interest']));
315 $contact = escape_tags(trim($_POST['contact']));
316 $music = escape_tags(trim($_POST['music']));
317 $book = escape_tags(trim($_POST['book']));
318 $tv = escape_tags(trim($_POST['tv']));
319 $film = escape_tags(trim($_POST['film']));
320 $romance = escape_tags(trim($_POST['romance']));
321 $work = escape_tags(trim($_POST['work']));
322 $education = escape_tags(trim($_POST['education']));
324 $hide_friends = (($_POST['hide-friends'] == 1) ? 1: 0);
326 set_pconfig(local_user(), 'system', 'detailled_profile', (($_POST['detailled_profile'] == 1) ? 1: 0));
331 if ($marital != $orig[0]['marital']) {
332 $changes[] = '[color=#ff0000]♥[/color] ' . t('Marital Status');
336 $changes[] = '[color=#ff0000]♥[/color] ' . t('Romantic Partner');
337 $value = strip_tags($with);
339 if ($likes != $orig[0]['likes']) {
340 $changes[] = t('Likes');
343 if ($dislikes != $orig[0]['dislikes']) {
344 $changes[] = t('Dislikes');
347 if ($work != $orig[0]['work']) {
348 $changes[] = t('Work/Employment');
350 if ($religion != $orig[0]['religion']) {
351 $changes[] = t('Religion');
354 if ($politic != $orig[0]['politic']) {
355 $changes[] = t('Political Views');
358 if ($gender != $orig[0]['gender']) {
359 $changes[] = t('Gender');
362 if ($sexual != $orig[0]['sexual']) {
363 $changes[] = t('Sexual Preference');
366 if ($xmpp != $orig[0]['xmpp']) {
367 $changes[] = t('XMPP');
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',
416 `pub_keywords` = '%s',
417 `prv_keywords` = '%s',
431 WHERE `id` = %d AND `uid` = %d",
432 dbesc($profile_name),
441 dbesc($country_name),
451 dbesc($pub_keywords),
452 dbesc($prv_keywords),
465 intval($hide_friends),
471 info(t('Profile updated.') . EOL);
475 if ($namechanged && $is_default) {
476 $r = q("UPDATE `contact` SET `name` = '%s', `name-date` = '%s' WHERE `self` = 1 AND `uid` = %d",
478 dbesc(datetime_convert()),
481 $r = q("UPDATE `user` set `username` = '%s' where `uid` = %d",
488 $location = formatted_location(array("locality" => $locality, "region" => $region, "country-name" => $country_name));
490 q("UPDATE `contact` SET `about` = '%s', `location` = '%s', `keywords` = '%s', `gender` = '%s' WHERE `self` AND `uid` = %d",
493 dbesc($pub_keywords),
498 // Update global directory in background
499 $url = $_SESSION['my_url'];
500 if ($url && strlen(get_config('system', 'directory'))) {
501 proc_run(PRIORITY_LOW, "include/directory.php", $url);
504 require_once('include/profile_update.php');
507 // Update the global contact for the user
508 update_gcontact_for_user(local_user());
514 function profile_activity($changed, $value) {
517 if (! local_user() || ! is_array($changed) || ! count($changed)) {
521 if ($a->user['hidewall'] || get_config('system', 'block_public')) {
525 if (! get_pconfig(local_user(), 'system', 'post_profilechange')) {
529 require_once('include/items.php');
531 $self = q("SELECT * FROM `contact` WHERE `self` = 1 AND `uid` = %d LIMIT 1",
535 if (! dbm::is_result($self)) {
541 $arr['guid'] = get_guid(32);
542 $arr['uri'] = $arr['parent-uri'] = item_new_uri($a->get_hostname(), local_user());
543 $arr['uid'] = local_user();
544 $arr['contact-id'] = $self[0]['id'];
546 $arr['type'] = 'wall';
549 $arr['author-name'] = $arr['owner-name'] = $self[0]['name'];
550 $arr['author-link'] = $arr['owner-link'] = $self[0]['url'];
551 $arr['author-avatar'] = $arr['owner-avatar'] = $self[0]['thumb'];
552 $arr['verb'] = ACTIVITY_UPDATE;
553 $arr['object-type'] = ACTIVITY_OBJ_PROFILE;
555 $A = '[url=' . $self[0]['url'] . ']' . $self[0]['name'] . '[/url]';
559 $t = count($changed);
561 foreach ($changed as $ch) {
562 if (strlen($changes)) {
563 if ($z == ($t - 1)) {
564 $changes .= t(' and ');
573 $prof = '[url=' . $self[0]['url'] . '?tab=profile' . ']' . t('public profile') . '[/url]';
575 if ($t == 1 && strlen($value)) {
576 $message = sprintf( t('%1$s changed %2$s to “%3$s”'), $A, $changes, $value);
577 $message .= "\n\n" . sprintf( t(' - Visit %1$s\'s %2$s'), $A, $prof);
579 $message = sprintf( t('%1$s has an updated %2$s, changing %3$s.'), $A, $prof, $changes);
583 $arr['body'] = $message;
585 $arr['object'] = '<object><type>' . ACTIVITY_OBJ_PROFILE . '</type><title>' . $self[0]['name'] . '</title>'
586 . '<id>' . $self[0]['url'] . '/' . $self[0]['name'] . '</id>';
587 $arr['object'] .= '<link>' . xmlify('<link rel="alternate" type="text/html" href="' . $self[0]['url'] . '?tab=profile' . '" />' . "\n");
588 $arr['object'] .= xmlify('<link rel="photo" type="image/jpeg" href="' . $self[0]['thumb'] . '" />' . "\n");
589 $arr['object'] .= '</link></object>' . "\n";
590 $arr['last-child'] = 1;
592 $arr['allow_cid'] = $a->user['allow_cid'];
593 $arr['allow_gid'] = $a->user['allow_gid'];
594 $arr['deny_cid'] = $a->user['deny_cid'];
595 $arr['deny_gid'] = $a->user['deny_gid'];
597 $i = item_store($arr);
599 proc_run(PRIORITY_HIGH, "include/notifier.php", "activity", $i);
604 function profiles_content(App $a) {
606 if (! local_user()) {
607 notice( t('Permission denied.') . EOL);
613 if (($a->argc > 1) && (intval($a->argv[1]))) {
614 $r = q("SELECT * FROM `profile` WHERE `id` = %d AND `uid` = %d LIMIT 1",
618 if (! dbm::is_result($r)) {
619 notice( t('Profile not found.') . EOL);
623 require_once('include/profile_selectors.php');
626 $a->page['htmlhead'] .= replace_macros(get_markup_template('profed_head.tpl'), array(
627 '$baseurl' => App::get_baseurl(true),
629 $a->page['end'] .= replace_macros(get_markup_template('profed_end.tpl'), array(
630 '$baseurl' => App::get_baseurl(true),
633 $opt_tpl = get_markup_template("profile-hide-friends.tpl");
634 $hide_friends = replace_macros($opt_tpl,array(
636 'hide-friends', //Name
637 t('Hide contacts and friends:'), //Label
638 !!$r[0]['hide-friends'], //Value
640 array(t('No'), t('Yes')) //Off - On strings
642 '$desc' => t('Hide your contact/friend list from viewers of this profile?'),
643 '$yes_str' => t('Yes'),
644 '$no_str' => t('No'),
645 '$yes_selected' => (($r[0]['hide-friends']) ? " checked=\"checked\" " : ""),
646 '$no_selected' => (($r[0]['hide-friends'] == 0) ? " checked=\"checked\" " : "")
649 $personal_account = !(in_array($a->user["page-flags"],
650 array(PAGE_COMMUNITY, PAGE_PRVGROUP)));
652 $detailled_profile = (get_pconfig(local_user(), 'system', 'detailled_profile') AND $personal_account);
654 $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' => ((feature_enabled(local_user(), 'multi_profiles')) ? '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"),
679 '$profile_action' => t('Profile Actions'),
680 '$banner' => t('Edit Profile Details'),
681 '$submit' => t('Submit'),
682 '$profpic' => t('Change Profile Photo'),
683 '$viewprof' => t('View this profile'),
684 '$editvis' => t('Edit visibility'),
685 '$cr_prof' => t('Create a new profile using these settings'),
686 '$cl_prof' => t('Clone this profile'),
687 '$del_prof' => t('Delete this profile'),
689 '$lbl_basic_section' => t('Basic information'),
690 '$lbl_picture_section' => t('Profile picture'),
691 '$lbl_location_section' => t('Location'),
692 '$lbl_preferences_section' => t('Preferences'),
693 '$lbl_status_section' => t('Status information'),
694 '$lbl_about_section' => t('Additional information'),
695 '$lbl_interests_section' => t('Interests'),
696 '$lbl_personal_section' => t('Personal'),
697 '$lbl_relation_section' => t('Relation'),
698 '$lbl_miscellaneous_section' => t('Miscellaneous'),
700 '$lbl_profile_photo' => t('Upload Profile Photo'),
701 '$lbl_gender' => t('Your Gender:'),
702 '$lbl_marital' => t('<span class="heart">♥</span> Marital Status:'),
703 '$lbl_sexual' => t('Sexual Preference:'),
704 '$lbl_ex2' => t('Example: fishing photography software'),
706 '$disabled' => (($is_default) ? 'onclick="return false;" style="color: #BBBBFF;"' : ''),
707 '$baseurl' => App::get_baseurl(true),
708 '$profile_id' => $r[0]['id'],
709 '$profile_name' => array('profile_name', t('Profile Name:'), $r[0]['profile-name'], t('Required'), '*'),
710 '$is_default' => $is_default,
711 '$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>' : ""),
712 '$name' => array('name', t('Your Full Name:'), $r[0]['name']),
713 '$pdesc' => array('pdesc', t('Title/Description:'), $r[0]['pdesc']),
714 '$dob' => dob($r[0]['dob']),
715 '$hide_friends' => $hide_friends,
716 '$address' => array('address', t('Street Address:'), $r[0]['address']),
717 '$locality' => array('locality', t('Locality/City:'), $r[0]['locality']),
718 '$region' => array('region', t('Region/State:'), $r[0]['region']),
719 '$postal_code' => array('postal_code', t('Postal/Zip Code:'), $r[0]['postal-code']),
720 '$country_name' => array('country_name', t('Country:'), $r[0]['country-name']),
721 '$age' => ((intval($r[0]['dob'])) ? '(' . t('Age: ') . age($r[0]['dob'],$a->user['timezone'],$a->user['timezone']) . ')' : ''),
722 '$gender' => gender_selector($r[0]['gender']),
723 '$marital' => marital_selector($r[0]['marital']),
724 '$with' => array('with', t("Who: \x28if applicable\x29"), strip_tags($r[0]['with']), t('Examples: cathy123, Cathy Williams, cathy@example.com')),
725 '$howlong' => array('howlong', t('Since [date]:'), ($r[0]['howlong'] <= NULL_DATE ? '' : datetime_convert('UTC',date_default_timezone_get(),$r[0]['howlong']))),
726 '$sexual' => sexpref_selector($r[0]['sexual']),
727 '$about' => array('about', t('Tell us about yourself...'), $r[0]['about']),
728 '$xmpp' => array('xmpp', t('XMPP (Jabber) address:'), $r[0]['xmpp'], t("The XMPP address will be propagated to your contacts so that they can follow you.")),
729 '$homepage' => array('homepage', t('Homepage URL:'), $r[0]['homepage']),
730 '$hometown' => array('hometown', t('Hometown:'), $r[0]['hometown']),
731 '$politic' => array('politic', t('Political Views:'), $r[0]['politic']),
732 '$religion' => array('religion', t('Religious Views:'), $r[0]['religion']),
733 '$pub_keywords' => array('pub_keywords', t('Public Keywords:'), $r[0]['pub_keywords'], t("\x28Used for suggesting potential friends, can be seen by others\x29")),
734 '$prv_keywords' => array('prv_keywords', t('Private Keywords:'), $r[0]['prv_keywords'], t("\x28Used for searching profiles, never shown to others\x29")),
735 '$likes' => array('likes', t('Likes:'), $r[0]['likes']),
736 '$dislikes' => array('dislikes', t('Dislikes:'), $r[0]['dislikes']),
737 '$music' => array('music', t('Musical interests'), $r[0]['music']),
738 '$book' => array('book', t('Books, literature'), $r[0]['book']),
739 '$tv' => array('tv', t('Television'), $r[0]['tv']),
740 '$film' => array('film', t('Film/dance/culture/entertainment'), $r[0]['film']),
741 '$interest' => array('interest', t('Hobbies/Interests'), $r[0]['interest']),
742 '$romance' => array('romance', t('Love/romance'), $r[0]['romance']),
743 '$work' => array('work', t('Work/employment'), $r[0]['work']),
744 '$education' => array('education', t('School/education'), $r[0]['education']),
745 '$contact' => array('contact', t('Contact information and Social Networks'), $r[0]['contact']),
748 $arr = array('profile' => $r[0], 'entry' => $o);
749 call_hooks('profile_edit', $arr);
754 // If we don't support multi profiles, don't display this list.
755 if (!feature_enabled(local_user(), 'multi_profiles')) {
756 $r = q("SELECT * FROM `profile` WHERE `uid` = %d AND `is-default`=1",
759 if (dbm::is_result($r)) {
760 //Go to the default profile.
761 goaway('profiles/' . $r[0]['id']);
765 $r = q("SELECT * FROM `profile` WHERE `uid` = %d",
768 if (dbm::is_result($r)) {
770 $tpl = get_markup_template('profile_entry.tpl');
773 foreach ($r as $rr) {
774 $profiles .= replace_macros($tpl, array(
775 '$photo' => $a->remove_baseurl($rr['thumb']),
777 '$alt' => t('Profile Image'),
778 '$profile_name' => $rr['profile-name'],
779 '$visible' => (($rr['is-default']) ? '<strong>' . t('visible to everybody') . '</strong>'
780 : '<a href="'.'profperm/'.$rr['id'].'" />' . t('Edit visibility') . '</a>')
784 $tpl_header = get_markup_template('profile_listing_header.tpl');
785 $o .= replace_macros($tpl_header,array(
786 '$header' => t('Edit/Manage Profiles'),
787 '$chg_photo' => t('Change profile photo'),
788 '$cr_new' => t('Create New Profile'),
789 '$cr_new_link' => 'profiles/new?t=' . get_form_security_token("profile_new"),
790 '$profiles' => $profiles