X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=include%2Fitems.php;h=ba95919a6ba9672a846b2bfa3fdf2c7d4c18caec;hb=64d0616762efcff413a335f2fdde4d8219d44895;hp=0bd77582a52b428c516ae414cc7fdcdd9bdc4a56;hpb=c1cf6e48c225725c380472e1f730f6dc02917ecd;p=friendica.git diff --git a/include/items.php b/include/items.php old mode 100644 new mode 100755 index 0bd77582a5..ba95919a6b --- a/include/items.php +++ b/include/items.php @@ -118,7 +118,7 @@ function get_feed_for(&$a, $dfrn_id, $owner_nick, $last_update, $direction = 0) `sign`.`signed_text`, `sign`.`signature`, `sign`.`signer` FROM `item` LEFT JOIN `contact` ON `contact`.`id` = `item`.`contact-id` LEFT JOIN `sign` ON `sign`.`iid` = `item`.`id` - WHERE `item`.`uid` = %d AND `item`.`visible` = 1 AND `item`.`parent` != 0 + WHERE `item`.`uid` = %d AND `item`.`visible` = 1 and `item`.`moderated` = 0 AND `item`.`parent` != 0 AND `item`.`wall` = 1 AND `contact`.`blocked` = 0 AND `contact`.`pending` = 0 AND ( `item`.`edited` > '%s' OR `item`.`changed` > '%s' ) $sql_extra @@ -295,6 +295,11 @@ function get_atom_elements($feed,$item) { $res['body'] = unxmlify($item->get_content()); $res['plink'] = unxmlify($item->get_link(0)); + if($res['plink']) + $base_url = implode('/', array_slice(explode('/',$res['plink']),0,3)); + else + $base_url = ''; + // look for a photo. We should check media size and find the best one, // but for now let's just find any author photo @@ -414,6 +419,8 @@ function get_atom_elements($feed,$item) { if((strpos($res['body'],'<') !== false) || (strpos($res['body'],'>') !== false)) { + $res['body'] = reltoabs($res['body'],$base_url); + $res['body'] = html2bb_video($res['body']); $res['body'] = oembed_html2bbcode($res['body']); @@ -807,6 +814,11 @@ function item_store($arr,$force_parent = false) { call_hooks('post_remote',$arr); + if(x($arr,'cancel')) { + logger('item_store: post cancelled by plugin.'); + return 0; + } + dbesc_array($arr); logger('item_store: ' . print_r($arr,true), LOGGER_DATA); @@ -1407,7 +1419,7 @@ function consume_feed($xml,$importer,&$contact, &$hub, $datedir = 0, $pass = 0) intval($item['uid']) ); // who is the last child now? - $r = q("SELECT `id` FROM `item` WHERE `parent-uri` = '%s' AND `type` != 'activity' AND `deleted` = 0 AND `uid` = %d + $r = q("SELECT `id` FROM `item` WHERE `parent-uri` = '%s' AND `type` != 'activity' AND `deleted` = 0 AND `moderated` = 0 AND `uid` = %d ORDER BY `created` DESC LIMIT 1", dbesc($item['parent-uri']), intval($importer['uid']) @@ -2748,6 +2760,9 @@ function item_expire($uid,$days) { function drop_items($items) { $uid = 0; + if((! local_user()) && (! $remote_user())) + return; + if(count($items)) { foreach($items as $item) { $owner = drop_item($item,false);