]> git.mxchange.org Git - friendica-addons.git/blobdiff - wppost/wppost.php
"remote self" should work now with the addons
[friendica-addons.git] / wppost / wppost.php
index 931b6d8188ca20e8dfe1b8fb2ba46328501c03ea..fc9244af6ee72193d8b9e0aee060753ff4ebcf2b 100755 (executable)
@@ -149,38 +149,39 @@ function wppost_settings_post(&$a,&$b) {
 
 }
 
-function wppost_post_local(&$a,&$b) {
+function wppost_post_local(&$a, &$b) {
 
        // This can probably be changed to allow editing by pointing to a different API endpoint
 
-       if($b['edit']) {
+       if ($b['edit']) {
                return;
        }
 
-       if((! local_user()) || (local_user() != $b['uid'])) {
+       if (!local_user() || (local_user() != $b['uid'])) {
                return;
        }
 
-       if($b['private'] || $b['parent']) {
+       if ($b['private'] || $b['parent']) {
                return;
        }
 
-    $wp_post   = intval(get_pconfig(local_user(),'wppost','post'));
+       $wp_post   = intval(get_pconfig(local_user(),'wppost','post'));
 
        $wp_enable = (($wp_post && x($_REQUEST,'wppost_enable')) ? intval($_REQUEST['wppost_enable']) : 0);
 
-       if($_REQUEST['api_source'] && intval(get_pconfig(local_user(),'wppost','post_by_default'))) {
+       if ($b['api_source'] && intval(get_pconfig(local_user(),'wppost','post_by_default'))) {
                $wp_enable = 1;
        }
 
-    if(! $wp_enable) {
-       return;
-    }
+       if (!$wp_enable) {
+               return;
+       }
 
-    if(strlen($b['postopts'])) {
-       $b['postopts'] .= ',';
-    }
-    $b['postopts'] .= 'wppost';
+       if (strlen($b['postopts'])) {
+               $b['postopts'] .= ',';
+       }
+
+       $b['postopts'] .= 'wppost';
 }
 
 
@@ -257,7 +258,7 @@ function wppost_send(&$a,&$b) {
                                $title = html2plain(bbcode($title, false, false), 0, true)."\n";
                                $pos = strpos($title, "\n");
                                $trailer = "";
-                               if (($pos == 0) or ($pos > 100)) {
+                               if (($pos == 0) || ($pos > 100)) {
                                        $pos = 100;
                                        $trailer = "...";
                                }