aboutsummaryrefslogtreecommitdiffstats
path: root/phpBB/functions/functions.php
diff options
context:
space:
mode:
authorPaul S. Owen <psotfx@users.sourceforge.net>2001-03-20 20:07:47 +0000
committerPaul S. Owen <psotfx@users.sourceforge.net>2001-03-20 20:07:47 +0000
commitf83af8fbd666b6f8176e83b180c85b7b5b60a216 (patch)
treeaa12e9054fced103afbac9480170075685054801 /phpBB/functions/functions.php
parent1fbbc382ccb6f0ffc081c7c1c8704bda6d643fb9 (diff)
downloadforums-f83af8fbd666b6f8176e83b180c85b7b5b60a216.tar
forums-f83af8fbd666b6f8176e83b180c85b7b5b60a216.tar.gz
forums-f83af8fbd666b6f8176e83b180c85b7b5b60a216.tar.bz2
forums-f83af8fbd666b6f8176e83b180c85b7b5b60a216.tar.xz
forums-f83af8fbd666b6f8176e83b180c85b7b5b60a216.zip
IP integer encoding and decoding added
git-svn-id: file:///svn/phpbb/trunk@110 89ea8834-ac86-4346-8a33-228a782c2dd0
Diffstat (limited to 'phpBB/functions/functions.php')
-rw-r--r--phpBB/functions/functions.php29
1 files changed, 22 insertions, 7 deletions
diff --git a/phpBB/functions/functions.php b/phpBB/functions/functions.php
index 0e5341d2e6..0e7878ed3e 100644
--- a/phpBB/functions/functions.php
+++ b/phpBB/functions/functions.php
@@ -186,23 +186,23 @@ function tz_select($default)
"-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",
+ "-2" => "(GMT -2:00 hours) Mid-Atlantic, Ascension Is., St. Helena, ",
"-1" => "(GMT -1:00 hours) Azores, Cape Verde Islands",
- "0" => "(GMT) Western Europe Time, London, Lisbon, Casablanca, Monrovia",
- "+1" => "(GMT +1:00 hours) CET(Central Europe Time), Brussels, Copenhagen, Madrid, Paris",
- "+2" => "(GMT +2:00 hours) EET(Eastern Europe Time), Kaliningrad, South Africa",
+ "0" => "(GMT) Casablanca, Dublin, Edinburgh, London, Lisbon, Monrovia",
+ "+1" => "(GMT +1:00 hours) CET, Berlin, Brussels, Copenhagen, Madrid, Paris, Rome",
+ "+2" => "(GMT +2:00 hours) EET, Kaliningrad, South Africa, Warsaw",
"+3" => "(GMT +3:00 hours) Baghdad, Kuwait, Riyadh, Moscow, St. Petersburg, Volgograd, Nairobi",
"+3.5" => "(GMT +3:30 hours) Tehran",
- "+4" => "(GMT +4:00 hours) Abu Dhabi, Muscat, Baku, Tbilisi",
+ "+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, Dhaka, Colombo",
+ "+6" => "(GMT +6:00 hours) Almaty, Colombo, Dhaka",
"+7" => "(GMT +7:00 hours) Bangkok, Hanoi, Jakarta",
"+8" => "(GMT +8:00 hours) Beijing, Perth, Singapore, Hong Kong, Chongqing, Urumqi, Taipei",
"+9" => "(GMT +9:00 hours) Tokyo, Seoul, Osaka, Sapporo, Yakutsk",
"+9.5" => "(GMT +9:30 hours) Adelaide, Darwin",
- "+10" => "(GMT +10:00 hours) EAST(East Australian Standard), Guam, Papua New Guinea, Vladivostok",
+ "+10" => "(GMT +10:00 hours) EAST (East Australian Standard), Guam, Papua New Guinea, Vladivostok",
"+11" => "(GMT +11:00 hours) Magadan, Solomon Islands, New Caledonia",
"+12" => "(GMT +12:00 hours) Auckland, Wellington, Fiji, Kamchatka, Marshall Island");
@@ -275,4 +275,19 @@ function generate_activation_key()
return($act_key_md);
}
+
+function encode_ip($dotquad_ip)
+{
+ $ip_sep = explode(".", $dotquad_ip);
+ return (( $ip_sep[0] * 0xFFFFFF + $ip_sep[0] ) + ( $ip_sep[1] * 0xFFFF + $ip_sep[1] ) + ( $ip_sep[2] * 0xFF + $ip_sep[2] ) + ( $ip_sep[3] ) );
+}
+
+function decode_ip($int_ip)
+{
+
+ return sprintf( "%d.%d.%d.%d", ( ( $int_ip >> 24 ) & 0xFF ), ( ( $int_ip >> 16 ) & 0xFF ), ( ( $int_ip >> 8 ) & 0xFF ), ( ( $int_ip ) & 0xFF ) );
+
+}
+
+
?> \ No newline at end of file