add plink to profile notifications

This commit is contained in:
friendica 2012-07-12 16:12:37 -07:00
parent ce5ca967c1
commit 7f7e2c5de0
2 changed files with 10 additions and 1 deletions

View file

@ -234,6 +234,7 @@ function localize_item(&$item){
$item['body'] = str_replace($mtch[0],'@[url=' . zrl($mtch[1]). ']',$item['body']); $item['body'] = str_replace($mtch[0],'@[url=' . zrl($mtch[1]). ']',$item['body']);
} }
} }
// add zrl's to public images // add zrl's to public images
if(preg_match_all('/\[url=(.*?)\/photos\/(.*?)\/image\/(.*?)\]\[img(.*?)\]h(.*?)\[\/img\]\[\/url\]/is',$item['body'],$matches,PREG_SET_ORDER)) { if(preg_match_all('/\[url=(.*?)\/photos\/(.*?)\/image\/(.*?)\]\[img(.*?)\]h(.*?)\[\/img\]\[\/url\]/is',$item['body'],$matches,PREG_SET_ORDER)) {
foreach($matches as $mtch) { foreach($matches as $mtch) {

View file

@ -385,9 +385,17 @@ function profile_activity($changed, $value) {
$arr['deny_gid'] = $a->user['deny_gid']; $arr['deny_gid'] = $a->user['deny_gid'];
$i = item_store($arr); $i = item_store($arr);
if($i) if($i) {
// give it a permanent link
q("update item set plink = '%s' where id = %d limit 1",
dbesc($a->get_baseurl() . '/display/' . $a->user['nickname'] . '/' . $i),
intval($i)
);
proc_run('php',"include/notifier.php","activity","$i"); proc_run('php',"include/notifier.php","activity","$i");
}
} }