diff --git a/extcron.tgz b/extcron.tgz index 0e5b2892..dabe1d09 100755 Binary files a/extcron.tgz and b/extcron.tgz differ diff --git a/extcron/extcron.php b/extcron/extcron.php index e3c21209..3eb34cdc 100755 --- a/extcron/extcron.php +++ b/extcron/extcron.php @@ -5,7 +5,7 @@ * Name: external cron * Description: Use external server or service to run poller regularly * Version: 1.0 - * Author: Mike Macgirvin + * Author: Mike Macgirvin * * Notes: External service needs to make a web request to http(s)://yoursite/extcron */ diff --git a/facebook.tgz b/facebook.tgz index 6bf8f7a9..2dbd4efd 100644 Binary files a/facebook.tgz and b/facebook.tgz differ diff --git a/facebook/facebook.php b/facebook/facebook.php index f977bef9..4c1c0a14 100644 --- a/facebook/facebook.php +++ b/facebook/facebook.php @@ -383,10 +383,12 @@ function fb_get_friends_sync_full($uid, $access_token, $persons) { if($s) { $results = json_decode($s); logger('fb_get_friends: info: ' . print_r($results,true), LOGGER_DATA); - foreach ($results as $contact) { - if ($contact->code != 200) logger('fb_get_friends: not found: ' . print_r($contact,true), LOGGER_DEBUG); - else fb_get_friends_sync_parsecontact($uid, json_decode($contact->body)); - } + if(count($results)) { + foreach ($results as $contact) { + if ($contact->code != 200) logger('fb_get_friends: not found: ' . print_r($contact,true), LOGGER_DEBUG); + else fb_get_friends_sync_parsecontact($uid, json_decode($contact->body)); + } + } } } } diff --git a/fbpost.tgz b/fbpost.tgz index ecf933d8..790a5732 100644 Binary files a/fbpost.tgz and b/fbpost.tgz differ diff --git a/forumdirectory.tgz b/forumdirectory.tgz index 249cd226..0a84585d 100644 Binary files a/forumdirectory.tgz and b/forumdirectory.tgz differ diff --git a/forumdirectory/forumdirectory.php b/forumdirectory/forumdirectory.php index 0d7fbee8..9837b9c1 100644 --- a/forumdirectory/forumdirectory.php +++ b/forumdirectory/forumdirectory.php @@ -168,12 +168,12 @@ function forumdirectory_content(&$a) { $entry = replace_macros($tpl,array( '$id' => $rr['id'], - '$profile-link' => $profile_link, + '$profile_link' => $profile_link, '$photo' => $a->get_cached_avatar_image($rr[$photo]), - '$alt-text' => $rr['name'], + '$alt_text' => $rr['name'], '$name' => $rr['name'], '$details' => $pdesc . $details, - '$page-type' => $page_type, + '$page_type' => $page_type, '$profile' => $profile, '$location' => template_escape($location), '$gender' => $gender, diff --git a/forumdirectory/view/forumdirectory_item.tpl b/forumdirectory/view/forumdirectory_item.tpl index 3b24d25f..e1bbffec 100755 --- a/forumdirectory/view/forumdirectory_item.tpl +++ b/forumdirectory/view/forumdirectory_item.tpl @@ -2,14 +2,14 @@
$name
-
$page-type
+
$page_type
{{ if $pdesc }}
$profile.pdesc
{{ endif }}
diff --git a/forumdirectory/view/smarty3/forumdirectory_item.tpl b/forumdirectory/view/smarty3/forumdirectory_item.tpl index 540a5aea..66410efe 100644 --- a/forumdirectory/view/smarty3/forumdirectory_item.tpl +++ b/forumdirectory/view/smarty3/forumdirectory_item.tpl @@ -2,14 +2,14 @@
{{$name}}
-
{{$page}}-type
+
{{$page_type}}
{{if $pdesc}}
{{$profile.pdesc}}
{{/if}}
diff --git a/forumlist.tgz b/forumlist.tgz index 1f303145..8356d443 100644 Binary files a/forumlist.tgz and b/forumlist.tgz differ diff --git a/geonames/geonames.php b/geonames/geonames.php index 8226fc0b..19725bef 100755 --- a/geonames/geonames.php +++ b/geonames/geonames.php @@ -40,8 +40,8 @@ function geonames_install() { * */ - register_hook('plugin_settings', 'addon/geonames/geonames.php', 'geonames_settings'); - register_hook('plugin_settings_post', 'addon/geonames/geonames.php', 'geonames_settings_post'); + register_hook('plugin_settings', 'addon/geonames/geonames.php', 'geonames_plugin_admin'); + register_hook('plugin_settings_post', 'addon/geonames/geonames.php', 'geonames_plugin_admin_post'); logger("installed geonames"); } @@ -58,8 +58,8 @@ function geonames_uninstall() { */ unregister_hook('post_local', 'addon/geonames/geonames.php', 'geonames_post_hook'); - unregister_hook('plugin_settings', 'addon/geonames/geonames.php', 'geonames_settings'); - unregister_hook('plugin_settings_post', 'addon/geonames/geonames.php', 'geonames_settings_post'); + unregister_hook('plugin_settings', 'addon/geonames/geonames.php', 'geonames_plugin_admin'); + unregister_hook('plugin_settings_post', 'addon/geonames/geonames.php', 'geonames_plugin_admin_post'); logger("removed geonames"); @@ -135,7 +135,7 @@ function geonames_post_hook($a, &$item) { * */ -function geonames_settings_post($a,$post) { +function geonames_plugin_admin_post($a,$post) { if(! local_user() || (! x($_POST,'geonames-submit'))) return; set_pconfig(local_user(),'geonames','enable',intval($_POST['geonames'])); @@ -153,7 +153,7 @@ function geonames_settings_post($a,$post) { -function geonames_settings(&$a,&$s) { +function geonames_plugin_admin(&$a,&$s) { if(! local_user()) return; diff --git a/openstreetmap/openstreetmap.js b/openstreetmap/openstreetmap.js new file mode 100644 index 00000000..479e769c --- /dev/null +++ b/openstreetmap/openstreetmap.js @@ -0,0 +1,41 @@ +var toolserver = 'http://toolserver.org/~kolossos/openlayers/kml-on-ol.php'; +var startTag = ''; + +jQuery(document).ready(function($) { + + $('.wall-item-content-wrapper').each(function(index) { + var link = $(this).find('.wall-item-location .OSMMapLink'); + link.toggle(addIframe, removeIframe); + }); +}); + +function addIframe(ev) { + var coordinate = $(ev.target).attr('title'); + + var newTag = startTag + convertCoordinateString(coordinate) + endTag; + $(ev.target).parents('.wall-item-content-wrapper').append(newTag); +} + +function removeIframe(ev) { + $(ev.target).parents('.wall-item-content-wrapper').find('iframe').remove(); + +} + +function convertCoordinateString(coordinate) { + var locstring = coordinate.split(' '); + var northSouth; + var westEast; + + if (locstring[0] < 0) { + northSouth = '_S_'; + }else{ + northSouth = '_N_'; + } + if (locstring[1] < 0) { + westEast = '_W'; + }else{ + westEast = '_E'; + } + return Math.abs(locstring[0]) + northSouth + Math.abs(locstring[1]) + westEast; +} \ No newline at end of file diff --git a/openstreetmap/openstreetmap.php b/openstreetmap/openstreetmap.php index cb9abcd7..2c5975eb 100755 --- a/openstreetmap/openstreetmap.php +++ b/openstreetmap/openstreetmap.php @@ -10,24 +10,33 @@ function openstreetmap_install() { register_hook('render_location', 'addon/openstreetmap/openstreetmap.php', 'openstreetmap_location'); + register_hook('page_header', 'addon/openstreetmap/openstreetmap.php', 'openstreetmap_alterheader'); logger("installed openstreetmap"); } function openstreetmap_uninstall() { unregister_hook('render_location', 'addon/openstreetmap/openstreetmap.php', 'openstreetmap_location'); + unregister_hook('page_header', 'addon/openstreetmap/openstreetmap.php', 'openstreetmap_alterheader'); logger("removed openstreetmap"); } +function openstreetmap_alterheader($a, &$navHtml) { + $addScriptTag='' . "\r\n"; + $a->page['htmlhead'] .= $addScriptTag; +} function openstreetmap_location($a, &$item) { + + // + if(! (strlen($item['location']) || strlen($item['coord']))) - return; + return; /* * Get the configuration variables from the .htconfig file. - */ + */ $tmsserver = get_config('openstreetmap','tmsserver'); if(! $tmsserver) $tmsserver = 'http://openstreetmap.org'; @@ -38,12 +47,27 @@ function openstreetmap_location($a, &$item) { $location = ''; $coord = ''; + + if($item['location'] && !$item['coord'] && true){ //if only a location is given, find the lat-lon + $geo_account='demo'; + + $s = fetch_url('http://api.geonames.org/search?maxRows=1&fuzzy=0.8&q=' . $item['location'] . '&username=' . $geo_account); + + if($s){ + $xml = parse_xml_string($s); + + if($xml->geoname->lat && $xml->geoname->lng){ + $item['coord'] = $xml->geoname->lat . ' ' . $xml->geoname->lng; + } + } + } + $location = (($item['location']) ? '' . $item['location'] . '' : ''); if($item['coord']) { $coords = explode(' ', $item['coord']); if(count($coords) > 1) { - $coord = '' . $item['coord'] . '' ; + $coord = ' Map ' ; } } if(strlen($coord)) { @@ -67,9 +91,9 @@ function openstreetmap_plugin_admin (&$a, &$o) { $zoom = 17; $o = replace_macros( $t, array( - '$submit' => t('Submit'), - '$tmsserver' => array('tmsserver', t('Tile Server URL'), $tmsserver, t('A list of public tile servers')), - '$zoom' => array('zoom', t('Default zoom'), $zoom, t('The default zoom level. (1:world, 18:highest)')), + '$submit' => t('Submit'), + '$tmsserver' => array('tmsserver', t('Tile Server URL'), $tmsserver, t('A list of public tile servers')), + '$zoom' => array('zoom', t('Default zoom'), $zoom, t('The default zoom level. (1:world, 18:highest)')), )); } function openstreetmap_plugin_admin_post (&$a) { diff --git a/privacy_image_cache.tgz b/privacy_image_cache.tgz index b0690fc2..45444a68 100644 Binary files a/privacy_image_cache.tgz and b/privacy_image_cache.tgz differ diff --git a/procrunner.tgz b/procrunner.tgz new file mode 100644 index 00000000..fec9dfa7 Binary files /dev/null and b/procrunner.tgz differ diff --git a/procrunner/procrunner.php b/procrunner/procrunner.php new file mode 100755 index 00000000..4c6f64b6 --- /dev/null +++ b/procrunner/procrunner.php @@ -0,0 +1,53 @@ + + * Author: Mike Macgirvin + */ + +function procrunner_install() { + + $addons = get_config('system','addon'); + if(strstr('poormancron',$addons)) { + logger('procrunner incompatible with poormancron. Not installing procrunner.'); + return; + } + + // check for command line php + $a = get_app(); + $ex = Array(); + $ex[0] = ((x($a->config,'php_path')) && (strlen($a->config['php_path'])) ? $a->config['php_path'] : 'php'); + $ex[1] = dirname(dirname(dirname(__file__)))."/testargs.php"; + $ex[2] = "test"; + $out = exec(implode(" ", $ex)); + if ($out==="test") { + logger('procrunner not required on this system. Not installing.'); + return; + } else { + register_hook('proc_run', 'addon/procrunner/procrunner.php','procrunner_procrun'); + logger("installed procrunner"); + } + +} + +function procrunner_uninstall() { + unregister_hook('proc_run', 'addon/procrunner/procrunner.php','procrunner_procrun'); + logger("removed procrunner"); +} + + + +function procrunner_procrun(&$a, &$arr) { + + $argv = $arr['args']; + $arr['run_cmd'] = false; + logger("procrunner procrun ".implode(", ",$argv)); + array_shift($argv); + $argc = count($argv); + logger("procrunner procrun require_once ".basename($argv[0])); + require_once(basename($argv[0])); + $funcname=str_replace(".php", "", basename($argv[0]))."_run"; + $funcname($argv, $argc); +} diff --git a/statusnet.tgz b/statusnet.tgz index 9801af55..ea19ef18 100755 Binary files a/statusnet.tgz and b/statusnet.tgz differ diff --git a/statusnet/statusnet.css b/statusnet/statusnet.css index a5594cb7..d8b9f1f1 100755 --- a/statusnet/statusnet.css +++ b/statusnet/statusnet.css @@ -15,19 +15,15 @@ width: 250px; margin-bottom: 25px; } -#statusnet-default-label { - float: left; - width: 250px; -} -#statusnet-sendtaglinks-label { - float: left; - width: 250px; - margin-bottom: 25px; -} #statusnet-disconnect { float: left; } +#statusnet-default-label, +#statusnet-sendtaglinks-label, +#statusnet-shortening-label, +#statusnet-mirror-label, +#statusnet-pin-label, #statusnet-enable-label { float: left; width: 250px; @@ -38,11 +34,6 @@ float: left; } -#statusnet-pin-label { - float: left; - width: 250px; - margin-bottom: 25px; -} #statusnet-pin { float: left; } diff --git a/twitter.tgz b/twitter.tgz index 0505830c..7558bca9 100755 Binary files a/twitter.tgz and b/twitter.tgz differ diff --git a/twitter/README b/twitter/README index ff08976c..8041f317 100755 --- a/twitter/README +++ b/twitter/README @@ -3,17 +3,14 @@ By Tobias Diekershoff http://diekershoff.homeunix.net/friendika/profile/tobias tobias.diekershoff(at)gmx.net -!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! -!! This addon is currently under development. If you have any problem !! -!! with it, please contact the Author. !! -!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! - With this addon to Friendica you can give your user the possibility to post their *public* messages to Twitter. The messages will be strapped their rich context and shortened to 140 characters length if necessary. If shortening of the message was performed a link will be added to the Tweet pointing to the original message on your server. +The addon can also mirror a users Tweets into the ~friendica wall. + There is a similar addon for forwarding public messages to "StatusNet":http://status.net [[StatusNet Plugin]]. diff --git a/twitter/twitter.css b/twitter/twitter.css index 75747979..3ff37cda 100755 --- a/twitter/twitter.css +++ b/twitter/twitter.css @@ -19,29 +19,20 @@ #twitter-disconnect { float: left; } -#twitter-enable-label { - float: left; - width: 250px; - margin-bottom: 5px; -} -#twitter-default-label { - float: left; - width: 250px; -} -#twitter-sendtaglinks-label { +#twitter-default-label, +#twitter-sendtaglinks-label, +#twitter-enable-label, +#twitter-shortening-label, +#twitter-mirror-label, +#twitter-pin-label { float: left; width: 250px; - margin-bottom: 25px; + margin-bottom: 10px; } #twitter-checkbox { float: left; } -#twitter-pin-label { - float: left; - width: 250px; - margin-bottom: 25px; -} #twitter-pin { float: left; diff --git a/twitter/twitter.php b/twitter/twitter.php index 88cf3858..0452db60 100755 --- a/twitter/twitter.php +++ b/twitter/twitter.php @@ -543,8 +543,10 @@ function twitter_post_hook(&$a,&$b) { function twitter_plugin_admin_post(&$a){ $consumerkey = ((x($_POST,'consumerkey')) ? notags(trim($_POST['consumerkey'])) : ''); $consumersecret = ((x($_POST,'consumersecret')) ? notags(trim($_POST['consumersecret'])): ''); + $applicationname = ((x($_POST, 'applicationname')) ? notags(trim($_POST['applicationname'])):''); set_config('twitter','consumerkey',$consumerkey); set_config('twitter','consumersecret',$consumersecret); + set_config('twitter','application_name',$applicationname); info( t('Settings updated.'). EOL ); } function twitter_plugin_admin(&$a, &$o){ @@ -554,7 +556,8 @@ function twitter_plugin_admin(&$a, &$o){ '$submit' => t('Submit'), // name, label, value, help, [extra values] '$consumerkey' => array('consumerkey', t('Consumer key'), get_config('twitter', 'consumerkey' ), ''), - '$consumersecret' => array('consumersecret', t('Consumer secret'), get_config('twitter', 'consumersecret' ), '') + '$consumersecret' => array('consumersecret', t('Consumer secret'), get_config('twitter', 'consumersecret' ), ''), + '$applicationname' => array('applicationname', t('Name of the Twitter Application'), get_config('twitter','application_name'),t('set this to avoid mirroring postings from ~friendica back to ~friendica')) )); } diff --git a/twitter/view/admin.tpl b/twitter/view/admin.tpl index a83eb07a..b89f51b6 100644 --- a/twitter/view/admin.tpl +++ b/twitter/view/admin.tpl @@ -1,3 +1,4 @@ {{ inc field_input.tpl with $field=$consumerkey }}{{ endinc }} {{ inc field_input.tpl with $field=$consumersecret }}{{ endinc }} +{{ inc field_input.tpl with $field=$applicationname }}{{ endinc }}
diff --git a/twitter/view/smarty3/admin.tpl b/twitter/view/smarty3/admin.tpl index 9efcb065..554ed5a0 100644 --- a/twitter/view/smarty3/admin.tpl +++ b/twitter/view/smarty3/admin.tpl @@ -1,3 +1,4 @@ {{include file="field_input.tpl" field=$consumerkey}} {{include file="field_input.tpl" field=$consumersecret}} +{{include file="field_input.tpl" field=$applicationname}}