$items = q("SELECT `uri`, `plink`, `author-link`, `author-name`, `created`, `edited`, `id`, `title`, `body` from `item` WHERE id=%d", intval($pid));
foreach ($items AS $item) {
+ $item['body'] = bb_CleanPictureLinks($item['body']);
+
// Looking for the first image
$image = '';
if(preg_match("/\[img\=([0-9]*)x([0-9]*)\](.*?)\[\/img\]/is",$item['body'],$matches))
require_once("include/bbcode.php");
require_once("include/html2plain.php");
+ $b['body'] = bb_CleanPictureLinks($b['body']);
+
// Looking for the first image
$image = '';
if(preg_match("/\[img\=([0-9]*)x([0-9]*)\](.*?)\[\/img\]/is",$b['body'],$matches))
logger('fbpost_post_hook: original msg=' . $msg, LOGGER_DATA);
+ // To-Do: if it is a reply, then only do a simple bbcode2plain conversion
$msgarr = fbpost_createmsg($b);
$msg = $msgarr["msg"];
$link = $msgarr["link"];
// If it is a special kind of failure the post was receiced
// Although facebook said it wasn't received ...
- if (!$likes AND (($retj->error->type != "OAuthException") OR ($retj->error->code != 2))) {
+ if (!$likes AND (($retj->error->type != "OAuthException") OR ($retj->error->code != 2)) AND ($x <> "")) {
$r = q("SELECT `id` FROM `contact` WHERE `uid` = %d AND `self`", intval($b['uid']));
if (count($r))
$a->contact = $r[0]["id"];
// If it is a special kind of failure the post was receiced
// Although facebook said it wasn't received ...
$ret = json_decode($j);
- if (($ret->error->type != "OAuthException") OR ($ret->error->code != 2))
+ if (($ret->error->type != "OAuthException") OR ($ret->error->code != 2) AND ($j <> ""))
update_queue_time($x['id']);
else
logger('fbpost_queue_hook: Not requeued, since it seems to be received');
$_REQUEST["body"] .= "[class=type-".$type."]";
if ($content)
- $_REQUEST["body"] .= $content;
+ $_REQUEST["body"] .= trim($content);
if ($quote)
$_REQUEST["body"] .= "\n[quote]".$quote."[/quote]";
//elseif ($images["full"] != "")
// $post .= "\n[img]".$images["full"]."[/img]\n";
if ($images["full"] != "")
- $post .= "\n[img]".$images["full"]."[/img]\n";
+ $post .= "\n[img]".$images["full"]."[/img]";
//$post .= "[quote]".trim(fromgplus_html2bbcode($attachment->content))."[/quote]";
$quote = trim(fromgplus_html2bbcode($attachment->content));
$items = q("SELECT `uri`, `plink`, `author-link`, `author-name`, `created`, `edited`, `id`, `title`, `body` from `item` WHERE id=%d", intval($pid));
foreach ($items AS $item) {
+ $item['body'] = bb_CleanPictureLinks($item['body']);
+
// Looking for the first image
$image = '';
if(preg_match("/\[img\=([0-9]*)x([0-9]*)\](.*?)\[\/img\]/is",$item['body'],$matches))
require_once("include/bbcode.php");
require_once("include/html2plain.php");
+ $b['body'] = bb_CleanPictureLinks($b['body']);
+
// Looking for the first image
$cleaned_body = api_clean_plain_items($b['body']);
$image = '';
$max_char = 140;
+ $b['body'] = bb_CleanPictureLinks($b['body']);
+
// Looking for the first image
$cleaned_body = api_clean_plain_items($b['body']);
$image = '';