X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=krynn%2Fkrynn.php;h=ca2c426d594185ea52068f5f867e54cebc92d683;hb=4b05d70b94033bf2bcf7a63ee5f9928a56504bd9;hp=f61538427e9a7fae2ba5ec449f0d52afd965e175;hpb=3c38480998b6a3a23159a70a6d1df675c6f03148;p=friendica-addons.git diff --git a/krynn/krynn.php b/krynn/krynn.php old mode 100755 new mode 100644 index f6153842..ca2c426d --- a/krynn/krynn.php +++ b/krynn/krynn.php @@ -5,11 +5,12 @@ * Version: 1.0 * Planets Author: Mike Macgirvin * Planets Author: Tony Baldwin - * Kryn Authoer: Dylan Thiedeke + * Author: Dylan Thiedeke * *"My body was my sacrifice... for my magic. This damage is permanent." - Raistlin Majere */ +use Friendica\Core\PConfig; function krynn_install() { @@ -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','Saifhum','Karthay','Mithas','Kothas','Silver Dragon Mountain','Silvanesti'); + $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','Saifhum','Karthay','Mithas','Kothas','Silver Dragon Mountain','Silvanesti'); $planet = array_rand($krynn,1); $item['location'] = $krynn[$planet]; @@ -119,7 +120,7 @@ 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'])); } @@ -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 .= '
';