$hashtags = "";
if (isset($data["keywords"]) AND count($data["keywords"])) {
- $a = get_app();
$hashtags = "\n";
foreach ($data["keywords"] AS $keyword) {
/// @todo make a positive list of allowed characters
$hashtag = str_replace(array(" ", "+", "/", ".", "#", "'", "’", "`", "(", ")", "„", "“"),
array("","", "", "", "", "", "", "", "", "", "", ""), $keyword);
- $hashtags .= "#[url=".$a->get_baseurl()."/search?tag=".rawurlencode($hashtag)."]".$hashtag."[/url] ";
+ $hashtags .= "#[url=".App::get_baseurl()."/search?tag=".rawurlencode($hashtag)."]".$hashtag."[/url] ";
}
}
$tags = "";
if (isset($data["keywords"]) AND count($data["keywords"])) {
- $a = get_app();
foreach ($data["keywords"] AS $keyword) {
$hashtag = str_replace(array(" ", "+", "/", ".", "#", "'"),
array("","", "", "", "", ""), $keyword);
if ($tags != "")
$tags .= ",";
- $tags .= "#[url=".$a->get_baseurl()."/search?tag=".rawurlencode($hashtag)."]".$hashtag."[/url]";
+ $tags .= "#[url=".App::get_baseurl()."/search?tag=".rawurlencode($hashtag)."]".$hashtag."[/url]";
}
}
logger("Both author-link and owner-link are empty. Called by: ".App::callstack(), LOGGER_DEBUG);
if ($arr['plink'] == "") {
- $a = get_app();
- $arr['plink'] = $a->get_baseurl().'/display/'.urlencode($arr['guid']);
+ $arr['plink'] = App::get_baseurl().'/display/'.urlencode($arr['guid']);
}
if ($arr['network'] == "") {
$u = q("SELECT `nickname` FROM `user` WHERE `uid` = %d", intval($arr['uid']));
if (count($u)) {
$a = get_app();
- $self = normalise_link($a->get_baseurl() . '/profile/' . $u[0]['nickname']);
+ $self = normalise_link(App::get_baseurl() . '/profile/' . $u[0]['nickname']);
logger("item_store: 'myself' is ".$self." for parent ".$parent_id." checking against ".$arr['author-link']." and ".$arr['owner-link'], LOGGER_DEBUG);
if ((normalise_link($arr['author-link']) == $self) OR (normalise_link($arr['owner-link']) == $self)) {
q("UPDATE `thread` SET `mention` = 1 WHERE `iid` = %d", intval($parent_id));
// in it.
if (!$deleted AND !$dontcache) {
- $r = q('SELECT * FROM `item` WHERE id = %d', intval($current_post));
- if (count($r) == 1) {
+ $r = q('SELECT * FROM `item` WHERE `id` = %d', intval($current_post));
+ if ((dbm::is_result($r)) && (count($r) == 1)) {
if ($notify)
call_hooks('post_local_end', $r[0]);
else
// All hashtags should point to the home server
//$item["body"] = preg_replace("/#\[url\=([$URLSearchString]*)\](.*?)\[\/url\]/ism",
- // "#[url=".$a->get_baseurl()."/search?tag=$2]$2[/url]", $item["body"]);
+ // "#[url=".App::get_baseurl()."/search?tag=$2]$2[/url]", $item["body"]);
//$item["tag"] = preg_replace("/#\[url\=([$URLSearchString]*)\](.*?)\[\/url\]/ism",
- // "#[url=".$a->get_baseurl()."/search?tag=$2]$2[/url]", $item["tag"]);
+ // "#[url=".App::get_baseurl()."/search?tag=$2]$2[/url]", $item["tag"]);
// mask hashtags inside of url, bookmarks and attachments to avoid urls in urls
$item["body"] = preg_replace_callback("/\[url\=([$URLSearchString]*)\](.*?)\[\/url\]/ism",
$basetag = str_replace('_',' ',substr($tag,1));
- $newtag = '#[url='.$a->get_baseurl().'/search?tag='.rawurlencode($basetag).']'.$basetag.'[/url]';
+ $newtag = '#[url='.App::get_baseurl().'/search?tag='.rawurlencode($basetag).']'.$basetag.'[/url]';
$item["body"] = str_replace($tag, $newtag, $item["body"]);
$item = $i[0];
- $link = normalise_link($a->get_baseurl() . '/profile/' . $u[0]['nickname']);
+ $link = normalise_link(App::get_baseurl() . '/profile/' . $u[0]['nickname']);
// Diaspora uses their own hardwired link URL in @-tags
// instead of the one we supply with webfinger
- $dlink = normalise_link($a->get_baseurl() . '/u/' . $u[0]['nickname']);
+ $dlink = normalise_link(App::get_baseurl() . '/u/' . $u[0]['nickname']);
$cnt = preg_match_all('/[\@\!]\[url\=(.*?)\](.*?)\[\/url\]/ism',$item['body'],$matches,PREG_SET_ORDER);
if ($cnt) {
$prvgroup = (($u[0]['page-flags'] == PAGE_PRVGROUP) ? true : false);
- $link = normalise_link($a->get_baseurl() . '/profile/' . $u[0]['nickname']);
+ $link = normalise_link(App::get_baseurl() . '/profile/' . $u[0]['nickname']);
// Diaspora uses their own hardwired link URL in @-tags
// instead of the one we supply with webfinger
- $dlink = normalise_link($a->get_baseurl() . '/u/' . $u[0]['nickname']);
+ $dlink = normalise_link(App::get_baseurl() . '/u/' . $u[0]['nickname']);
$cnt = preg_match_all('/[\@\!]\[url\=(.*?)\](.*?)\[\/url\]/ism',$item['body'],$matches,PREG_SET_ORDER);
if ($cnt) {
intval($importer['uid'])
);
$a = get_app();
+
if (dbm::is_result($r) AND !in_array($r[0]['page-flags'], array(PAGE_SOAPBOX, PAGE_FREELOVE))) {
// create notification
'to_name' => $r[0]['username'],
'to_email' => $r[0]['email'],
'uid' => $r[0]['uid'],
- 'link' => $a->get_baseurl() . '/notifications/intro',
+ 'link' => App::get_baseurl() . '/notifications/intro',
'source_name' => ((strlen(stripslashes($contact_record['name']))) ? stripslashes($contact_record['name']) : t('[Name Withheld]')),
'source_link' => $contact_record['url'],
'source_photo' => $contact_record['photo'],
$a = get_app();
logger('fix_private_photos: check for photos', LOGGER_DEBUG);
- $site = substr($a->get_baseurl(),strpos($a->get_baseurl(),'://'));
+ $site = substr(App::get_baseurl(),strpos(App::get_baseurl(),'://'));
$orig_body = $s;
$new_body = '';
if (! $interactive)
return 0;
notice( t('Item not found.') . EOL);
- goaway($a->get_baseurl() . '/' . $_SESSION['return_url']);
+ goaway(App::get_baseurl() . '/' . $_SESSION['return_url']);
}
$item = $r[0];
}
// Now check how the user responded to the confirmation query
if ($_REQUEST['canceled']) {
- goaway($a->get_baseurl() . '/' . $_SESSION['return_url']);
+ goaway(App::get_baseurl() . '/' . $_SESSION['return_url']);
}
logger('delete item: ' . $item['id'], LOGGER_DEBUG);
if (! $interactive)
return $owner;
- goaway($a->get_baseurl() . '/' . $_SESSION['return_url']);
+ goaway(App::get_baseurl() . '/' . $_SESSION['return_url']);
//NOTREACHED
} else {
if (! $interactive)
return 0;
notice( t('Permission denied.') . EOL);
- goaway($a->get_baseurl() . '/' . $_SESSION['return_url']);
+ goaway(App::get_baseurl() . '/' . $_SESSION['return_url']);
//NOTREACHED
}
$ret = list_post_dates($uid,$wall);
- if (! count($ret))
+ if (! dbm::is_result($ret))
return $o;
$cutoff_year = intval(datetime_convert('',date_default_timezone_get(),'now','Y')) - $visible_years;