3 function dirfind_init(&$a) {
5 require_once('include/contact_widgets.php');
7 if(! x($a->page,'aside'))
8 $a->page['aside'] = '';
10 $a->page['aside'] .= follow_widget();
12 $a->page['aside'] .= findpeople_widget();
17 function dirfind_content(&$a) {
19 $search = notags(trim($_REQUEST['search']));
21 if(strpos($search,'@') === 0)
22 $search = substr($search,1);
26 $o .= '<h2>' . t('People Search') . ' - ' . $search . '</h2>';
30 $p = (($a->pager['page'] != 1) ? '&p=' . $a->pager['page'] : '');
32 if(strlen(get_config('system','directory_submit_url')))
33 $x = fetch_url('http://dir.friendica.com/lsearch?f=' . $p . '&search=' . urlencode($search));
35 //TODO fallback local search if global dir not available.
37 // $x = post_url($a->get_baseurl() . '/lsearch', $params);
42 $a->set_pager_total($j->total);
43 $a->set_pager_itemspage($j->items_page);
46 if(count($j->results)) {
48 $tpl = get_markup_template('match.tpl');
49 foreach($j->results as $jj) {
51 $o .= replace_macros($tpl,array(
52 '$url' => zrl($jj->url),
54 '$photo' => $jj->photo,
60 info( t('No matches') . EOL);
65 $o .= '<div class="clear"></div>';