summaryrefslogtreecommitdiff
path: root/news.php
diff options
context:
space:
mode:
authorJared Adams <jaxad0127@gmail.com>2009-02-10 15:39:54 +0000
committerJared Adams <jaxad0127@gmail.com>2009-02-10 15:39:54 +0000
commit6c35dd5332ff919d509dfda0820d6a599ec5ed52 (patch)
tree3fb281dbeb730904f98829781eead95a9d08c47c /news.php
parentb6b42a4aa12a044b938c6e22253cb75c79123da4 (diff)
downloadserverdata-6c35dd5332ff919d509dfda0820d6a599ec5ed52.tar.gz
serverdata-6c35dd5332ff919d509dfda0820d6a599ec5ed52.tar.bz2
serverdata-6c35dd5332ff919d509dfda0820d6a599ec5ed52.tar.xz
serverdata-6c35dd5332ff919d509dfda0820d6a599ec5ed52.zip
Update client version tracking
New scripts now keep automatic daily logs, time indices, and easier old version checking
Diffstat (limited to 'news.php')
-rw-r--r--news.php25
1 files changed, 12 insertions, 13 deletions
diff --git a/news.php b/news.php
index 1804bcc2..fff3ed8c 100644
--- a/news.php
+++ b/news.php
@@ -8,22 +8,21 @@ $agent = $_SERVER['HTTP_USER_AGENT'];
if (substr($agent, 0, 3) == "TMW")
{
- file_put_contents('versions.txt', "$agent\n", FILE_APPEND);
+ $file = 'versions/' . date('Y-m-d') . '.txt';
+ touch($file);
+ file_put_contents($file, '[' . date('H:i') . "] $agent\n", FILE_APPEND);
}
-if ($agent == "TMW/0.0.23")
-{
- echo "##1 The client you're using is no longer\n".
- "##1 supported! Please upgrade to 0.0.25 or\n".
- "##1 higher!\n \n";
-}
-else if ($agent == "TMW/0.0.24" ||
- $agent == "TMW/0.0.24.1")
+$old_versions = array("TMW/0.0.23", "TMW/0.0.24", "TMW/0.0.24.1");
+$min_version = '0.0.25';
+
+if (array_search($agent, $old_versions) !== FALSE) // Explicit check for saftey
{
- echo "##1 On Monday, November 3rd, support for your\n".
- "##1 client version will be dropped. Please\n".
- "##1 upgrade to 0.0.25 or later!\n \n TMW Staff\n \n";
+ echo "##1 The client you're using is no longer\n".
+ "##1 supported! Please upgrade to $min_version or\n".
+ "##1 higher!\n \n".
+ "##1 TMW Staff\n \n";
}
-print file_get_contents ("news.txt");
+print file_get_contents("news.txt");
?>