2 require_once("include/Contact.php");
4 if(! function_exists('profiles_init')) {
5 function profiles_init(&$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",
19 notice( t('Profile not found.') . EOL);
20 goaway($a->get_baseurl(true) . '/profiles');
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",
38 info( t('Profile deleted.') . EOL);
40 goaway($a->get_baseurl(true) . '/profiles');
48 if(($a->argc > 1) && ($a->argv[1] === 'new')) {
50 check_form_security_token_redirectOnErr('/profiles', 'profile_new', 't');
52 $r0 = q("SELECT `id` FROM `profile` WHERE `uid` = %d",
53 intval(local_user()));
54 $num_profiles = count($r0);
56 $name = t('Profile-') . ($num_profiles + 1);
58 $r1 = q("SELECT `name`, `photo`, `thumb` FROM `profile` WHERE `uid` = %d AND `is-default` = 1 LIMIT 1",
59 intval(local_user()));
61 $r2 = q("INSERT INTO `profile` (`uid` , `profile-name` , `name`, `photo`, `thumb`)
62 VALUES ( %d, '%s', '%s', '%s', '%s' )",
65 dbesc($r1[0]['name']),
66 dbesc($r1[0]['photo']),
67 dbesc($r1[0]['thumb'])
70 $r3 = q("SELECT `id` FROM `profile` WHERE `uid` = %d AND `profile-name` = '%s' LIMIT 1",
75 info( t('New profile created.') . EOL);
77 goaway($a->get_baseurl(true) . '/profiles/' . $r3[0]['id']);
79 goaway($a->get_baseurl(true) . '/profiles');
82 if(($a->argc > 2) && ($a->argv[1] === 'clone')) {
84 check_form_security_token_redirectOnErr('/profiles', 'profile_clone', 't');
86 $r0 = q("SELECT `id` FROM `profile` WHERE `uid` = %d",
87 intval(local_user()));
88 $num_profiles = count($r0);
90 $name = t('Profile-') . ($num_profiles + 1);
91 $r1 = q("SELECT * FROM `profile` WHERE `uid` = %d AND `id` = %d LIMIT 1",
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);
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);
120 goaway($a->get_baseurl(true) . '/profiles/' . $r3[0]['id']);
122 goaway($a->get_baseurl(true) . '/profiles');
124 return; // NOTREACHED
128 if(($a->argc > 1) && (intval($a->argv[1]))) {
129 $r = q("SELECT id FROM `profile` WHERE `id` = %d AND `uid` = %d LIMIT 1",
134 notice( t('Profile not found.') . EOL);
139 profile_load($a,$a->user['nickname'],$r[0]['id']);
146 if(! function_exists('profile_clean_keywords')) {
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, "#");
156 $cleaned[] = $keyword;
159 $keywords = implode(", ", $cleaned);
165 if(! function_exists('profiles_post')) {
166 function profiles_post(&$a) {
169 notice( t('Permission denied.') . EOL);
173 $namechanged = false;
175 call_hooks('profile_post', $_POST);
177 if(($a->argc > 1) && ($a->argv[1] !== "new") && intval($a->argv[1])) {
178 $orig = q("SELECT * FROM `profile` WHERE `id` = %d AND `uid` = %d LIMIT 1",
183 notice( t('Profile not found.') . EOL);
187 check_form_security_token_redirectOnErr('/profiles', 'profile_edit');
189 $is_default = (($orig[0]['is-default']) ? 1 : 0);
191 $profile_name = notags(trim($_POST['profile_name']));
192 if(! strlen($profile_name)) {
193 notice( t('Profile Name is required.') . EOL);
197 $dob = $_POST['dob'] ? escape_tags(trim($_POST['dob'])) : '0000-00-00'; // FIXME: Needs to be validated?
199 $y = substr($dob,0,4);
200 if((! ctype_digit($y)) || ($y < 1900))
203 $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'));
211 $dob = '0000-' . $dob;
214 $name = notags(trim($_POST['name']));
216 if(! strlen($name)) {
220 if($orig[0]['name'] != $name)
225 $pdesc = notags(trim($_POST['pdesc']));
226 $gender = notags(trim($_POST['gender']));
227 $address = notags(trim($_POST['address']));
228 $locality = notags(trim($_POST['locality']));
229 $region = notags(trim($_POST['region']));
230 $postal_code = notags(trim($_POST['postal_code']));
231 $country_name = notags(trim($_POST['country_name']));
232 $pub_keywords = profile_clean_keywords(notags(trim($_POST['pub_keywords'])));
233 $prv_keywords = profile_clean_keywords(notags(trim($_POST['prv_keywords'])));
234 $marital = notags(trim($_POST['marital']));
235 $howlong = notags(trim($_POST['howlong']));
237 $with = ((x($_POST,'with')) ? notags(trim($_POST['with'])) : '');
239 if(! strlen($howlong))
240 $howlong = '0000-00-00 00:00:00';
242 $howlong = datetime_convert(date_default_timezone_get(),'UTC',$howlong);
244 // linkify the relationship target if applicable
246 $withchanged = false;
249 if($with != strip_tags($orig[0]['with'])) {
253 if(strpos($lookup,'@') === 0)
254 $lookup = substr($lookup,1);
255 $lookup = str_replace('_',' ', $lookup);
256 if(strpos($lookup,'@') || (strpos($lookup,'http://'))) {
258 $links = @lrdd($lookup);
260 foreach($links as $link) {
261 if($link['@attributes']['rel'] === 'http://webfinger.net/rel/profile-page') {
262 $prf = $link['@attributes']['href'];
269 /* if(strstr($lookup,' ')) {
270 $r = q("SELECT * FROM `contact` WHERE `name` = '%s' AND `uid` = %d LIMIT 1",
276 $r = q("SELECT * FROM `contact` WHERE `nick` = '%s' AND `uid` = %d LIMIT 1",
282 $r = q("SELECT * FROM `contact` WHERE `name` = '%s' AND `uid` = %d LIMIT 1",
287 $r = q("SELECT * FROM `contact` WHERE `nick` = '%s' AND `uid` = %d LIMIT 1",
294 $newname = $r[0]['name'];
299 $with = str_replace($lookup,'<a href="' . $prf . '">' . $newname . '</a>', $with);
300 if(strpos($with,'@') === 0)
301 $with = substr($with,1);
305 $with = $orig[0]['with'];
308 $sexual = notags(trim($_POST['sexual']));
309 $homepage = notags(trim($_POST['homepage']));
310 if ((strpos($homepage, 'http') !== 0) && (strlen($homepage))) {
311 // neither http nor https in URL, add them
312 $homepage = 'http://'.$homepage;
314 $hometown = notags(trim($_POST['hometown']));
315 $politic = notags(trim($_POST['politic']));
316 $religion = notags(trim($_POST['religion']));
318 $likes = fix_mce_lf(escape_tags(trim($_POST['likes'])));
319 $dislikes = fix_mce_lf(escape_tags(trim($_POST['dislikes'])));
321 $about = fix_mce_lf(escape_tags(trim($_POST['about'])));
322 $interest = fix_mce_lf(escape_tags(trim($_POST['interest'])));
323 $contact = fix_mce_lf(escape_tags(trim($_POST['contact'])));
324 $music = fix_mce_lf(escape_tags(trim($_POST['music'])));
325 $book = fix_mce_lf(escape_tags(trim($_POST['book'])));
326 $tv = fix_mce_lf(escape_tags(trim($_POST['tv'])));
327 $film = fix_mce_lf(escape_tags(trim($_POST['film'])));
328 $romance = fix_mce_lf(escape_tags(trim($_POST['romance'])));
329 $work = fix_mce_lf(escape_tags(trim($_POST['work'])));
330 $education = fix_mce_lf(escape_tags(trim($_POST['education'])));
332 $hide_friends = (($_POST['hide-friends'] == 1) ? 1: 0);
334 set_pconfig(local_user(),'system','detailled_profile', (($_POST['detailled_profile'] == 1) ? 1: 0));
339 if($marital != $orig[0]['marital']) {
340 $changes[] = '[color=#ff0000]♥[/color] ' . t('Marital Status');
344 $changes[] = '[color=#ff0000]♥[/color] ' . t('Romantic Partner');
345 $value = strip_tags($with);
347 if($likes != $orig[0]['likes']) {
348 $changes[] = t('Likes');
351 if($dislikes != $orig[0]['dislikes']) {
352 $changes[] = t('Dislikes');
355 if($work != $orig[0]['work']) {
356 $changes[] = t('Work/Employment');
358 if($religion != $orig[0]['religion']) {
359 $changes[] = t('Religion');
362 if($politic != $orig[0]['politic']) {
363 $changes[] = t('Political Views');
366 if($gender != $orig[0]['gender']) {
367 $changes[] = t('Gender');
370 if($sexual != $orig[0]['sexual']) {
371 $changes[] = t('Sexual Preference');
374 if($homepage != $orig[0]['homepage']) {
375 $changes[] = t('Homepage');
378 if($interest != $orig[0]['interest']) {
379 $changes[] = t('Interests');
382 if($address != $orig[0]['address']) {
383 $changes[] = t('Address');
384 // New address not sent in notifications, potential privacy issues
385 // in case this leaks to unintended recipients. Yes, it's in the public
386 // profile but that doesn't mean we have to broadcast it to everybody.
388 if($locality != $orig[0]['locality'] || $region != $orig[0]['region']
389 || $country_name != $orig[0]['country-name']) {
390 $changes[] = t('Location');
391 $comma1 = ((($locality) && ($region || $country_name)) ? ', ' : ' ');
392 $comma2 = (($region && $country_name) ? ', ' : '');
393 $value = $locality . $comma1 . $region . $comma2 . $country_name;
396 profile_activity($changes,$value);
400 $r = q("UPDATE `profile`
401 SET `profile-name` = '%s',
409 `postal-code` = '%s',
410 `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),
453 dbesc($pub_keywords),
454 dbesc($prv_keywords),
467 intval($hide_friends),
473 info( t('Profile updated.') . EOL);
476 if($namechanged && $is_default) {
477 $r = q("UPDATE `contact` SET `name` = '%s', `name-date` = '%s' WHERE `self` = 1 AND `uid` = %d",
479 dbesc(datetime_convert()),
482 $r = q("UPDATE `user` set `username` = '%s' where `uid` = %d",
489 $location = formatted_location(array("locality" => $locality, "region" => $region, "country-name" => $country_name));
491 $r = q("UPDATE `contact` SET `about` = '%s', `location` = '%s', `keywords` = '%s', `gender` = '%s' WHERE `self` = 1 AND `uid` = %d",
494 dbesc($pub_keywords),
499 // Update global directory in background
500 $url = $_SESSION['my_url'];
501 if($url && strlen(get_config('system','directory')))
502 proc_run('php',"include/directory.php","$url");
504 require_once('include/profile_update.php');
511 if(! function_exists('profile_activity')) {
512 function profile_activity($changed, $value) {
515 if(! local_user() || ! is_array($changed) || ! count($changed))
518 if($a->user['hidewall'] || get_config('system','block_public'))
521 if(! get_pconfig(local_user(),'system','post_profilechange'))
524 require_once('include/items.php');
526 $self = q("SELECT * FROM `contact` WHERE `self` = 1 AND `uid` = %d LIMIT 1",
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);
591 // give it a permanent link
592 //q("update item set plink = '%s' where id = %d",
593 // dbesc($a->get_baseurl() . '/display/' . $a->user['nickname'] . '/' . $i),
597 proc_run('php',"include/notifier.php","activity","$i");
603 if(! function_exists('profiles_content')) {
604 function profiles_content(&$a) {
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",
619 notice( t('Profile not found.') . EOL);
623 require_once('include/profile_selectors.php');
626 /* $editselect = 'textareas';
627 if( intval(get_pconfig(local_user(),'system','plaintext')) || !feature_enabled(local_user(),'richtext') )
628 $editselect = 'none';*/
629 $editselect = 'none';
630 if( feature_enabled(local_user(),'richtext') )
631 $editselect = 'textareas';
633 $a->page['htmlhead'] .= replace_macros(get_markup_template('profed_head.tpl'), array(
634 '$baseurl' => $a->get_baseurl(true),
635 '$editselect' => $editselect,
637 $a->page['end'] .= replace_macros(get_markup_template('profed_end.tpl'), array(
638 '$baseurl' => $a->get_baseurl(true),
639 '$editselect' => $editselect,
643 $opt_tpl = get_markup_template("profile-hide-friends.tpl");
644 $hide_friends = replace_macros($opt_tpl,array(
646 'hide-friends', //Name
647 t('Hide contacts and friends:'), //Label
648 !!$r[0]['hide-friends'], //Value
650 array(t('No'),t('Yes')) //Off - On strings
652 '$desc' => t('Hide your contact/friend list from viewers of this profile?'),
653 '$yes_str' => t('Yes'),
654 '$no_str' => t('No'),
655 '$yes_selected' => (($r[0]['hide-friends']) ? " checked=\"checked\" " : ""),
656 '$no_selected' => (($r[0]['hide-friends'] == 0) ? " checked=\"checked\" " : "")
659 $personal_account = !(in_array($a->user["page-flags"],
660 array(PAGE_COMMUNITY, PAGE_PRVGROUP)));
662 $detailled_profile = (get_pconfig(local_user(),'system','detailled_profile') AND $personal_account);
664 $f = get_config('system','birthday_input_format');
668 $is_default = (($r[0]['is-default']) ? 1 : 0);
669 $tpl = get_markup_template("profile_edit.tpl");
670 $o .= replace_macros($tpl,array(
671 '$personal_account' => $personal_account,
672 '$detailled_profile' => $detailled_profile,
675 'detailled_profile', //Name
676 t('Show more profile fields:'), //Label
677 $detailled_profile, //Value
679 array(t('No'),t('Yes')) //Off - On strings
682 '$multi_profiles' => feature_enabled(local_user(),'multi_profiles'),
683 '$form_security_token' => get_form_security_token("profile_edit"),
684 '$form_security_token_photo' => get_form_security_token("profile_photo"),
685 '$profile_clone_link' => 'profiles/clone/' . $r[0]['id'] . '?t=' . get_form_security_token("profile_clone"),
686 '$profile_drop_link' => 'profiles/drop/' . $r[0]['id'] . '?t=' . get_form_security_token("profile_drop"),
687 '$banner' => t('Edit Profile Details'),
688 '$submit' => t('Submit'),
689 '$profpic' => t('Change Profile Photo'),
690 '$viewprof' => t('View this profile'),
691 '$cr_prof' => t('Create a new profile using these settings'),
692 '$cl_prof' => t('Clone this profile'),
693 '$del_prof' => t('Delete this profile'),
694 '$lbl_basic_section' => t('Basic information'),
695 '$lbl_picture_section' => t('Profile picture'),
696 '$lbl_location_section' => t('Location'),
697 '$lbl_preferences_section' => t('Preferences'),
698 '$lbl_status_section' => t('Status information'),
699 '$lbl_about_section' => t('Additional information'),
700 '$lbl_interests_section' => t('Interests'),
701 '$lbl_profile_photo' => t('Upload Profile Photo'),
702 '$lbl_profname' => t('Profile Name:'),
703 '$lbl_fullname' => t('Your Full Name:'),
704 '$lbl_title' => t('Title/Description:'),
705 '$lbl_gender' => t('Your Gender:'),
706 '$lbl_bd' => t("Birthday :"),
707 '$lbl_address' => t('Street Address:'),
708 '$lbl_city' => t('Locality/City:'),
709 '$lbl_zip' => t('Postal/Zip Code:'),
710 '$lbl_country' => t('Country:'),
711 '$lbl_region' => t('Region/State:'),
712 '$lbl_marital' => t('<span class="heart">♥</span> Marital Status:'),
713 '$lbl_with' => t("Who: \x28if applicable\x29"),
714 '$lbl_ex1' => t('Examples: cathy123, Cathy Williams, cathy@example.com'),
715 '$lbl_howlong' => t('Since [date]:'),
716 '$lbl_sexual' => t('Sexual Preference:'),
717 '$lbl_homepage' => t('Homepage URL:'),
718 '$lbl_hometown' => t('Hometown:'),
719 '$lbl_politic' => t('Political Views:'),
720 '$lbl_religion' => t('Religious Views:'),
721 '$lbl_pubkey' => t('Public Keywords:'),
722 '$lbl_prvkey' => t('Private Keywords:'),
723 '$lbl_likes' => t('Likes:'),
724 '$lbl_dislikes' => t('Dislikes:'),
725 '$lbl_ex2' => t('Example: fishing photography software'),
726 '$lbl_pubdsc' => t("\x28Used for suggesting potential friends, can be seen by others\x29"),
727 '$lbl_prvdsc' => t("\x28Used for searching profiles, never shown to others\x29"),
728 '$lbl_about' => t('Tell us about yourself...'),
729 '$lbl_hobbies' => t('Hobbies/Interests'),
730 '$lbl_social' => t('Contact information and Social Networks'),
731 '$lbl_music' => t('Musical interests'),
732 '$lbl_book' => t('Books, literature'),
733 '$lbl_tv' => t('Television'),
734 '$lbl_film' => t('Film/dance/culture/entertainment'),
735 '$lbl_love' => t('Love/romance'),
736 '$lbl_work' => t('Work/employment'),
737 '$lbl_school' => t('School/education'),
738 '$disabled' => (($is_default) ? 'onclick="return false;" style="color: #BBBBFF;"' : ''),
739 '$baseurl' => $a->get_baseurl(true),
740 '$profile_id' => $r[0]['id'],
741 '$profile_name' => $r[0]['profile-name'],
742 '$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>' : ""),
743 '$name' => $r[0]['name'],
744 '$pdesc' => $r[0]['pdesc'],
745 '$dob' => dob($r[0]['dob']),
746 '$hide_friends' => $hide_friends,
747 '$address' => $r[0]['address'],
748 '$locality' => $r[0]['locality'],
749 '$region' => $r[0]['region'],
750 '$postal_code' => $r[0]['postal-code'],
751 '$country_name' => $r[0]['country-name'],
752 '$age' => ((intval($r[0]['dob'])) ? '(' . t('Age: ') . age($r[0]['dob'],$a->user['timezone'],$a->user['timezone']) . ')' : ''),
753 '$gender' => gender_selector($r[0]['gender']),
754 '$marital' => marital_selector($r[0]['marital']),
755 '$with' => strip_tags($r[0]['with']),
756 '$howlong' => ($r[0]['howlong'] === '0000-00-00 00:00:00' ? '' : datetime_convert('UTC',date_default_timezone_get(),$r[0]['howlong'])),
757 '$sexual' => sexpref_selector($r[0]['sexual']),
758 '$about' => $r[0]['about'],
759 '$homepage' => $r[0]['homepage'],
760 '$hometown' => $r[0]['hometown'],
761 '$politic' => $r[0]['politic'],
762 '$religion' => $r[0]['religion'],
763 '$pub_keywords' => $r[0]['pub_keywords'],
764 '$prv_keywords' => $r[0]['prv_keywords'],
765 '$likes' => $r[0]['likes'],
766 '$dislikes' => $r[0]['dislikes'],
767 '$music' => $r[0]['music'],
768 '$book' => $r[0]['book'],
769 '$tv' => $r[0]['tv'],
770 '$film' => $r[0]['film'],
771 '$interest' => $r[0]['interest'],
772 '$romance' => $r[0]['romance'],
773 '$work' => $r[0]['work'],
774 '$education' => $r[0]['education'],
775 '$contact' => $r[0]['contact']
778 $arr = array('profile' => $r[0], 'entry' => $o);
779 call_hooks('profile_edit', $arr);
787 //If we don't support multi profiles, don't display this list.
788 if(!feature_enabled(local_user(),'multi_profiles')){
790 "SELECT * FROM `profile` WHERE `uid` = %d AND `is-default`=1",
794 //Go to the default profile.
795 goaway($a->get_baseurl(true) . '/profiles/'.$r[0]['id']);
799 $r = q("SELECT * FROM `profile` WHERE `uid` = %d",
803 $tpl_header = get_markup_template('profile_listing_header.tpl');
804 $o .= replace_macros($tpl_header,array(
805 '$header' => t('Edit/Manage Profiles'),
806 '$chg_photo' => t('Change profile photo'),
807 '$cr_new' => t('Create New Profile'),
808 '$cr_new_link' => 'profiles/new?t=' . get_form_security_token("profile_new")
812 $tpl = get_markup_template('profile_entry.tpl');
815 $o .= replace_macros($tpl, array(
816 '$photo' => $a->get_cached_avatar_image($rr['thumb']),
818 '$alt' => t('Profile Image'),
819 '$profile_name' => $rr['profile-name'],
820 '$visible' => (($rr['is-default']) ? '<strong>' . t('visible to everybody') . '</strong>'
821 : '<a href="' . $a->get_baseurl(true) . '/profperm/' . $rr['id'] . '" />' . t('Edit visibility') . '</a>')