// if using the API, we won't see pubmail_enable - figure out if it should be set
if ($api_source && $profile_uid && $profile_uid == local_user() && (! $private)) {
- $mail_disabled = ((function_exists('imap_open') && (! get_config('system','imap_disabled'))) ? 0 : 1);
+ $mail_disabled = ((function_exists('imap_open') && (! get_config('system', 'imap_disabled'))) ? 0 : 1);
if (! $mail_disabled) {
+ /// @TODO Check if only pubmail is loaded, * loads all columns
$r = q("SELECT * FROM `mailacct` WHERE `uid` = %d AND `server` != '' LIMIT 1",
intval(local_user())
);
$r = q("SELECT * FROM `contact` WHERE `uid` = %d AND `self` = 1 LIMIT 1",
intval($_SESSION['uid']));
} elseif(remote_user()) {
- if (is_array($_SESSION['remote'])) {
+ if (x($_SESSION, 'remote') && is_array($_SESSION['remote'])) {
foreach ($_SESSION['remote'] as $v) {
if ($v['uid'] == $profile_uid) {
$contact_id = $v['cid'];
if ($parent AND ($parent_contact['network'] == NETWORK_OSTATUS)) {
$contact = '@[url=' . $parent_contact['url'] . ']' . $parent_contact['nick'] . '[/url]';
- if (!in_array($contact,$tags)) {
+ if (!in_array($contact, $tags)) {
$body = $contact . ' ' . $body;
$tags[] = $contact;
}
}
} else {
$r = false;
- if (strrpos($name,'+')) {
+ if (strrpos($name, '+')) {
// Is it in format @nick+number?
- $tagcid = intval(substr($name,strrpos($name,'+') + 1));
+ $tagcid = intval(substr($name, strrpos($name, '+') + 1));
$r = q("SELECT `id`, `url`, `nick`, `name`, `alias`, `network` FROM `contact` WHERE `id` = %d AND `uid` = %d LIMIT 1",
intval($tagcid),
$replaced = true;
// create profile link
- $profile = str_replace(',','%2c',$profile);
- $newtag = '@[url='.$profile.']'.$newname.'[/url]';
- $body = str_replace('@'.$name, $newtag, $body);
+ $profile = str_replace(',', '%2c', $profile);
+ $newtag = '@[url=' . $profile . ']' . $newname . '[/url]';
+ $body = str_replace('@' . $name, $newtag, $body);
// append tag to str_tags
- if (! stristr($str_tags,$newtag)) {
+ if (! stristr($str_tags, $newtag)) {
if (strlen($str_tags)) {
$str_tags .= ',';
}
$str_tags .= $newtag;
}
- // Status.Net seems to require the numeric ID URL in a mention if the person isn't
- // subscribed to you. But the nickname URL is OK if they are. Grrr. We'll tag both.
+ /*
+ * Status.Net seems to require the numeric ID URL in a mention if the person isn't
+ * subscribed to you. But the nickname URL is OK if they are. Grrr. We'll tag both.
+ */
if (strlen($alias)) {
- $newtag = '@[url='.$alias.']'.$newname.'[/url]';
- if (! stristr($str_tags,$newtag)) {
+ $newtag = '@[url=' . $alias . ']' . $newname . '[/url]';
+ if (! stristr($str_tags, $newtag)) {
if (strlen($str_tags)) {
$str_tags .= ',';
}