X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=mod%2Fprofiles.php;h=434f58adf990d487c6fae8013f6a87025afcaaac;hb=5d5a94c88a173b95e902afc31a9a2e527b6d3098;hp=d74219501a0ce3501888994bf715e908320188af;hpb=26cc2e02fe6e075cd35a3069edbc006219f5b435;p=friendica.git diff --git a/mod/profiles.php b/mod/profiles.php index d74219501a..434f58adf9 100644 --- a/mod/profiles.php +++ b/mod/profiles.php @@ -55,7 +55,8 @@ function profiles_post(&$a) { $region = notags(trim($_POST['region'])); $postal_code = notags(trim($_POST['postal_code'])); $country_name = notags(trim($_POST['country_name'])); - $keywords = notags(trim($_POST['keywords'])); + $pub_keywords = notags(trim($_POST['pub_keywords'])); + $prv_keywords = notags(trim($_POST['prv_keywords'])); $marital = notags(trim($_POST['marital'])); if($marital != $orig[0]['marital']) $maritalchanged = true; @@ -68,7 +69,10 @@ function profiles_post(&$a) { if($with != strip_tags($orig[0]['with'])) { $prf = ''; $lookup = $with; - if((strpos($lookup,'@')) || (strpos($lookup,'http://'))) { + if(strpos($lookup,'@') === 0) + $lookup = substr($lookup,1); + $lookup = str_replace('_',' ', $lookup); + if(strpos($lookup,'@') || (strpos($lookup,'http://'))) { $newname = $lookup; $links = @lrdd($lookup); if(count($links)) { @@ -101,6 +105,8 @@ function profiles_post(&$a) { if($prf) { $with = str_replace($lookup,'' . $newname . '', $with); + if(strpos($with,'@') === 0) + $with = substr($with,1); } } else @@ -142,7 +148,8 @@ function profiles_post(&$a) { `homepage` = '%s', `politic` = '%s', `religion` = '%s', - `keywords` = '%s', + `pub_keywords` = '%s', + `prv_keywords` = '%s', `about` = '%s', `interest` = '%s', `contact` = '%s', @@ -171,7 +178,8 @@ function profiles_post(&$a) { dbesc($homepage), dbesc($politic), dbesc($religion), - dbesc($keywords), + dbesc($pub_keywords), + dbesc($prv_keywords), dbesc($about), dbesc($interest), dbesc($contact), @@ -200,11 +208,9 @@ function profiles_post(&$a) { if($is_default) { // Update global directory in background - $php_path = ((strlen($a->config['php_path'])) ? $a->config['php_path'] : 'php'); $url = $_SESSION['my_url']; if($url && strlen(get_config('system','directory_submit_url'))) - //proc_close(proc_open("\"$php_path\" \"include/directory.php\" \"$url\" &", array(),$foo)); - proc_run($php_path,"include/directory.php","$url"); + proc_run('php',"include/directory.php","$url"); } } } @@ -223,7 +229,7 @@ function profiles_content(&$a) { } if(($a->argc > 2) && ($a->argv[1] === "drop") && intval($a->argv[2])) { - $r = q("SELECT * FROM `profile` WHERE `id` = %d AND `uid` = %d AND `is-default` = 0 AND `self` = 0 LIMIT 1", + $r = q("SELECT * FROM `profile` WHERE `id` = %d AND `uid` = %d AND `is-default` = 0 LIMIT 1", intval($a->argv[2]), intval(local_user()) ); @@ -240,8 +246,9 @@ function profiles_content(&$a) { intval($a->argv[2]), intval(local_user()) ); - $r = q("DELETE FROM `profile` WHERE `id` = %d LIMIT 1", - intval($a->argv[2]) + $r = q("DELETE FROM `profile` WHERE `id` = %d AND `uid` = %d LIMIT 1", + intval($a->argv[2]), + intval(local_user()) ); if($r) notice( t('Profile deleted.') . EOL); @@ -379,7 +386,8 @@ function profiles_content(&$a) { '$homepage' => $r[0]['homepage'], '$politic' => $r[0]['politic'], '$religion' => $r[0]['religion'], - '$keywords' => $r[0]['keywords'], + '$pub_keywords' => $r[0]['pub_keywords'], + '$prv_keywords' => $r[0]['prv_keywords'], '$music' => $r[0]['music'], '$book' => $r[0]['book'], '$tv' => $r[0]['tv'],