]> git.mxchange.org Git - friendica.git/blobdiff - mod/dirfind.php
improved infinite scrollling
[friendica.git] / mod / dirfind.php
index 2d8479043508a9b881bbde23b9f9967559164eff..5c5d0e933ac5856444811e4479409f4cdcbbd93e 100644 (file)
@@ -1,9 +1,25 @@
 <?php
 
+function dirfind_init(&$a) {
+
+       require_once('include/contact_widgets.php');
+
+       if(! x($a->page,'aside'))
+               $a->page['aside'] = '';
+
+       $a->page['aside'] .= follow_widget();
+
+       $a->page['aside'] .= findpeople_widget();
+}
+
+
 
 function dirfind_content(&$a) {
 
        $search = notags(trim($_REQUEST['search']));
+
+       if(strpos($search,'@') === 0)
+               $search = substr($search,1);
        
        $o = '';
 
@@ -14,7 +30,7 @@ function dirfind_content(&$a) {
                $p = (($a->pager['page'] != 1) ? '&p=' . $a->pager['page'] : '');
                        
                if(strlen(get_config('system','directory_submit_url')))
-                       $x = fetch_url('http://dir.friendika.com/lsearch?f=' . $p .  '&search=' . urlencode($search));
+                       $x = fetch_url('http://dir.friendica.com/lsearch?f=' . $p .  '&search=' . urlencode($search));
 
 //TODO fallback local search if global dir not available.
 //             else
@@ -33,7 +49,7 @@ function dirfind_content(&$a) {
                        foreach($j->results as $jj) {
                                
                                $o .= replace_macros($tpl,array(
-                                       '$url' => $jj->url,
+                                       '$url' => zrl($jj->url),
                                        '$name' => $jj->name,
                                        '$photo' => $jj->photo,
                                        '$tags' => $jj->tags