Trailing whitespace on lines
darcs-hash:20080710051201-533db-2d5fb38710ce1dedcb6e161b08e31611dbaba666.gz
This commit is contained in:
parent
ce2b174c4a
commit
8b32942658
@ -25,18 +25,18 @@ define(NOTICES_PER_PAGE, 20);
|
|||||||
# XXX common parent for people and content search?
|
# XXX common parent for people and content search?
|
||||||
|
|
||||||
class NoticesearchAction extends SearchAction {
|
class NoticesearchAction extends SearchAction {
|
||||||
|
|
||||||
function get_instructions() {
|
function get_instructions() {
|
||||||
return _('Search for notices on %%site.name%% by their contents. ' .
|
return _('Search for notices on %%site.name%% by their contents. ' .
|
||||||
'Separate search terms by spaces; they must be 3 characters or more.');
|
'Separate search terms by spaces; they must be 3 characters or more.');
|
||||||
}
|
}
|
||||||
|
|
||||||
function get_title() {
|
function get_title() {
|
||||||
return _('Text search');
|
return _('Text search');
|
||||||
}
|
}
|
||||||
|
|
||||||
function show_results($q, $page) {
|
function show_results($q, $page) {
|
||||||
|
|
||||||
$notice = new Notice();
|
$notice = new Notice();
|
||||||
|
|
||||||
# lcase it for comparison
|
# lcase it for comparison
|
||||||
@ -44,7 +44,7 @@ class NoticesearchAction extends SearchAction {
|
|||||||
$notice->whereAdd('MATCH(content) against (\''.addslashes($q).'\')');
|
$notice->whereAdd('MATCH(content) against (\''.addslashes($q).'\')');
|
||||||
|
|
||||||
# Ask for an extra to see if there's more.
|
# Ask for an extra to see if there's more.
|
||||||
|
|
||||||
$notice->limit((($page-1)*NOTICES_PER_PAGE), NOTICES_PER_PAGE + 1);
|
$notice->limit((($page-1)*NOTICES_PER_PAGE), NOTICES_PER_PAGE + 1);
|
||||||
|
|
||||||
$cnt = $notice->find();
|
$cnt = $notice->find();
|
||||||
@ -64,7 +64,7 @@ class NoticesearchAction extends SearchAction {
|
|||||||
} else {
|
} else {
|
||||||
common_element('p', 'error', _('No results'));
|
common_element('p', 'error', _('No results'));
|
||||||
}
|
}
|
||||||
|
|
||||||
common_pagination($page > 1, $cnt > NOTICES_PER_PAGE,
|
common_pagination($page > 1, $cnt > NOTICES_PER_PAGE,
|
||||||
$page, 'noticesearch', array('q' => $q));
|
$page, 'noticesearch', array('q' => $q));
|
||||||
}
|
}
|
||||||
@ -81,9 +81,9 @@ class NoticesearchAction extends SearchAction {
|
|||||||
'title' => _('Search Stream Feed')));
|
'title' => _('Search Stream Feed')));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
# XXX: refactor and combine with StreamAction::show_notice()
|
# XXX: refactor and combine with StreamAction::show_notice()
|
||||||
|
|
||||||
function show_notice($notice, $terms) {
|
function show_notice($notice, $terms) {
|
||||||
$profile = $notice->getProfile();
|
$profile = $notice->getProfile();
|
||||||
# XXX: RDFa
|
# XXX: RDFa
|
||||||
@ -127,7 +127,7 @@ class NoticesearchAction extends SearchAction {
|
|||||||
_('in reply to...'));
|
_('in reply to...'));
|
||||||
common_text(')');
|
common_text(')');
|
||||||
}
|
}
|
||||||
common_element_start('a',
|
common_element_start('a',
|
||||||
array('href' => common_local_url('newnotice',
|
array('href' => common_local_url('newnotice',
|
||||||
array('replyto' => $profile->nickname)),
|
array('replyto' => $profile->nickname)),
|
||||||
'onclick' => 'doreply("'.$profile->nickname.'"); return false',
|
'onclick' => 'doreply("'.$profile->nickname.'"); return false',
|
||||||
|
@ -28,35 +28,35 @@ class NoticesearchrssAction extends Rss10Action {
|
|||||||
function init() {
|
function init() {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
function get_notices($limit=0) {
|
function get_notices($limit=0) {
|
||||||
|
|
||||||
$q = $this->trimmed('q');
|
$q = $this->trimmed('q');
|
||||||
$notices = array();
|
$notices = array();
|
||||||
|
|
||||||
$notice = new Notice();
|
$notice = new Notice();
|
||||||
|
|
||||||
# lcase it for comparison
|
# lcase it for comparison
|
||||||
$q = strtolower($q);
|
$q = strtolower($q);
|
||||||
|
|
||||||
$notice->whereAdd('MATCH(content) against (\''.addslashes($q).'\')');
|
$notice->whereAdd('MATCH(content) against (\''.addslashes($q).'\')');
|
||||||
$notice->orderBy('created DESC');
|
$notice->orderBy('created DESC');
|
||||||
|
|
||||||
# Ask for an extra to see if there's more.
|
# Ask for an extra to see if there's more.
|
||||||
|
|
||||||
if ($limit != 0) {
|
if ($limit != 0) {
|
||||||
$notice->limit(0, $limit);
|
$notice->limit(0, $limit);
|
||||||
}
|
}
|
||||||
|
|
||||||
$notice->find();
|
$notice->find();
|
||||||
|
|
||||||
while ($notice->fetch()) {
|
while ($notice->fetch()) {
|
||||||
$notices[] = clone($notice);
|
$notices[] = clone($notice);
|
||||||
}
|
}
|
||||||
|
|
||||||
return $notices;
|
return $notices;
|
||||||
}
|
}
|
||||||
|
|
||||||
function get_channel() {
|
function get_channel() {
|
||||||
global $config;
|
global $config;
|
||||||
$q = $this->trimmed('q');
|
$q = $this->trimmed('q');
|
||||||
@ -66,7 +66,7 @@ class NoticesearchrssAction extends Rss10Action {
|
|||||||
'description' => sprintf(_('All updates matching search term "%s"'), $q));
|
'description' => sprintf(_('All updates matching search term "%s"'), $q));
|
||||||
return $c;
|
return $c;
|
||||||
}
|
}
|
||||||
|
|
||||||
function get_image() {
|
function get_image() {
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
@ -23,7 +23,7 @@ require_once(INSTALLDIR.'/lib/searchaction.php');
|
|||||||
define(PROFILES_PER_PAGE, 10);
|
define(PROFILES_PER_PAGE, 10);
|
||||||
|
|
||||||
class PeoplesearchAction extends SearchAction {
|
class PeoplesearchAction extends SearchAction {
|
||||||
|
|
||||||
function get_instructions() {
|
function get_instructions() {
|
||||||
return _('Search for people on %%site.name%% by their name, location, or interests. ' .
|
return _('Search for people on %%site.name%% by their name, location, or interests. ' .
|
||||||
'Separate the terms by spaces; they must be 3 characters or more.');
|
'Separate the terms by spaces; they must be 3 characters or more.');
|
||||||
@ -32,18 +32,18 @@ class PeoplesearchAction extends SearchAction {
|
|||||||
function get_title() {
|
function get_title() {
|
||||||
return _('People search');
|
return _('People search');
|
||||||
}
|
}
|
||||||
|
|
||||||
function show_results($q, $page) {
|
function show_results($q, $page) {
|
||||||
|
|
||||||
$profile = new Profile();
|
$profile = new Profile();
|
||||||
|
|
||||||
# lcase it for comparison
|
# lcase it for comparison
|
||||||
$q = strtolower($q);
|
$q = strtolower($q);
|
||||||
$profile->whereAdd('MATCH(nickname, fullname, location, bio, homepage) ' .
|
$profile->whereAdd('MATCH(nickname, fullname, location, bio, homepage) ' .
|
||||||
'against (\''.addslashes($q).'\')');
|
'against (\''.addslashes($q).'\')');
|
||||||
|
|
||||||
# Ask for an extra to see if there's more.
|
# Ask for an extra to see if there's more.
|
||||||
|
|
||||||
$profile->limit((($page-1)*PROFILES_PER_PAGE), PROFILES_PER_PAGE + 1);
|
$profile->limit((($page-1)*PROFILES_PER_PAGE), PROFILES_PER_PAGE + 1);
|
||||||
|
|
||||||
$cnt = $profile->find();
|
$cnt = $profile->find();
|
||||||
@ -63,11 +63,11 @@ class PeoplesearchAction extends SearchAction {
|
|||||||
} else {
|
} else {
|
||||||
common_element('p', 'error', _('No results'));
|
common_element('p', 'error', _('No results'));
|
||||||
}
|
}
|
||||||
|
|
||||||
common_pagination($page > 1, $cnt > PROFILES_PER_PAGE,
|
common_pagination($page > 1, $cnt > PROFILES_PER_PAGE,
|
||||||
$page, 'peoplesearch', array('q' => $q));
|
$page, 'peoplesearch', array('q' => $q));
|
||||||
}
|
}
|
||||||
|
|
||||||
function show_profile($profile, $terms) {
|
function show_profile($profile, $terms) {
|
||||||
common_element_start('li', array('class' => 'profile_single',
|
common_element_start('li', array('class' => 'profile_single',
|
||||||
'id' => 'profile-' . $profile->id));
|
'id' => 'profile-' . $profile->id));
|
||||||
|
@ -75,7 +75,7 @@ class Action { // lawsuit
|
|||||||
unset($args['action']);
|
unset($args['action']);
|
||||||
return common_local_url($action, $args);
|
return common_local_url($action, $args);
|
||||||
}
|
}
|
||||||
|
|
||||||
function nav_menu($menu) {
|
function nav_menu($menu) {
|
||||||
$action = $this->trimmed('action');
|
$action = $this->trimmed('action');
|
||||||
common_element_start('ul', array('id' => 'nav_views'));
|
common_element_start('ul', array('id' => 'nav_views'));
|
||||||
|
Loading…
Reference in New Issue
Block a user