Browse Source

make both content and people search POSTable

pull/1/head
Friendika 10 years ago
parent
commit
57eb0576b0
2 changed files with 22 additions and 2 deletions
  1. +12
    -1
      mod/directory.php
  2. +10
    -1
      mod/search.php

+ 12
- 1
mod/directory.php View File

@ -3,11 +3,22 @@ function directory_init(&$a) {
$a->set_pager_itemspage(60);
}
function directory_post(&$a) {
if(x($_POST,'search'))
$a->data['search'] = $_POST['search'];
}
function directory_content(&$a) {
$o = '';
$o .= '<script> $(document).ready(function() { $(\'#nav-directory-link\').addClass(\'nav-selected\'); });</script>';
$search = ((x($_GET,'search')) ? notags(trim($_GET['search'])) : '');
if(x($a->data,'search'))
$search = notags(trim($a->data['search']));
else
$search = ((x($_GET,'search')) ? notags(trim($_GET['search'])) : '');
$tpl = load_view_file('view/directory_header.tpl');


+ 10
- 1
mod/search.php View File

@ -1,13 +1,22 @@
<?php
function search_post(&$a) {
if(x($_POST,'search'))
$a->data['search'] = $_POST['search'];
}
function search_content(&$a) {
$o = '<div id="live-search"></div>' . "\r\n";
$o .= '<h3>' . t('Search') . '</h3>';
$search = ((x($_GET,'search')) ? rawurldecode($_GET['search']) : '');
if(x($a->data,'search'))
$search = notags(trim($a->data['search']));
else
$search = ((x($_GET,'search')) ? notags(trim(rawurldecode($_GET['search']))) : '');
$o .= search($search);


Loading…
Cancel
Save