);
}
-
-
// search terms header
if(x($_GET,'search')) {
$a->page['content'] .= '<h2>' . t('Search Results For:') . ' ' . $search . '</h2>';
'selected' => ($search==$rr['term']),
);
}
- }
+ }
+
-
$tpl = get_markup_template("saved_searches_aside.tpl");
$o = replace_macros($tpl, array(
'$title' => t('Saved Searches'),
'$searchbox' => search($search,'netsearch-box',$srchurl,true),
'$saved' => $saved,
));
-
+
return $o;
}
|| ($a->argc > 2 && $a->argv[2] === 'new')) {
$new_active = 'active';
}
-
+
if(x($_GET,'search')) {
$search_active = 'active';
}
-
+
if(x($_GET,'star')) {
$starred_active = 'active';
}
-
+
if(x($_GET,'bmark')) {
$bookmarked_active = 'active';
}
$spam_active = 'active';
}
-
-
+
+
if (($new_active == '')
&& ($starred_active == '')
&& ($bookmarked_active == '')
case 'comment' : $all_active = 'active'; $no_active=''; break;
}
}
-
+
return array($no_active, $all_active, $postord_active, $conv_active, $new_active, $starred_active, $bookmarked_active, $spam_active);
}
// that belongs to you, hence you can see all of it. We will filter by group if
// desired.
-
$sql_options = (($star) ? " and starred = 1 " : '');
$sql_options .= (($bmark) ? " and bookmark = 1 " : '');
$sql_extra2 = (($nouveau) ? '' : " AND `item`.`parent` = `item`.`id` ");
$sql_extra3 = (($nouveau) ? '' : $sql_extra3);
+ $sql_order = "`item`.`received`";
$sql_table = "`item`";
if(x($_GET,'search')) {
$sql_extra = sprintf(" AND `term`.`term` = '%s' AND `term`.`otype` = %d AND `term`.`type` = %d ",
dbesc(protect_sprintf($search)), intval(TERM_OBJ_POST), intval(TERM_HASHTAG));
$sql_table = "`term` LEFT JOIN `item` ON `item`.`id` = `term`.`oid` AND `item`.`uid` = `term`.`uid` ";
+
+ $sql_order = "`term`.`tid`";
} else {
if (get_config('system','use_fulltext_engine'))
$sql_extra = sprintf(" AND MATCH (`item`.`body`, `item`.`title`) AGAINST ('%s' in boolean mode) ", dbesc(protect_sprintf($search)));
else
$sql_extra = sprintf(" AND `item`.`body` REGEXP '%s' ", dbesc(protect_sprintf(preg_quote($search))));
+
+ $sql_order = "`item`.`received`";
}
}
if(strlen($file)) {
$simple_update
AND `contact`.`blocked` = 0 AND `contact`.`pending` = 0
$sql_extra $sql_nets
- ORDER BY `item`.`received` DESC $pager_sql ",
+ ORDER BY $sql_order DESC $pager_sql ",
intval($_SESSION['uid'])
);
else
$ordering = "`commented`";
+ if ($sql_order == "")
+ $sql_order = "`item`.$ordering";
+
// Fetch a page full of parent items for this page
if($update) {
AND `item`.`moderated` = 0 AND `contact`.`blocked` = 0 AND `contact`.`pending` = 0
AND `item`.`parent` = `item`.`id`
$sql_extra3 $sql_extra $sql_nets
- ORDER BY `item`.$ordering DESC $pager_sql ",
+ ORDER BY $sql_order DESC $pager_sql ",
intval(local_user())
);
}
$o .= conversation($a,$items,$mode,$update);
- if(! $update) {
+ if(!$update) {
if( get_config('alt_pager', 'global') || get_pconfig(local_user(),'system','alt_pager') ) {
$o .= alt_pager($a,count($items));
}
$sql_extra = sprintf(" AND `term`.`term` = '%s' AND `term`.`otype` = %d AND `term`.`type` = %d group by `item`.`uri` ",
dbesc(protect_sprintf($search)), intval(TERM_OBJ_POST), intval(TERM_HASHTAG));
$sql_table = "`term` LEFT JOIN `item` ON `item`.`id` = `term`.`oid` AND `item`.`uid` = `term`.`uid` ";
+ $sql_order = "`term`.`tid`";
+ //$sql_order = "`item`.`received`";
//$sql_extra = sprintf(" AND EXISTS (SELECT * FROM `term` WHERE `item`.`id` = `term`.`oid` AND `item`.`uid` = `term`.`uid` AND `term`.`term` = '%s' AND `term`.`otype` = %d AND `term`.`type` = %d) GROUP BY `item`.`uri` ",
// dbesc(protect_sprintf($search)), intval(TERM_OBJ_POST), intval(TERM_HASHTAG));
$sql_extra = sprintf(" AND `item`.`body` REGEXP '%s' ", dbesc(protect_sprintf(preg_quote($search))));
}
$sql_table = "`item`";
+ $sql_order = "`item`.`received`";
}
// Here is the way permissions work in the search module...
OR ( `item`.`uid` = %d ))
AND `contact`.`blocked` = 0 AND `contact`.`pending` = 0
$sql_extra
- ORDER BY `received` DESC LIMIT %d , %d ",
+ ORDER BY $sql_order DESC LIMIT %d , %d ",
intval(local_user()),
intval($a->pager['start']),
intval($a->pager['itemspage'])
}
- if($tag)
+ if($tag)
$o .= '<h2>Items tagged with: ' . $search . '</h2>';
else
$o .= '<h2>Search results for: ' . $search . '</h2>';