X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=pumpio%2Fpumpio.php;h=78b738fab8dfb52618ddfe2fffe1e1afc6b3cff3;hb=39c9eb8817d0f0e1cf435f75eca781c60d616825;hp=0280b5170940c707a55fd6eac359011487accf1c;hpb=503ec7d072a3d9cf8d394e97fa44a71589d16e37;p=friendica-addons.git
diff --git a/pumpio/pumpio.php b/pumpio/pumpio.php
index 0280b517..78b738fa 100755
--- a/pumpio/pumpio.php
+++ b/pumpio/pumpio.php
@@ -39,10 +39,8 @@ function pumpio_content(&$a) {
return '';
}
- if (function_exists("apc_delete")) {
- $toDelete = new APCIterator('user', APC_ITER_VALUE);
- apc_delete($toDelete);
- }
+ require_once("mod/settings.php");
+ settings_init($a);
if (isset($a->argv[1]))
switch ($a->argv[1]) {
@@ -203,6 +201,7 @@ function pumpio_settings(&$a,&$s) {
$enabled = get_pconfig(local_user(),'pumpio','post');
$checked = (($enabled) ? ' checked="checked" ' : '');
+ $css = (($enabled) ? '' : '-disabled');
$def_enabled = get_pconfig(local_user(),'pumpio','post_by_default');
$def_checked = (($def_enabled) ? ' checked="checked" ' : '');
@@ -219,11 +218,11 @@ function pumpio_settings(&$a,&$s) {
/* Add some HTML to the existing form */
$s .= '';
- $s .= '' . t('Pump.io') . '
';
+ $s .= '![](images/pumpio.png)
'. t('Pump.io Import/Export/Mirror').'
';
$s .= '';
$s .= '
';
$s .= '
';
- $s .= '' . t('Pump.io') . '
';
+ $s .= '![](images/pumpio.png)
'. t('Pump.io Import/Export/Mirror').'
';
$s .= '';
$s .= '
';
@@ -294,12 +293,16 @@ function pumpio_settings_post(&$a,&$b) {
if(x($_POST,'pumpio_delete')) {
set_pconfig(local_user(),'pumpio','consumer_key','');
set_pconfig(local_user(),'pumpio','consumer_secret','');
- set_pconfig(local_user(),'pumpio','host','');
set_pconfig(local_user(),'pumpio','oauth_token','');
set_pconfig(local_user(),'pumpio','oauth_token_secret','');
set_pconfig(local_user(),'pumpio','post',false);
- set_pconfig(local_user(),'pumpio','post_by_default',false);
+ set_pconfig(local_user(),'pumpio','import',false);
+ set_pconfig(local_user(),'pumpio','host','');
set_pconfig(local_user(),'pumpio','user','');
+ set_pconfig(local_user(),'pumpio','public',false);
+ set_pconfig(local_user(),'pumpio','mirror',false);
+ set_pconfig(local_user(),'pumpio','post_by_default',false);
+ set_pconfig(local_user(),'pumpio','lastdate', 0);
} else {
// filtering the username if it is filled wrong
$user = $_POST['pumpio_user'];
@@ -322,7 +325,10 @@ function pumpio_settings_post(&$a,&$b) {
set_pconfig(local_user(),'pumpio','mirror',$_POST['pumpio_mirror']);
set_pconfig(local_user(),'pumpio','post_by_default',intval($_POST['pumpio_bydefault']));
- header("Location: ".$a->get_baseurl()."/pumpio/connect");
+ if (!$_POST['pumpio_mirror'])
+ del_pconfig(local_user(),'pumpio','lastdate');
+
+ //header("Location: ".$a->get_baseurl()."/pumpio/connect");
}
}
}
@@ -409,6 +415,9 @@ function pumpio_send(&$a,&$b) {
if($b['app'] == "pump.io")
return;
+ // To-Do;
+ // Support for native shares
+ // http:///api//shares?id=
$oauth_token = get_pconfig($b['uid'], "pumpio", "oauth_token");
$oauth_token_secret = get_pconfig($b['uid'], "pumpio", "oauth_token_secret");
@@ -676,11 +685,11 @@ function pumpio_fetchtimeline(&$a, $uid) {
if (count($posts)) {
foreach ($posts as $post) {
- if ($post->generator->published <= $initiallastdate)
+ if ($post->published <= $initiallastdate)
continue;
- if ($lastdate < $post->generator->published)
- $lastdate = $post->generator->published;
+ if ($lastdate < $post->published)
+ $lastdate = $post->published;
if ($first_time)
continue;
@@ -1324,7 +1333,7 @@ function pumpio_getallusers(&$a, $uid) {
}
foreach ($users->items AS $user)
- echo pumpio_get_contact($uid, $user)."\n";
+ pumpio_get_contact($uid, $user);
}
function pumpio_queue_hook(&$a,&$b) {