From 03d980518790dafbdea0e94b4dbe8c148ef3bf56 Mon Sep 17 00:00:00 2001 From: mrpete Date: Sun, 4 Mar 2007 21:47:15 +0000 Subject: [PATCH] Support cpu-usage rendertime --- class2.php | 39 ++++++++++++++++++++------------------- 1 file changed, 20 insertions(+), 19 deletions(-) diff --git a/class2.php b/class2.php index e8010fdd4..c3f2db65a 100644 --- a/class2.php +++ b/class2.php @@ -1,4 +1,4 @@ -db_Select_gen("REPLACE INTO #core (e107_name,e107_value) values ('SitePrefs_Backup', '".addslashes($PrefCache)."') "); + if ($row_val == '') + { // Save old version as a backup first + $sql->db_Select_gen("REPLACE INTO #core (e107_name,e107_value) values ('SitePrefs_Backup', '".addslashes($PrefCache)."') "); - // Now save the updated values - // traverse the pref array, with toDB on everything - $_pref = $tp -> toDB($pref, true, true); - // Create the data to be stored - $sql->db_Select_gen("REPLACE INTO #core (e107_name,e107_value) values ('SitePrefs', '".$eArrayStorage->WriteArray($_pref)."') "); - ecache::clear('SitePrefs'); - } + // Now save the updated values + // traverse the pref array, with toDB on everything + $_pref = $tp -> toDB($pref, true, true); + // Create the data to be stored + $sql->db_Select_gen("REPLACE INTO #core (e107_name,e107_value) values ('SitePrefs', '".$eArrayStorage->WriteArray($_pref)."') "); + ecache::clear('SitePrefs'); + } } else { - $_user_pref = $tp -> toDB($user_pref); - $tmp=addslashes(serialize($_user_pref)); - $sql->db_Update("user", "user_prefs='$tmp' WHERE user_id=".intval($uid)); - return $tmp; + $_user_pref = $tp -> toDB($user_pref); + $tmp=addslashes(serialize($_user_pref)); + $sql->db_Update("user", "user_prefs='$tmp' WHERE user_id=".intval($uid)); + return $tmp; } }