4 use Friendica\Core\Config;
5 use Friendica\Core\PConfig;
6 use Friendica\Core\System;
7 use Friendica\Core\Worker;
8 use Friendica\Database\DBM;
9 use Friendica\Network\Probe;
11 require_once 'include/Contact.php';
12 require_once 'include/socgraph.php';
14 function profiles_init(App $a) {
16 nav_set_selected('profiles');
22 if (($a->argc > 2) && ($a->argv[1] === "drop") && intval($a->argv[2])) {
23 $r = q("SELECT * FROM `profile` WHERE `id` = %d AND `uid` = %d AND `is-default` = 0 LIMIT 1",
27 if (! DBM::is_result($r)) {
28 notice( t('Profile not found.') . EOL);
33 check_form_security_token_redirectOnErr('/profiles', 'profile_drop', 't');
35 // move every contact using this profile as their default to the user default
37 $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 ",
42 $r = q("DELETE FROM `profile` WHERE `id` = %d AND `uid` = %d",
46 if (DBM::is_result($r)) {
47 info(t('Profile deleted.').EOL);
54 if (($a->argc > 1) && ($a->argv[1] === 'new')) {
56 check_form_security_token_redirectOnErr('/profiles', 'profile_new', 't');
58 $r0 = q("SELECT `id` FROM `profile` WHERE `uid` = %d",
59 intval(local_user()));
61 $num_profiles = (DBM::is_result($r0) ? count($r0) : 0);
63 $name = t('Profile-') . ($num_profiles + 1);
65 $r1 = q("SELECT `name`, `photo`, `thumb` FROM `profile` WHERE `uid` = %d AND `is-default` = 1 LIMIT 1",
66 intval(local_user()));
68 $r2 = q("INSERT INTO `profile` (`uid` , `profile-name` , `name`, `photo`, `thumb`)
69 VALUES ( %d, '%s', '%s', '%s', '%s' )",
72 dbesc($r1[0]['name']),
73 dbesc($r1[0]['photo']),
74 dbesc($r1[0]['thumb'])
77 $r3 = q("SELECT `id` FROM `profile` WHERE `uid` = %d AND `profile-name` = '%s' LIMIT 1",
82 info( t('New profile created.') . EOL);
83 if (DBM::is_result($r3) && count($r3) == 1) {
84 goaway('profiles/' . $r3[0]['id']);
90 if (($a->argc > 2) && ($a->argv[1] === 'clone')) {
92 check_form_security_token_redirectOnErr('/profiles', 'profile_clone', 't');
94 $r0 = q("SELECT `id` FROM `profile` WHERE `uid` = %d",
95 intval(local_user()));
97 $num_profiles = (DBM::is_result($r0) ? count($r0) : 0);
99 $name = t('Profile-') . ($num_profiles + 1);
100 $r1 = q("SELECT * FROM `profile` WHERE `uid` = %d AND `id` = %d LIMIT 1",
101 intval(local_user()),
104 if(! DBM::is_result($r1)) {
105 notice( t('Profile unavailable to clone.') . EOL);
110 $r1[0]['is-default'] = 0;
111 $r1[0]['publish'] = 0;
112 $r1[0]['net-publish'] = 0;
113 $r1[0]['profile-name'] = dbesc($name);
115 dba::insert('profile', $r1[0]);
117 $r3 = q("SELECT `id` FROM `profile` WHERE `uid` = %d AND `profile-name` = '%s' LIMIT 1",
118 intval(local_user()),
121 info( t('New profile created.') . EOL);
122 if ((DBM::is_result($r3)) && (count($r3) == 1)) {
123 goaway('profiles/'.$r3[0]['id']);
128 return; // NOTREACHED
132 if (($a->argc > 1) && (intval($a->argv[1]))) {
133 $r = q("SELECT id FROM `profile` WHERE `id` = %d AND `uid` = %d LIMIT 1",
137 if (! DBM::is_result($r)) {
138 notice( t('Profile not found.') . EOL);
143 profile_load($a,$a->user['nickname'], $r[0]['id']);
150 function profile_clean_keywords($keywords) {
151 $keywords = str_replace(",", " ", $keywords);
152 $keywords = explode(" ", $keywords);
155 foreach ($keywords as $keyword) {
156 $keyword = trim(strtolower($keyword));
157 $keyword = trim($keyword, "#");
158 if ($keyword != "") {
159 $cleaned[] = $keyword;
163 $keywords = implode(", ", $cleaned);
168 function profiles_post(App $a) {
170 if (! local_user()) {
171 notice( t('Permission denied.') . EOL);
175 $namechanged = false;
177 call_hooks('profile_post', $_POST);
179 if (($a->argc > 1) && ($a->argv[1] !== "new") && intval($a->argv[1])) {
180 $orig = q("SELECT * FROM `profile` WHERE `id` = %d AND `uid` = %d LIMIT 1",
184 if (! DBM::is_result($orig)) {
185 notice( t('Profile not found.') . EOL);
189 check_form_security_token_redirectOnErr('/profiles', 'profile_edit');
191 $is_default = (($orig[0]['is-default']) ? 1 : 0);
193 $profile_name = notags(trim($_POST['profile_name']));
194 if (! strlen($profile_name)) {
195 notice( t('Profile Name is required.') . EOL);
199 $dob = $_POST['dob'] ? escape_tags(trim($_POST['dob'])) : '0001-01-01'; // FIXME: Needs to be validated?
201 $y = substr($dob, 0, 4);
202 if ((! ctype_digit($y)) || ($y < 1900)) {
205 $ignore_year = false;
207 if (!in_array($dob, array('0000-00-00', '0001-01-01'))) {
208 if (strpos($dob, '0000-') === 0 || strpos($dob, '0001-') === 0) {
210 $dob = substr($dob, 5);
212 $dob = datetime_convert('UTC', 'UTC', (($ignore_year) ? '1900-' . $dob : $dob), (($ignore_year) ? 'm-d' : 'Y-m-d'));
215 $dob = '0001-' . $dob;
219 $name = notags(trim($_POST['name']));
221 if (! strlen($name)) {
225 if ($orig[0]['name'] != $name) {
229 $pdesc = notags(trim($_POST['pdesc']));
230 $gender = notags(trim($_POST['gender']));
231 $address = notags(trim($_POST['address']));
232 $locality = notags(trim($_POST['locality']));
233 $region = notags(trim($_POST['region']));
234 $postal_code = notags(trim($_POST['postal_code']));
235 $country_name = notags(trim($_POST['country_name']));
236 $pub_keywords = profile_clean_keywords(notags(trim($_POST['pub_keywords'])));
237 $prv_keywords = profile_clean_keywords(notags(trim($_POST['prv_keywords'])));
238 $marital = notags(trim($_POST['marital']));
239 $howlong = notags(trim($_POST['howlong']));
241 $with = ((x($_POST,'with')) ? notags(trim($_POST['with'])) : '');
243 if (! strlen($howlong)) {
244 $howlong = NULL_DATE;
246 $howlong = datetime_convert(date_default_timezone_get(), 'UTC', $howlong);
248 // linkify the relationship target if applicable
250 $withchanged = false;
253 if ($with != strip_tags($orig[0]['with'])) {
257 if (strpos($lookup, '@') === 0) {
258 $lookup = substr($lookup, 1);
260 $lookup = str_replace('_',' ', $lookup);
261 if (strpos($lookup, '@') || (strpos($lookup, 'http://'))) {
263 $links = @Probe::lrdd($lookup);
265 foreach ($links as $link) {
266 if ($link['@attributes']['rel'] === 'http://webfinger.net/rel/profile-page') {
267 $prf = $link['@attributes']['href'];
274 $r = q("SELECT * FROM `contact` WHERE `name` = '%s' AND `uid` = %d LIMIT 1",
278 if (! DBM::is_result($r)) {
279 $r = q("SELECT * FROM `contact` WHERE `nick` = '%s' AND `uid` = %d LIMIT 1",
284 if (DBM::is_result($r)) {
286 $newname = $r[0]['name'];
291 $with = str_replace($lookup, '<a href="' . $prf . '">' . $newname . '</a>', $with);
292 if (strpos($with, '@') === 0) {
293 $with = substr($with, 1);
297 $with = $orig[0]['with'];
301 /// @TODO Not flexible enough for later expansion, let's have more OOP here
302 $sexual = notags(trim($_POST['sexual']));
303 $xmpp = notags(trim($_POST['xmpp']));
304 $homepage = notags(trim($_POST['homepage']));
305 if ((strpos($homepage, 'http') !== 0) && (strlen($homepage))) {
306 // neither http nor https in URL, add them
307 $homepage = 'http://'.$homepage;
309 $hometown = notags(trim($_POST['hometown']));
310 $politic = notags(trim($_POST['politic']));
311 $religion = notags(trim($_POST['religion']));
313 $likes = escape_tags(trim($_POST['likes']));
314 $dislikes = escape_tags(trim($_POST['dislikes']));
316 $about = escape_tags(trim($_POST['about']));
317 $interest = escape_tags(trim($_POST['interest']));
318 $contact = escape_tags(trim($_POST['contact']));
319 $music = escape_tags(trim($_POST['music']));
320 $book = escape_tags(trim($_POST['book']));
321 $tv = escape_tags(trim($_POST['tv']));
322 $film = escape_tags(trim($_POST['film']));
323 $romance = escape_tags(trim($_POST['romance']));
324 $work = escape_tags(trim($_POST['work']));
325 $education = escape_tags(trim($_POST['education']));
327 $hide_friends = (($_POST['hide-friends'] == 1) ? 1: 0);
329 PConfig::set(local_user(), 'system', 'detailled_profile', (($_POST['detailled_profile'] == 1) ? 1: 0));
334 if ($marital != $orig[0]['marital']) {
335 $changes[] = '[color=#ff0000]♥[/color] ' . t('Marital Status');
339 $changes[] = '[color=#ff0000]♥[/color] ' . t('Romantic Partner');
340 $value = strip_tags($with);
342 if ($likes != $orig[0]['likes']) {
343 $changes[] = t('Likes');
346 if ($dislikes != $orig[0]['dislikes']) {
347 $changes[] = t('Dislikes');
350 if ($work != $orig[0]['work']) {
351 $changes[] = t('Work/Employment');
353 if ($religion != $orig[0]['religion']) {
354 $changes[] = t('Religion');
357 if ($politic != $orig[0]['politic']) {
358 $changes[] = t('Political Views');
361 if ($gender != $orig[0]['gender']) {
362 $changes[] = t('Gender');
365 if ($sexual != $orig[0]['sexual']) {
366 $changes[] = t('Sexual Preference');
369 if ($xmpp != $orig[0]['xmpp']) {
370 $changes[] = t('XMPP');
373 if ($homepage != $orig[0]['homepage']) {
374 $changes[] = t('Homepage');
377 if ($interest != $orig[0]['interest']) {
378 $changes[] = t('Interests');
381 if ($address != $orig[0]['address']) {
382 $changes[] = t('Address');
383 // New address not sent in notifications, potential privacy issues
384 // in case this leaks to unintended recipients. Yes, it's in the public
385 // profile but that doesn't mean we have to broadcast it to everybody.
387 if ($locality != $orig[0]['locality'] || $region != $orig[0]['region']
388 || $country_name != $orig[0]['country-name']) {
389 $changes[] = t('Location');
390 $comma1 = ((($locality) && ($region || $country_name)) ? ', ' : ' ');
391 $comma2 = (($region && $country_name) ? ', ' : '');
392 $value = $locality . $comma1 . $region . $comma2 . $country_name;
395 profile_activity($changes,$value);
399 $r = q("UPDATE `profile`
400 SET `profile-name` = '%s',
408 `postal-code` = '%s',
409 `country-name` = '%s',
419 `pub_keywords` = '%s',
420 `prv_keywords` = '%s',
434 WHERE `id` = %d AND `uid` = %d",
435 dbesc($profile_name),
444 dbesc($country_name),
454 dbesc($pub_keywords),
455 dbesc($prv_keywords),
468 intval($hide_friends),
474 info(t('Profile updated.') . EOL);
478 if ($namechanged && $is_default) {
479 $r = q("UPDATE `contact` SET `name` = '%s', `name-date` = '%s' WHERE `self` = 1 AND `uid` = %d",
481 dbesc(datetime_convert()),
484 $r = q("UPDATE `user` set `username` = '%s' where `uid` = %d",
491 $location = formatted_location(array("locality" => $locality, "region" => $region, "country-name" => $country_name));
493 q("UPDATE `contact` SET `about` = '%s', `location` = '%s', `keywords` = '%s', `gender` = '%s' WHERE `self` AND `uid` = %d",
496 dbesc($pub_keywords),
501 // Update global directory in background
502 $url = $_SESSION['my_url'];
503 if ($url && strlen(Config::get('system', 'directory'))) {
504 Worker::add(PRIORITY_LOW, "directory", $url);
507 Worker::add(PRIORITY_LOW, 'profile_update', local_user());
509 // Update the global contact for the user
510 update_gcontact_for_user(local_user());
516 function profile_activity($changed, $value) {
519 if (! local_user() || ! is_array($changed) || ! count($changed)) {
523 if ($a->user['hidewall'] || Config::get('system', 'block_public')) {
527 if (! PConfig::get(local_user(), 'system', 'post_profilechange')) {
531 require_once 'include/items.php';
533 $self = q("SELECT * FROM `contact` WHERE `self` = 1 AND `uid` = %d LIMIT 1",
537 if (! DBM::is_result($self)) {
543 $arr['guid'] = get_guid(32);
544 $arr['uri'] = $arr['parent-uri'] = item_new_uri($a->get_hostname(), local_user());
545 $arr['uid'] = local_user();
546 $arr['contact-id'] = $self[0]['id'];
548 $arr['type'] = 'wall';
551 $arr['author-name'] = $arr['owner-name'] = $self[0]['name'];
552 $arr['author-link'] = $arr['owner-link'] = $self[0]['url'];
553 $arr['author-avatar'] = $arr['owner-avatar'] = $self[0]['thumb'];
554 $arr['verb'] = ACTIVITY_UPDATE;
555 $arr['object-type'] = ACTIVITY_OBJ_PROFILE;
557 $A = '[url=' . $self[0]['url'] . ']' . $self[0]['name'] . '[/url]';
561 $t = count($changed);
563 foreach ($changed as $ch) {
564 if (strlen($changes)) {
565 if ($z == ($t - 1)) {
566 $changes .= t(' and ');
575 $prof = '[url=' . $self[0]['url'] . '?tab=profile' . ']' . t('public profile') . '[/url]';
577 if ($t == 1 && strlen($value)) {
578 $message = sprintf( t('%1$s changed %2$s to “%3$s”'), $A, $changes, $value);
579 $message .= "\n\n" . sprintf( t(' - Visit %1$s\'s %2$s'), $A, $prof);
581 $message = sprintf( t('%1$s has an updated %2$s, changing %3$s.'), $A, $prof, $changes);
585 $arr['body'] = $message;
587 $arr['object'] = '<object><type>' . ACTIVITY_OBJ_PROFILE . '</type><title>' . $self[0]['name'] . '</title>'
588 . '<id>' . $self[0]['url'] . '/' . $self[0]['name'] . '</id>';
589 $arr['object'] .= '<link>' . xmlify('<link rel="alternate" type="text/html" href="' . $self[0]['url'] . '?tab=profile' . '" />' . "\n");
590 $arr['object'] .= xmlify('<link rel="photo" type="image/jpeg" href="' . $self[0]['thumb'] . '" />' . "\n");
591 $arr['object'] .= '</link></object>' . "\n";
592 $arr['last-child'] = 1;
594 $arr['allow_cid'] = $a->user['allow_cid'];
595 $arr['allow_gid'] = $a->user['allow_gid'];
596 $arr['deny_cid'] = $a->user['deny_cid'];
597 $arr['deny_gid'] = $a->user['deny_gid'];
599 $i = item_store($arr);
601 Worker::add(PRIORITY_HIGH, "notifier", "activity", $i);
606 function profiles_content(App $a) {
608 if (! local_user()) {
609 notice( t('Permission denied.') . EOL);
615 if (($a->argc > 1) && (intval($a->argv[1]))) {
616 $r = q("SELECT * FROM `profile` WHERE `id` = %d AND `uid` = %d LIMIT 1",
620 if (! DBM::is_result($r)) {
621 notice( t('Profile not found.') . EOL);
625 require_once 'include/profile_selectors.php';
628 $a->page['htmlhead'] .= replace_macros(get_markup_template('profed_head.tpl'), array(
629 '$baseurl' => System::baseUrl(true),
631 $a->page['end'] .= replace_macros(get_markup_template('profed_end.tpl'), array(
632 '$baseurl' => System::baseUrl(true),
635 $opt_tpl = get_markup_template("profile-hide-friends.tpl");
636 $hide_friends = replace_macros($opt_tpl,array(
638 'hide-friends', //Name
639 t('Hide contacts and friends:'), //Label
640 !!$r[0]['hide-friends'], //Value
642 array(t('No'), t('Yes')) //Off - On strings
644 '$desc' => t('Hide your contact/friend list from viewers of this profile?'),
645 '$yes_str' => t('Yes'),
646 '$no_str' => t('No'),
647 '$yes_selected' => (($r[0]['hide-friends']) ? " checked=\"checked\" " : ""),
648 '$no_selected' => (($r[0]['hide-friends'] == 0) ? " checked=\"checked\" " : "")
651 $personal_account = !(in_array($a->user["page-flags"],
652 array(PAGE_COMMUNITY, PAGE_PRVGROUP)));
654 $detailled_profile = (PConfig::get(local_user(), 'system', 'detailled_profile') AND $personal_account);
656 $f = Config::get('system', 'birthday_input_format');
661 $is_default = (($r[0]['is-default']) ? 1 : 0);
662 $tpl = get_markup_template("profile_edit.tpl");
663 $o .= replace_macros($tpl, array(
664 '$personal_account' => $personal_account,
665 '$detailled_profile' => $detailled_profile,
668 'detailled_profile', //Name
669 t('Show more profile fields:'), //Label
670 $detailled_profile, //Value
672 array(t('No'), t('Yes')) //Off - On strings
675 '$multi_profiles' => feature_enabled(local_user(), 'multi_profiles'),
676 '$form_security_token' => get_form_security_token("profile_edit"),
677 '$form_security_token_photo' => get_form_security_token("profile_photo"),
678 '$profile_clone_link' => ((feature_enabled(local_user(), 'multi_profiles')) ? 'profiles/clone/' . $r[0]['id'] . '?t=' . get_form_security_token("profile_clone") : ""),
679 '$profile_drop_link' => 'profiles/drop/' . $r[0]['id'] . '?t=' . get_form_security_token("profile_drop"),
681 '$profile_action' => t('Profile Actions'),
682 '$banner' => t('Edit Profile Details'),
683 '$submit' => t('Submit'),
684 '$profpic' => t('Change Profile Photo'),
685 '$viewprof' => t('View this profile'),
686 '$editvis' => t('Edit visibility'),
687 '$cr_prof' => t('Create a new profile using these settings'),
688 '$cl_prof' => t('Clone this profile'),
689 '$del_prof' => t('Delete this profile'),
691 '$lbl_basic_section' => t('Basic information'),
692 '$lbl_picture_section' => t('Profile picture'),
693 '$lbl_location_section' => t('Location'),
694 '$lbl_preferences_section' => t('Preferences'),
695 '$lbl_status_section' => t('Status information'),
696 '$lbl_about_section' => t('Additional information'),
697 '$lbl_interests_section' => t('Interests'),
698 '$lbl_personal_section' => t('Personal'),
699 '$lbl_relation_section' => t('Relation'),
700 '$lbl_miscellaneous_section' => t('Miscellaneous'),
702 '$lbl_profile_photo' => t('Upload Profile Photo'),
703 '$lbl_gender' => t('Your Gender:'),
704 '$lbl_marital' => t('<span class="heart">♥</span> Marital Status:'),
705 '$lbl_sexual' => t('Sexual Preference:'),
706 '$lbl_ex2' => t('Example: fishing photography software'),
708 '$disabled' => (($is_default) ? 'onclick="return false;" style="color: #BBBBFF;"' : ''),
709 '$baseurl' => System::baseUrl(true),
710 '$profile_id' => $r[0]['id'],
711 '$profile_name' => array('profile_name', t('Profile Name:'), $r[0]['profile-name'], t('Required'), '*'),
712 '$is_default' => $is_default,
713 '$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>' : ""),
714 '$name' => array('name', t('Your Full Name:'), $r[0]['name']),
715 '$pdesc' => array('pdesc', t('Title/Description:'), $r[0]['pdesc']),
716 '$dob' => dob($r[0]['dob']),
717 '$hide_friends' => $hide_friends,
718 '$address' => array('address', t('Street Address:'), $r[0]['address']),
719 '$locality' => array('locality', t('Locality/City:'), $r[0]['locality']),
720 '$region' => array('region', t('Region/State:'), $r[0]['region']),
721 '$postal_code' => array('postal_code', t('Postal/Zip Code:'), $r[0]['postal-code']),
722 '$country_name' => array('country_name', t('Country:'), $r[0]['country-name']),
723 '$age' => ((intval($r[0]['dob'])) ? '(' . t('Age: ') . age($r[0]['dob'],$a->user['timezone'],$a->user['timezone']) . ')' : ''),
724 '$gender' => gender_selector($r[0]['gender']),
725 '$marital' => marital_selector($r[0]['marital']),
726 '$with' => array('with', t("Who: \x28if applicable\x29"), strip_tags($r[0]['with']), t('Examples: cathy123, Cathy Williams, cathy@example.com')),
727 '$howlong' => array('howlong', t('Since [date]:'), ($r[0]['howlong'] <= NULL_DATE ? '' : datetime_convert('UTC',date_default_timezone_get(),$r[0]['howlong']))),
728 '$sexual' => sexpref_selector($r[0]['sexual']),
729 '$about' => array('about', t('Tell us about yourself...'), $r[0]['about']),
730 '$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.")),
731 '$homepage' => array('homepage', t('Homepage URL:'), $r[0]['homepage']),
732 '$hometown' => array('hometown', t('Hometown:'), $r[0]['hometown']),
733 '$politic' => array('politic', t('Political Views:'), $r[0]['politic']),
734 '$religion' => array('religion', t('Religious Views:'), $r[0]['religion']),
735 '$pub_keywords' => array('pub_keywords', t('Public Keywords:'), $r[0]['pub_keywords'], t("\x28Used for suggesting potential friends, can be seen by others\x29")),
736 '$prv_keywords' => array('prv_keywords', t('Private Keywords:'), $r[0]['prv_keywords'], t("\x28Used for searching profiles, never shown to others\x29")),
737 '$likes' => array('likes', t('Likes:'), $r[0]['likes']),
738 '$dislikes' => array('dislikes', t('Dislikes:'), $r[0]['dislikes']),
739 '$music' => array('music', t('Musical interests'), $r[0]['music']),
740 '$book' => array('book', t('Books, literature'), $r[0]['book']),
741 '$tv' => array('tv', t('Television'), $r[0]['tv']),
742 '$film' => array('film', t('Film/dance/culture/entertainment'), $r[0]['film']),
743 '$interest' => array('interest', t('Hobbies/Interests'), $r[0]['interest']),
744 '$romance' => array('romance', t('Love/romance'), $r[0]['romance']),
745 '$work' => array('work', t('Work/employment'), $r[0]['work']),
746 '$education' => array('education', t('School/education'), $r[0]['education']),
747 '$contact' => array('contact', t('Contact information and Social Networks'), $r[0]['contact']),
750 $arr = array('profile' => $r[0], 'entry' => $o);
751 call_hooks('profile_edit', $arr);
756 // If we don't support multi profiles, don't display this list.
757 if (!feature_enabled(local_user(), 'multi_profiles')) {
758 $r = q("SELECT * FROM `profile` WHERE `uid` = %d AND `is-default`=1",
761 if (DBM::is_result($r)) {
762 //Go to the default profile.
763 goaway('profiles/' . $r[0]['id']);
767 $r = q("SELECT * FROM `profile` WHERE `uid` = %d",
770 if (DBM::is_result($r)) {
772 $tpl = get_markup_template('profile_entry.tpl');
775 foreach ($r as $rr) {
776 $profiles .= replace_macros($tpl, array(
777 '$photo' => $a->remove_baseurl($rr['thumb']),
779 '$alt' => t('Profile Image'),
780 '$profile_name' => $rr['profile-name'],
781 '$visible' => (($rr['is-default']) ? '<strong>' . t('visible to everybody') . '</strong>'
782 : '<a href="'.'profperm/'.$rr['id'].'" />' . t('Edit visibility') . '</a>')
786 $tpl_header = get_markup_template('profile_listing_header.tpl');
787 $o .= replace_macros($tpl_header,array(
788 '$header' => t('Edit/Manage Profiles'),
789 '$chg_photo' => t('Change profile photo'),
790 '$cr_new' => t('Create New Profile'),
791 '$cr_new_link' => 'profiles/new?t=' . get_form_security_token("profile_new"),
792 '$profiles' => $profiles