X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=wppost%2Fwppost.php;h=96e95979d34ebc7e7f14aab68e71f39d60742312;hb=3e141d268e10a10e2c7a69782fdd6378f0804368;hp=3c7c17b10012579d9bdd984d5d15900d046a592b;hpb=7fb604f0ff544faa567aa93212649413ef727811;p=friendica-addons.git diff --git a/wppost/wppost.php b/wppost/wppost.php old mode 100755 new mode 100644 index 3c7c17b1..96e95979 --- a/wppost/wppost.php +++ b/wppost/wppost.php @@ -3,10 +3,12 @@ /** * Name: WordPress Post Connector * Description: Post to WordPress (or anything else which uses blogger XMLRPC API) - * Version: 1.0 + * Version: 1.1 * Author: Mike Macgirvin */ +use Friendica\Core\PConfig; + function wppost_install() { register_hook('post_local', 'addon/wppost/wppost.php', 'wppost_post_local'); register_hook('notifier_normal', 'addon/wppost/wppost.php', 'wppost_send'); @@ -34,9 +36,9 @@ function wppost_jot_nets(&$a,&$b) { if(! local_user()) return; - $wp_post = get_pconfig(local_user(),'wppost','post'); + $wp_post = PConfig::get(local_user(),'wppost','post'); if(intval($wp_post) == 1) { - $wp_defpost = get_pconfig(local_user(),'wppost','post_by_default'); + $wp_defpost = PConfig::get(local_user(),'wppost','post_by_default'); $selected = ((intval($wp_defpost) == 1) ? ' checked="checked" ' : ''); $b .= '
' . t('Post to Wordpress') . '
'; @@ -46,38 +48,42 @@ function wppost_jot_nets(&$a,&$b) { function wppost_settings(&$a,&$s) { - if(! local_user()) - return; + if(! local_user()) + return; - /* Add our stylesheet to the page so we can make our settings look nice */ + /* Add our stylesheet to the page so we can make our settings look nice */ - $a->page['htmlhead'] .= '' . "\r\n"; + $a->page['htmlhead'] .= '' . "\r\n"; - /* Get the current state of our config variables */ + /* Get the current state of our config variables */ - $enabled = get_pconfig(local_user(),'wppost','post'); + $enabled = PConfig::get(local_user(),'wppost','post'); + $checked = (($enabled) ? ' checked="checked" ' : ''); - $checked = (($enabled) ? ' checked="checked" ' : ''); + $css = (($enabled) ? '' : '-disabled'); - $def_enabled = get_pconfig(local_user(),'wppost','post_by_default'); - $back_enabled = get_pconfig(local_user(),'wppost','backlink'); + $def_enabled = PConfig::get(local_user(),'wppost','post_by_default'); + $back_enabled = PConfig::get(local_user(),'wppost','backlink'); + $shortcheck_enabled = PConfig::get(local_user(),'wppost','shortcheck'); - $def_checked = (($def_enabled) ? ' checked="checked" ' : ''); - $back_checked = (($back_enabled) ? ' checked="checked" ' : ''); + $def_checked = (($def_enabled) ? ' checked="checked" ' : ''); + $back_checked = (($back_enabled) ? ' checked="checked" ' : ''); + $shortcheck_checked = (($shortcheck_enabled) ? ' checked="checked" ' : ''); - $wp_username = get_pconfig(local_user(), 'wppost', 'wp_username'); - $wp_password = get_pconfig(local_user(), 'wppost', 'wp_password'); - $wp_blog = get_pconfig(local_user(), 'wppost', 'wp_blog'); + $wp_username = PConfig::get(local_user(), 'wppost', 'wp_username'); + $wp_password = PConfig::get(local_user(), 'wppost', 'wp_password'); + $wp_blog = PConfig::get(local_user(), 'wppost', 'wp_blog'); + $wp_backlink_text = PConfig::get(local_user(), 'wppost', 'wp_backlink_text'); /* Add some HTML to the existing form */ $s .= ''; - $s .= '

' . t('WordPress') . '

'; + $s .= '

'. t('Wordpress Export').'

'; $s .= '
'; $s .= '