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 .= replace_macros(get_markup_template("section_title.tpl"),array(
27 '$title' => sprintf( t('People Search - %s'), $search)
32 $p = (($a->pager['page'] != 1) ? '&p=' . $a->pager['page'] : '');
34 if(strlen(get_config('system','directory_submit_url')))
35 $x = fetch_url('http://dir.friendica.com/lsearch?f=' . $p . '&search=' . urlencode($search));
37 //TODO fallback local search if global dir not available.
39 // $x = post_url($a->get_baseurl() . '/lsearch', $params);
44 $a->set_pager_total($j->total);
45 $a->set_pager_itemspage($j->items_page);
48 if(count($j->results)) {
50 $tpl = get_markup_template('match.tpl');
51 foreach($j->results as $jj) {
53 $o .= replace_macros($tpl,array(
54 '$url' => zrl($jj->url),
56 '$photo' => $jj->photo,
62 info( t('No matches') . EOL);
67 $o .= '<div class="clear"></div>';