if($contact['archive'])
return;
- if($contact['term-date'] == '0000-00-00 00:00:00') {
+ if ($contact['term-date'] <= NULL_DATE) {
q("UPDATE `contact` SET `term-date` = '%s' WHERE `id` = %d",
dbesc(datetime_convert()),
intval($contact['id'])
// It's a miracle. Our dead contact has inexplicably come back to life.
q("UPDATE `contact` SET `term-date` = '%s' WHERE `id` = %d",
- dbesc('0000-00-00 00:00:00'),
+ dbesc(NULL_DATE),
intval($contact['id'])
);
if ($contact['url'] != '') {
q("UPDATE `contact` SET `term-date` = '%s' WHERE `nurl` = '%s'",
- dbesc('0000-00-00 00:00:00'),
+ dbesc(NULL_DATE),
dbesc(normalise_link($contact['url']))
);
}
// "bd" always contains the upcoming birthday of a contact.
// "birthday" might contain the birthday including the year of birth.
- if ($profile["birthday"] != "0000-00-00") {
+ if ($profile["birthday"] > '0001-01-01') {
$bd_timestamp = strtotime($profile["birthday"]);
$month = date("m", $bd_timestamp);
$day = date("d", $bd_timestamp);
$profile["bd"] = (++$current_year)."-".$month."-".$day;
}
} else {
- $profile["bd"] = "0000-00-00";
+ $profile["bd"] = '0001-01-01';
}
} else {
$profile = $default;
$profile["location"] = "";
$profile["about"] = "";
$profile["gender"] = "";
- $profile["birthday"] = "0000-00-00";
+ $profile["birthday"] = '0001-01-01';
}
$cache[$url][$uid] = $profile;
else
$sql = "`item`.`uid` = %d";
- if(get_config('system', 'old_pager')) {
- $r = q("SELECT COUNT(*) AS `total` FROM `item`
- WHERE `gcontact-id` = %d and $sql",
- intval($gcontact_id),
- intval(local_user()));
-
- $a->set_pager_total($r[0]['total']);
- }
-
$r = q("SELECT `item`.`uri`, `item`.*, `item`.`id` AS `item_id`,
`author-name` AS `name`, `owner-avatar` AS `photo`,
`owner-link` AS `url`, `owner-avatar` AS `thumb`
intval($a->pager['itemspage'])
);
- $o = conversation($a,$r,'community',false);
+ $o = conversation($a, $r, 'community', false);
- if(!get_config('system', 'old_pager')) {
- $o .= alt_pager($a,count($r));
- } else {
- $o .= paginate($a);
- }
+ $o .= alt_pager($a, count($r));
return $o;
}
$author_id = intval($r[0]["author-id"]);
- if (get_config('system', 'old_pager')) {
- $r = q("SELECT COUNT(*) AS `total` FROM `item`
- WHERE `author-id` = %d and $sql",
- intval($author_id),
- intval(local_user()));
-
- $a->set_pager_total($r[0]['total']);
- }
-
$r = q(item_query()." AND `item`.`author-id` = %d AND ".$sql.
" ORDER BY `item`.`created` DESC LIMIT %d, %d",
intval($author_id),
intval($a->pager['itemspage'])
);
- $o = conversation($a,$r,'community',false);
+ $o = conversation($a, $r, 'community', false);
- if (!get_config('system', 'old_pager')) {
- $o .= alt_pager($a,count($r));
- } else {
- $o .= paginate($a);
- }
+ $o .= alt_pager($a, count($r));
return $o;
}