** Loads preferences from the $username.pref file used by almost
** every other script in the source directory and alswhere.
**
+ ** $Id$
**/
if (!isset($config_php))
include("../functions/plugin.php");
$load_prefs_php = true;
+ if (!isset($username))
+ $username = '';
checkForPrefs($data_dir, $username);
$chosen_theme = getPref($data_dir, $username, "chosen_theme");
- if ((substr($chosen_theme, 0, 10) == "../config/")) {
- $chosen_theme = substr($chosen_theme, 10);
- $chosen_theme = "../themes/$chosen_theme";
+ $in_ary = false;
+ for ($i=0; $i < count($theme); $i++){
+ if ($theme[$i]["PATH"] == $chosen_theme) {
+ $in_ary = true;
+ break;
+ }
+ }
+ if (!$in_ary) {
+ $chosen_theme = "";
}
if ((isset($chosen_theme)) && (file_exists($chosen_theme))) {
#
# I hard coded the theme as a last resort if no themes were
# found. It makes no sense to cause the whole thing to exit
- # just because themes weren't found. This is the absolute
+ # just because themes were not found. This is the absolute
# last resort.
#
$color[0] = "#DCDCDC"; // (light gray) TitleBar
}
}
- session_register("theme_css");
+ if (!isset($download_php)) session_register("theme_css");
$use_javascript_addr_book = getPref($data_dir, $username, "use_javascript_addr_book");
if ($use_javascript_addr_book == "")
$wrap_at = getPref($data_dir, $username, "wrap_at");
if ($wrap_at == "")
$wrap_at = 86;
+ if ($wrap_at < 15)
+ $wrap_at = 15;
$left_size = getPref($data_dir, $username, "left_size");
if ($left_size == "") {
$left_refresh = getPref($data_dir, $username, "left_refresh");
if ($left_refresh == "")
$left_refresh = false;
+
+ $sort = getPref($data_dir, $username, "sort");
+ if ($sort == "")
+ $sort = 6;
/** Load up the Signature file **/
if ($use_signature == true) {
$signature_abs = getSig($data_dir, $username);
}
- /** Load up the Language preference **/
- $user_language = getPref($data_dir, $username, "language");
- if ($user_language == "") {
- if (isset($default_charset))
- $user_language = $default_charset;
- else
- $user_language = en;
- }
-
// highlightX comes in with the form: name,color,header,value
for ($i=0; $hlt = getPref($data_dir, $username, "highlight$i"); $i++) {
$ary = explode(",", $hlt);
$message_highlight_list[$i]["match_type"] = $ary[3];
}
+ #index order lets you change the order of the message index
+ $order = getPref($data_dir, $username, "order1");
+ for ($i=1; $order; $i++) {
+ $index_order[$i] = $order;
+ $order = getPref($data_dir, $username, "order".($i+1));
+ }
+ if (!isset($index_order)) {
+ $index_order[1] = 1;
+ $index_order[2] = 2;
+ $index_order[3] = 3;
+ $index_order[4] = 5;
+ $index_order[5] = 4;
+ }
+
+ $location_of_bar = getPref($data_dir, $username, 'location_of_bar');
+ if ($location_of_bar == '')
+ $location_of_bar = 'left';
+
+ $location_of_buttons = getPref($data_dir, $username, 'location_of_buttons');
+ if ($location_of_buttons == '')
+ $location_of_buttons = 'between';
+
+ $collapse_folders = getPref($data_dir, $username, 'collapse_folders');
+
do_hook("loading_prefs");
+
?>