'; _e('Options saved.'); echo '

'; } /* Draw the form to choose what soldier will fight for you */ echo '

Anti IE6 army - Choose a Soldier"

What language your soldier should speak?

( If your soldier dont speak this language he will speak English )

Here you choose which soldier of your army will lead the battle against IE6

Crossbrowser
End6
End6 Sarcasm
Stop IE6
Update IE6
Update Your Browser

'; } /* * print the crossbrowser script * Created by Imasters Team: http://imasters.uol.com.br/crossbrowser/en/ */ function crossbrowser_js(){ $languages = array("en/","NATIVE"); echo "\n".''; echo "\n".''."\n"; } /* * print the end6 script * Created by Miquel Hudin: http://www.end6.org/eng/faq/ */ function end6_js(){ $languages = array("eng","por","deu_du","deu_sie","esp","fra","cat","gal","hun","jap"); echo "\n".''; echo "\n".''."\n"; } /* * print the end6 sarcasm script * created by Canha from http://digitalpaperweb.com.br based on End6 */ function end6_sarcasm_js(){ $languages = array("_eng","NATIVE"); echo "\n".''; echo "\n".''."\n"; } /* * print the stop ie6 script * Created by this guys: http://www.stopie6.org/about */ function stop_ie6_js(){ /* StopIE6 just have one version...in English */ /* $languages = array("eng"); */ echo "\n".''; echo "\n".''; /* Detect */ echo "\n".''."\n"; /* Tolerant */ } /* * print the stop ie6 script * Created by this guys: http://www.stopie6.org/about */ function update_ie6_js(){ /* TODO: Include multi-language */ echo "\n".''; echo "\n".''; } /* * print the updateyourbrowser script * created by Richard Barros from http://www.richardbarros.com.br/blog/ */ function updateyourbrowser_js(){ $languages = array("uyb","asn"); /* uyb = English and asn = Portuguese */ echo "\n".''; echo "\n".''."\n"; } /* * Return what language soldier will speak * If he can't speak the chosen language, he will speak your native language...ENGLISH! =) */ function soldier_language($soldier_speak){ $chosen_language = get_option('anti-ie6-soldier-language'); if($soldier_speak[$chosen_language]){ return ( $soldier_speak[$chosen_language] == 'NATIVE' ) ? "" : $soldier_speak[$chosen_language]; /* NATIVE is used in case of no preffix or suffix to a native language */ }else{ return $soldier_speak[0]; } } /* * Add the chosen option at blog */ function add_javascript_at_head($chosen_soldier){ switch ($chosen_soldier) { case 0: add_action('wp_head', 'crossbrowser_js'); break; case 1: add_action('wp_head', 'end6_js'); break; case 2: add_action('wp_head', 'stop_ie6_js'); break; case 3: add_action('wp_head', 'end6_sarcasm_js'); case 4: add_action('wp_head', 'update_ie6_js'); case 5: add_action('wp_head', 'updateyourbrowser_js'); } } /* Let's prepare our army to battle! */ add_action('init', 'prepare_army'); /* And now, call our leader */ $chosen_soldier = get_option('anti-ie6-soldier'); add_javascript_at_head($chosen_soldier); ?>