From 5a0690d9407588b7ed2c312c56290e4a9917597d Mon Sep 17 00:00:00 2001 From: Friendika Date: Thu, 26 May 2011 06:46:55 -0700 Subject: add attachments to FB posts, fix paren string in statusnet, do not insert attach div into post if no attachments --- addon/facebook/facebook.php | 15 +++++++++++++++ 1 file changed, 15 insertions(+) (limited to 'addon/facebook/facebook.php') diff --git a/addon/facebook/facebook.php b/addon/facebook/facebook.php index 17cc8bf56..d5544601a 100644 --- a/addon/facebook/facebook.php +++ b/addon/facebook/facebook.php @@ -505,6 +505,21 @@ function facebook_post_hook(&$a,&$b) { $msg = trim(strip_tags(bbcode($msg))); $msg = html_entity_decode($msg,ENT_QUOTES,'UTF-8'); + // add any attachments as text urls + + $arr = explode(',',$b['attach']); + + if(count($arr)) { + $msg .= "\n"; + foreach($arr as $r) { + $matches = false; + $cnt = preg_match('|\[attach\]href=\"(.+?)\" size=\"(.+?)\" type=\"(.+?)\" title=\"(.+?)\"\[\/attach\]|',$r,$matches); + if($cnt) { + $msg .= $matches[1]; + } + } + } + if (strlen($msg) > FACEBOOK_MAXPOSTLEN) { $shortlink = ""; require_once('library/slinky.php'); -- cgit v1.2.3