X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=krynn%2Fkrynn.php;h=17e7d2b485cb9f6b3f6b0cc13e827b6fdde27caf;hb=461b3db9f449fdb1ce780a337cf2f1bb7aa35ac5;hp=4f336d7b8698473acaf2f39b849efca1242f5d42;hpb=beab86860e62fda96de1d071c5749628a53d3e99;p=friendica-addons.git diff --git a/krynn/krynn.php b/krynn/krynn.php old mode 100755 new mode 100644 index 4f336d7b..17e7d2b4 --- a/krynn/krynn.php +++ b/krynn/krynn.php @@ -1,20 +1,21 @@ * Planets Author: Tony Baldwin - * Krynn modifications: Dylan Thiedeke + * Author: Dylan Thiedeke * - *"My body was my sacrifice... for my magic. This damage is permanent." - Raislin Majere + *"My body was my sacrifice... for my magic. This damage is permanent." - Raistlin Majere */ +use Friendica\Core\PConfig; function krynn_install() { /** - * + * * Our demo plugin will attach in three places. * The first is just prior to storing a local post. * @@ -24,7 +25,7 @@ function krynn_install() { /** * - * Then we'll attach into the plugin settings page, and also the + * Then we'll attach into the plugin settings page, and also the * settings post hook so that we can create and update * user preferences. * @@ -81,7 +82,7 @@ function krynn_post_hook($a, &$item) { /* Retrieve our personal config setting */ - $active = get_pconfig(local_user(), 'krynn', 'enable'); + $active = PConfig::get(local_user(), 'krynn', 'enable'); if(! $active) return; @@ -95,7 +96,7 @@ function krynn_post_hook($a, &$item) { * */ - $krynn = array('Ansalon','Abanasinia','Solace','Haven','Gateway','Qualinost','Ankatavaka','Pax Tharkas','Ergoth','Newsea','Straights of Schallsea','Plains of Dust','Tarsis','Barren Hills','Que Shu','Citadel of Light','Solinari','Hedge Maze','Tower of High Sorcery','Inn of the Last Home','Last Heroes Tomb','Academy of Sorcery','Gods Row','Temple of Majere','Temple of Kiri-Jolith','Temple of Mishakal','Temple of Zeboim,','The Trough','Sad Town','Xak Tsaroth','ZHaman','SKullcap',); + $krynn = ['Ansalon','Abanasinia','Solace','Haven','Gateway','Qualinost','Ankatavaka','Pax Tharkas','Ergoth','Newsea','Straights of Schallsea','Plains of Dust','Tarsis','Barren Hills','Que Shu','Citadel of Light','Solinari','Hedge Maze','Tower of High Sorcery','Inn of the Last Home','Last Heroes Tomb','Academy of Sorcery','Gods Row','Temple of Majere','Temple of Kiri-Jolith','Temple of Mishakal','Temple of Zeboim','The Trough','Sad Town','Xak Tsaroth','Zhaman','Skullcap','Saifhum','Karthay','Mithas','Kothas','Silver Dragon Mountain','Silvanesti']; $planet = array_rand($krynn,1); $item['location'] = $krynn[$planet]; @@ -119,13 +120,13 @@ function krynn_settings_post($a,$post) { if(! local_user()) return; if($_POST['krynn-submit']) - set_pconfig(local_user(),'krynn','enable',intval($_POST['krynn'])); + PConfig::set(local_user(),'krynn','enable',intval($_POST['krynn'])); } /** * - * Called from the Plugin Setting form. + * Called from the Plugin Setting form. * Add our own settings info to the page. * */ @@ -143,19 +144,27 @@ function krynn_settings(&$a,&$s) { /* Get the current state of our config variable */ - $enabled = get_pconfig(local_user(),'krynn','enable'); + $enabled = PConfig::get(local_user(),'krynn','enable'); $checked = (($enabled) ? ' checked="checked" ' : ''); /* Add some HTML to the existing form */ - $s .= '
'; + $s .= ''; + $s .= '

' . t('Krynn') . '

'; + $s .= '
'; + $s .= ''; /* provide a submit button */ $s .= '
';