]> git.mxchange.org Git - friendica.git/commitdiff
Poco now shows "about" and the location as well.
authorMichael Vogel <icarus@dabo.de>
Fri, 9 Jan 2015 23:34:08 +0000 (00:34 +0100)
committerMichael Vogel <icarus@dabo.de>
Fri, 9 Jan 2015 23:34:08 +0000 (00:34 +0100)
mod/poco.php
mod/profiles.php

index 25edabac9ab9d8e95a9c3d7ca03185f5a02cc7b2..154f13c7ec202eae6936b36f54fc58fe39d633ca 100644 (file)
@@ -1,6 +1,7 @@
 <?php
 
 function poco_init(&$a) {
+       require_once("include/bbcode.php");
 
        $system_mode = false;
 
@@ -125,6 +126,8 @@ function poco_init(&$a) {
                'updated' => false,
                'preferredUsername' => false,
                'photos' => false,
+               'aboutMe' => false,
+               'currentLocation' => false,
                'network' => false
        );
 
@@ -145,6 +148,10 @@ function poco_init(&$a) {
                                        $entry['id'] = $rr['id'];
                                if($fields_ret['displayName'])
                                        $entry['displayName'] = $rr['name'];
+                               if($fields_ret['aboutMe'])
+                                       $entry['aboutMe'] = bbcode($rr['about'], false, false);
+                               if($fields_ret['currentLocation'])
+                                       $entry['currentLocation'] = $rr['location'];
                                if($fields_ret['urls']) {
                                        $entry['urls'] = array(array('value' => $rr['url'], 'type' => 'profile'));
                                        if($rr['addr'] && ($rr['network'] !== NETWORK_MAIL))
@@ -172,6 +179,8 @@ function poco_init(&$a) {
                                        $entry['network'] = $rr['network'];
                                        if ($entry['network'] == NETWORK_STATUSNET)
                                                $entry['network'] = NETWORK_OSTATUS;
+                                       if (($entry['network'] == "") AND ($rr['self']))
+                                               $entry['network'] = NETWORK_DFRN;
                                }
                                $ret['entry'][] = $entry;
                        }
index 6187e1c1e2e5aa5a2fbeee23fe17d52ecde58d50..e08b621c028b3c24849bba92a3d80fbefcdd7c05 100644 (file)
@@ -137,8 +137,8 @@ function profiles_init(&$a) {
 
                profile_load($a,$a->user['nickname'],$r[0]['id']);
        }
-       
-       
+
+
 
 }
 
@@ -193,7 +193,7 @@ function profiles_post(&$a) {
                $dob = '0000-00-00';
                $dob = sprintf('%04d-%02d-%02d',$year,$month,$day);
 
-                       
+
                $name = notags(trim($_POST['name']));
 
                if(! strlen($name)) {
@@ -223,7 +223,7 @@ function profiles_post(&$a) {
                        $howlong = '0000-00-00 00:00:00';
                else
                        $howlong = datetime_convert(date_default_timezone_get(),'UTC',$howlong);
+
                // linkify the relationship target if applicable
 
                $withchanged = false;
@@ -277,7 +277,7 @@ function profiles_post(&$a) {
                                                $newname = $r[0]['name'];
                                        }
                                }
-       
+
                                if($prf) {
                                        $with = str_replace($lookup,'<a href="' . $prf . '">' . $newname        . '</a>', $with);
                                        if(strpos($with,'@') === 0)
@@ -468,6 +468,13 @@ function profiles_post(&$a) {
                }
 
                if($is_default) {
+
+                       $r = q("UPDATE `contact` SET `about` = '%s', `location` = '%s' WHERE `self` = 1 AND `uid` = %d",
+                               dbesc($about),
+                               dbesc($locality),
+                               intval(local_user())
+                       );
+
                        // Update global directory in background
                        $url = $_SESSION['my_url'];
                        if($url && strlen(get_config('system','directory_submit_url')))