X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=mod%2Fprofiles.php;h=893f0d51e34ba35cdd2e2271a93df29fffb383fc;hb=63622966666729ba82fef8f12484e022500ff867;hp=90296322a280cc8d570c7ecef6d843aafe2f7b06;hpb=c847a2f9cc969c9d79141713f646dd371e898168;p=friendica.git diff --git a/mod/profiles.php b/mod/profiles.php index 90296322a2..893f0d51e3 100644 --- a/mod/profiles.php +++ b/mod/profiles.php @@ -1,13 +1,18 @@ argv[2]), intval(local_user()) ); - if (! dbm::is_result($r)) { + if (! DBM::is_result($r)) { notice( t('Profile not found.') . EOL); goaway('profiles'); return; // NOTREACHED @@ -40,7 +45,7 @@ function profiles_init(App $a) { intval($a->argv[2]), intval(local_user()) ); - if (dbm::is_result($r)) { + if (DBM::is_result($r)) { info(t('Profile deleted.').EOL); } @@ -55,7 +60,7 @@ function profiles_init(App $a) { $r0 = q("SELECT `id` FROM `profile` WHERE `uid` = %d", intval(local_user())); - $num_profiles = (dbm::is_result($r0) ? count($r0) : 0); + $num_profiles = (DBM::is_result($r0) ? count($r0) : 0); $name = t('Profile-') . ($num_profiles + 1); @@ -77,7 +82,7 @@ function profiles_init(App $a) { ); info( t('New profile created.') . EOL); - if (dbm::is_result($r3) && count($r3) == 1) { + if (DBM::is_result($r3) && count($r3) == 1) { goaway('profiles/' . $r3[0]['id']); } @@ -91,14 +96,14 @@ function profiles_init(App $a) { $r0 = q("SELECT `id` FROM `profile` WHERE `uid` = %d", intval(local_user())); - $num_profiles = (dbm::is_result($r0) ? count($r0) : 0); + $num_profiles = (DBM::is_result($r0) ? count($r0) : 0); $name = t('Profile-') . ($num_profiles + 1); $r1 = q("SELECT * FROM `profile` WHERE `uid` = %d AND `id` = %d LIMIT 1", intval(local_user()), intval($a->argv[2]) ); - if(! dbm::is_result($r1)) { + if(! DBM::is_result($r1)) { notice( t('Profile unavailable to clone.') . EOL); killme(); return; @@ -116,7 +121,7 @@ function profiles_init(App $a) { dbesc($name) ); info( t('New profile created.') . EOL); - if ((dbm::is_result($r3)) && (count($r3) == 1)) { + if ((DBM::is_result($r3)) && (count($r3) == 1)) { goaway('profiles/'.$r3[0]['id']); } @@ -131,7 +136,7 @@ function profiles_init(App $a) { intval($a->argv[1]), intval(local_user()) ); - if (! dbm::is_result($r)) { + if (! DBM::is_result($r)) { notice( t('Profile not found.') . EOL); killme(); return; @@ -178,7 +183,7 @@ function profiles_post(App $a) { intval($a->argv[1]), intval(local_user()) ); - if (! dbm::is_result($orig)) { + if (! DBM::is_result($orig)) { notice( t('Profile not found.') . EOL); return; } @@ -272,13 +277,13 @@ function profiles_post(App $a) { dbesc($newname), intval(local_user()) ); - if (! dbm::is_result($r)) { + if (! DBM::is_result($r)) { $r = q("SELECT * FROM `contact` WHERE `nick` = '%s' AND `uid` = %d LIMIT 1", dbesc($lookup), intval(local_user()) ); } - if (dbm::is_result($r)) { + if (DBM::is_result($r)) { $prf = $r[0]['url']; $newname = $r[0]['name']; } @@ -323,7 +328,7 @@ function profiles_post(App $a) { $hide_friends = (($_POST['hide-friends'] == 1) ? 1: 0); - set_pconfig(local_user(), 'system', 'detailled_profile', (($_POST['detailled_profile'] == 1) ? 1: 0)); + PConfig::set(local_user(), 'system', 'detailled_profile', (($_POST['detailled_profile'] == 1) ? 1: 0)); $changes = array(); $value = ''; @@ -485,7 +490,7 @@ function profiles_post(App $a) { } if ($is_default) { - $location = formatted_location(array("locality" => $locality, "region" => $region, "country-name" => $country_name)); + $location = Profile::formatLocation(array("locality" => $locality, "region" => $region, "country-name" => $country_name)); q("UPDATE `contact` SET `about` = '%s', `location` = '%s', `keywords` = '%s', `gender` = '%s' WHERE `self` AND `uid` = %d", dbesc($about), @@ -497,14 +502,14 @@ function profiles_post(App $a) { // Update global directory in background $url = $_SESSION['my_url']; - if ($url && strlen(get_config('system', 'directory'))) { - Worker::add(PRIORITY_LOW, "directory", $url); + if ($url && strlen(Config::get('system', 'directory'))) { + Worker::add(PRIORITY_LOW, "Directory", $url); } - Worker::add(PRIORITY_LOW, 'profile_update', local_user()); + Worker::add(PRIORITY_LOW, 'ProfileUpdate', local_user()); // Update the global contact for the user - update_gcontact_for_user(local_user()); + GContact::updateForUser(local_user()); } } } @@ -517,11 +522,11 @@ function profile_activity($changed, $value) { return; } - if ($a->user['hidewall'] || get_config('system', 'block_public')) { + if ($a->user['hidewall'] || Config::get('system', 'block_public')) { return; } - if (! get_pconfig(local_user(), 'system', 'post_profilechange')) { + if (! PConfig::get(local_user(), 'system', 'post_profilechange')) { return; } @@ -531,7 +536,7 @@ function profile_activity($changed, $value) { intval(local_user()) ); - if (! dbm::is_result($self)) { + if (! DBM::is_result($self)) { return; } @@ -595,7 +600,7 @@ function profile_activity($changed, $value) { $i = item_store($arr); if ($i) { - Worker::add(PRIORITY_HIGH, "notifier", "activity", $i); + Worker::add(PRIORITY_HIGH, "Notifier", "activity", $i); } } @@ -614,7 +619,7 @@ function profiles_content(App $a) { intval($a->argv[1]), intval(local_user()) ); - if (! dbm::is_result($r)) { + if (! DBM::is_result($r)) { notice( t('Profile not found.') . EOL); return; } @@ -648,9 +653,9 @@ function profiles_content(App $a) { $personal_account = !(in_array($a->user["page-flags"], array(PAGE_COMMUNITY, PAGE_PRVGROUP))); - $detailled_profile = (get_pconfig(local_user(), 'system', 'detailled_profile') AND $personal_account); + $detailled_profile = (PConfig::get(local_user(), 'system', 'detailled_profile') AND $personal_account); - $f = get_config('system', 'birthday_input_format'); + $f = Config::get('system', 'birthday_input_format'); if (! $f) { $f = 'ymd'; } @@ -669,10 +674,10 @@ function profiles_content(App $a) { array(t('No'), t('Yes')) //Off - On strings ), - '$multi_profiles' => feature_enabled(local_user(), 'multi_profiles'), + '$multi_profiles' => Feature::isEnabled(local_user(), 'multi_profiles'), '$form_security_token' => get_form_security_token("profile_edit"), '$form_security_token_photo' => get_form_security_token("profile_photo"), - '$profile_clone_link' => ((feature_enabled(local_user(), 'multi_profiles')) ? 'profiles/clone/' . $r[0]['id'] . '?t=' . get_form_security_token("profile_clone") : ""), + '$profile_clone_link' => ((Feature::isEnabled(local_user(), 'multi_profiles')) ? 'profiles/clone/' . $r[0]['id'] . '?t=' . get_form_security_token("profile_clone") : ""), '$profile_drop_link' => 'profiles/drop/' . $r[0]['id'] . '?t=' . get_form_security_token("profile_drop"), '$profile_action' => t('Profile Actions'), @@ -749,13 +754,12 @@ function profiles_content(App $a) { return $o; } else { - // If we don't support multi profiles, don't display this list. - if (!feature_enabled(local_user(), 'multi_profiles')) { + if (!Feature::isEnabled(local_user(), 'multi_profiles')) { $r = q("SELECT * FROM `profile` WHERE `uid` = %d AND `is-default`=1", local_user() ); - if (dbm::is_result($r)) { + if (DBM::is_result($r)) { //Go to the default profile. goaway('profiles/' . $r[0]['id']); } @@ -764,7 +768,7 @@ function profiles_content(App $a) { $r = q("SELECT * FROM `profile` WHERE `uid` = %d", local_user()); - if (dbm::is_result($r)) { + if (DBM::is_result($r)) { $tpl = get_markup_template('profile_entry.tpl');