Znaduje sie tam plik phpLang.inc
Na samym koncu jest funkcja ktora dodaje flagi jezeli plik istnieje. Problem polega na tym ze jezeli zmienie nazwe pliku w ktorym phpLang.inc jest includowany to mi sie juz nie pojawiaja flagi. O co w tym chodzi? Co powinienem zmienic?
<?php /* project : phpLang location : <a href="http://www.phpheaven.net/projects/phpLang/" target="_blank">http://www.phpheaven.net/projects/phpLang/</a> version : 0.4.1 date : 25/03/2001 authors : Nicolas Hoizey <nhoizey@phpheaven.net> Loďc Chapeaux <lolo@phpheaven.net> file : phpLang.inc.php description : main file of phpLang, to be included at the top of your main files to activate language detection (see examples) */ // path to image files // path to translated files // name of a translation file that will always be included if it exists // parameter to add in url // indicates if it should put a cookie // how are named the xx-localized version of file 'toto.php' ? // 1 -> current_dir/toto.php.xx // 2 -> current_dir/toto.xx.php // 3 -> current_dir/xx.toto.php // 4 -> current_dir/xx/toto.php (in a directory for each language) // list of available languages, order it as you need ); // finds current file name, extension and uri { { } else { } } else { // it should not be possible } // function that gives the localized file name function phpLang_localizedFileName($lang) { switch(phpLang_fileNameType) { case 1 : $ret = phpLang_localDir.phpLang_currentFileName.phpLang_currentFileExtension.'.'.$lang; break; case 2 : $ret = phpLang_localDir.phpLang_currentFileName.'.'.$lang.phpLang_currentFileExtension; break; case 3 : $ret = phpLang_localDir.$lang.'.'.phpLang_currentFileName.phpLang_currentFileExtension; break; case 4 : $ret = phpLang_localDir.$lang.'/'.phpLang_currentFileName.phpLang_currentFileExtension; break; } return $ret; } // language code detection function phpLang_detectLanguage($str, $from) { $ext = ''; { { $ext = $name[0]; } } return $ext; } // finds the appropriate language file if (isset($HTTP_GET_VARS[phpLang_urlParam]) && file_exists(phpLang_localizedFileName($HTTP_GET_VARS[phpLang_urlParam]))) { // a language as been chosen by the user } if (!defined('phpLang_current') && phpLang_useCookie && isset($HTTP_COOKIE_VARS['phpLangCookie']) && file_exists(phpLang_localizedFileName($HTTP_COOKIE_VARS['phpLangCookie']))) { // a language as been found in a cookie previously set } { // looks at the languages accepted by the browser { $ext = phpLang_detectLanguage($code[0], 1); { } } } { // looks at the browser's identification $ext = phpLang_detectLanguage($HTTP_USER_AGENT, 2); { } } { // if no language yet found, chose the first existing in site's list { { } } } // detection done, cookie update and inclusion of localized files if any available { if(phpLang_useCookie) { // set a cookie expiring in one year for current language } // defines a string to add at the end of each link } else { // no language found } // ################################################################### // only for backward compatibility with versions previous to 0.3.0 !!! // ################################################################### // function that adds the flags with links for existing files // give as first parameter the HTML string to put between each flag function AddFlags($between = "", $showCurrent = false) { $temp = ""; { if(file_exists(phpLang_localizedFileName($name[0])) && ($showCurrent || $name[0] != phpLang_current)) { echo('<img src="'.phpLang_images.$name[0].'.gif" border="0" align="middle" width="24" height="16" alt="'.$name[1].'" />'); $temp = $between; } } } if(phpLang_current != '') { // includes global language file { include(phpLang_localDir.phpLang_globalFile.'.'.phpLang_current); } // includes current language file } // then, you can use two constants in your scripts : // phpLang_current : current language code // phpLang_link : add this in the links after a '?' or a '&' ?>