aboutsummaryrefslogtreecommitdiffstats
path: root/addon
diff options
context:
space:
mode:
Diffstat (limited to 'addon')
-rw-r--r--addon/calc/calc.php2
-rw-r--r--addon/facebook/facebook.css8
-rw-r--r--addon/facebook/facebook.php25
-rw-r--r--addon/poormancron/poormancron.php3
-rw-r--r--addon/randplace/randplace.php3
-rw-r--r--addon/statusnet/statusnet.php29
-rw-r--r--addon/tictac/tictac.php2
-rw-r--r--addon/twitter/twitter.php29
8 files changed, 64 insertions, 37 deletions
diff --git a/addon/calc/calc.php b/addon/calc/calc.php
index fd6a11777..a095e3960 100644
--- a/addon/calc/calc.php
+++ b/addon/calc/calc.php
@@ -10,7 +10,7 @@ function calc_uninstall() {
}
function calc_app_menu($a,&$b) {
- $b['app_menu'] .= '<a href="calc">Calculator</a><br />';
+ $b['app_menu'] .= '<div class="app-title"><a href="calc">Calculator</a></div>';
}
diff --git a/addon/facebook/facebook.css b/addon/facebook/facebook.css
new file mode 100644
index 000000000..3df65706f
--- /dev/null
+++ b/addon/facebook/facebook.css
@@ -0,0 +1,8 @@
+
+#facebook-enable-wrapper {
+ margin-top: 20px;
+}
+
+#facebook-disable-wrapper {
+ margin-top: 20px;
+}
diff --git a/addon/facebook/facebook.php b/addon/facebook/facebook.php
index 119c2102e..876a9740b 100644
--- a/addon/facebook/facebook.php
+++ b/addon/facebook/facebook.php
@@ -7,10 +7,17 @@
* view a page on your site, then add it back to the list. This will reset
* all of the plugin 'hooks'.
*
- * 1. register an API key from developer.facebook.com
+ * 1. register an API key for your site from developer.facebook.com
* a. We'd be very happy if you include "Friendika" in the application name
- * to increase name recognition.
- * b. The url should be your site URL with a trailing slash
+ * to increase name recognition. The Friendika icons are also present
+ * in the images directory and may be uploaded as a Facebook app icon.
+ * Use images/ff-16.jpg for the Icon and images/ff-128.jpg for the Logo.
+ * b. The url should be your site URL with a trailing slash.
+ * You may use http://portal.friendika.com/privacy as the privacy policy
+ * URL unless your site has different requirements, and
+ * http://portal.friendika.com as the Terms of Service URL unless
+ * you have different requirements. (Friendika is a software application
+ * and does not require Terms of Service, though your installation of it might).
* c. Set the following values in your .htconfig.php file
* $a->config['facebook']['appid'] = 'xxxxxxxxxxx';
* $a->config['facebook']['appsecret'] = 'xxxxxxxxxxxxxxx';
@@ -107,14 +114,18 @@ function facebook_content(&$a) {
return '';
}
+ $a->page['htmlhead'] .= '<link rel="stylesheet" type="text/css" href="'
+ . $a->get_baseurl() . '/addon/facebook/facebook.css' . '" media="all" />' . "\r\n";
+
$o .= '<h3>' . t('Facebook Connect') . '</h3>';
- $o .= '<br />';
+ $o .= '<div id="facebook-enable-wrapper">';
$o .= '<a href="https://www.facebook.com/dialog/oauth?client_id=' . $appid . '&redirect_uri='
- . $a->get_baseurl() . '/facebook/' . $a->user['nickname'] . '&scope=publish_stream,read_stream,offline_access">' . t('Install Facebook post connector') . '</a><br /><br />';
+ . $a->get_baseurl() . '/facebook/' . $a->user['nickname'] . '&scope=publish_stream,read_stream,offline_access">' . t('Install Facebook post connector') . '</a>';
+ $o .= '</div><div id="facebook-disable-wrapper">';
- $o .= '<a href="' . $a->get_baseurl() . '/facebook/remove' . '">' . t('Remove Facebook post connector') . '</a><br />';
+ $o .= '<a href="' . $a->get_baseurl() . '/facebook/remove' . '">' . t('Remove Facebook post connector') . '</a></div>';
return $o;
@@ -136,8 +147,10 @@ function facebook_uninstall() {
function facebook_plugin_settings(&$a,&$b) {
+ $b .= '<div class="settings-block">';
$b .= '<h3>' . t('Facebook') . '</h3>';
$b .= '<a href="facebook">' . t('Facebook Connector Settings') . '</a><br />';
+ $b .= '</div>';
}
diff --git a/addon/poormancron/poormancron.php b/addon/poormancron/poormancron.php
index c31d2772c..830c10ddf 100644
--- a/addon/poormancron/poormancron.php
+++ b/addon/poormancron/poormancron.php
@@ -27,8 +27,7 @@ function poormancron_hook($a,&$b) {
// 300 secs, 5 mins
if (!$lastupdate || ($now-$lastupdate)>300) {
set_config('poormancron','lastupdate', $now);
- $php_path = ((strlen($a->config['php_path'])) ? $a->config['php_path'] : 'php');
- proc_run($php_path,"include/poller.php");
+ proc_run('php',"include/poller.php");
}
}
diff --git a/addon/randplace/randplace.php b/addon/randplace/randplace.php
index d7ea65c9d..fa38de377 100644
--- a/addon/randplace/randplace.php
+++ b/addon/randplace/randplace.php
@@ -167,6 +167,7 @@ function randplace_settings(&$a,&$s) {
/* Add some HTML to the existing form */
+ $s .= '<div class="settings-block">';
$s .= '<h3>' . t('Randplace Settings') . '</h3>';
$s .= '<div id="randplace-enable-wrapper">';
$s .= '<label id="randplace-enable-label" for="randplace-checkbox">' . t('Enable Randplace Plugin') . '</label>';
@@ -175,6 +176,6 @@ function randplace_settings(&$a,&$s) {
/* provide a submit button */
- $s .= '<div class="settings-submit-wrapper" ><input type="submit" name="submit" class="settings-submit" value="' . t('Submit') . '" /></div>';
+ $s .= '<div class="settings-submit-wrapper" ><input type="submit" name="submit" class="settings-submit" value="' . t('Submit') . '" /></div></div>';
} \ No newline at end of file
diff --git a/addon/statusnet/statusnet.php b/addon/statusnet/statusnet.php
index 7928003bc..545518622 100644
--- a/addon/statusnet/statusnet.php
+++ b/addon/statusnet/statusnet.php
@@ -53,6 +53,8 @@ function statusnet_install() {
register_hook('plugin_settings', 'addon/statusnet/statusnet.php', 'statusnet_settings');
register_hook('plugin_settings_post', 'addon/statusnet/statusnet.php', 'statusnet_settings_post');
register_hook('post_local_end', 'addon/statusnet/statusnet.php', 'statusnet_post_hook');
+ register_hook('jot_networks', 'addon/statusnet/statusnet.php', 'statusnet_jot_nets');
+
logger("installed statusnet");
}
@@ -61,8 +63,25 @@ function statusnet_uninstall() {
unregister_hook('plugin_settings', 'addon/statusnet/statusnet.php', 'statusnet_settings');
unregister_hook('plugin_settings_post', 'addon/statusnet/statusnet.php', 'statusnet_settings_post');
unregister_hook('post_local_end', 'addon/statusnet/statusnet.php', 'statusnet_post_hook');
+ unregister_hook('jot_networks', 'addon/statusnet/statusnet.php', 'statusnet_jot_nets');
+}
+
+function statusnet_jot_nets(&$a,&$b) {
+ if(! local_user())
+ return;
+
+ $statusnet_post = get_pconfig(local_user(),'statusnet','post');
+ if(intval($statusnet_post) == 1) {
+ $statusnet_defpost = get_pconfig(local_user(),'statusnet','post_by_default');
+ $selected = ((intval($statusnet_defpost == 1)) ? ' selected="selected" ' : '');
+ $b .= '<div class="profile-jot-net"><input type="checkbox" name="statusnet_enable"' . $selected . 'value="1" /> '
+ . t('Post to StatusNet') . '</div>';
+ }
}
+
+
+
function statusnet_settings_post ($a,$post) {
if(! local_user())
return;
@@ -123,7 +142,8 @@ function statusnet_settings(&$a,&$s) {
$osecret = get_pconfig(local_user(), 'statusnet', 'oauthsecret' );
$enabled = get_pconfig(local_user(), 'statusnet', 'post');
$checked = (($enabled) ? ' checked="checked" ' : '');
- $s .= '<h3>'.t('StatusNet Posting Settings').'</h3>';
+ $s .= '<div class="settings-block">';
+ $s .= '<h3>'. t('StatusNet Posting Settings').'</h3>';
if ( (!$ckey) && (!$csecret) ) {
/***
@@ -185,7 +205,7 @@ function statusnet_settings(&$a,&$s) {
$s .= '<div class="settings-submit-wrapper" ><input type="submit" name="submit" class="settings-submit" value="' . t('Submit') . '" /></div>';
}
}
- $s .= '</div><div class="clear"></div>';
+ $s .= '</div><div class="clear"></div></div>';
}
@@ -210,8 +230,9 @@ function statusnet_post_hook(&$a,&$b) {
if($ckey && $csecret && $otoken && $osecret) {
$statusnet_post = get_pconfig(local_user(),'statusnet','post');
+ $statusnet_enable = (($statusnet_post && x($_POST,'statusnet_enable')) ? intval($_POST['statusnet_enable']) : 0);
- if($statusnet_post) {
+ if($statusnet_enable && $statusnet_post) {
require_once('include/bbcode.php');
$dent = new StatusNetOAuth($api,$ckey,$csecret,$otoken,$osecret);
$max_char = $dent->get_maxlength(); // max. length for a dent
@@ -241,6 +262,6 @@ function statusnet_post_hook(&$a,&$b) {
$dent->post('statuses/update', array('status' => $msg));
}
}
- }
+ }
}
diff --git a/addon/tictac/tictac.php b/addon/tictac/tictac.php
index 95678302c..f73937cdd 100644
--- a/addon/tictac/tictac.php
+++ b/addon/tictac/tictac.php
@@ -11,7 +11,7 @@ function tictac_uninstall() {
}
function tictac_app_menu($a,&$b) {
- $b['app_menu'] .= '<a href="tictac">' . t('Three Dimensional Tic-Tac-Toe') . '</a><br />';
+ $b['app_menu'] .= '<div class="app-title"><a href="tictac">' . t('Three Dimensional Tic-Tac-Toe') . '</a></div>';
}
diff --git a/addon/twitter/twitter.php b/addon/twitter/twitter.php
index 509297d4e..0fd891d20 100644
--- a/addon/twitter/twitter.php
+++ b/addon/twitter/twitter.php
@@ -41,7 +41,6 @@ function twitter_install() {
register_hook('plugin_settings_post', 'addon/twitter/twitter.php', 'twitter_settings_post');
register_hook('post_local_end', 'addon/twitter/twitter.php', 'twitter_post_hook');
register_hook('jot_networks', 'addon/twitter/twitter.php', 'twitter_jot_nets');
- register_hook('post_local_start', 'addon/twitter/twitter.php', 'twitter_post_start');
logger("installed twitter");
}
@@ -51,8 +50,6 @@ function twitter_uninstall() {
unregister_hook('plugin_settings_post', 'addon/twitter/twitter.php', 'twitter_settings_post');
unregister_hook('post_local_end', 'addon/twitter/twitter.php', 'twitter_post_hook');
unregister_hook('jot_networks', 'addon/twitter/twitter.php', 'twitter_jot_nets');
- unregister_hook('post_local_start', 'addon/twitter/twitter.php', 'twitter_post_start');
-
}
function twitter_jot_nets(&$a,&$b) {
@@ -70,19 +67,6 @@ function twitter_jot_nets(&$a,&$b) {
}
-function twitter_post_start(&$a,&$b) {
- if(! local_user())
- return;
-
- if((x($b,'twitter_enable')) && (intval($b['twitter_enable'])))
- set_pconfig(local_user(),'twitter','enable','1');
- else
- del_pconfig(local_user(),'twitter','enable');
-
-
-}
-
-
function twitter_settings_post ($a,$post) {
if(! local_user())
return;
@@ -134,6 +118,7 @@ function twitter_settings(&$a,&$s) {
$osecret = get_pconfig(local_user(), 'twitter', 'oauthsecret' );
$enabled = get_pconfig(local_user(), 'twitter', 'post');
$checked = (($enabled) ? ' checked="checked" ' : '');
+ $s .= '<div class="settings-block">';
$s .= '<h3>'. t('Twitter Posting Settings') .'</h3>';
if ( (!$ckey) && (!$csecret) ) {
@@ -167,8 +152,8 @@ function twitter_settings(&$a,&$s) {
$s .= '<input id="twitter-pin" type="text" name="twitter-pin" />';
$s .= '<input id="twitter-token" type="hidden" name="twitter-token" value="'.$token.'" />';
$s .= '<input id="twitter-token2" type="hidden" name="twitter-token2" value="'.$request_token['oauth_token_secret'].'" />';
- $s .= '</div><div class="clear"></div>';
- $s .= '<div class="settings-submit-wrapper" ><input type="submit" name="submit" class="settings-submit" value="' . t('Submit') . '" /></div>';
+ $s .= '</div><div class="clear"></div>';
+ $s .= '<div class="settings-submit-wrapper" ><input type="submit" name="submit" class="settings-submit" value="' . t('Submit') . '" /></div>';
} else {
/***
* we have an OAuth key / secret pair for the user
@@ -190,7 +175,7 @@ function twitter_settings(&$a,&$s) {
$s .= '<div class="settings-submit-wrapper" ><input type="submit" name="submit" class="settings-submit" value="' . t('Submit') . '" /></div>';
}
}
- $s .= '</div><div class="clear"></div>';
+ $s .= '</div><div class="clear"></div></div>';
}
@@ -213,11 +198,11 @@ function twitter_post_hook(&$a,&$b) {
if($ckey && $csecret && $otoken && $osecret) {
- $twitter_post = get_pconfig(local_user(),'twitter','post');
- $twitter_enable = intval(get_pconfig(local_user(),'twitter','enable'));
+ $twitter_post = intval(get_pconfig(local_user(),'twitter','post'));
+ $twitter_enable = (($twitter_post && x($_POST,'twitter_enable')) ? intval($_POST['twitter_enable']) : 0);
if($twitter_post && $twitter_enable) {
- require_once('addon/twitter/twitteroauth.php');
+ require_once('library/twitteroauth.php');
require_once('include/bbcode.php');
$tweet = new TwitterOAuth($ckey,$csecret,$otoken,$osecret);
$max_char = 140; // max. length for a tweet