nlopess         Tue May  4 10:57:42 2004 EDT

  Modified files:              
    /livedocs   error.php 
  Log:
  redirect the user automatically if there is just one language on the server
  improve performance in splitting languages
  
http://cvs.php.net/diff.php/livedocs/error.php?r1=1.11&r2=1.12&ty=u
Index: livedocs/error.php
diff -u livedocs/error.php:1.11 livedocs/error.php:1.12
--- livedocs/error.php:1.11     Sat May  1 07:34:50 2004
+++ livedocs/error.php  Tue May  4 10:57:42 2004
@@ -18,7 +18,7 @@
 // | Handles the 404 error and try to redirect to the good place.         |
 // +----------------------------------------------------------------------+
 //
-// $Id: error.php,v 1.11 2004/05/01 11:34:50 derick Exp $
+// $Id: error.php,v 1.12 2004/05/04 14:57:42 nlopess Exp $
 
 /* handle IIS style 404 handler */
 if (strncmp($_SERVER['SERVER_SOFTWARE'], "Microsoft", 9) == 0 &&
@@ -99,10 +99,18 @@
        $langs = array('en' => 'English',
                        'de' => 'German',
                        'fr' => 'French',
+                       'ja' => 'Japanese',
+                       'nl' => 'Dutch',
                        'pt_BR' => 'Portuguese (Brazilian)');
 
+       $languages = explode(' ', LANGUAGES);
+
+       if (count($languages) == 1) {
+               $link = FORCE_DYNAMIC ? "?l=$languages[0]&q=manual" : 
"$languages[0]/manual.html";
+               die(header('Location: http://' . $_SERVER['HTTP_HOST'] . WEBBASE . 
$link));
+       }
+
        echo index_page_header();
-       $languages = preg_split('|[\s]+|', LANGUAGES);
        sort($languages);
        echo 'Choose a language:';
        echo '<ul>';

Reply via email to