From 0a92a484554f214d0e499c872807e6b0a3e865ad Mon Sep 17 00:00:00 2001 From: Malf Furious Date: Fri, 1 Jan 2016 16:50:22 -0500 Subject: + Added class file for setting table --- app/class/framework.class.php | 2 +- app/class/setting.class.php | 28 ++++++++++++++++++++++++++++ 2 files changed, 29 insertions(+), 1 deletion(-) create mode 100644 app/class/setting.class.php (limited to 'app') diff --git a/app/class/framework.class.php b/app/class/framework.class.php index eea6c25..d1293de 100644 --- a/app/class/framework.class.php +++ b/app/class/framework.class.php @@ -50,7 +50,7 @@ abstract class Framework /* * Get or create the app's database connection object (this is a singleton object and dependent on system-level config) */ - function getDbConnection() + static function getDbConnection() { global $_SCROTT; diff --git a/app/class/setting.class.php b/app/class/setting.class.php new file mode 100644 index 0000000..ea5fac3 --- /dev/null +++ b/app/class/setting.class.php @@ -0,0 +1,28 @@ +esc($key); + + $query = "SELECT `value` FROM `setting` WHERE `key` = '" . $escdKey . "'"; + $res = $db->query($query); + + if (count($res) == 0) + return false; + + return $res[0]['value']; + } +} + +?> -- cgit v1.2.3