diff --git a/buildtgz b/buildtgz
index 37c734f8..61dd5d71 100755
--- a/buildtgz
+++ b/buildtgz
@@ -1,4 +1,4 @@
-#!/bin/bash
+#!/bin/sh
# Make doesn't handle subdirs very well
# without providing a Makefile in each one.
# So we will just manually find any source
diff --git a/calc.tgz b/calc.tgz
index a849ef0e..f5d6870d 100755
Binary files a/calc.tgz and b/calc.tgz differ
diff --git a/facebook.tgz b/facebook.tgz
index 582d4e5a..e049d2b8 100755
Binary files a/facebook.tgz and b/facebook.tgz differ
diff --git a/facebook/facebook.php b/facebook/facebook.php
index 755e7766..39013402 100755
--- a/facebook/facebook.php
+++ b/facebook/facebook.php
@@ -24,8 +24,7 @@
* d. Navigate to Set Web->Site URL & Domain -> Website Settings. Set
* Site URL to yoursubdomain.yourdomain.com. Set Site Domain to your
* yourdomain.com.
- * 2. (This step is now obsolete. Enable the plugin via the Admin panel.)
- * Enable the facebook plugin by including it in .htconfig.php - e.g.
+ * 2. Enable the facebook plugin by including it in .htconfig.php - e.g.
* $a->config['system']['addon'] = 'plugin1,plugin2,facebook';
* 3. Visit the Facebook Settings section of the "Settings->Plugin Settings" page.
* and click 'Install Facebook Connector'.
@@ -732,7 +731,7 @@ function facebook_post_hook(&$a,&$b) {
logger('facebook: postvars: ' . print_r($postvars,true));
// "test_mode" prevents anything from actually being posted.
- // Otherwise, let's do it.
+ // Otherwise, let's do it.
if(! get_config('facebook','test_mode')) {
$x = post_url($url, $postvars);
@@ -953,11 +952,13 @@ function fb_consume_stream($uid,$j,$wall = false) {
// don't store post if we don't have a contact
if(! x($datarray,'contact-id')) {
- logger('no contact: post ignored');
- continue;
+ // Test: Workaround for page entries
+ $datarray['contact-id'] = $self[0]['id'];
+ //logger('no contact: post ignored');
+ //continue;
}
- $datarray['verb'] = ACTIVITY_POST;
+ $datarray['verb'] = ACTIVITY_POST;
if($wall) {
$datarray['owner-name'] = $self[0]['name'];
$datarray['owner-link'] = $self[0]['url'];
diff --git a/openstreetmap.tgz b/openstreetmap.tgz
index e54b0c78..93dc874b 100644
Binary files a/openstreetmap.tgz and b/openstreetmap.tgz differ
diff --git a/openstreetmap/README b/openstreetmap/README
deleted file mode 100644
index 41fc842c..00000000
--- a/openstreetmap/README
+++ /dev/null
@@ -1,30 +0,0 @@
- ____ OpenStreetMap Plugin ____
-by Mike Macgirvin
- Klaus Weidenbach
-
-This addon allows you to use OpenStreetMap for displaying locations.
-
-___ Requirements ___
-
-To use this plugin you need a tile Server that provides the maps.
-OpenStreetMap data is free for everyone to use. Their tile servers are not.
-Please take a look at their "Tile Usage Policy":
-http://wiki.openstreetmap.org/wiki/Tile_usage_policy
-You can run your own tile server or choose one from their list of public
-tile servers: http://wiki.openstreetmap.org/wiki/TMS
-Support the OpenStreetMap community and share the load.
-
-___ Configuration ___
-
-Open the .htconfig.php file and add "openstreetmap" to the list of activated
-addons.
- $a->config['system']['addon'] = "openstreetmap, ..."
-
-You have to add two configuration variables for the addon:
- $a->config['openstreetmap']['tmsserver'] = 'http://www.openstreetmap.org/';
- $a->config['openstreetmap']['zoom'] = '18';
-
-The *tmsserver* points to the tile server you want to use. Use the full URL,
-with protocol (http/s) and trailing slash. You can configure the default zoom
-level on the map with *zoom*. 1 will show the whole world and 18 is the highest
-zoom level available.
diff --git a/openstreetmap/admin.tpl b/openstreetmap/admin.tpl
deleted file mode 100644
index 75db9cd7..00000000
--- a/openstreetmap/admin.tpl
+++ /dev/null
@@ -1,3 +0,0 @@
-{{ inc field_input.tpl with $field=$tmsserver }}{{ endinc }}
-{{ inc field_input.tpl with $field=$zoom }}{{ endinc }}
-
';
+ }
+}
+
+function showmore_cutitem($text, $limit) {
+ $text = trim($text);
+
+ $text = mb_convert_encoding($text, 'HTML-ENTITIES', "UTF-8");
+
+ $text = substr($text, 0, $limit);
+
+ $pos1 = strrpos($text, "<");
+ $pos2 = strrpos($text, ">");
+ $pos3 = strrpos($text, "&");
+ $pos4 = strrpos($text, ";");
+
+ if ($pos1 > $pos3) {
+ if ($pos1 > $pos2)
+ $text = substr($text, 0, $pos1);
+ } else {
+ if ($pos3 > $pos4)
+ $text = substr($text, 0, $pos3);
+ }
+
+ $doc = new DOMDocument();
+ $doc->preserveWhiteSpace = false;
+
+ $doctype = '';
+ @$doc->loadHTML($doctype."".$text."");
+
+ $text = $doc->saveHTML();
+ $text = str_replace(array("", "", $doctype), array("", "", ""), $text);
+
+ return($text);
+}
diff --git a/statusnet.tgz b/statusnet.tgz
index e73c3b5d..3d7c9f58 100755
Binary files a/statusnet.tgz and b/statusnet.tgz differ
diff --git a/statusnet/statusnet.php b/statusnet/statusnet.php
index 38202483..f558cbec 100755
--- a/statusnet/statusnet.php
+++ b/statusnet/statusnet.php
@@ -1,8 +1,7 @@
*/
@@ -23,6 +22,13 @@
* Documentation: http://diekershoff.homeunix.net/redmine/wiki/friendikaplugin/StatusNet_Plugin
*/
+/* __TODO__
+ *
+ * - what about multimedia content?
+ * so far we just strip HTML tags from the message
+ */
+
+
/***
* We have to alter the TwitterOAuth class a little bit to work with any StatusNet
* installation abroad. Basically it's only make the API path variable and be happy.
@@ -147,6 +153,7 @@ function statusnet_settings_post ($a,$post) {
if (isset($_POST['statusnet-disconnect'])) {
/***
* if the statusnet-disconnect checkbox is set, clear the statusnet configuration
+ * TODO can we revoke the access tokens at Twitter and do we need to do so?
*/
del_pconfig( local_user(), 'statusnet', 'consumerkey' );
del_pconfig( local_user(), 'statusnet', 'consumersecret' );
@@ -368,30 +375,6 @@ function statusnet_post_local(&$a,&$b) {
}
}
-function short($url) {
- require_once('library/slinky.php');
- $slinky = new Slinky( $url );
- $yourls_url = get_config('yourls','url1');
- if ($yourls_url) {
- $yourls_username = get_config('yourls','username1');
- $yourls_password = get_config('yourls', 'password1');
- $yourls_ssl = get_config('yourls', 'ssl1');
- $yourls = new Slinky_YourLS();
- $yourls->set( 'username', $yourls_username );
- $yourls->set( 'password', $yourls_password );
- $yourls->set( 'ssl', $yourls_ssl );
- $yourls->set( 'yourls-url', $yourls_url );
- $slinky->set_cascade( array( $yourls, new Slinky_UR1ca(), new Slinky_Trim(), new Slinky_IsGd(), new Slinky_TinyURL() ) );
- }
- else {
- // setup a cascade of shortening services
- // try to get a short link from these services
- // in the order ur1.ca, trim, id.gd, tinyurl
- $slinky->set_cascade( array( new Slinky_UR1ca(), new Slinky_Trim(), new Slinky_IsGd(), new Slinky_TinyURL() ) );
- }
- return $slinky->short();
-}
-
function statusnet_post_hook(&$a,&$b) {
/**
@@ -416,50 +399,33 @@ function statusnet_post_hook(&$a,&$b) {
require_once('include/bbcode.php');
$dent = new StatusNetOAuth($api,$ckey,$csecret,$otoken,$osecret);
- $max_char = $dent->get_maxlength(); // max. length for a dent
- // we will only work with up to two time the length of the dent
- // we can later send to StatusNet. This way we can "gain" some
- // information during shortening of potential links but do not
- // shorten all the links in a 200000 character long essay.
- $tmp = substr($b['body'], 0, 2*$max_char);
- // if [url=bla][img]blub.png[/img][/url] get blub.png
- $tmp = preg_replace( '/\[url\=(https?\:\/\/[a-zA-Z0-9\:\/\-\?\&\;\.\=\_\~\#\%\$\!\+\,]+)\]\[img\](\\w+.*?)\\[\\/img\]\\[\\/url\]/i', '$2', $tmp);
-// $tmp = preg_replace( '/\[url\=(\w+.*?)\]\[img\](\w+.*?)\[\/img\]\[\/url\]/i', '$2', $tmp);
- // preserve links to images, videos and audios
- $tmp = preg_replace( '/\[img\=([0-9]*)x([0-9]*)\](.*?)\[\/img\]/ism', '$3', $tmp);
- $tmp = preg_replace( '/\[\\/?img(\\s+.*?\]|\])/i', '', $tmp);
- $tmp = preg_replace( '/\[\\/?video(\\s+.*?\]|\])/i', '', $tmp);
- $tmp = preg_replace( '/\[\\/?youtube(\\s+.*?\]|\])/i', '', $tmp);
- $tmp = preg_replace( '/\[\\/?vimeo(\\s+.*?\]|\])/i', '', $tmp);
- $tmp = preg_replace( '/\[\\/?audio(\\s+.*?\]|\])/i', '', $tmp);
- // if a #tag is linked, don't send the [url] over to SN
- // this is commented out by default as it means backlinks
- // to friendica, if you don't like this feel free to
- // uncomment the following line
-// $tmp = preg_replace( '/#\[url\=(\w+.*?)\](\w+.*?)\[\/url\]/i', '#$2', $tmp);
- // preserve links to webpages
- $tmp = preg_replace( '/\[url\=(https?\:\/\/[a-zA-Z0-9\:\/\-\?\&\;\.\=\_\~\#\%\$\!\+\,]+)\](\w+.*?)\[\/url\]/i', '$2 $1', $tmp);
- $tmp = preg_replace( '/\[bookmark\=(https?\:\/\/[a-zA-Z0-9\:\/\-\?\&\;\.\=\_\~\#\%\$\!\+\,]+)\](\w+.*?)\[\/bookmark\]/i', '$2 $1', $tmp);
- // find all http or https links in the body of the entry and
- // apply the shortener if the link is longer then 20 characters
- if (( strlen($tmp)>$max_char ) && ( $max_char > 0 )) {
- preg_match_all ( '/(https?\:\/\/[a-zA-Z0-9\:\/\-\?\&\;\.\=\_\~\#\%\$\!\+\,]+)/i', $tmp, $allurls );
- foreach ($allurls as $url) {
- foreach ($url as $u) {
- if (strlen($u)>20) {
- $sl = short($u);
- $tmp = str_replace( $u, $sl, $tmp );
- }
- }
- }
- }
- // ok, all the links we want to send out are save, now strip
- // away the remaining bbcode
- $msg = strip_tags(bbcode($tmp));
+ $max_char = $dent->get_maxlength(); // max. length for a dent
+ $msg = strip_tags(bbcode($b['body']));
// quotes not working - let's try this
$msg = html_entity_decode($msg);
if (( strlen($msg) > $max_char) && $max_char > 0) {
- $shortlink = short( $b['plink'] );
+ $shortlink = "";
+ require_once('library/slinky.php');
+ $slinky = new Slinky( $b['plink'] );
+ $yourls_url = get_config('yourls','url1');
+ if ($yourls_url) {
+ $yourls_username = get_config('yourls','username1');
+ $yourls_password = get_config('yourls', 'password1');
+ $yourls_ssl = get_config('yourls', 'ssl1');
+ $yourls = new Slinky_YourLS();
+ $yourls->set( 'username', $yourls_username );
+ $yourls->set( 'password', $yourls_password );
+ $yourls->set( 'ssl', $yourls_ssl );
+ $yourls->set( 'yourls-url', $yourls_url );
+ $slinky->set_cascade( array( $yourls, new Slinky_UR1ca(), new Slinky_Trim(), new Slinky_IsGd(), new Slinky_TinyURL() ) );
+ }
+ else {
+ // setup a cascade of shortening services
+ // try to get a short link from these services
+ // in the order ur1.ca, trim, id.gd, tinyurl
+ $slinky->set_cascade( array( new Slinky_UR1ca(), new Slinky_Trim(), new Slinky_IsGd(), new Slinky_TinyURL() ) );
+ }
+ $shortlink = $slinky->short();
// the new message will be shortened such that "... $shortlink"
// will fit into the character limit
$msg = substr($msg, 0, $max_char-strlen($shortlink)-4);
diff --git a/wppost.tgz b/wppost.tgz
index 6dad5c11..34858866 100755
Binary files a/wppost.tgz and b/wppost.tgz differ
diff --git a/wppost/wppost.php b/wppost/wppost.php
index 5c1482e7..6db0d944 100755
--- a/wppost/wppost.php
+++ b/wppost/wppost.php
@@ -38,7 +38,7 @@ function wppost_jot_nets(&$a,&$b) {
if(intval($wp_post) == 1) {
$wp_defpost = get_pconfig(local_user(),'wppost','post_by_default');
$selected = ((intval($wp_defpost) == 1) ? ' checked="checked" ' : '');
- $b .= '