Changeset 2286 for trunk/plugins
- Timestamp:
- Mar 20, 2008, 1:35:36 AM (16 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/plugins/language_switch/language_switch.inc.php
r2164 r2286 1 <?php 1 <?php 2 2 // +-----------------------------------------------------------------------+ 3 3 // | PhpWebGallery - a PHP based picture gallery | … … 31 31 if ( isset( $_GET['lang']) ) 32 32 { 33 if ( !empty($_GET['lang'] ) and 33 if ( !empty($_GET['lang'] ) and 34 34 file_exists( PHPWG_ROOT_PATH.'language/' 35 35 . $_GET['lang'].'/common.lang.php') ) … … 37 37 if (is_a_guest() or is_generic()) 38 38 { 39 setcookie( 'pwg_lang_switch', $_GET['lang'], 39 setcookie( 'pwg_lang_switch', $_GET['lang'], 40 40 time()+60*60*24*30, cookie_path() ); 41 41 } … … 55 55 if ((is_a_guest() or is_generic()) 56 56 and isset( $_COOKIE['pwg_lang_switch'] ) ) 57 { 58 $user['language'] = $_COOKIE['pwg_lang_switch']; 57 { 58 $user['language'] = $_COOKIE['pwg_lang_switch']; 59 59 } 60 60 // Reload language only if it isn't the same one 61 if ( $same !== $user['language']) 61 if ( $same !== $user['language']) 62 62 { 63 63 load_language('common.lang', '', $user['language']); … … 71 71 //if ( isset( $_GET['lang']) ) { redirect( make_index_url() ); } 72 72 73 function Lang_flags() 73 function Lang_flags() 74 74 { 75 75 global $user, $template; … … 80 80 $qlc_alt = ucwords( $displayname ); 81 81 $qlc_title = $qlc_alt; 82 $qlc_img = PHPWG_PLUGINS_PATH.'language_switch/icons/'82 $qlc_img = 'plugins/language_switch/icons/' 83 83 . $code . '.gif'; 84 85 if ( $code !== $user['language'] and file_exists( $qlc_img) )84 85 if ( $code !== $user['language'] and file_exists(PHPWG_ROOT_PATH.$qlc_img) ) 86 86 { 87 $template -> concat_var( 'PLUGIN_INDEX_ACTIONS',88 '<li><a href="' . $qlc_url . '" ><img src="' . $qlc_img . '" alt="'87 $template->concat( 'PLUGIN_INDEX_ACTIONS', 88 '<li><a href="' . $qlc_url . '" ><img src="' . get_root_url().$qlc_img . '" alt="' 89 89 . $qlc_alt . '" title="' 90 . $qlc_title . '" style="border: 1px solid #000000; ' 90 . $qlc_title . '" style="border: 1px solid #000000; ' 91 91 . ' margin: 0px 2px;" /></a></li>'); 92 92 }
Note: See TracChangeset
for help on using the changeset viewer.