From edf6da7189b69e05128ae6c433b9744f6a09b28f Mon Sep 17 00:00:00 2001 From: Mario Vavti Date: Fri, 4 Mar 2016 15:44:33 +0100 Subject: add cover photo upload link to edit profile --- mod/profiles.php | 1 + 1 file changed, 1 insertion(+) (limited to 'mod/profiles.php') diff --git a/mod/profiles.php b/mod/profiles.php index 282d741ac..3ae1390df 100644 --- a/mod/profiles.php +++ b/mod/profiles.php @@ -675,6 +675,7 @@ function profiles_content(&$a) { '$submit' => t('Submit'), '$viewprof' => t('View this profile'), '$editvis' => t('Edit visibility'), + '$coverpic' => t('Change Cover Photo'), '$profpic' => t('Change Profile Photo'), '$cr_prof' => t('Create a new profile using these settings'), '$cl_prof' => t('Clone this profile'), -- cgit v1.2.3 From 848c0389704ab14aeecc77a5b8bd5d9e7ec4ad06 Mon Sep 17 00:00:00 2001 From: redmatrix Date: Mon, 7 Mar 2016 16:54:58 -0800 Subject: issue #313 --- mod/profiles.php | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) (limited to 'mod/profiles.php') diff --git a/mod/profiles.php b/mod/profiles.php index 3ae1390df..fe45f1b92 100644 --- a/mod/profiles.php +++ b/mod/profiles.php @@ -272,9 +272,17 @@ function profiles_post(&$a) { $name = escape_tags(trim($_POST['name'])); - if($orig[0]['name'] != $name) + if($orig[0]['name'] != $name) { $namechanged = true; + $v = validate_channelname($name); + if($v) { + $notice($v); + $namechanged = false; + $name = $orig[0]['name']; + } + } + $pdesc = escape_tags(trim($_POST['pdesc'])); $gender = escape_tags(trim($_POST['gender'])); $address = escape_tags(trim($_POST['address'])); @@ -563,6 +571,10 @@ function profiles_post(&$a) { dbesc(datetime_convert()), dbesc($channel['xchan_hash']) ); + $r = q("UPDATE channel SET channel_name = '%s' WHERE channel_hash = '%s'", + dbesc($name), + dbesc($channel['xchan_hash']) + ); } if($is_default) { -- cgit v1.2.3 From 32e903e9560b3a6d1b133524493c3d72f384164c Mon Sep 17 00:00:00 2001 From: redmatrix Date: Mon, 7 Mar 2016 18:49:17 -0800 Subject: a bit of page cleanup for edit profiles --- mod/profiles.php | 42 +++++++++++++++++++++--------------------- 1 file changed, 21 insertions(+), 21 deletions(-) (limited to 'mod/profiles.php') diff --git a/mod/profiles.php b/mod/profiles.php index fe45f1b92..57d3561b1 100644 --- a/mod/profiles.php +++ b/mod/profiles.php @@ -695,28 +695,28 @@ function profiles_content(&$a) { '$exportable' => feature_enabled(local_channel(),'profile_export'), '$lbl_import' => t('Import profile from file'), '$lbl_export' => t('Export profile to file'), - '$lbl_profname' => t('Profile Name:'), - '$lbl_fullname' => t('Your Full Name:'), - '$lbl_title' => t('Title/Description:'), - '$lbl_gender' => t('Your Gender:'), - '$lbl_bd' => t("Birthday :"), - '$lbl_address' => t('Street Address:'), - '$lbl_city' => t('Locality/City:'), - '$lbl_zip' => t('Postal/Zip Code:'), - '$lbl_country' => t('Country:'), - '$lbl_region' => t('Region/State:'), - '$lbl_marital' => t(' Marital Status:'), - '$lbl_with' => t("Who: \x28if applicable\x29"), + '$lbl_profname' => t('Profile Name'), + '$lbl_fullname' => t('Your Full Name'), + '$lbl_title' => t('Title/Description'), + '$lbl_gender' => t('Your Gender'), + '$lbl_bd' => t("Birthday"), + '$lbl_address' => t('Street Address'), + '$lbl_city' => t('Locality/City'), + '$lbl_zip' => t('Postal/Zip Code'), + '$lbl_country' => t('Country'), + '$lbl_region' => t('Region/State'), + '$lbl_marital' => t(' Marital Status'), + '$lbl_with' => t("Who (if applicable)"), '$lbl_ex1' => t('Examples: cathy123, Cathy Williams, cathy@example.com'), - '$lbl_howlong' => t('Since [date]:'), - '$lbl_sexual' => t('Sexual Preference:'), - '$lbl_homepage' => t('Homepage URL:'), - '$lbl_hometown' => t('Hometown:'), - '$lbl_politic' => t('Political Views:'), - '$lbl_religion' => t('Religious Views:'), - '$lbl_pubkey' => t('Keywords:'), - '$lbl_likes' => t('Likes:'), - '$lbl_dislikes' => t('Dislikes:'), + '$lbl_howlong' => t('Since [date]'), + '$lbl_sexual' => t('Sexual Preference'), + '$lbl_homepage' => t('Homepage URL'), + '$lbl_hometown' => t('Hometown'), + '$lbl_politic' => t('Political Views'), + '$lbl_religion' => t('Religious Views'), + '$lbl_pubkey' => t('Keywords'), + '$lbl_likes' => t('Likes'), + '$lbl_dislikes' => t('Dislikes'), '$lbl_ex2' => t('Example: fishing photography software'), '$lbl_pubdsc' => t("Used in directory listings"), '$lbl_about' => t('Tell us about yourself...'), -- cgit v1.2.3 From 2d8deb60826a12b5bbe6ac1a8c123796c201d6fd Mon Sep 17 00:00:00 2001 From: Mario Vavti Date: Sat, 12 Mar 2016 22:13:46 +0100 Subject: some janitor work on profiles --- mod/profiles.php | 29 ++++++++++++----------------- 1 file changed, 12 insertions(+), 17 deletions(-) (limited to 'mod/profiles.php') diff --git a/mod/profiles.php b/mod/profiles.php index 57d3561b1..f6d75bb7e 100644 --- a/mod/profiles.php +++ b/mod/profiles.php @@ -639,14 +639,13 @@ function profiles_content(&$a) { else $fields = $profile_fields_basic; - - $opt_tpl = get_markup_template("profile_hide_friends.tpl"); - $hide_friends = replace_macros($opt_tpl,array('$field' => array( - 'hide_friends', - t('Hide your contact/friend list from viewers of this profile?'), - $r[0]['hide_friends'], - '', - ))); + $hide_friends = array( + 'hide_friends', + t('Hide your contact/friend list from viewers of this profile?'), + $r[0]['hide_friends'], + '', + array(t('No'),t('Yes')) + ); $q = q("select * from profdef where true"); if($q) { @@ -672,6 +671,7 @@ function profiles_content(&$a) { $f = 'ymd'; $is_default = (($r[0]['is_default']) ? 1 : 0); + $tpl = get_markup_template("profile_edit.tpl"); $o .= replace_macros($tpl,array( @@ -695,11 +695,7 @@ function profiles_content(&$a) { '$exportable' => feature_enabled(local_channel(),'profile_export'), '$lbl_import' => t('Import profile from file'), '$lbl_export' => t('Export profile to file'), - '$lbl_profname' => t('Profile Name'), - '$lbl_fullname' => t('Your Full Name'), - '$lbl_title' => t('Title/Description'), '$lbl_gender' => t('Your Gender'), - '$lbl_bd' => t("Birthday"), '$lbl_address' => t('Street Address'), '$lbl_city' => t('Locality/City'), '$lbl_zip' => t('Postal/Zip Code'), @@ -733,12 +729,12 @@ function profiles_content(&$a) { '$disabled' => (($is_default) ? 'onclick="return false;" style="color: #BBBBFF;"' : ''), '$baseurl' => $a->get_baseurl(true), '$profile_id' => $r[0]['id'], - '$profile_name' => $r[0]['profile_name'], + '$profile_name' => array('profile_name', t('Profile Name'), $r[0]['profile_name'], '', '*'), '$is_default' => $is_default, '$default' => t('This is your default profile.') . EOL . translate_scope(map_scope($channel['channel_r_profile'])), '$advanced' => $advanced, - '$name' => $r[0]['name'], - '$pdesc' => $r[0]['pdesc'], + '$name' => array('name', t('Your Full Name'), $r[0]['name']), + '$pdesc' => array('pdesc', t('Title/Description'), $r[0]['pdesc']), '$dob' => dob($r[0]['dob']), '$hide_friends' => $hide_friends, '$address' => $r[0]['address'], @@ -746,9 +742,8 @@ function profiles_content(&$a) { '$region' => $r[0]['region'], '$postal_code' => $r[0]['postal_code'], '$country_name' => $r[0]['country_name'], - '$age' => ((intval($r[0]['dob'])) ? '(' . t('Age: ') . age($r[0]['dob'],$a->user['timezone'],$a->user['timezone']) . ')' : ''), '$gender' => gender_selector($r[0]['gender']), - '$gender_min' => gender_selector_min($r[0]['gender']), + '$gender_min' => gender_selector_min($r[0]['gender']), '$marital' => marital_selector($r[0]['marital']), '$marital_min' => marital_selector_min($r[0]['marital']), '$with' => $r[0]['with'], -- cgit v1.2.3 From 370a007ee215d2889d9bf760b0247678c08d31ac Mon Sep 17 00:00:00 2001 From: Mario Vavti Date: Sun, 13 Mar 2016 21:19:15 +0100 Subject: more janitor work on profiles --- mod/profiles.php | 24 +++++++++--------------- 1 file changed, 9 insertions(+), 15 deletions(-) (limited to 'mod/profiles.php') diff --git a/mod/profiles.php b/mod/profiles.php index f6d75bb7e..209a7a32d 100644 --- a/mod/profiles.php +++ b/mod/profiles.php @@ -641,7 +641,7 @@ function profiles_content(&$a) { $hide_friends = array( 'hide_friends', - t('Hide your contact/friend list from viewers of this profile?'), + t('Hide your connections list from viewers of this profile'), $r[0]['hide_friends'], '', array(t('No'),t('Yes')) @@ -696,18 +696,12 @@ function profiles_content(&$a) { '$lbl_import' => t('Import profile from file'), '$lbl_export' => t('Export profile to file'), '$lbl_gender' => t('Your Gender'), - '$lbl_address' => t('Street Address'), - '$lbl_city' => t('Locality/City'), - '$lbl_zip' => t('Postal/Zip Code'), - '$lbl_country' => t('Country'), - '$lbl_region' => t('Region/State'), '$lbl_marital' => t(' Marital Status'), '$lbl_with' => t("Who (if applicable)"), '$lbl_ex1' => t('Examples: cathy123, Cathy Williams, cathy@example.com'), '$lbl_howlong' => t('Since [date]'), '$lbl_sexual' => t('Sexual Preference'), '$lbl_homepage' => t('Homepage URL'), - '$lbl_hometown' => t('Hometown'), '$lbl_politic' => t('Political Views'), '$lbl_religion' => t('Religious Views'), '$lbl_pubkey' => t('Keywords'), @@ -737,22 +731,22 @@ function profiles_content(&$a) { '$pdesc' => array('pdesc', t('Title/Description'), $r[0]['pdesc']), '$dob' => dob($r[0]['dob']), '$hide_friends' => $hide_friends, - '$address' => $r[0]['address'], - '$locality' => $r[0]['locality'], - '$region' => $r[0]['region'], - '$postal_code' => $r[0]['postal_code'], - '$country_name' => $r[0]['country_name'], + '$address' => array('address', t('Street Address'), $r[0]['address']), + '$locality' => array('locality', t('Locality/City'), $r[0]['locality']), + '$region' => array('region', t('Region/State'), $r[0]['region']), + '$postal_code' => array('postal_code', t('Postal/Zip Code'), $r[0]['postal_code']), + '$country_name' => array('country', t('Country'), $r[0]['country_name']), '$gender' => gender_selector($r[0]['gender']), '$gender_min' => gender_selector_min($r[0]['gender']), '$marital' => marital_selector($r[0]['marital']), - '$marital_min' => marital_selector_min($r[0]['marital']), + '$marital_min' => marital_selector_min($r[0]['marital']), '$with' => $r[0]['with'], '$howlong' => ($r[0]['howlong'] === NULL_DATE ? '' : datetime_convert('UTC',date_default_timezone_get(),$r[0]['howlong'])), '$sexual' => sexpref_selector($r[0]['sexual']), - '$sexual_min' => sexpref_selector_min($r[0]['sexual']), + '$sexual_min' => sexpref_selector_min($r[0]['sexual']), '$about' => $r[0]['about'], '$homepage' => $r[0]['homepage'], - '$hometown' => $r[0]['hometown'], + '$hometown' => array('hometown', t('Hometown'), $r[0]['hometown']), '$politic' => $r[0]['politic'], '$religion' => $r[0]['religion'], '$keywords' => $r[0]['keywords'], -- cgit v1.2.3 From d98d7003edfb54c3bbe624e1feb53904f4756f0e Mon Sep 17 00:00:00 2001 From: Mario Vavti Date: Tue, 15 Mar 2016 21:38:03 +0100 Subject: even more janitor work on profiles --- mod/profiles.php | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) (limited to 'mod/profiles.php') diff --git a/mod/profiles.php b/mod/profiles.php index 209a7a32d..c135814a8 100644 --- a/mod/profiles.php +++ b/mod/profiles.php @@ -696,10 +696,7 @@ function profiles_content(&$a) { '$lbl_import' => t('Import profile from file'), '$lbl_export' => t('Export profile to file'), '$lbl_gender' => t('Your Gender'), - '$lbl_marital' => t(' Marital Status'), - '$lbl_with' => t("Who (if applicable)"), - '$lbl_ex1' => t('Examples: cathy123, Cathy Williams, cathy@example.com'), - '$lbl_howlong' => t('Since [date]'), + '$lbl_marital' => t('Marital Status'), '$lbl_sexual' => t('Sexual Preference'), '$lbl_homepage' => t('Homepage URL'), '$lbl_politic' => t('Political Views'), @@ -740,8 +737,8 @@ function profiles_content(&$a) { '$gender_min' => gender_selector_min($r[0]['gender']), '$marital' => marital_selector($r[0]['marital']), '$marital_min' => marital_selector_min($r[0]['marital']), - '$with' => $r[0]['with'], - '$howlong' => ($r[0]['howlong'] === NULL_DATE ? '' : datetime_convert('UTC',date_default_timezone_get(),$r[0]['howlong'])), + '$with' => array('with', t("Who (if applicable)"), $r[0]['with'], t('Examples: cathy123, Cathy Williams, cathy@example.com')), + '$howlong' => array('howlong', t('Since (date)'), ($r[0]['howlong'] === NULL_DATE ? '' : datetime_convert('UTC',date_default_timezone_get(),$r[0]['howlong']))), '$sexual' => sexpref_selector($r[0]['sexual']), '$sexual_min' => sexpref_selector_min($r[0]['sexual']), '$about' => $r[0]['about'], -- cgit v1.2.3 From d22b21c56f978d6b1ed42c9edde2a0214a16aef7 Mon Sep 17 00:00:00 2001 From: Mario Vavti Date: Wed, 16 Mar 2016 13:45:24 +0100 Subject: still more janitor work on profiles --- mod/profiles.php | 53 +++++++++++++++++------------------------------------ 1 file changed, 17 insertions(+), 36 deletions(-) (limited to 'mod/profiles.php') diff --git a/mod/profiles.php b/mod/profiles.php index c135814a8..2ffe7da63 100644 --- a/mod/profiles.php +++ b/mod/profiles.php @@ -698,25 +698,6 @@ function profiles_content(&$a) { '$lbl_gender' => t('Your Gender'), '$lbl_marital' => t('Marital Status'), '$lbl_sexual' => t('Sexual Preference'), - '$lbl_homepage' => t('Homepage URL'), - '$lbl_politic' => t('Political Views'), - '$lbl_religion' => t('Religious Views'), - '$lbl_pubkey' => t('Keywords'), - '$lbl_likes' => t('Likes'), - '$lbl_dislikes' => t('Dislikes'), - '$lbl_ex2' => t('Example: fishing photography software'), - '$lbl_pubdsc' => t("Used in directory listings"), - '$lbl_about' => t('Tell us about yourself...'), - '$lbl_hobbies' => t('Hobbies/Interests'), - '$lbl_social' => t('Contact information and Social Networks'), - '$lbl_channels' => t('My other channels'), - '$lbl_music' => t('Musical interests'), - '$lbl_book' => t('Books, literature'), - '$lbl_tv' => t('Television'), - '$lbl_film' => t('Film/dance/culture/entertainment'), - '$lbl_love' => t('Love/romance'), - '$lbl_work' => t('Work/employment'), - '$lbl_school' => t('School/education'), '$disabled' => (($is_default) ? 'onclick="return false;" style="color: #BBBBFF;"' : ''), '$baseurl' => $a->get_baseurl(true), '$profile_id' => $r[0]['id'], @@ -741,24 +722,24 @@ function profiles_content(&$a) { '$howlong' => array('howlong', t('Since (date)'), ($r[0]['howlong'] === NULL_DATE ? '' : datetime_convert('UTC',date_default_timezone_get(),$r[0]['howlong']))), '$sexual' => sexpref_selector($r[0]['sexual']), '$sexual_min' => sexpref_selector_min($r[0]['sexual']), - '$about' => $r[0]['about'], - '$homepage' => $r[0]['homepage'], + '$about' => array('about', t('Tell us about yourself'), $r[0]['about']), + '$homepage' => array('homepage', t('Homepage URL'), $r[0]['homepage']), '$hometown' => array('hometown', t('Hometown'), $r[0]['hometown']), - '$politic' => $r[0]['politic'], - '$religion' => $r[0]['religion'], - '$keywords' => $r[0]['keywords'], - '$likes' => $r[0]['likes'], - '$dislikes' => $r[0]['dislikes'], - '$music' => $r[0]['music'], - '$book' => $r[0]['book'], - '$tv' => $r[0]['tv'], - '$film' => $r[0]['film'], - '$interest' => $r[0]['interest'], - '$romance' => $r[0]['romance'], - '$work' => $r[0]['work'], - '$education' => $r[0]['education'], - '$contact' => $r[0]['contact'], - '$channels' => $r[0]['channels'], + '$politic' => array('politic', t('Political Views'), $r[0]['politic']), + '$religion' => array('religion', t('Religious Views'), $r[0]['religion']), + '$keywords' => array('keywords', t('Keywords used in directory listings'), $r[0]['keywords'], t('Example: fishing photography software')), + '$likes' => array('likes', t('Likes'), $r[0]['likes']), + '$dislikes' => array('dislikes', t('Dislikes'), $r[0]['dislikes']), + '$music' => array('music', t('Musical interests'), $r[0]['music']), + '$book' => array('book', t('Books, literature'), $r[0]['book']), + '$tv' => array('tv', t('Television'), $r[0]['tv']), + '$film' => array('film', t('Film/dance/culture/entertainment'), $r[0]['film']), + '$interest' => array('interest', t('Hobbies/Interests'), $r[0]['interest']), + '$romance' => array('romance',t('Love/romance'), $r[0]['romance']), + '$work' => array('work', t('Work/employment'), $r[0]['work']), + '$education' => array('education', t('School/education'), $r[0]['education']), + '$contact' => array('contact', t('Contact information and Social Networks'), $r[0]['contact']), + '$channels' => array('channels', t('My other channels'), $r[0]['channels']), '$extra_fields' => $extra_fields, )); -- cgit v1.2.3 From 2165733ddce0bcae386d8b4b25ef7fec83266db7 Mon Sep 17 00:00:00 2001 From: Mario Vavti Date: Wed, 16 Mar 2016 23:07:29 +0100 Subject: move buttons to dropdown menu and some cleanup --- mod/profiles.php | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) (limited to 'mod/profiles.php') diff --git a/mod/profiles.php b/mod/profiles.php index 2ffe7da63..c3f5679fe 100644 --- a/mod/profiles.php +++ b/mod/profiles.php @@ -686,7 +686,7 @@ function profiles_content(&$a) { '$banner' => t('Edit Profile Details'), '$submit' => t('Submit'), '$viewprof' => t('View this profile'), - '$editvis' => t('Edit visibility'), + '$editvis' => t('Edit visibility'), '$coverpic' => t('Change Cover Photo'), '$profpic' => t('Change Profile Photo'), '$cr_prof' => t('Create a new profile using these settings'), @@ -698,7 +698,6 @@ function profiles_content(&$a) { '$lbl_gender' => t('Your Gender'), '$lbl_marital' => t('Marital Status'), '$lbl_sexual' => t('Sexual Preference'), - '$disabled' => (($is_default) ? 'onclick="return false;" style="color: #BBBBFF;"' : ''), '$baseurl' => $a->get_baseurl(true), '$profile_id' => $r[0]['id'], '$profile_name' => array('profile_name', t('Profile Name'), $r[0]['profile_name'], '', '*'), @@ -713,7 +712,7 @@ function profiles_content(&$a) { '$locality' => array('locality', t('Locality/City'), $r[0]['locality']), '$region' => array('region', t('Region/State'), $r[0]['region']), '$postal_code' => array('postal_code', t('Postal/Zip Code'), $r[0]['postal_code']), - '$country_name' => array('country', t('Country'), $r[0]['country_name']), + '$country_name' => array('country_name', t('Country'), $r[0]['country_name']), '$gender' => gender_selector($r[0]['gender']), '$gender_min' => gender_selector_min($r[0]['gender']), '$marital' => marital_selector($r[0]['marital']), -- cgit v1.2.3 From a41a05e6c0b0fa5f9497f0880a2db9d8d7374092 Mon Sep 17 00:00:00 2001 From: Mario Vavti Date: Thu, 17 Mar 2016 11:50:53 +0100 Subject: bring more structure to profiles edit --- mod/profiles.php | 41 +++++++++++++++++++++++------------------ 1 file changed, 23 insertions(+), 18 deletions(-) (limited to 'mod/profiles.php') diff --git a/mod/profiles.php b/mod/profiles.php index c3f5679fe..aebcc9022 100644 --- a/mod/profiles.php +++ b/mod/profiles.php @@ -248,7 +248,7 @@ function profiles_post(&$a) { $profile_name = notags(trim($_POST['profile_name'])); if(! strlen($profile_name)) { - notify( t('Profile Name is required.') . EOL); + notice( t('Profile Name is required.') . EOL); return; } @@ -277,7 +277,7 @@ function profiles_post(&$a) { $v = validate_channelname($name); if($v) { - $notice($v); + notice($v); $namechanged = false; $name = $orig[0]['name']; } @@ -687,31 +687,36 @@ function profiles_content(&$a) { '$submit' => t('Submit'), '$viewprof' => t('View this profile'), '$editvis' => t('Edit visibility'), - '$coverpic' => t('Change Cover Photo'), - '$profpic' => t('Change Profile Photo'), + '$coverpic' => t('Change cover photo'), + '$profpic' => t('Change profile photo'), '$cr_prof' => t('Create a new profile using these settings'), '$cl_prof' => t('Clone this profile'), '$del_prof' => t('Delete this profile'), + '$addthing' => t('Add profile things'), + '$personal' => t('Personal'), + '$location' => t('Location'), + '$relation' => t('Relation'), + '$miscellaneous'=> t('Miscellaneous'), '$exportable' => feature_enabled(local_channel(),'profile_export'), '$lbl_import' => t('Import profile from file'), '$lbl_export' => t('Export profile to file'), - '$lbl_gender' => t('Your Gender'), - '$lbl_marital' => t('Marital Status'), - '$lbl_sexual' => t('Sexual Preference'), + '$lbl_gender' => t('Your gender'), + '$lbl_marital' => t('Marital status'), + '$lbl_sexual' => t('Sexual preference'), '$baseurl' => $a->get_baseurl(true), '$profile_id' => $r[0]['id'], - '$profile_name' => array('profile_name', t('Profile Name'), $r[0]['profile_name'], '', '*'), + '$profile_name' => array('profile_name', t('Profile name'), $r[0]['profile_name'], t('Required'), '*'), '$is_default' => $is_default, '$default' => t('This is your default profile.') . EOL . translate_scope(map_scope($channel['channel_r_profile'])), '$advanced' => $advanced, - '$name' => array('name', t('Your Full Name'), $r[0]['name']), + '$name' => array('name', t('Your full name'), $r[0]['name'], t('Required'), '*'), '$pdesc' => array('pdesc', t('Title/Description'), $r[0]['pdesc']), '$dob' => dob($r[0]['dob']), '$hide_friends' => $hide_friends, - '$address' => array('address', t('Street Address'), $r[0]['address']), + '$address' => array('address', t('Street address'), $r[0]['address']), '$locality' => array('locality', t('Locality/City'), $r[0]['locality']), '$region' => array('region', t('Region/State'), $r[0]['region']), - '$postal_code' => array('postal_code', t('Postal/Zip Code'), $r[0]['postal_code']), + '$postal_code' => array('postal_code', t('Postal/Zip code'), $r[0]['postal_code']), '$country_name' => array('country_name', t('Country'), $r[0]['country_name']), '$gender' => gender_selector($r[0]['gender']), '$gender_min' => gender_selector_min($r[0]['gender']), @@ -724,20 +729,20 @@ function profiles_content(&$a) { '$about' => array('about', t('Tell us about yourself'), $r[0]['about']), '$homepage' => array('homepage', t('Homepage URL'), $r[0]['homepage']), '$hometown' => array('hometown', t('Hometown'), $r[0]['hometown']), - '$politic' => array('politic', t('Political Views'), $r[0]['politic']), - '$religion' => array('religion', t('Religious Views'), $r[0]['religion']), + '$politic' => array('politic', t('Political views'), $r[0]['politic']), + '$religion' => array('religion', t('Religious views'), $r[0]['religion']), '$keywords' => array('keywords', t('Keywords used in directory listings'), $r[0]['keywords'], t('Example: fishing photography software')), '$likes' => array('likes', t('Likes'), $r[0]['likes']), '$dislikes' => array('dislikes', t('Dislikes'), $r[0]['dislikes']), '$music' => array('music', t('Musical interests'), $r[0]['music']), '$book' => array('book', t('Books, literature'), $r[0]['book']), '$tv' => array('tv', t('Television'), $r[0]['tv']), - '$film' => array('film', t('Film/dance/culture/entertainment'), $r[0]['film']), + '$film' => array('film', t('Film/Dance/Culture/Entertainment'), $r[0]['film']), '$interest' => array('interest', t('Hobbies/Interests'), $r[0]['interest']), - '$romance' => array('romance',t('Love/romance'), $r[0]['romance']), - '$work' => array('work', t('Work/employment'), $r[0]['work']), - '$education' => array('education', t('School/education'), $r[0]['education']), - '$contact' => array('contact', t('Contact information and Social Networks'), $r[0]['contact']), + '$romance' => array('romance',t('Love/Romance'), $r[0]['romance']), + '$work' => array('work', t('Work/Employment'), $r[0]['work']), + '$education' => array('education', t('School/Education'), $r[0]['education']), + '$contact' => array('contact', t('Contact information and social networks'), $r[0]['contact']), '$channels' => array('channels', t('My other channels'), $r[0]['channels']), '$extra_fields' => $extra_fields, )); -- cgit v1.2.3 From 40162cd6b712f45ecd21f41d7793b2a6be6ac021 Mon Sep 17 00:00:00 2001 From: Mario Vavti Date: Thu, 17 Mar 2016 12:56:55 +0100 Subject: some work on profile listing --- mod/profiles.php | 25 ++++++++++++------------- 1 file changed, 12 insertions(+), 13 deletions(-) (limited to 'mod/profiles.php') diff --git a/mod/profiles.php b/mod/profiles.php index aebcc9022..f891c6033 100644 --- a/mod/profiles.php +++ b/mod/profiles.php @@ -758,21 +758,9 @@ function profiles_content(&$a) { local_channel()); if(count($r)) { - $tpl_header = get_markup_template('profile_listing_header.tpl'); - $o .= replace_macros($tpl_header,array( - '$header' => t('Edit/Manage Profiles'), - '$addstuff' => t('Add profile things'), - '$stuff_desc' => t('Include desirable objects in your profile'), - '$chg_photo' => t('Change profile photo'), - '$cr_new' => t('Create New Profile'), - '$cr_new_link' => 'profiles/new?t=' . get_form_security_token("profile_new") - )); - - $tpl = get_markup_template('profile_entry.tpl'); - foreach($r as $rr) { - $o .= replace_macros($tpl, array( + $profiles .= replace_macros($tpl, array( '$photo' => $rr['thumb'], '$id' => $rr['id'], '$alt' => t('Profile Image'), @@ -782,6 +770,17 @@ function profiles_content(&$a) { : '' . t('Edit visibility') . '') )); } + + $tpl_header = get_markup_template('profile_listing_header.tpl'); + $o .= replace_macros($tpl_header,array( + '$header' => t('Edit Profiles'), + '$cr_new' => t('Create New'), + '$cr_new_link' => 'profiles/new?t=' . get_form_security_token("profile_new"), + '$profiles' => $profiles + )); + + + } return $o; -- cgit v1.2.3 From 1cd3b4182595b838a535dd6b6990251db05d49e6 Mon Sep 17 00:00:00 2001 From: redmatrix Date: Wed, 30 Mar 2016 22:13:24 -0700 Subject: deprecate $a->get_baseurl() --- mod/profiles.php | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) (limited to 'mod/profiles.php') diff --git a/mod/profiles.php b/mod/profiles.php index f891c6033..fca2ff429 100644 --- a/mod/profiles.php +++ b/mod/profiles.php @@ -17,7 +17,7 @@ function profiles_init(&$a) { ); if(! count($r)) { notice( t('Profile not found.') . EOL); - goaway($a->get_baseurl(true) . '/profiles'); + goaway(z_root() . '/profiles'); return; // NOTREACHED } $profile_guid = $r['profile_guid']; @@ -44,7 +44,7 @@ function profiles_init(&$a) { // profiles_build_sync(local_channel()); - goaway($a->get_baseurl(true) . '/profiles'); + goaway(z_root() . '/profiles'); return; // NOTREACHED } @@ -83,9 +83,9 @@ function profiles_init(&$a) { info( t('New profile created.') . EOL); if(count($r3) == 1) - goaway($a->get_baseurl(true) . '/profiles/' . $r3[0]['id']); + goaway(z_root() . '/profiles/' . $r3[0]['id']); - goaway($a->get_baseurl(true) . '/profiles'); + goaway(z_root() . '/profiles'); } if((argc() > 2) && (argv(1) === 'clone')) { @@ -129,9 +129,9 @@ function profiles_init(&$a) { profiles_build_sync(local_channel()); if(($r3) && (count($r3) == 1)) - goaway($a->get_baseurl(true) . '/profiles/' . $r3[0]['id']); + goaway(z_root() . '/profiles/' . $r3[0]['id']); - goaway($a->get_baseurl(true) . '/profiles'); + goaway(z_root() . '/profiles'); return; // NOTREACHED } @@ -629,7 +629,7 @@ function profiles_content(&$a) { // $editselect = 'textareas'; $a->page['htmlhead'] .= replace_macros(get_markup_template('profed_head.tpl'), array( - '$baseurl' => $a->get_baseurl(true), + '$baseurl' => z_root(), '$editselect' => $editselect, )); @@ -703,7 +703,7 @@ function profiles_content(&$a) { '$lbl_gender' => t('Your gender'), '$lbl_marital' => t('Marital status'), '$lbl_sexual' => t('Sexual preference'), - '$baseurl' => $a->get_baseurl(true), + '$baseurl' => z_root(), '$profile_id' => $r[0]['id'], '$profile_name' => array('profile_name', t('Profile name'), $r[0]['profile_name'], t('Required'), '*'), '$is_default' => $is_default, @@ -767,7 +767,7 @@ function profiles_content(&$a) { '$profile_name' => $rr['profile_name'], '$visible' => (($rr['is_default']) ? '' . translate_scope(map_scope($channel['channel_r_profile'])) . '' - : '' . t('Edit visibility') . '') + : '' . t('Edit visibility') . '') )); } -- cgit v1.2.3 From 9abd95fad3784a10fc48bc40f9b8a75d7d74edda Mon Sep 17 00:00:00 2001 From: redmatrix Date: Thu, 31 Mar 2016 16:06:03 -0700 Subject: static App --- mod/profiles.php | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) (limited to 'mod/profiles.php') diff --git a/mod/profiles.php b/mod/profiles.php index fca2ff429..75c05b634 100644 --- a/mod/profiles.php +++ b/mod/profiles.php @@ -99,11 +99,11 @@ function profiles_init(&$a) { $name = t('Profile-') . ($num_profiles + 1); $r1 = q("SELECT * FROM `profile` WHERE `uid` = %d AND `id` = %d LIMIT 1", intval(local_channel()), - intval($a->argv[2]) + intval(App::$argv[2]) ); if(! count($r1)) { notice( t('Profile unavailable to clone.') . EOL); - $a->error = 404; + App::$error = 404; return; } unset($r1[0]['id']); @@ -144,7 +144,7 @@ function profiles_init(&$a) { ); if(! $r1) { notice( t('Profile unavailable to export.') . EOL); - $a->error = 404; + App::$error = 404; return; } header('content-type: application/octet_stream'); @@ -168,7 +168,7 @@ function profiles_init(&$a) { // we start loading content if(((argc() > 1) && (intval(argv(1)))) || !feature_enabled(local_channel(),'multi_profiles')) { if(feature_enabled(local_channel(),'multi_profiles')) - $id = $a->argv[1]; + $id = App::$argv[1]; else { $x = q("select id from profile where uid = %d and is_default = 1", intval(local_channel()) @@ -182,11 +182,11 @@ function profiles_init(&$a) { ); if(! count($r)) { notice( t('Profile not found.') . EOL); - $a->error = 404; + App::$error = 404; return; } - $chan = $a->get_channel(); + $chan = App::get_channel(); profile_load($a,$chan['channel_address'],$r[0]['id']); } @@ -234,7 +234,7 @@ function profiles_post(&$a) { if((argc() > 1) && (argv(1) !== "new") && intval(argv(1))) { $orig = q("SELECT * FROM `profile` WHERE `id` = %d AND `uid` = %d LIMIT 1", - intval($a->argv[1]), + intval(App::$argv[1]), intval(local_channel()) ); if(! count($orig)) { @@ -563,7 +563,7 @@ function profiles_post(&$a) { build_sync_packet(local_channel(),array('profile' => $r)); } - $channel = $a->get_channel(); + $channel = App::get_channel(); if($namechanged && $is_default) { $r = q("UPDATE xchan SET xchan_name = '%s', xchan_name_date = '%s' WHERE xchan_hash = '%s'", @@ -590,7 +590,7 @@ function profiles_content(&$a) { $o = ''; - $channel = $a->get_channel(); + $channel = App::get_channel(); if(! local_channel()) { notice( t('Permission denied.') . EOL); @@ -604,7 +604,7 @@ function profiles_content(&$a) { if(((argc() > 1) && (intval(argv(1)))) || !feature_enabled(local_channel(),'multi_profiles')) { if(feature_enabled(local_channel(),'multi_profiles')) - $id = $a->argv[1]; + $id = App::$argv[1]; else { $x = q("select id from profile where uid = %d and is_default = 1", intval(local_channel()) @@ -628,7 +628,7 @@ function profiles_content(&$a) { // if(feature_enabled(local_channel(),'richtext')) // $editselect = 'textareas'; - $a->page['htmlhead'] .= replace_macros(get_markup_template('profed_head.tpl'), array( + App::$page['htmlhead'] .= replace_macros(get_markup_template('profed_head.tpl'), array( '$baseurl' => z_root(), '$editselect' => $editselect, )); -- cgit v1.2.3