]> git.mxchange.org Git - friendica.git/blobdiff - mod/profiles.php
Merge pull request #2319 from stieben/develop
[friendica.git] / mod / profiles.php
index 3ba57c8831962c92df38d197c67267ab535df777..9ce478ba198a375a80d664fcfea4c8935dab4f2c 100644 (file)
@@ -1,6 +1,7 @@
 <?php
+require_once("include/Contact.php");
 
-
+if(! function_exists('profiles_init')) {
 function profiles_init(&$a) {
 
        nav_set_selected('profiles');
@@ -139,9 +140,10 @@ function profiles_init(&$a) {
        }
 
 
-
+}
 }
 
+if(! function_exists('profile_clean_keywords')) {
 function profile_clean_keywords($keywords) {
        $keywords = str_replace(","," ",$keywords);
        $keywords = explode(" ", $keywords);
@@ -158,7 +160,9 @@ function profile_clean_keywords($keywords) {
 
        return $keywords;
 }
+}
 
+if(! function_exists('profiles_post')) {
 function profiles_post(&$a) {
 
        if(! local_user()) {
@@ -482,21 +486,7 @@ function profiles_post(&$a) {
                }
 
                if($is_default) {
-                       $location = $locality;
-
-                       if ($region != "") {
-                               if ($location != "")
-                                       $location .= ", ";
-
-                               $location .= $region;
-                       }
-
-                       if ($country_name != "") {
-                               if ($location != "")
-                                       $location .= ", ";
-
-                               $location .= $country_name;
-                       }
+                       $location = formatted_location(array("locality" => $locality, "region" => $region, "country-name" => $country_name));
 
                        $r = q("UPDATE `contact` SET `about` = '%s', `location` = '%s', `keywords` = '%s', `gender` = '%s' WHERE `self` = 1 AND `uid` = %d",
                                dbesc($about),
@@ -516,8 +506,9 @@ function profiles_post(&$a) {
                }
        }
 }
+}
 
-
+if(! function_exists('profile_activity')) {
 function profile_activity($changed, $value) {
        $a = get_app();
 
@@ -607,8 +598,9 @@ function profile_activity($changed, $value) {
 
        }
 }
+}
 
-
+if(! function_exists('profiles_content')) {
 function profiles_content(&$a) {
 
        if(! local_user()) {
@@ -832,5 +824,5 @@ function profiles_content(&$a) {
                }
                return $o;
        }
-
+}
 }