add attachments to FB posts, fix paren string in statusnet, do not insert attach div into post if no attachments

pull/1/head
Friendika 2011-05-26 06:46:55 -07:00
rodzic 61b730d567
commit 5a0690d940
6 zmienionych plików z 33 dodań i 16 usunięć

Wyświetl plik

@ -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');

Wyświetl plik

@ -207,7 +207,7 @@ function statusnet_settings(&$a,&$s) {
*/
if (! $globalsn == null) {
$s .= '<h4>' . t('Globally Available StatusNet OAuthKeys') . '</h4>';
$s .= '<p>'. 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).') .'</p>';
$s .= '<p>'. 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.") .'</p>';
$s .= '<div id="statusnet-preconf-wrapper">';
foreach ($globalsn as $asn) {
$s .= '<input type="radio" name="statusnet-preconf-apiurl" value="'. $asn['apiurl'] .'">'. $asn['sitename'] .'<br />';

Wyświetl plik

@ -2547,8 +2547,8 @@ function prepare_body($item,$attach = false) {
return $s;
$arr = explode(',',$item['attach']);
$s .= '<div class="body-attach">';
if(count($arr)) {
$s .= '<div class="body-attach">';
foreach($arr as $r) {
$matches = false;
$icon = '';
@ -2572,8 +2572,8 @@ function prepare_body($item,$attach = false) {
$s .= '<a href="' . strip_tags($matches[1]) . '" title="' . $title . '" class="attachlink" target="external-link" >' . $icon . '</a>';
}
}
$s .= '<div class="clear"></div></div>';
}
$s .= '<div class="clear"></div></div>';
return $s;
}}

Plik binarny nie jest wyświetlany.

Przed

Szerokość:  |  Wysokość:  |  Rozmiar: 384 B

Wyświetl plik

@ -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 <EMAIL@ADDRESS>\n"
"Language-Team: LANGUAGE <LL@li.org>\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 ""

Wyświetl plik

@ -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.<br />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.<br />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';