diff options
-rw-r--r-- | include/nav.php | 5 | ||||
-rw-r--r-- | mod/acl.php | 17 | ||||
-rw-r--r-- | mod/dirsearch.php | 12 | ||||
-rw-r--r-- | view/tpl/nav.tpl | 1 | ||||
-rw-r--r-- | view/tpl/smarty3/nav.tpl | 1 |
5 files changed, 17 insertions, 19 deletions
diff --git a/include/nav.php b/include/nav.php index 644264a92..b65577e0f 100644 --- a/include/nav.php +++ b/include/nav.php @@ -118,9 +118,9 @@ EOT; $nav['search'] = array('search', t('Search'), "", t('Search site content')); - $gdirpath = 'directory'; - $nav['directory'] = array($gdirpath, t('Directory'), "", t('People directory')); + $nav['directory'] = array('directory', t('Channel Directory'), "", t('Channel Locator')); + /** * @@ -199,6 +199,7 @@ EOT; '$localuser' => local_user(), '$sel' => $a->nav_sel, '$apps' => $a->get_apps(), + '$pleasewait' => t('Please wait...') )); call_hooks('page_header', $a->page['nav']); diff --git a/mod/acl.php b/mod/acl.php index 16945d1a9..0290edca8 100644 --- a/mod/acl.php +++ b/mod/acl.php @@ -5,7 +5,7 @@ require_once("include/acl_selectors.php"); function acl_init(&$a){ - logger('mod_acl: ' . print_r($_REQUEST,true)); +// logger('mod_acl: ' . print_r($_REQUEST,true)); $start = (x($_REQUEST,'start')?$_REQUEST['start']:0); $count = (x($_REQUEST,'count')?$_REQUEST['count']:100); @@ -26,8 +26,6 @@ function acl_init(&$a){ if($type != 'x') killme(); - logger('continue'); - if ($search != "") { $sql_extra = " AND `name` LIKE " . protect_sprintf( "'%" . dbesc($search) . "%'" ) . " "; $sql_extra2 = "AND ( xchan_name LIKE " . protect_sprintf( "'%" . dbesc($search) . "%'" ) . " OR xchan_addr LIKE " . protect_sprintf( "'%" . dbesc($search) . "%'" ) . ") "; @@ -170,16 +168,7 @@ function acl_init(&$a){ } echo json_encode($x); killme(); - - - -// $r = q("SELECT xchan_name as id, xchan_name as name, xchan_photo_s as micro, xchan_url as url from xchan -// where 1 -// $sql_extra3 -// ORDER BY `xchan_name` ASC ", -// intval(local_user()) -// ); } else $r = array(); @@ -196,7 +185,7 @@ function acl_init(&$a){ foreach($r as $g) { $x['photos'][] = $g['micro']; $x['links'][] = $g['url']; - $x['suggestions'][] = (($type === 'x') ? '@' : '') . $g['name']; + $x['suggestions'][] = $g['name']; $x['data'][] = $g['id']; } } @@ -235,7 +224,7 @@ function acl_init(&$a){ function navbar_complete(&$a) { - logger('navbar_complete'); +// logger('navbar_complete'); $dirmode = intval(get_config('system','directory_mode')); $search = ((x($_REQUEST,'query')) ? htmlentities($_REQUEST['query'],ENT_COMPAT,'UTF-8',false) : ''); diff --git a/mod/dirsearch.php b/mod/dirsearch.php index b3b824b24..07af90ffb 100644 --- a/mod/dirsearch.php +++ b/mod/dirsearch.php @@ -4,7 +4,7 @@ require_once('include/dir_fns.php'); function dirsearch_init(&$a) { - $a->set_pager_itemspage(60); + $a->set_pager_itemspage(80); } @@ -36,6 +36,8 @@ function dirsearch_content(&$a) { $marital = ((x($_REQUEST,'marital')) ? $_REQUEST['marital'] : ''); $keywords = ((x($_REQUEST,'keywords')) ? $_REQUEST['keywords'] : ''); +// TODO - a meta search which joins all of these things to one search string + $sql_extra = ''; if($name) @@ -61,12 +63,16 @@ function dirsearch_content(&$a) { $page = (($_REQUEST['p']) ? intval($_REQUEST['p'] - 1) : 0); $startrec = (($page+1) * $perpage) - $perpage; $limit = (($_REQUEST['limit']) ? intval($_REQUEST['limit']) : 0); + $return_total = ((x($_REQUEST,'return_total')) ? intval($_REQUEST['return_total']) : 0); // ok a separate tag table won't work. // merge them into xprof $ret['success'] = true; + // If &limit=n, return at most n entries + // If &return_total=1, we count matching entries and return that as 'total_items' for use in pagination. + // By default we return one page (default 80 items maximum) and do not count total entries if($limit) $qlimit = " LIMIT $limit "; @@ -80,9 +86,9 @@ function dirsearch_content(&$a) { $order = " ORDER BY `xchan_name` ASC "; $logic = ((strlen($sql_extra)) ? 0 : 1); -dbg(1); + $r = q("SELECT xchan.*, xprof.* from xchan left join xprof on xchan_hash = xprof_hash where $logic $sql_extra $order $qlimit "); -dbg(0); + $ret['page'] = $page + 1; $ret['records'] = count($r); diff --git a/view/tpl/nav.tpl b/view/tpl/nav.tpl index b0c2393cd..3b997e215 100644 --- a/view/tpl/nav.tpl +++ b/view/tpl/nav.tpl @@ -86,6 +86,7 @@ <li id="nav-site-linkmenu" class="nav-menu-icon"><a href="#" rel="#nav-site-menu"><span class="icon s22 gear">$nav.settings.1</span></a> <ul id="nav-site-menu" class="menu-popup"> {{ if $nav.settings }}<li><a class="$nav.settings.2" href="$nav.settings.0" title="$nav.settings.3">$nav.settings.1</a></li>{{ endif }} + {{ if $nav.directory }}<li><a class="$nav.directory.2" href="$nav.directory.0" title="$nav.directory.3">$nav.directory.1</a></li>{{ endif }} {{ if $nav.admin }}<li><a class="$nav.admin.2" href="$nav.admin.0" title="$nav.admin.3" >$nav.admin.1</a></li>{{ endif }} diff --git a/view/tpl/smarty3/nav.tpl b/view/tpl/smarty3/nav.tpl index 0b8344b07..6e441e915 100644 --- a/view/tpl/smarty3/nav.tpl +++ b/view/tpl/smarty3/nav.tpl @@ -86,6 +86,7 @@ <li id="nav-site-linkmenu" class="nav-menu-icon"><a href="#" rel="#nav-site-menu"><span class="icon s22 gear">{{$nav.settings.1}}</span></a> <ul id="nav-site-menu" class="menu-popup"> {{if $nav.settings}}<li><a class="{{$nav.settings.2}}" href="{{$nav.settings.0}}" title="{{$nav.settings.3}}">{{$nav.settings.1}}</a></li>{{/if}} + {{if $nav.directory}}<li><a class="{{$nav.directory.2}}" href="{{$nav.directory.0}}" title="{{$nav.directory.3}}">{{$nav.directory.1}}</a></li>{{/if}} {{if $nav.admin}}<li><a class="{{$nav.admin.2}}" href="{{$nav.admin.0}}" title="{{$nav.admin.3}}" >{{$nav.admin.1}}</a></li>{{/if}} |