$with = ((x($_POST,'with')) ? notags(trim($_POST['with'])) : '');
- if (! strlen($howlong))
- $howlong = '0000-00-00 00:00:00';
- else
+ if (! strlen($howlong)) {
+ $howlong = NULL_DATE;
+ } else {
$howlong = datetime_convert(date_default_timezone_get(),'UTC',$howlong);
-
+ }
// linkify the relationship target if applicable
$withchanged = false;
$withchanged = true;
$prf = '';
$lookup = $with;
- if (strpos($lookup,'@') === 0)
+ if (strpos($lookup,'@') === 0) {
$lookup = substr($lookup,1);
+ }
$lookup = str_replace('_',' ', $lookup);
if (strpos($lookup,'@') || (strpos($lookup,'http://'))) {
$newname = $lookup;
+ /// @TODO Maybe kill those error/debugging-surpressing @ characters
$links = @Probe::lrdd($lookup);
if (count($links)) {
foreach ($links as $link) {
}
}
}
- }
- else {
+ } else {
$newname = $lookup;
/* if (strstr($lookup,' ')) {
$r = q("SELECT * FROM `contact` WHERE `name` = '%s' AND `uid` = %d LIMIT 1",
'$gender' => gender_selector($r[0]['gender']),
'$marital' => marital_selector($r[0]['marital']),
'$with' => array('with', t("Who: \x28if applicable\x29"), strip_tags($r[0]['with']), t('Examples: cathy123, Cathy Williams, cathy@example.com')),
- '$howlong' => array('howlong', t('Since [date]:'), ($r[0]['howlong'] === '0000-00-00 00:00:00' ? '' : datetime_convert('UTC',date_default_timezone_get(),$r[0]['howlong']))),
+ '$howlong' => array('howlong', t('Since [date]:'), ($r[0]['howlong'] <= NULL_DATE ? '' : datetime_convert('UTC',date_default_timezone_get(),$r[0]['howlong']))),
'$sexual' => sexpref_selector($r[0]['sexual']),
'$about' => array('about', t('Tell us about yourself...'), $r[0]['about']),
'$xmpp' => array('xmpp', t('XMPP (Jabber) address:'), $r[0]['xmpp'], t("The XMPP address will be propagated to your contacts so that they can follow you.")),