11-12-2019
Update:
Fixed a minor bug in the Minor League Member Leaderboard, caused by sorting on strings instead of floats, which caused users with scores of '100%' to not appear in the sort results.
This bug only appeared in queries where there were no incorrect answers to trivia questions, and this was only the case with people with a very few answers.
Also,
Added a PHP array of country codes to country name so now the country names appear in the leaderboards instead of the country codes.
5 More Discussions You Might Find Interesting
1. UNIX for Dummies Questions & Answers
Thanks Livin Free...
Here's another one... Why is it that I always get the error message "Error: Can't open display:" in my mail whenever I execute or try to call an xterm command using cron to activate the command. What did I miss? Thanks in advance UNIX gurus... (3 Replies)
Discussion started by: jfsuminist
3 Replies
2. What is on Your Mind?
I have added a new experimental "Computer Science and Mathematics Trivia - True or False" section in the discussions, currently under the tags box.
In the future, I plan to
Expand this feature to add more trivia categories from math, science and technology.
Keep track of correct and... (20 Replies)
Discussion started by: Neo
20 Replies
3. What is on Your Mind?
The UNIX and Linux Forums now has over 1000 TRUE / FALSE computer science and computer related trivia question in our database. These questions are of relatively high quality (compared to similar sites on the web) and are fun (according to feedback by users). In the first week during the... (1 Reply)
Discussion started by: Neo
1 Replies
4. What is on Your Mind?
Only a few days after I coded this new feature from scratch, we are seeing over 3000 entries in the database from members (mostly guests) playing CS trivia.
I have spend a lot of time coding this (from scratch) and testing the API. From the logs, it seems to have an API bug which appears... (31 Replies)
Discussion started by: Neo
31 Replies
5. What is on Your Mind?
Just noticed that our successful computer trivia feature (stats here) has surpassed over 50,000 questions answered by users:
https://www.unix.com/trivia_stats.php
This was a coding effort worth while and I'm pleased to see so many people enjoying it in such a short time since it was released... (3 Replies)
Discussion started by: Neo
3 Replies
LEARN ABOUT PHP
geoip_time_zone_by_country_and_region
GEOIP_TIME_ZONE_BY_COUNTRY_AND_REGION(3) 1 GEOIP_TIME_ZONE_BY_COUNTRY_AND_REGION(3)
geoip_time_zone_by_country_and_region - Returns the time zone for some country and region code combo
SYNOPSIS
string geoip_time_zone_by_country_and_region (string $country_code, [string $region_code])
DESCRIPTION
The geoip_time_zone_by_country_and_region(3) function will return the time zone corresponding to a country and region code combo.
In the United States, the region code corresponds to the two-letter abbreviation of each state. In Canada, the region code corresponds to
the two-letter province or territory code as attributed by Canada Post.
For the rest of the world, GeoIP uses FIPS 10-4 codes to represent regions. You can check http://www.maxmind.com/app/fips10_4 for a
detailed list of FIPS 10-4 codes.
This function is always available if using GeoIP Library version 1.4.1 or newer. The data is taken directly from the GeoIP Library and not
from any database.
PARAMETERS
o $country_code
- The two-letter country code (see geoip_country_code_by_name(3))
o $region_code
- The two-letter (or digit) region code (see geoip_region_by_name(3))
RETURN VALUES
Returns the time zone on success, or FALSE if the country and region code combo cannot be found.
EXAMPLES
Example #1
A geoip_time_zone_by_country_and_region(3) example using region code for US/Canada
This will print the time zone for country CA (Canada), region QC (Quebec).
<?php
$timezone = geoip_time_zone_by_country_and_region('CA', 'QC');
if ($timezone) {
echo 'Time zone for CA/QC is: ' . $timezone;
}
?>
The above example will output:
Time zone for CA/QC is: America/Montreal
Example #2
A geoip_time_zone_by_country_and_region(3) example using FIPS codes
This will print the time zone for country JP (Japan), region 01 (Aichi).
<?php
$timezone = geoip_time_zone_by_country_and_region('JP', '01');
if ($timezone) {
echo 'Time zone for JP/01 is: ' . $timezone;
}
?>
The above example will output:
Time zone for JP/01 is: Asia/Tokyo
PHP Documentation Group GEOIP_TIME_ZONE_BY_COUNTRY_AND_REGION(3)