summaryrefslogtreecommitdiff
path: root/db-prefs.php
diff options
context:
space:
mode:
authorAndrew Dolgov <[email protected]>2005-11-16 17:57:08 +0100
committerAndrew Dolgov <[email protected]>2005-11-16 17:57:08 +0100
commit3bac89ad2a44562f4d0b1c458ed20740379c03fc (patch)
treec18c0380279c59d787954da94b99a4db979e58b9 /db-prefs.php
parente0257be14a1df1d47498f47b2d2aa15f5a5d8808 (diff)
add db-prefs.php
Diffstat (limited to 'db-prefs.php')
-rw-r--r--db-prefs.php25
1 files changed, 25 insertions, 0 deletions
diff --git a/db-prefs.php b/db-prefs.php
new file mode 100644
index 000000000..c0f6159e7
--- /dev/null
+++ b/db-prefs.php
@@ -0,0 +1,25 @@
+<?
+
+ require_once "config.php";
+ require_once "db.php";
+
+ global $dbprefs_link;
+
+ function get_pref($pref_name) {
+
+ $pref_name = db_escape_string($pref_name);
+
+ $result = db_query($dbprefs_link, "SELECT
+ value,ttrss_prefs_types.id as type_name
+ FROM ttrss_prefs,ttrss_prefs_types
+ WHERE pref_name = '$pref_name' AND ttrss_prefs_types.id = type_id");
+
+ if (db_num_rows($result) > 0) {
+ $value = db_fetch_result($result, 0, "value");
+ return $value;
+ } else {
+ die("Fatal error, unknown preferences key: $pref_name");
+ }
+ }
+
+?>