<?php
+function search_post(&$a) {
+ if(x($_POST,'search'))
+ $a->data['search'] = $_POST['search'];
+}
+
+
function search_content(&$a) {
+ if(x($_SESSION,'theme'))
+ unset($_SESSION['theme']);
+
$o = '<div id="live-search"></div>' . "\r\n";
$o .= '<h3>' . t('Search') . '</h3>';
- $search = ((x($_GET,'search')) ? $_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);
$a->set_pager_total($r[0]['total']);
if(! $r[0]['total']) {
- notice('No results.');
+ notice( t('No results.') . EOL);
return $o;
}
foreach($r as $item) {
+ $total = 0;
$comment = '';
$owner_url = '';
$owner_photo = '';
&& ($item['id'] != $item['parent']))
continue;
+ $total ++;
+
$profile_name = ((strlen($item['author-name'])) ? $item['author-name'] : $item['name']);
$profile_avatar = ((strlen($item['author-avatar'])) ? $item['author-avatar'] : $item['thumb']);
$profile_link = ((strlen($item['author-link'])) ? $item['author-link'] : $item['url']);
$o .= replace_macros($tpl,array(
'$id' => $item['item_id'],
+ '$linktitle' => t('View $name\'s profile'),
'$profile_url' => $profile_link,
'$name' => $profile_name,
'$sparkle' => $sparkle,
}
}
+
+ $o .= paginate($a);
+
return $o;
}