$notice->whereAdd('EXISTS (SELECT subscribed from subscription where subscriber = '.$profile->id.' and subscribed = notice.profile_id)', 'OR');
$notice->whereAdd('profile_id = ' . $profile->id, 'OR');
- $notice->orderBy('created DESC');
+ $notice->orderBy('created DESC, notice.id DESC');
$page = ($this->arg('page')) ? ($this->arg('page')+0) : 1;
$notice->whereAdd('EXISTS (SELECT subscribed from subscription where subscriber = '.$user->id.' and subscribed = notice.profile_id)', 'OR');
$notice->whereAdd('profile_id = ' . $user->id, 'OR');
- $notice->orderBy('created DESC');
+ $notice->orderBy('created DESC, notice.id DESC');
if ($limit != 0) {
$notice->limit(0, $limit);
}
$q = strtolower($q);
$notice->whereAdd('MATCH(content) against (\''.addslashes($q).'\')');
- $notice->orderBy('created DESC');
+ $notice->orderBy('created DESC, notice.id DESC');
# Ask for an extra to see if there's more.
$notice->whereAdd('EXISTS (SELECT user.id from user where user.id = notice.profile_id)');
- $notice->orderBy('created DESC');
+ $notice->orderBy('created DESC, notice.id DESC');
if ($limit != 0) {
$notice->limit(0, $limit);
$notice = DB_DataObject::factory('notice');
$notice->profile_id = $profile->id;
- $notice->orderBy('created DESC');
+ $notice->orderBy('created DESC, notice.id DESC');
$page = ($this->arg('page')) ? ($this->arg('page')+0) : 1;
$notice = DB_DataObject::factory('notice');
$notice->profile_id = $user->id; # user id === profile id
- $notice->orderBy('created DESC');
+ $notice->orderBy('created DESC, notice.id DESC');
if ($limit != 0) {
$notice->limit(0, $limit);
}
if ($dt) {
$notice->whereAdd('created < "' . $dt . '"');
}
- $notice->orderBy('created DESC');
+ $notice->orderBy('created DESC, notice.id DESC');
$notice->limit(1);
if ($notice->find(true)) {
return $notice;