cvs: phpweb /archive index.php
| From: | Hannes Magnusson | Date: | Thu, 07 Jun 2007 10:33:39 +0000 |
| Subject: | cvs: phpweb /archive index.php | ||
| Groups: | php.mirrors | ||
| Request: | Send a blank email to php-mirrors+get-35627@lists.php.net to get a copy of this message | ||
bjori Thu Jun 7 10:33:39 2007 UTC
Modified files:
/phpweb/archive index.php
Log:
Don't hard code the file to redirect to
http://cvs.php.net/viewvc.cgi/phpweb/archive/index.php?r1=1.1&r2=1.2&diff_format=u
Index: phpweb/archive/index.php
diff -u phpweb/archive/index.php:1.1 phpweb/archive/index.php:1.2
--- phpweb/archive/index.php:1.1 Sun Sep 17 13:15:06 2006
+++ phpweb/archive/index.php Thu Jun 7 10:33:39 2007
@@ -1,5 +1,15 @@
<?php
-// $Id: index.php,v 1.1 2006/09/17 13:15:06 goba Exp $
+// $Id: index.php,v 1.2 2007/06/07 10:33:39 bjori Exp $
include_once $_SERVER['DOCUMENT_ROOT'] . '/include/prepend.inc';
-mirror_redirect("/archive/2006.php");
-?>
\ No newline at end of file
+$i = 0;
+do {
+ $y = date("Y")-$i;
+ if (file_exists("./$y.php")) {
+ mirror_redirect("/archive/$y.php");
+ break;
+ }
+} while(++$i<3);
+
+include_once $_SERVER['DOCUMENT_ROOT'] . '/include/errors.inc';
+error_noservice();
+