aboutsummaryrefslogtreecommitdiffstats
path: root/phpBB/includes
diff options
context:
space:
mode:
authorJames Atkinson <thefinn@users.sourceforge.net>2001-07-24 22:11:24 +0000
committerJames Atkinson <thefinn@users.sourceforge.net>2001-07-24 22:11:24 +0000
commit982566faa01977c3160cdb6707635f9b7f75c1e2 (patch)
treeefc7aa8f4fcde0d6b75b5e6fbe205dae171becc2 /phpBB/includes
parent7dfe41c0b9224f49c25d530ad26bc15d5382c11a (diff)
downloadforums-982566faa01977c3160cdb6707635f9b7f75c1e2.tar
forums-982566faa01977c3160cdb6707635f9b7f75c1e2.tar.gz
forums-982566faa01977c3160cdb6707635f9b7f75c1e2.tar.bz2
forums-982566faa01977c3160cdb6707635f9b7f75c1e2.tar.xz
forums-982566faa01977c3160cdb6707635f9b7f75c1e2.zip
System config admin section started. Can view settings but can't modify them at the moment
git-svn-id: file:///svn/phpbb/trunk@750 89ea8834-ac86-4346-8a33-228a782c2dd0
Diffstat (limited to 'phpBB/includes')
-rw-r--r--phpBB/includes/functions.php144
1 files changed, 144 insertions, 0 deletions
diff --git a/phpBB/includes/functions.php b/phpBB/includes/functions.php
index 98769d178b..7cb2c761d8 100644
--- a/phpBB/includes/functions.php
+++ b/phpBB/includes/functions.php
@@ -626,4 +626,148 @@ function sync($type, $id)
}
+function language_select($default, $dirname="language/")
+{
+ global $phpEx;
+
+ $dir = opendir($dirname);
+
+ $lang_select = "<select name=\"language\">\n";
+ while ($file = readdir($dir))
+ {
+ if (ereg("^lang_", $file))
+ {
+ $filename = str_replace("lang_", "", $file);
+ $filename = str_replace(".$phpEx", "", $filename);
+ $displayname = preg_replace("/(.*)_(.*)/", "\\1 [ \\2 ]", $filename);
+ $selected = (strtolower($default) == strtolower($filename)) ? " selected" : "";
+ $lang_select .= " <option value=\"$filename\"$selected>".ucwords($displayname)."</option>\n";
+ }
+ }
+ $lang_select .= "</select>\n";
+
+ closedir($dir);
+
+ return $lang_select;
+}
+// NOTE: This function should check is_dir($file), however the is_dir function seems to be buggy on my
+// system so its not currently implemented that way
+// - James
+function template_select($default, $dirname = "templates")
+{
+ $dir = opendir($dirname);
+
+ $template_select = "<select name=\"template\">\n";
+ while($file = readdir($dir))
+ {
+ unset($selected);
+
+ if($file != "." && $file != ".." && $file != "CVS")
+ {
+ if($file == $default)
+ {
+ $selected = " selected";
+ }
+ $template_select .= "<option value=\"$file\"$selected>$file</option>\n";
+ }
+ }
+ $template_select .= "</select>";
+
+ closedir($dir);
+
+ return($template_select);
+}
+function theme_select($default)
+{
+ global $db, $board_config, $lang;
+
+ $sql = "SELECT themes_id, themes_name
+ FROM " . THEMES_TABLE . "
+ WHERE themes_name LIKE '" . $board_config['default_template'] . "-%'
+ ORDER BY themes_name";
+ if($result = $db->sql_query($sql))
+ {
+ $num = $db->sql_numrows($result);
+ $rowset = $db->sql_fetchrowset($result);
+
+ if($num)
+ {
+ $theme_select = "<select name=\"theme\">\n";
+ for($i = 0; $i < $num; $i++)
+ {
+ if(stripslashes($rowset[$i]['themes_name']) == $default || $rowset[$i]['themes_id'] == $default)
+ {
+ $selected = " selected";
+ }
+ else
+ {
+ $selected = "";
+ }
+ $theme_select .= "\t<option value=\"" . $rowset[$i]['themes_id'] ."\"$selected>" . stripslashes($rowset[$i]['themes_name']) . "</option>\n";
+ }
+ $theme_select .= "</select>\n";
+ }
+ else
+ {
+ $theme_select = "<select name=\"theme\"><option value=\"-1\">" . $lang['No_themes'] . "</option></select>";
+ }
+ }
+ else
+ {
+ message_die(GENERAL_ERROR, "Couldn't query themes table", "", __LINE__, __FILE__, $sql);
+ }
+ return($theme_select);
+}
+function tz_select($default)
+{
+ global $sys_timezone;
+
+ if(!isset($default))
+ {
+ $default == $sys_timezone;
+ }
+ $tz_select = "<select name=\"timezone\">";
+ $tz_array = array(
+ "-12" => "(GMT -12:00 hours) Eniwetok, Kwajalein",
+ "-11" => "(GMT -11:00 hours) Midway Island, Samoa",
+ "-10" => "(GMT -10:00 hours) Hawaii",
+ "-9" => "(GMT -9:00 hours) Alaska",
+ "-8" => "(GMT -8:00 hours) Pacific Time (US & Canada)",
+ "-7" => "(GMT -7:00 hours) Mountain Time (US & Canada)",
+ "-6" => "(GMT -6:00 hours) Central Time (US & Canada), Mexico City",
+ "-5" => "(GMT -5:00 hours) Eastern Time (US & Canada), Bogota, Lima, Quito",
+ "-4" => "(GMT -4:00 hours) Atlantic Time (Canada), Caracas, La Paz",
+ "-3.5" => "(GMT -3:30 hours) Newfoundland",
+ "-3" => "(GMT -3:00 hours) Brazil, Buenos Aires, Georgetown",
+ "-2" => "(GMT -2:00 hours) Mid-Atlantic, Ascension Is., St. Helena, ",
+ "-1" => "(GMT -1:00 hours) Azores, Cape Verde Islands",
+ "0" => "(GMT) Casablanca, Dublin, Edinburgh, London, Lisbon, Monrovia",
+ "+1" => "(GMT +1:00 hours) Berlin, Brussels, Copenhagen, Madrid, Paris, Rome",
+ "+2" => "(GMT +2:00 hours) Kaliningrad, South Africa, Warsaw",
+ "+3" => "(GMT +3:00 hours) Baghdad, Riyadh, Moscow, Nairobi",
+ "+3.5" => "(GMT +3:30 hours) Tehran",
+ "+4" => "(GMT +4:00 hours) Abu Dhabi, Baku, Muscat, Tbilisi",
+ "+4.5" => "(GMT +4:30 hours) Kabul",
+ "+5" => "(GMT +5:00 hours) Ekaterinburg, Islamabad, Karachi, Tashkent",
+ "+5.5" => "(GMT +5:30 hours) Bombay, Calcutta, Madras, New Delhi",
+ "+6" => "(GMT +6:00 hours) Almaty, Colombo, Dhaka",
+ "+7" => "(GMT +7:00 hours) Bangkok, Hanoi, Jakarta",
+ "+8" => "(GMT +8:00 hours) Beijing, Chongqing, Hong Kong, Perth, Singapore, Taipei",
+ "+9" => "(GMT +9:00 hours) Osaka, Sapporo, Seoul, Tokyo, Yakutsk",
+ "+9.5" => "(GMT +9:30 hours) Adelaide, Darwin",
+ "+10" => "(GMT +10:00 hours) Guam, Melbourne, Papua New Guinea, Sydney, Vladivostok",
+ "+11" => "(GMT +11:00 hours) Magadan, New Caledonia, Solomon Islands",
+ "+12" => "(GMT +12:00 hours) Auckland, Wellington, Fiji, Kamchatka, Marshall Island");
+
+ while(list($offset, $zone) = each($tz_array))
+ {
+ $selected = ($offset == $default) ? " selected" : "";
+ $tz_select .= "\t<option value=\"$offset\"$selected>$zone</option>\n";
+ }
+ $tz_select .= "</select>\n";
+
+ return($tz_select);
+}
+
+
?> \ No newline at end of file