summaryrefslogtreecommitdiffstats
path: root/app/class/setting.class.php
diff options
context:
space:
mode:
authorMalf Furious <m@lfurio.us>2016-01-01 16:58:34 -0500
committerMalf Furious <m@lfurio.us>2016-01-01 16:58:34 -0500
commit03dd6556041ec11efe86f36d53db38c02d4362a7 (patch)
treee2565c1e1dc7ba5de7342b7b6199d970c60dae94 /app/class/setting.class.php
parentc36269f976cb8287f1b6e17d4b0a958e4e9741da (diff)
parent0a92a484554f214d0e499c872807e6b0a3e865ad (diff)
downloadscrott-03dd6556041ec11efe86f36d53db38c02d4362a7.tar.gz
scrott-03dd6556041ec11efe86f36d53db38c02d4362a7.zip
Merge branch 'datastructures' into dev
Diffstat (limited to 'app/class/setting.class.php')
-rw-r--r--app/class/setting.class.php28
1 files changed, 28 insertions, 0 deletions
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 @@
+<?php
+
+require_once "class/framework.class.php";
+
+/*
+ * Scrott administrative settings
+ */
+class Setting extends Framework
+{
+ /*
+ * Helper function for getting setting values from the database
+ */
+ static function getValue($key)
+ {
+ $db = parent::getDbConnection();
+ $escdKey = $db->esc($key);
+
+ $query = "SELECT `value` FROM `setting` WHERE `key` = '" . $escdKey . "'";
+ $res = $db->query($query);
+
+ if (count($res) == 0)
+ return false;
+
+ return $res[0]['value'];
+ }
+}
+
+?>