diff options
author | Friendika <info@friendika.com> | 2011-05-26 06:46:55 -0700 |
---|---|---|
committer | Friendika <info@friendika.com> | 2011-05-26 06:46:55 -0700 |
commit | 5a0690d9407588b7ed2c312c56290e4a9917597d (patch) | |
tree | 0c2f7c1f141b60113fac75d643d8959ab173e05b /addon/facebook | |
parent | 61b730d567ac4bb648a8d4399f35ca0d32328d40 (diff) | |
download | volse-hubzilla-5a0690d9407588b7ed2c312c56290e4a9917597d.tar.gz volse-hubzilla-5a0690d9407588b7ed2c312c56290e4a9917597d.tar.bz2 volse-hubzilla-5a0690d9407588b7ed2c312c56290e4a9917597d.zip |
add attachments to FB posts, fix paren string in statusnet, do not insert attach div into post if no attachments
Diffstat (limited to 'addon/facebook')
-rw-r--r-- | addon/facebook/facebook.php | 15 |
1 files changed, 15 insertions, 0 deletions
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'); |