mirror of
https://git.friendi.ca/friendica/friendica-addons.git
synced 2025-07-19 23:07:03 +00:00
Continued:
- used empty() instead of strlen() - PR - added empty lines, removed some Signed-off-by: Roland Häder <roland@mxchange.org>
This commit is contained in:
parent
bfe2f6e891
commit
2ab82ad084
1 changed files with 5 additions and 3 deletions
|
@ -6,6 +6,7 @@
|
||||||
* Author: Tony Baldwin <https://free-haven.org/profile/tony>
|
* Author: Tony Baldwin <https://free-haven.org/profile/tony>
|
||||||
* Author: Michael Johnston
|
* Author: Michael Johnston
|
||||||
* Author: Cat Gray <https://free-haven.org/profile/catness>
|
* Author: Cat Gray <https://free-haven.org/profile/catness>
|
||||||
|
* @TODO A lot spaces here needs converted to tab
|
||||||
*/
|
*/
|
||||||
|
|
||||||
use Friendica\App;
|
use Friendica\App;
|
||||||
|
@ -25,6 +26,7 @@ function ijpost_install() {
|
||||||
Addon::registerHook('connector_settings_post', 'addon/ijpost/ijpost.php', 'ijpost_settings_post');
|
Addon::registerHook('connector_settings_post', 'addon/ijpost/ijpost.php', 'ijpost_settings_post');
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
function ijpost_uninstall() {
|
function ijpost_uninstall() {
|
||||||
Addon::unregisterHook('post_local', 'addon/ijpost/ijpost.php', 'ijpost_post_local');
|
Addon::unregisterHook('post_local', 'addon/ijpost/ijpost.php', 'ijpost_post_local');
|
||||||
Addon::unregisterHook('notifier_normal', 'addon/ijpost/ijpost.php', 'ijpost_send');
|
Addon::unregisterHook('notifier_normal', 'addon/ijpost/ijpost.php', 'ijpost_send');
|
||||||
|
@ -34,7 +36,6 @@ function ijpost_uninstall() {
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
function ijpost_jot_nets(App $a, &$b) {
|
function ijpost_jot_nets(App $a, &$b) {
|
||||||
if(! local_user())
|
if(! local_user())
|
||||||
return;
|
return;
|
||||||
|
@ -122,7 +123,6 @@ function ijpost_settings_post(App $a, array &$b) {
|
||||||
}
|
}
|
||||||
|
|
||||||
function ijpost_post_local(App $a, array &$b) {
|
function ijpost_post_local(App $a, array &$b) {
|
||||||
|
|
||||||
// This can probably be changed to allow editing by pointing to a different API endpoint
|
// This can probably be changed to allow editing by pointing to a different API endpoint
|
||||||
|
|
||||||
if($b['edit'])
|
if($b['edit'])
|
||||||
|
@ -173,12 +173,13 @@ function ijpost_send(App $a, array &$b) {
|
||||||
intval($b['uid'])
|
intval($b['uid'])
|
||||||
);
|
);
|
||||||
|
|
||||||
if (DBM::is_result($x) && strlen($x[0]['timezone'])) {
|
if (DBM::is_result($x) && !empty($x[0]['timezone'])) {
|
||||||
$tz = $x[0]['timezone'];
|
$tz = $x[0]['timezone'];
|
||||||
}
|
}
|
||||||
|
|
||||||
$ij_username = PConfig::get($b['uid'],'ijpost','ij_username');
|
$ij_username = PConfig::get($b['uid'],'ijpost','ij_username');
|
||||||
$ij_password = PConfig::get($b['uid'],'ijpost','ij_password');
|
$ij_password = PConfig::get($b['uid'],'ijpost','ij_password');
|
||||||
|
|
||||||
$ij_blog = 'http://www.insanejournal.com/interface/xmlrpc';
|
$ij_blog = 'http://www.insanejournal.com/interface/xmlrpc';
|
||||||
|
|
||||||
if ($ij_username && $ij_password && $ij_blog) {
|
if ($ij_username && $ij_password && $ij_blog) {
|
||||||
|
@ -226,6 +227,7 @@ EOT;
|
||||||
if($ij_blog !== 'test') {
|
if($ij_blog !== 'test') {
|
||||||
$x = Network::post($ij_blog, $xml, ["Content-Type: text/xml"]);
|
$x = Network::post($ij_blog, $xml, ["Content-Type: text/xml"]);
|
||||||
}
|
}
|
||||||
|
|
||||||
logger('posted to insanejournal: ' . ($x) ? $x : '', LOGGER_DEBUG);
|
logger('posted to insanejournal: ' . ($x) ? $x : '', LOGGER_DEBUG);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue