From 5a0690d9407588b7ed2c312c56290e4a9917597d Mon Sep 17 00:00:00 2001 From: Friendika Date: Thu, 26 May 2011 06:46:55 -0700 Subject: [PATCH 01/12] 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 +++++++++++++++ addon/statusnet/statusnet.php | 2 +- boot.php | 4 ++-- images/content-types.gif | Bin 384 -> 0 bytes util/messages.po | 24 +++++++++++++----------- util/strings.php | 4 ++-- 6 files changed, 33 insertions(+), 16 deletions(-) delete mode 100644 images/content-types.gif 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'); diff --git a/addon/statusnet/statusnet.php b/addon/statusnet/statusnet.php index bd40f78d8..39df7d962 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 79e520150..cac272be5 100644 --- a/boot.php +++ b/boot.php @@ -2547,8 +2547,8 @@ function prepare_body($item,$attach = false) { return $s; $arr = explode(',',$item['attach']); - $s .= '
'; if(count($arr)) { + $s .= '
'; foreach($arr as $r) { $matches = false; $icon = ''; @@ -2572,8 +2572,8 @@ function prepare_body($item,$attach = false) { $s .= '' . $icon . ''; } } + $s .= '
'; } - $s .= '
'; return $s; }} diff --git a/images/content-types.gif b/images/content-types.gif deleted file mode 100644 index 2b8cc7fc3ce29419008175b2d7f790ed1b3a1c96..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 384 zcmV-`0e}8SNk%v~VPpUo0Kx?T000000RR600RI60fPjGi|NsC0|NsC0EC2ui0Av6c z000C22)f+w%5 zNc=rCMc-{U@oQz#{Z(qe!`i=K$p0k}@V z#=M9`02a7Nk`^69+2lnd$1LQWkt8uzgUE~BhG8xpW{fGbp39W5SU&t&v82hI;rsvv eiIir>kUD8~oJzH-)vH*uKGDjxYQPH#0029QzPHQ( diff --git a/util/messages.po b/util/messages.po index 19c39b249..68c844388 100644 --- a/util/messages.po +++ b/util/messages.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: 2.2.991\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2011-05-25 17:11-0700\n" +"POT-Creation-Date: 2011-05-26 06:46-0700\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" @@ -1725,12 +1725,12 @@ msgstr "" msgid "Register" msgstr "" -#: ../../mod/like.php:110 ../../addon/facebook/facebook.php:759 +#: ../../mod/like.php:110 ../../addon/facebook/facebook.php:774 #: ../../include/conversation.php:20 msgid "status" msgstr "" -#: ../../mod/like.php:127 ../../addon/facebook/facebook.php:763 +#: ../../mod/like.php:127 ../../addon/facebook/facebook.php:778 #: ../../include/conversation.php:25 #, php-format msgid "%1$s likes %2$s's %3$s" @@ -1822,8 +1822,15 @@ msgstr "" msgid "Administrator@" msgstr "" -#: ../../mod/item.php:562 ../../mod/item.php:626 ../../mod/dfrn_notify.php:573 -msgid " commented on an item at " +#: ../../mod/item.php:562 ../../mod/dfrn_notify.php:446 +#: ../../mod/dfrn_notify.php:573 +#, php-format +msgid "%s commented on an item at %s" +msgstr "" + +#: ../../mod/item.php:626 +#, php-format +msgid "%s posted to your profile wall at %s" msgstr "" #: ../../mod/item.php:655 @@ -2084,11 +2091,6 @@ msgstr "" msgid "New mail received at " msgstr "" -#: ../../mod/dfrn_notify.php:446 -#, php-format -msgid "%s commented on an item at %s" -msgstr "" - #: ../../mod/apps.php:6 msgid "Applications" msgstr "" @@ -2508,7 +2510,7 @@ msgstr "" msgid "Image: " msgstr "" -#: ../../addon/facebook/facebook.php:561 +#: ../../addon/facebook/facebook.php:576 msgid "View on Friendika" msgstr "" diff --git a/util/strings.php b/util/strings.php index 659b0a2df..a9591b0c2 100644 --- a/util/strings.php +++ b/util/strings.php @@ -158,7 +158,6 @@ $a->strings["Connection accepted at %s"] = "Connection accepted at %s"; $a->strings['Administrator'] = 'Administrator'; $a->strings['noreply'] = 'noreply'; $a->strings['%s commented on an item at %s'] = '%s commented on an item at %s'; -$a->strings[" commented on an item at "] = " commented on an item at "; $a->strings["This introduction has already been accepted."] = "This introduction has already been accepted."; $a->strings['Profile location is not valid or does not contain profile information.'] = 'Profile location is not valid or does not contain profile information.'; $a->strings['Warning: profile location has no identifiable owner name.'] = 'Warning: profile location has no identifiable owner name.'; @@ -314,6 +313,7 @@ $a->strings["%d message sent."] = array( $a->strings['Unable to locate original post.'] = 'Unable to locate original post.'; $a->strings['Empty post discarded.'] = 'Empty post discarded.'; $a->strings['Wall Photos'] = 'Wall Photos'; +$a->strings['%s posted to your profile wall at %s'] = '%s posted to your profile wall at %s'; $a->strings['System error. Post not saved.'] = 'System error. Post not saved.'; $a->strings['This message was sent to you by %s, a member of the Friendika social network.'] = 'This message was sent to you by %s, a member of the Friendika social network.'; $a->strings['You may visit them online at %s'] = 'You may visit them online at %s'; @@ -787,7 +787,7 @@ $a->strings['We could not contact the StatusNet API with the Path you entered.'] $a->strings['StatusNet settings updated.'] = 'StatusNet settings updated.'; $a->strings['StatusNet Posting Settings'] = 'StatusNet Posting Settings'; $a->strings['Globally Available StatusNet OAuthKeys'] = 'Globally Available StatusNet OAuthKeys'; -$a->strings['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] = '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; +$a->strings["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."] = "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."; $a->strings['Provide your own OAuth Credentials'] = 'Provide your own OAuth Credentials'; $a->strings['No consumer key pair for StatusNet found. Register your Friendika Account as an desktop client on your StatusNet account, copy the consumer key pair here and enter the API base root.
Before you register your own OAuth key pair ask the administrator if there is already a key pair for this Friendika installation at your favorited StatusNet installation.'] = 'No consumer key pair for StatusNet found. Register your Friendika Account as an desktop client on your StatusNet account, copy the consumer key pair here and enter the API base root.
Before you register your own OAuth key pair ask the administrator if there is already a key pair for this Friendika installation at your favorited StatusNet installation.'; $a->strings['OAuth Consumer Key'] = 'OAuth Consumer Key'; From 7acb8fa6e7144435b81b57e3ad949846b1cbb68d Mon Sep 17 00:00:00 2001 From: Friendika Date: Thu, 26 May 2011 16:41:36 -0700 Subject: [PATCH 02/12] add webfinger diagnostic module --- boot.php | 2 +- mod/webfinger.php | 24 ++++++++++++++++++++++++ 2 files changed, 25 insertions(+), 1 deletion(-) create mode 100644 mod/webfinger.php diff --git a/boot.php b/boot.php index cac272be5..c567533c1 100644 --- a/boot.php +++ b/boot.php @@ -4,7 +4,7 @@ set_time_limit(0); ini_set('pcre.backtrack_limit', 250000); -define ( 'FRIENDIKA_VERSION', '2.2.991' ); +define ( 'FRIENDIKA_VERSION', '2.2.992' ); define ( 'DFRN_PROTOCOL_VERSION', '2.21' ); define ( 'DB_UPDATE_VERSION', 1058 ); diff --git a/mod/webfinger.php b/mod/webfinger.php new file mode 100644 index 000000000..dd6d72a13 --- /dev/null +++ b/mod/webfinger.php @@ -0,0 +1,24 @@ +Webfinger Diagnostic'; + + $o .= '
'; + $o .= 'Lookup address: '; + $o .= '
'; + + $o .= '

'; + + if(x($_GET,'addr')) { + $addr = $_GET['addr']; + if(strpos($addr,'@' !== false)) + $res = webfinger($addr); + else + $res = lrdd($addr); + $o .= str_replace("\n",'
',print_r($res,true)); + } + return $o; +} \ No newline at end of file From 341f853b042f0f4dcdc5e256c46a25c402d2de2e Mon Sep 17 00:00:00 2001 From: Friendika Date: Thu, 26 May 2011 17:47:33 -0700 Subject: [PATCH 03/12] search from network page --- boot.php | 6 +++--- mod/network.php | 21 ++++++++++++++++++--- view/theme/duepuntozero/style.css | 10 ++++++++++ view/theme/loozah/style.css | 8 ++++++++ 4 files changed, 39 insertions(+), 6 deletions(-) diff --git a/boot.php b/boot.php index c567533c1..7d96eac9f 100644 --- a/boot.php +++ b/boot.php @@ -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 = '