diff --git a/addon/facebook/facebook.php b/addon/facebook/facebook.php index 17cc8bf565..cd1ae4aa33 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'); @@ -718,11 +733,17 @@ function fb_consume_stream($uid,$j,$wall = false) { if(! $orig_post) continue; - $r = q("SELECT * FROM `item` WHERE `parent-uri` = '%s' AND `uid` = %d AND `verb` = '%s' AND `author-link` = '%s' LIMIT 1", + // If we posted the like locally, it will be found with our url, not the FB url. + + $second_url = (($likes->id == $self_id) ? $self[0]['url'] : 'http://facebook.com/profile.php?id=' . $likes->id); + + $r = q("SELECT * FROM `item` WHERE `parent-uri` = '%s' AND `uid` = %d AND `verb` = '%s' + AND ( `author-link` = '%s' OR `author-link` = '%s' ) LIMIT 1", dbesc($orig_post['uri']), intval($uid), dbesc(ACTIVITY_LIKE), - dbesc('http://facebook.com/profile.php?id=' . $likes->id) + dbesc('http://facebook.com/profile.php?id=' . $likes->id), + dbesc($second_url) ); if(count($r)) diff --git a/addon/statusnet/statusnet.php b/addon/statusnet/statusnet.php index bd40f78d83..39df7d9620 100644 --- a/addon/statusnet/statusnet.php +++ b/addon/statusnet/statusnet.php @@ -207,7 +207,7 @@ function statusnet_settings(&$a,&$s) { */ if (! $globalsn == null) { $s .= '

' . t('Globally Available StatusNet OAuthKeys') . '

'; - $s .= '

'. t('There are preconfigured OAuth key pairs for some StatusNet servers available. If you are useing one of them, please use these credentials. If not feel free to connect to any other StatusNet instance (see below).') .'

'; + $s .= '

'. t("There are preconfigured OAuth key pairs for some StatusNet servers available. If you are useing one of them, please use these credentials. If not feel free to connect to any other StatusNet instance \x28see below\x29.") .'

'; $s .= '
'; foreach ($globalsn as $asn) { $s .= ''. $asn['sitename'] .'
'; diff --git a/boot.php b/boot.php index 79e520150a..6de0f7a7fa 100644 --- a/boot.php +++ b/boot.php @@ -4,9 +4,9 @@ set_time_limit(0); ini_set('pcre.backtrack_limit', 250000); -define ( 'FRIENDIKA_VERSION', '2.2.991' ); +define ( 'FRIENDIKA_VERSION', '2.2.993' ); define ( 'DFRN_PROTOCOL_VERSION', '2.21' ); -define ( 'DB_UPDATE_VERSION', 1058 ); +define ( 'DB_UPDATE_VERSION', 1059 ); define ( 'EOL', "
\r\n" ); define ( 'ATOM_TIME', 'Y-m-d\TH:i:s\Z' ); @@ -682,7 +682,7 @@ function fetch_url($url,$binary = false, &$redirects = 0) { $s = substr($s,strlen($header)+4); $header = substr($s,0,strpos($s,"\r\n\r\n")); } - if($http_code == 301 || $http_code == 302 || $http_code == 303) { + if($http_code == 301 || $http_code == 302 || $http_code == 303 || $http_code == 307) { $matches = array(); preg_match('/(Location:|URI:)(.*?)\n/', $header, $matches); $url = trim(array_pop($matches)); @@ -2106,10 +2106,10 @@ function micropro($contact, $redirect = false, $class = '', $textmode = false) { if(! function_exists('search')) { -function search($s) { +function search($s,$id='search-box',$url='/search') { $a = get_app(); - $o = ''; + +return $o; +} \ No newline at end of file diff --git a/mod/dfrn_notify.php b/mod/dfrn_notify.php index 5d6f2c3717..12e7ff7ced 100644 --- a/mod/dfrn_notify.php +++ b/mod/dfrn_notify.php @@ -420,7 +420,7 @@ function dfrn_notify_post(&$a) { '$url' => $datarray['author-link'], // full url for the site '$from' => $from, // name of the person sending the message '$body' => $msg['htmlversion'], // html version of the message - '$display' => $a->get_baseurl() . '/display/' . $importer['nick'] . '/' . $posted_id, + '$display' => $a->get_baseurl() . '/display/' . $importer['nickname'] . '/' . $posted_id, )); // load the template for private message notifications @@ -433,7 +433,7 @@ function dfrn_notify_post(&$a) { '$url' => $datarray['author-link'], // full url for the site '$from' => $from, // name of the person sending the message '$body' => $msg['textversion'], // text version of the message - '$display' => $a->get_baseurl() . '/display/' . $importer['nick'] . '/' . $posted_id, + '$display' => $a->get_baseurl() . '/display/' . $importer['nickname'] . '/' . $posted_id, )); // use the EmailNotification library to send the message diff --git a/mod/item.php b/mod/item.php index 82f33eaebd..b07f26e328 100644 --- a/mod/item.php +++ b/mod/item.php @@ -204,13 +204,25 @@ function item_post(&$a) { continue; $image_uri = substr($image,strrpos($image,'/') + 1); $image_uri = substr($image_uri,0, strpos($image_uri,'-')); + $srch = '<' . intval($profile_uid) . '>'; + $r = q("SELECT `id` FROM `photo` WHERE `allow_cid` = '%s' AND `allow_gid` = '' AND `deny_cid` = '' AND `deny_gid` = '' + AND `resource-id` = '%s' AND `uid` = %d LIMIT 1", + dbesc($srch), + dbesc($image_uri), + intval($profile_uid) + ); + if(! count($r)) + continue; + + $r = q("UPDATE `photo` SET `allow_cid` = '%s', `allow_gid` = '%s', `deny_cid` = '%s', `deny_gid` = '%s' - WHERE `resource-id` = '%s' AND `album` = '%s' ", + WHERE `resource-id` = '%s' AND `uid` = %d AND `album` = '%s' ", dbesc($str_contact_allow), dbesc($str_group_allow), dbesc($str_contact_deny), dbesc($str_group_deny), dbesc($image_uri), + intval($profile_uid), dbesc( t('Wall Photos')) ); diff --git a/mod/network.php b/mod/network.php index f38fb8c213..75775ba502 100644 --- a/mod/network.php +++ b/mod/network.php @@ -12,10 +12,18 @@ function network_init(&$a) { if(! x($a->page,'aside')) $a->page['aside'] = ''; + $search = ((x($_GET,'search')) ? escape_tags($_GET['search']) : ''); + $srchurl = '/network' . ((x($_GET,'cid')) ? '?cid=' . $_GET['cid'] : ''); + + + $a->page['aside'] .= search($search,'netsearch-box',$srchurl); + $a->page['aside'] .= '