mirror of
https://github.com/vichan-devel/vichan.git
synced 2024-11-26 16:30:52 +01:00
Merge branch 'bui-master'
This commit is contained in:
commit
461a7f8a0b
@ -2,6 +2,8 @@
|
||||
|
||||
include "inc/functions.php";
|
||||
include "inc/mod/auth.php";
|
||||
include "inc/countries.php";
|
||||
|
||||
$admin = isset($mod["type"]) && $mod["type"]<=30;
|
||||
|
||||
if (php_sapi_name() == 'fpm-fcgi' && !$admin) {
|
||||
@ -60,9 +62,10 @@ foreach ($boards as $i => &$board) {
|
||||
$locale_arr = explode('_', $locale);
|
||||
$locale_short = isset($locale_arr[1]) ? strtolower($locale_arr[1]) : strtolower($locale_arr[0]);
|
||||
$locale_short = str_replace('.utf-8', '', $locale_short);
|
||||
if ($board['uri'] === 'int') {$locale_short = 'eo'; $locale = 'eo';}
|
||||
$country = get_country($locale_short);
|
||||
if ($board['uri'] === 'int') {$locale_short = 'eo'; $locale = 'eo'; $country = 'Esperanto';}
|
||||
|
||||
$board['img'] = "<img class=\"flag flag-$locale_short\" src=\"/static/blank.gif\" style=\"width:16px;height:11px;\" alt=\"$locale\" title=\"$locale\">";
|
||||
$board['img'] = "<img class=\"flag flag-$locale_short\" src=\"/static/blank.gif\" style=\"width:16px;height:11px;\" alt=\"$country\" title=\"$country\">";
|
||||
|
||||
if ($showboard || $admin) {
|
||||
if (!$showboard) {
|
||||
|
29
inc/countries.php
Normal file
29
inc/countries.php
Normal file
@ -0,0 +1,29 @@
|
||||
<?php
|
||||
|
||||
function get_country( $code ){
|
||||
$country = '';
|
||||
if( $code == 'en' ) $country = 'English';
|
||||
if( $code == 'cs' ) $country = 'Czech';
|
||||
if( $code == 'da' ) $country = 'Danish';
|
||||
if( $code == 'de' ) $country = 'German';
|
||||
if( $code == 'eo' ) $country = 'Esperanto';
|
||||
if( $code == 'es' ) $country = 'Spanish';
|
||||
if( $code == 'fi' ) $country = 'Finnish';
|
||||
if( $code == 'fr' ) $country = 'French';
|
||||
if( $code == 'hu' ) $country = 'Hungarian';
|
||||
if( $code == 'it' ) $country = 'Italian';
|
||||
if( $code == 'ja' ) $country = 'Japanese';
|
||||
if( $code == 'jbo' ) $country = 'Lojban';
|
||||
if( $code == 'lt' ) $country = 'Lithuanian';
|
||||
if( $code == 'lv' ) $country = 'Latvian';
|
||||
if( $code == 'nb' ) $country = 'Norwegian';
|
||||
if( $code == 'nl' ) $country = 'Dutch';
|
||||
if( $code == 'pl' ) $country = 'Polish';
|
||||
if( $code == 'pt' ) $country = 'Portuguese';
|
||||
if( $code == 'ru' ) $country = 'Russian';
|
||||
if( $code == 'sk' ) $country = 'Slovak';
|
||||
if( $code == 'zh' ) $country = 'Chinese';
|
||||
|
||||
if( $country == '') $country = $code;
|
||||
return $country;
|
||||
}
|
Loading…
Reference in New Issue
Block a user