diff options
Diffstat (limited to 'mod/directory.php')
-rw-r--r-- | mod/directory.php | 30 |
1 files changed, 22 insertions, 8 deletions
diff --git a/mod/directory.php b/mod/directory.php index e80e9661d..3d7632ec0 100644 --- a/mod/directory.php +++ b/mod/directory.php @@ -5,7 +5,7 @@ require_once('include/widgets.php'); function directory_init(&$a) { - $a->set_pager_itemspage(80); + $a->set_pager_itemspage(60); } @@ -199,16 +199,24 @@ function directory_content(&$a) { $a->data['directory_keywords'] = $j['keywords']; } -// logger('mod_directory: entries: ' . print_r($entries,true), LOGGER_DATA); - - - if($dynamic) { + logger('mod_directory: entries: ' . print_r($entries,true), LOGGER_DATA); + if($_REQUEST['aj']) { + if($entries) { + $o = replace_macros(get_markup_template('directajax.tpl'),array( + '$entries' => $entries + )); + } + else { + $o = '<div id="content-complete"></div>'; + } + echo $o; + killme(); } else { - $o .= "<script> var page_query_args = '" . $a->query_string . "'; </script>"; + $o .= "<script> var page_query = '" . $_GET['q'] . "'; var extra_args = '" . extra_query_args() . "' ; </script>"; $o .= replace_macros($tpl, array( '$search' => $search, '$desc' => t('Find'), @@ -216,15 +224,21 @@ function directory_content(&$a) { '$safetxt' => htmlspecialchars($search,ENT_QUOTES,'UTF-8'), '$entries' => $entries, '$dirlbl' => t('Directory'), - '$submit' => t('Find') + '$submit' => t('Find'), + '$next' => alt_pager($a,$j['records'], t('next page'), t('previous page')) + )); - $o .= alt_pager($a,$j['records'], t('next page'), t('previous page')); } } else { + if($_REQUEST['aj']) { + $o = '<div id="content-complete"></div>'; + echo $o; + killme(); + } if($a->pager['page'] == 1 && $j['records'] == 0 && strpos($search,'@')) { goaway(z_root() . '/chanview/?f=&address=' . $search); } |