]> git.mxchange.org Git - friendica.git/blobdiff - mod/dirfind.php
Tabs instead of spaces
[friendica.git] / mod / dirfind.php
index da3fafce299fa4f2ac2c1b8b65fcf6b864556bc1..dc86f03a68f4c9cee27bd6e6f5d61efd92ae5dc8 100644 (file)
@@ -11,7 +11,6 @@ use Friendica\Core\System;
 use Friendica\Core\Worker;
 use Friendica\Model\Contact;
 use Friendica\Model\GContact;
-use Friendica\Model\Profile;
 use Friendica\Network\Probe;
 use Friendica\Protocol\PortableContact;
 use Friendica\Util\Network;
@@ -114,28 +113,22 @@ function dirfind_content(App $a, $prefix = "") {
 
                        /// @TODO These 2 SELECTs are not checked on validity with DBM::is_result()
                        $count = q("SELECT count(*) AS `total` FROM `gcontact`
-                                       LEFT JOIN `contact` ON `contact`.`nurl` = `gcontact`.`nurl` AND `contact`.`uid` = 0
-                                       WHERE NOT `gcontact`.`hide` AND `gcontact`.`network` IN ('%s', '%s', '%s') AND
-                                               ((`gcontact`.`last_contact` >= `gcontact`.`last_failure`) OR
-                                               (`gcontact`.`updated` >= `gcontact`.`last_failure`)) AND
-                                               (`gcontact`.`url` LIKE '%s' OR `gcontact`.`name` LIKE '%s' OR
-                                               `gcontact`.`location` LIKE '%s' OR `gcontact`.`addr` LIKE '%s' OR
-                                               `gcontact`.`about` LIKE '%s' OR `gcontact`.`keywords` LIKE '%s') $extra_sql",
+                                       WHERE NOT `hide` AND `network` IN ('%s', '%s', '%s') AND
+                                               ((`last_contact` >= `last_failure`) OR (`updated` >= `last_failure`)) AND
+                                               (`url` LIKE '%s' OR `name` LIKE '%s' OR `location` LIKE '%s' OR
+                                               `addr` LIKE '%s' OR `about` LIKE '%s' OR `keywords` LIKE '%s') $extra_sql",
                                        dbesc(NETWORK_DFRN), dbesc($ostatus), dbesc($diaspora),
                                        dbesc(escape_tags($search2)), dbesc(escape_tags($search2)), dbesc(escape_tags($search2)),
                                        dbesc(escape_tags($search2)), dbesc(escape_tags($search2)), dbesc(escape_tags($search2)));
 
-                       $results = q("SELECT `gcontact`.`nurl`
+                       $results = q("SELECT `nurl`
                                        FROM `gcontact`
-                                       LEFT JOIN `contact` ON `contact`.`nurl` = `gcontact`.`nurl` AND `contact`.`uid` = 0
-                                       WHERE NOT `gcontact`.`hide` AND `gcontact`.`network` IN ('%s', '%s', '%s') AND
-                                               ((`gcontact`.`last_contact` >= `gcontact`.`last_failure`) OR
-                                               (`gcontact`.`updated` >= `gcontact`.`last_failure`)) AND
-                                               (`gcontact`.`url` LIKE '%s' OR `gcontact`.`name` LIKE '%s' OR
-                                               `gcontact`.`location` LIKE '%s' OR `gcontact`.`addr` LIKE '%s' OR
-                                               `gcontact`.`about` LIKE '%s' OR `gcontact`.`keywords` LIKE '%s') $extra_sql
-                                               GROUP BY `gcontact`.`nurl`
-                                               ORDER BY `gcontact`.`updated` DESC LIMIT %d, %d",
+                                       WHERE NOT `hide` AND `network` IN ('%s', '%s', '%s') AND
+                                               ((`last_contact` >= `last_failure`) OR (`updated` >= `last_failure`)) AND
+                                               (`url` LIKE '%s' OR `name` LIKE '%s' OR `location` LIKE '%s' OR
+                                               `addr` LIKE '%s' OR `about` LIKE '%s' OR `keywords` LIKE '%s') $extra_sql
+                                               GROUP BY `nurl`
+                                               ORDER BY `updated` DESC LIMIT %d, %d",
                                        dbesc(NETWORK_DFRN), dbesc($ostatus), dbesc($diaspora),
                                        dbesc(escape_tags($search2)), dbesc(escape_tags($search2)), dbesc(escape_tags($search2)),
                                        dbesc(escape_tags($search2)), dbesc(escape_tags($search2)), dbesc(escape_tags($search2)),
@@ -220,7 +213,7 @@ function dirfind_content(App $a, $prefix = "") {
                                        $connlnk = System::baseUrl().'/follow/?url='.(($jj->connect) ? $jj->connect : $jj->url);
                                        $conntxt = L10n::t('Connect');
                                        $photo_menu = [
-                                               'profile' => [L10n::t("View Profile"), Profile::zrl($jj->url)],
+                                               'profile' => [L10n::t("View Profile"), Contact::magicLink($jj->url)],
                                                'follow' => [L10n::t("Connect/Follow"), $connlnk]
                                        ];
                                }
@@ -229,7 +222,7 @@ function dirfind_content(App $a, $prefix = "") {
 
                                $entry = [
                                        'alt_text' => $alt_text,
-                                       'url' => Profile::zrl($jj->url),
+                                       'url' => Contact::magicLink($jj->url),
                                        'itemurl' => $itemurl,
                                        'name' => htmlentities($jj->name),
                                        'thumb' => proxy_url($jj->photo, false, PROXY_SIZE_THUMB),