From bcad40a05ab2dc2a341a3227e30b96668bce4500 Mon Sep 17 00:00:00 2001 From: Karl 'vollmerk' Vollmer Date: Thu, 9 Jun 2005 16:34:40 +0000 Subject: New Import --- lib/themes.php | 124 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 124 insertions(+) create mode 100644 lib/themes.php (limited to 'lib/themes.php') diff --git a/lib/themes.php b/lib/themes.php new file mode 100644 index 00000000..ca4a92c7 --- /dev/null +++ b/lib/themes.php @@ -0,0 +1,124 @@ +$color) { + + $sql = "SELECT id FROM preferences WHERE name='" . sql_escape($key) . "'"; + $db_results = mysql_query($sql, dbh()); + + $results = mysql_fetch_array($db_results); + + $sql = "UPDATE user_preference SET `value`='" . sql_escape($color) . "' WHERE `user`='" . $user_id . "' AND " . + " preference='" . $results[0] . "'"; + $db_results = mysql_query($sql, dbh()); + + } // theme colors + +} // set_theme_colors + +/*! + @function set_theme + @discussion this sets the needed vars for the theme +*/ +function set_theme() { + + if (strlen(conf('theme_name')) > 0) { + $theme_path = "/themes/" . conf('theme_name'); + conf(array('theme_path'=>$theme_path),1); + } + +} // set_theme + +/*! + @function get_theme_author + @discussion returns the author of this theme +*/ +function get_theme_author($theme_name) { + + $theme_path = conf('prefix') . "/themes/" . conf('theme_name') . "/theme.cfg.php"; + $results = read_config($theme_path); + + return $results['author']; + +} // get_theme_author +?> -- cgit