Just had to change hosting options last night from php4 engine to php5 engine, took bout an hour to take effect which was why i had the intermitent issues last eve, my patience sucked... as for secondary items
settings.php v1.2.0
<?php
// translator ready
// addnews ready
// mail ready
function savesetting($settingname,$value){
global $settings;
loadsettings();
if (!isset($settings[$settingname]) && $value){
$sql = "INSERT INTO " . db_prefix("settings") . " (setting,value) VALUES (\"".addslashes($settingname)."\",\"".addslashes($value)."\")";
}else if (isset($settings[$settingname])) {
$sql = "UPDATE " . db_prefix("settings") . " SET value=\"".addslashes($value)."\" WHERE setting=\"".addslashes($settingname)."\"";
} else {
return false;
}
db_query($sql);
$settings[$settingname]=$value;
invalidatedatacache("gamesettings");
if (db_affected_rows()>0) {
return true;
}else{
return false;
}
}
function loadsettings(){
global $settings;
// as this seems to be a common complaint, examine the execution path
// of this function, it will only load the settings once per page hit,
// in subsequent calls to this function, $settings will be an array,
// thus this function will do nothing.
// slight change in 1.1.1 ... let's store a serialized array instead of a cached query
// we need it too often and the for/while construct necessary is just too much for it.
if (!is_array($settings)){
$settings=datacache("gamesettings");
if (!is_array($settings)){
$settings=array();
$sql = "SELECT * FROM " . db_prefix("settings");
$result = db_query($sql);
while ($row = db_fetch_assoc($result)) {
$settings[$row['setting']] = $row['value'];
}
db_free_result($result);
updatedatacache("gamesettings",$settings);
}
}
}
function clearsettings(){
//scraps the loadsettings() data to force it to reload.
global $settings;
invalidatedatacache("gamesettings");
unset($settings);
}
function getsetting($settingname,$default){
global $settings;
global $DB_USEDATACACHE,$DB_DATACACHEPATH;
if ($settingname=="usedatacache") return $DB_USEDATACACHE;
elseif ($settingname=="datacachepath") return $DB_DATACACHEPATH;
if (!isset($settings[$settingname])) {
loadsettings();
}else {
return $settings[$settingname];
}
if (!isset($settings[$settingname])){
savesetting($settingname,$default);
return $default;
}else{
return $settings[$settingname];
}
}
?>
settings.php v1.2.1
<?php
// translator ready
// addnews ready
// mail ready
require_once("lib/settings.class.php");
function savesetting($settingname,$value){
global $settings;
$settings->saveSetting($settingname,$value);
}
function loadsettings(){
global $settings;
// as this seems to be a common complaint, examine the execution path
// of this function, it will only load the settings once per page hit,
// in subsequent calls to this function, $settings will be an array,
// thus this function will do nothing.
// slight change in 1.1.1 ... let's store a serialized array instead of a cached query
// we need it too often and the for/while construct necessary is just too much for it.
var_export($settings);
// $settings->loadSettings();
}
function clearsettings(){
//scraps the loadsettings() data to force it to reload.
global $settings;
$settings->clearSettings();
unset($settings);
$settings=new settings("settings");
}
function getsetting($settingname,$default){
global $settings;
if (!$settings) return "";
return $settings->getSetting($settingname,$default);
}
?>
for seeing them in their locations
http://www.digitaldamon.net/UAO-111/http://www.digitaldamon.net/UAO-120/http://www.digitaldamon.net/UAO-121/1.2.1 can loadup installer with intermitent issue, but clicking on "Game Installer" gives
Parse error: syntax error, unexpected ')', expecting ',' or ';' in /mnt/w1007/d12/s14/b02d4616/www/digitaldamon.net/UAO-121/installer.php on line 28
Which is the get MySQL version line (Mine is 5.0.24a so I meet the 5.0.0+ specification)
Appologize for being a pain in the arse but attempting for module building and trying to make sure my testbed enviroments are fully functional before i start throwing code at the wind
EDITED 9:43AM PST - Modified settings.php as per your directions above settings glitch gone, just installer line 28 glitch remaining, I will download a new package right now and reupload her, be back in a few moments.