]> git.mxchange.org Git - friendica.git/commitdiff
poco: Only update the global contacts when there is a network value/Export your own...
authorMichael Vogel <icarus@dabo.de>
Sun, 25 Jan 2015 15:40:20 +0000 (16:40 +0100)
committerMichael Vogel <icarus@dabo.de>
Sun, 25 Jan 2015 15:40:20 +0000 (16:40 +0100)
include/Scrape.php
include/socgraph.php
mod/poco.php

index fa2d7944a3bda0de32666f9eddef97bcecf3e96e..31e2be263fc3c8910ab6deb7d4c58742924d740d 100644 (file)
@@ -345,7 +345,7 @@ function probe_url($url, $mode = PROBE_NORMAL) {
 
        $result = Cache::get("probe_url:".$mode.":".$url);
        if (!is_null($result)) {
-                $result = unserialize($result);
+               $result = unserialize($result);
                return $result;
        }
 
index f37fdca98d1f7ce561a2223ad3a276ccf43b7d21..f2ccd946a8685286fa89f1bb31989a5f43897eb6 100644 (file)
@@ -113,21 +113,23 @@ function poco_load($cid,$uid = 0,$zcid = 0,$url = null) {
                        $gender = $entry->gender;
 
                if(isset($entry->tags))
-                       $keywords = implode(", ", $entry->tags);
-
-               poco_check($profile_url, $name, $network, $profile_photo, $about, $location, $gender, $keywords, $connect_url, $updated, $cid, $uid, $zcid);
-
-               // Update the Friendica contacts. Diaspora is doing it via a message. (See include/diaspora.php)
-               if (($location != "") OR ($about != "") OR ($keywords != "") OR ($gender != ""))
-                       q("UPDATE `contact` SET `location` = '%s', `about` = '%s', `keywords` = '%s', `gender` = '%s'
-                               WHERE `nurl` = '%s' AND NOT `self` AND `network` = '%s'",
-                               dbesc($location),
-                               dbesc($about),
-                               dbesc($keywords),
-                               dbesc($gender),
-                               dbesc(normalise_link($profile_url)),
-                               dbesc(NETWORK_DFRN));
-
+                       foreach($entry->tags as $tag)
+                               $keywords = implode(", ", $tag);
+
+               if ($network != "") {
+                       poco_check($profile_url, $name, $network, $profile_photo, $about, $location, $gender, $keywords, $connect_url, $updated, $cid, $uid, $zcid);
+
+                       // Update the Friendica contacts. Diaspora is doing it via a message. (See include/diaspora.php)
+                       if (($location != "") OR ($about != "") OR ($keywords != "") OR ($gender != ""))
+                               q("UPDATE `contact` SET `location` = '%s', `about` = '%s', `keywords` = '%s', `gender` = '%s'
+                                       WHERE `nurl` = '%s' AND NOT `self` AND `network` = '%s'",
+                                       dbesc($location),
+                                       dbesc($about),
+                                       dbesc($keywords),
+                                       dbesc($gender),
+                                       dbesc(normalise_link($profile_url)),
+                                       dbesc(NETWORK_DFRN));
+               }
        }
        logger("poco_load: loaded $total entries",LOGGER_DEBUG);
 
index aa570ec3423d5d9533b6a6c60514e604a9976415..70514606d4b1bd6ad647aa56619b6b670f681559 100644 (file)
@@ -46,8 +46,8 @@ function poco_init(&$a) {
 
        if($justme)
                $sql_extra = " AND `contact`.`self` = 1 ";
-       else
-               $sql_extra = " AND `contact`.`self` = 0 ";
+//     else
+//             $sql_extra = " AND `contact`.`self` = 0 ";
 
        if($cid)
                $sql_extra = sprintf(" AND `contact`.`id` = %d ",intval($cid));