Merge remote-tracking branch 'upstream/master'

pull/99/head
Michael Vogel 2013-01-17 23:31:16 +01:00
commit 9f6b64a8fd
24 changed files with 166 additions and 62 deletions

Binary file not shown.

View File

@ -5,7 +5,7 @@
* Name: external cron
* Description: Use external server or service to run poller regularly
* Version: 1.0
* Author: Mike Macgirvin <http://macgirvin.com/profile/mike>
* Author: Mike Macgirvin <https://macgirvin.com/profile/mike>
*
* Notes: External service needs to make a web request to http(s)://yoursite/extcron
*/

Binary file not shown.

View File

@ -383,6 +383,7 @@ 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);
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));
@ -390,6 +391,7 @@ function fb_get_friends_sync_full($uid, $access_token, $persons) {
}
}
}
}

Binary file not shown.

Binary file not shown.

View File

@ -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,

View File

@ -2,14 +2,14 @@
<div class="forumdirectory-item" id="forumdirectory-item-$id" >
<div class="forumdirectory-photo-wrapper" id="forumdirectory-photo-wrapper-$id" >
<div class="forumdirectory-photo" id="forumdirectory-photo-$id" >
<a href="$profile-link" class="forumdirectory-profile-link" id="forumdirectory-profile-link-$id" >
<img class="forumdirectory-photo-img photo" src="$photo" alt="$alt-text" title="$alt-text" />
<a href="$profile_link" class="forumdirectory-profile-link" id="forumdirectory-profile-link-$id" >
<img class="forumdirectory-photo-img photo" src="$photo" alt="$alt_text" title="$alt_text" />
</a>
</div>
</div>
<div class="forumdirectory-profile-wrapper" id="forumdirectory-profile-wrapper-$id" >
<div class="contact-name" id="forumdirectory-name-$id">$name</div>
<div class="page-type">$page-type</div>
<div class="page-type">$page_type</div>
{{ if $pdesc }}<div class="forumdirectory-profile-title">$profile.pdesc</div>{{ endif }}
<div class="forumdirectory-detailcolumns-wrapper" id="forumdirectory-detailcolumns-wrapper-$id">
<div class="forumdirectory-detailscolumn-wrapper" id="forumdirectory-detailscolumn1-wrapper-$id">

View File

@ -2,14 +2,14 @@
<div class="forumdirectory-item" id="forumdirectory-item-{{$id}}" >
<div class="forumdirectory-photo-wrapper" id="forumdirectory-photo-wrapper-{{$id}}" >
<div class="forumdirectory-photo" id="forumdirectory-photo-{{$id}}" >
<a href="{{$profile}}-link" class="forumdirectory-profile-link" id="forumdirectory-profile-link-{{$id}}" >
<img class="forumdirectory-photo-img photo" src="{{$photo}}" alt="{{$alt}}-text" title="{{$alt}}-text" />
<a href="{{$profile_link}}" class="forumdirectory-profile-link" id="forumdirectory-profile-link-{{$id}}" >
<img class="forumdirectory-photo-img photo" src="{{$photo}}" alt="{{$alt_text}}" title="{{$alt_text}}" />
</a>
</div>
</div>
<div class="forumdirectory-profile-wrapper" id="forumdirectory-profile-wrapper-{{$id}}" >
<div class="contact-name" id="forumdirectory-name-{{$id}}">{{$name}}</div>
<div class="page-type">{{$page}}-type</div>
<div class="page-type">{{$page_type}}</div>
{{if $pdesc}}<div class="forumdirectory-profile-title">{{$profile.pdesc}}</div>{{/if}}
<div class="forumdirectory-detailcolumns-wrapper" id="forumdirectory-detailcolumns-wrapper-{{$id}}">
<div class="forumdirectory-detailscolumn-wrapper" id="forumdirectory-detailscolumn1-wrapper-{{$id}}">

Binary file not shown.

View File

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

View File

@ -0,0 +1,41 @@
var toolserver = 'http://toolserver.org/~kolossos/openlayers/kml-on-ol.php';
var startTag = '<iframe class="osmFrame" style="width: 100%; height: 350px; clear: both;" src="'+ toolserver + '?lang=de&amp;uselang=de&amp;params=';
var endTag = '"></iframe>';
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;
}

View File

@ -10,18 +10,27 @@
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='<script type="text/javascript" src="' . $a->get_baseurl() . '/addon/openstreetmap/openstreetmap.js' . '"></script>' . "\r\n";
$a->page['htmlhead'] .= $addScriptTag;
}
function openstreetmap_location($a, &$item) {
//
if(! (strlen($item['location']) || strlen($item['coord'])))
return;
@ -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']) ? '<a target="map" title="' . $item['location'] . '" href="'.$tmsserver.'?q=' . urlencode($item['location']) . '">' . $item['location'] . '</a>' : '');
if($item['coord']) {
$coords = explode(' ', $item['coord']);
if(count($coords) > 1) {
$coord = '<a target="map" title="' . $item['coord'] . '" href="'.$tmsserver.'?lat=' . urlencode($coords[0]) . '&lon=' . urlencode($coords[1]) . '&zoom='.$zoom.'">' . $item['coord'] . '</a>' ;
$coord = '<a target="map" class="OSMMapLink" title="' . $item['coord'] . '" href="'.$tmsserver.'?lat=' . urlencode($coords[0]) . '&lon=' . urlencode($coords[1]) . '&zoom='.$zoom.'"> Map </a>' ;
}
}
if(strlen($coord)) {

Binary file not shown.

BIN
procrunner.tgz Normal file

Binary file not shown.

53
procrunner/procrunner.php Executable file
View File

@ -0,0 +1,53 @@
<?php
/**
* Name: Proc Runner
* Description: Derivative of poormancron when proc_open() and exec() are disabled
* Version: 1.0
* Author: Fabio Comuni <http://kirgroup.com/profile/fabrix>
* 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);
}

Binary file not shown.

View File

@ -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;
}

Binary file not shown.

View File

@ -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]].

View File

@ -19,29 +19,20 @@
#twitter-disconnect {
float: left;
}
#twitter-enable-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: 5px;
}
#twitter-default-label {
float: left;
width: 250px;
}
#twitter-sendtaglinks-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;

View File

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

View File

@ -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 }}
<div class="submit"><input type="submit" name="page_site" value="$submit" /></div>

View File

@ -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}}
<div class="submit"><input type="submit" name="page_site" value="{{$submit}}" /></div>