Site Settings

eFiction way:

global variable $settings

  $settingsresults = dbquery("SELECT * FROM ".$settingsprefix."fanfiction_settings WHERE sitekey = '".SITEKEY."'");
  $settings = dbassoc($settingsresults); 
  
  unset($settings['sitekey']);
   
  unset($settings['tableprefix']);
  define("STORIESPATH", $settings['storiespath']);
  unset($settings['storiespath']);
  foreach($settings as $var => $val) {
  	$$var = stripslashes($val);
  	$settings[$var] = htmlspecialchars($val);
  }

it creates variables from column names, those variables should be replaced...

new way:

e_module:

e107::getSingleton('efiction_settings', e_PLUGIN.'efiction/classes/settings.class.php');

$settings = efiction_settings::get_settings();

header (temp solution)

$settings = efiction_settings::get_settings();
foreach($settings as $var => $val) {
  	$$var = stripslashes($val);
}

Last updated