diff --git a/install.php b/install.php index 46d2b24..781f47f 100644 --- a/install.php +++ b/install.php @@ -1,5 +1,6 @@ - @@ -36,7 +37,7 @@ require_once('other/config.php');
diff --git a/stats/list_rankup.php b/stats/list_rankup.php index ce0279f..a7a15f3 100644 --- a/stats/list_rankup.php +++ b/stats/list_rankup.php @@ -16,7 +16,7 @@ require_once('../other/config.php'); require_once('../other/session.php'); require_once('../other/load_addons_config.php'); -$addons_config = load_addons_config($mysqlcon,$lang,$dbname,$timezone,$logpath); +$addons_config = load_addons_config($mysqlcon,$lang,$cfg,$dbname); function getclientip() { if (!empty($_SERVER['HTTP_CLIENT_IP'])) @@ -36,15 +36,14 @@ function getclientip() { } if(!isset($_SESSION[$rspathhex.'tsuid'])) { - set_session_ts3($ts['voice'], $mysqlcon, $dbname, $language, $adminuuid); + set_session_ts3($mysqlcon,$cfg,$lang,$dbname); } if(isset($_POST['username'])) { $_GET["search"] = $_POST['usersuche']; $_GET["seite"] = 1; } -$filter=''; -$searchstring=''; +$filter = $searchstring = NULL; if(isset($_GET["search"]) && $_GET["search"] != '') { $getstring = htmlspecialchars($_GET['search']); } @@ -64,7 +63,7 @@ if(isset($getstring) && strstr($getstring, 'filter:excepted:')) { } else { $searchstring = ''; } - if($showexcld == 0) { + if($cfg['stats_show_excepted_clients_switch'] == 0) { $filter .= " AND `except` IN ('0','1')"; } } @@ -145,7 +144,7 @@ if(isset($_GET['order']) && $_GET['order'] == 'desc') { } if(isset($_GET['admin'])) { - if($_SESSION[$rspathhex.'username'] == $webuser && $_SESSION[$rspathhex.'password'] == $webpass && $_SESSION[$rspathhex.'clientip'] == getclientip()) { + if($_SESSION[$rspathhex.'username'] == $cfg['webinterface_user'] && $_SESSION[$rspathhex.'password'] == $cfg['webinterface_pass'] && $_SESSION[$rspathhex.'clientip'] == getclientip()) { $adminlogin = 1; } } @@ -247,6 +246,7 @@ if($adminlogin == 1) { case "desc": $keyorder2 = "asc&admin=true"; } + $keyorder .= "&admin=true"; } else { switch ($keyorder) { case "asc": @@ -261,7 +261,7 @@ if($adminlogin == 1) {
' , $lang['listrank'] , ''; - if ($showcolcld == 1 || $adminlogin == 1) + if ($cfg['stats_column_client_name_switch'] == 1 || $adminlogin == 1) echo ($keysort == 'name') ? '' . $lang['listnick'] . '' : '' . $lang['listnick'] . ''; - if ($showcoluuid == 1 || $adminlogin == 1) + if ($cfg['stats_column_unique_id_switch'] == 1 || $adminlogin == 1) echo '' , $lang['listuid'] , ''; - if ($showcoldbid == 1 || $adminlogin == 1) + if ($cfg['stats_column_client_db_id_switch'] == 1 || $adminlogin == 1) echo '' , $lang['listcldbid'] , ''; - if ($showcolls == 1 || $adminlogin == 1) + if ($cfg['stats_column_last_seen_switch'] == 1 || $adminlogin == 1) echo '' , $lang['listseen'] , ''; - if ($showcolot == 1 || $adminlogin == 1) + if ($cfg['stats_column_online_time_switch'] == 1 || $adminlogin == 1) echo '' , $lang['listsumo'] , ''; - if ($showcolit == 1 || $adminlogin == 1) + if ($cfg['stats_column_idle_time_switch'] == 1 || $adminlogin == 1) echo '' , $lang['listsumi'] , ''; - if ($showcolat == 1 || $adminlogin == 1) + if ($cfg['stats_column_active_time_switch'] == 1 || $adminlogin == 1) echo '' , $lang['listsuma'] , ''; - if ($showcolas == 1 || $adminlogin == 1) + if ($cfg['stats_column_current_server_group_switch'] == 1 || $adminlogin == 1) echo '' , $lang['listacsg'] , ''; - if ($showgrpsince == 1 || $adminlogin == 1) + if ($cfg['stats_column_current_group_since_switch'] == 1 || $adminlogin == 1) echo '' , $lang['listgrps'] , ''; - if ($showcolnx == 1 || $adminlogin == 1) + if ($cfg['stats_column_next_rankup_switch'] == 1 || $adminlogin == 1) echo ($keysort == 'nextup') ? '' . $lang['listnxup'] . '' : '' . $lang['listnxup'] . ''; - if (($showcolsg == 1 || $adminlogin == 1) && $substridle == 1) { + if (($cfg['stats_column_next_server_group_switch'] == 1 || $adminlogin == 1) && $cfg['rankup_time_assess_mode'] == 1) { echo '' , $lang['listnxsg'] , ''; - } elseif (($showcolsg == 1 || $adminlogin == 1) && $substridle != 1) { + } elseif (($cfg['stats_column_next_server_group_switch'] == 1 || $adminlogin == 1) && $cfg['rankup_time_assess_mode'] != 1) { echo '' , $lang['listnxsg'] , ''; } echo ''; - ksort($grouptime); + ksort($cfg['rankup_definition']); if (count($sqlhis) > 0) { foreach ($sqlhis as $uuid => $value) { - if ($substridle == 1) { + if ($cfg['rankup_time_assess_mode'] == 1) { $activetime = $value['count'] - $value['idle']; } else { $activetime = $value['count']; } $grpcount=0; - foreach ($grouptime as $time => $groupid) { + foreach ($cfg['rankup_definition'] as $time => $groupid) { $grpcount++; - if ($activetime < $time || $grpcount == count($grouptime) && $value['nextup'] <= 0 && $showhighest == 1 || $grpcount == count($grouptime) && $value['nextup'] == 0 && $adminlogin == 1) { + if ($activetime < $time || $grpcount == count($cfg['rankup_definition']) && $value['nextup'] <= 0 && $cfg['stats_show_clients_in_highest_rank_switch'] == 1 || $grpcount == count($cfg['rankup_definition']) && $value['nextup'] == 0 && $adminlogin == 1) { echo ''; - if ($showcolrg == 1 || $adminlogin == 1) { + if ($cfg['stats_column_rank_switch'] == 1 || $adminlogin == 1) { if($value['except'] == 2 || $value['except'] == 3) { echo ''; } else { @@ -320,42 +320,42 @@ if($adminlogin == 1) { } if ($adminlogin == 1) { echo '' , htmlspecialchars($value['name']) , ''; - } elseif ($showcolcld == 1) { + } elseif ($cfg['stats_column_client_name_switch'] == 1) { echo '' , htmlspecialchars($value['name']) , ''; } if ($adminlogin == 1) { echo '' , $uuid , ''; - } elseif ($showcoluuid == 1) { + } elseif ($cfg['stats_column_unique_id_switch'] == 1) { echo '' , $uuid , ''; } - if ($showcoldbid == 1 || $adminlogin == 1) + if ($cfg['stats_column_client_db_id_switch'] == 1 || $adminlogin == 1) echo '' , $value['cldbid'] , ''; - if ($showcolls == 1 || $adminlogin == 1) { + if ($cfg['stats_column_last_seen_switch'] == 1 || $adminlogin == 1) { if ($value['online'] == 1) { echo 'online'; } else { echo '' , date('Y-m-d H:i:s',$value['lastseen']), ''; } } - if ($showcolot == 1 || $adminlogin == 1) { + if ($cfg['stats_column_online_time_switch'] == 1 || $adminlogin == 1) { echo ''; $dtF = new DateTime("@0"); $dtT = new DateTime("@".$value['count']); - echo $dtF->diff($dtT)->format($timeformat); + echo $dtF->diff($dtT)->format($cfg['default_date_format']); } - if ($showcolit == 1 || $adminlogin == 1) { + if ($cfg['stats_column_idle_time_switch'] == 1 || $adminlogin == 1) { echo ''; $dtF = new DateTime("@0"); $dtT = new DateTime("@".$value['idle']); - echo $dtF->diff($dtT)->format($timeformat); + echo $dtF->diff($dtT)->format($cfg['default_date_format']); } - if ($showcolat == 1 || $adminlogin == 1) { + if ($cfg['stats_column_active_time_switch'] == 1 || $adminlogin == 1) { echo ''; $dtF = new DateTime("@0"); $dtT = new DateTime("@".($value['count']-$value['idle'])); - echo $dtF->diff($dtT)->format($timeformat); + echo $dtF->diff($dtT)->format($cfg['default_date_format']); } - if ($showcolas == 1 || $adminlogin == 1) { + if ($cfg['stats_column_current_server_group_switch'] == 1 || $adminlogin == 1) { if ($value['grpid'] == 0) { echo ''; } elseif ($sqlhisgroup[$value['grpid']]['iconfile'] == 1) { @@ -364,19 +364,19 @@ if($adminlogin == 1) { echo '' , $sqlhisgroup[$value['grpid']]['sgidname'] , ''; } } - if ($showgrpsince == 1 || $adminlogin == 1) { + if ($cfg['stats_column_current_group_since_switch'] == 1 || $adminlogin == 1) { if ($value['grpsince'] == 0) { echo ''; } else { echo '' , date('Y-m-d H:i:s',$value['grpsince']), ''; } } - if ($showcolnx == 1 || $adminlogin == 1) { + if ($cfg['stats_column_next_rankup_switch'] == 1 || $adminlogin == 1) { echo ''; if (($value['except'] == 0 || $value['except'] == 1) && $value['nextup'] > 0) { $dtF = new DateTime("@0"); $dtT = new DateTime("@".$value['nextup']); - echo $dtF->diff($dtT)->format($timeformat) , ''; + echo $dtF->diff($dtT)->format($cfg['default_date_format']) , ''; } elseif ($value['except'] == 0 || $value['except'] == 1) { echo '0'; } elseif ($value['except'] == 2 || $value['except'] == 3) { @@ -385,8 +385,8 @@ if($adminlogin == 1) { echo $lang['errukwn'], ''; } } - if ($showcolsg == 1 || $adminlogin == 1) { - if ($grpcount == count($grouptime) && $value['nextup'] == 0 && $showhighest == 1 || $grpcount == count($grouptime) && $value['nextup'] == 0 && $adminlogin == 1) { + if ($cfg['stats_column_next_server_group_switch'] == 1 || $adminlogin == 1) { + if ($grpcount == count($cfg['rankup_definition']) && $value['nextup'] == 0 && $cfg['stats_show_clients_in_highest_rank_switch'] == 1 || $grpcount == count($cfg['rankup_definition']) && $value['nextup'] == 0 && $adminlogin == 1) { echo '',$lang['highest'],''; } elseif ($value['except'] == 2 || $value['except'] == 3) { echo '',$lang['listexcept'],''; diff --git a/stats/my_stats.php b/stats/my_stats.php index c32ad13..b8a3553 100644 --- a/stats/my_stats.php +++ b/stats/my_stats.php @@ -16,10 +16,10 @@ require_once('../other/config.php'); require_once('../other/session.php'); require_once('../other/load_addons_config.php'); -$addons_config = load_addons_config($mysqlcon,$lang,$dbname,$timezone,$logpath); +$addons_config = load_addons_config($mysqlcon,$lang,$cfg,$dbname); if(!isset($_SESSION[$rspathhex.'tsuid'])) { - set_session_ts3($ts['voice'], $mysqlcon, $dbname, $language, $adminuuid); + set_session_ts3($mysqlcon,$cfg,$lang,$dbname); } if(count($_SESSION[$rspathhex.'multiple']) > 1 && !isset($_SESSION[$rspathhex.'uuid_verified'])) { @@ -31,17 +31,17 @@ if(count($_SESSION[$rspathhex.'multiple']) > 1 && !isset($_SESSION[$rspathhex.'u $count_hours = round($dbdata_fetched['count']/3600); $idle_hours = round($dbdata_fetched['idle']/3600); - if ($substridle == 1) { + if ($cfg['rankup_time_assess_mode'] == 1) { $activetime = $dbdata_fetched['count'] - $dbdata_fetched['idle']; } else { $activetime = $dbdata_fetched['count']; } $active_count = $dbdata_fetched['count'] - $dbdata_fetched['idle']; - krsort($grouptime); + krsort($cfg['rankup_definition']); $nextgrp = ''; - foreach ($grouptime as $time => $groupid) { + foreach ($cfg['rankup_definition'] as $time => $groupid) { $actualgrp = $time; if ($activetime > $time) { break; @@ -63,16 +63,16 @@ if(count($_SESSION[$rspathhex.'multiple']) > 1 && !isset($_SESSION[$rspathhex.'u $stats_user = $mysqlcon->query("SELECT `count_week`,`active_week`,`count_month`,`active_month` FROM `$dbname`.`stats_user` WHERE `uuid`='".$_SESSION[$rspathhex.'tsuid']."'")->fetch(); if (isset($stats_user['count_week'])) $count_week = $stats_user['count_week']; else $count_week = 0; - $dtF = new DateTime("@0"); $dtT = new DateTime("@$count_week"); $count_week = $dtF->diff($dtT)->format($timeformat); + $dtF = new DateTime("@0"); $dtT = new DateTime("@$count_week"); $count_week = $dtF->diff($dtT)->format($cfg['default_date_format']); if (isset($stats_user['active_week'])) $active_week = $stats_user['active_week']; else $active_week = 0; - $dtF = new DateTime("@0"); $dtT = new DateTime("@$active_week"); $active_week = $dtF->diff($dtT)->format($timeformat); + $dtF = new DateTime("@0"); $dtT = new DateTime("@$active_week"); $active_week = $dtF->diff($dtT)->format($cfg['default_date_format']); if (isset($stats_user['count_month'])) $count_month = $stats_user['count_month']; else $count_month = 0; - $dtF = new DateTime("@0"); $dtT = new DateTime("@$count_month"); $count_month = $dtF->diff($dtT)->format($timeformat); + $dtF = new DateTime("@0"); $dtT = new DateTime("@$count_month"); $count_month = $dtF->diff($dtT)->format($cfg['default_date_format']); if (isset($stats_user['active_month'])) $active_month = $stats_user['active_month']; else $active_month = 0; - $dtF = new DateTime("@0"); $dtT = new DateTime("@$active_month"); $active_month = $dtF->diff($dtT)->format($timeformat); + $dtF = new DateTime("@0"); $dtT = new DateTime("@$active_month"); $active_month = $dtF->diff($dtT)->format($cfg['default_date_format']); if (isset($dbdata_fetched['count'])) $count_total = $dbdata_fetched['count']; else $count_total = 0; - $dtF = new DateTime("@0"); $dtT = new DateTime("@$count_total"); $count_total = $dtF->diff($dtT)->format($timeformat); - $dtF = new DateTime("@0"); $dtT = new DateTime("@$active_count"); $active_count = $dtF->diff($dtT)->format($timeformat); + $dtF = new DateTime("@0"); $dtT = new DateTime("@$count_total"); $count_total = $dtF->diff($dtT)->format($cfg['default_date_format']); + $dtF = new DateTime("@0"); $dtT = new DateTime("@$active_count"); $active_count = $dtF->diff($dtT)->format($cfg['default_date_format']); $time_for_bronze = 50; $time_for_silver = 100; diff --git a/stats/nations.php b/stats/nations.php index d78aecd..acdfd30 100644 --- a/stats/nations.php +++ b/stats/nations.php @@ -15,34 +15,36 @@ require_once('../other/config.php'); require_once('../other/session.php'); require_once('../other/load_addons_config.php'); -$addons_config = load_addons_config($mysqlcon,$lang,$dbname,$timezone,$logpath); +$addons_config = load_addons_config($mysqlcon,$lang,$cfg,$dbname); -if($language == "ar") { +if($cfg['default_language'] == "ar") { require_once('../languages/nations_en.php'); -} elseif($language == "cz") { +} elseif($cfg['default_language'] == "cz") { require_once('../languages/nations_en.php'); -} elseif($language == "de") { +} elseif($cfg['default_language'] == "de") { require_once('../languages/nations_de.php'); -} elseif($language == "en") { +} elseif($cfg['default_language'] == "en") { require_once('../languages/nations_en.php'); -} elseif($language == "fr") { +} elseif($cfg['default_language'] == "es") { + require_once('../languages/nations_es.php'); +} elseif($cfg['default_language'] == "fr") { require_once('../languages/nations_fr.php'); -} elseif($language == "it") { +} elseif($cfg['default_language'] == "it") { require_once('../languages/nations_it.php'); -} elseif($language == "nl") { +} elseif($cfg['default_language'] == "nl") { require_once('../languages/nations_en.php'); -} elseif($language == "pl") { +} elseif($cfg['default_language'] == "pl") { require_once('../languages/nations_pl.php'); -} elseif($language == "ro") { - require_once('../languages/nations_en.php'); -} elseif($language == "ru") { - require_once('../languages/nations_ru.php'); -} elseif($language == "pt") { +} elseif($cfg['default_language'] == "pt") { require_once('../languages/nations_pt.php'); +} elseif($cfg['default_language'] == "ro") { + require_once('../languages/nations_en.php'); +} elseif($cfg['default_language'] == "ru") { + require_once('../languages/nations_ru.php'); } if(!isset($_SESSION[$rspathhex.'tsuid'])) { - set_session_ts3($ts['voice'], $mysqlcon, $dbname, $language, $adminuuid); + set_session_ts3($mysqlcon,$cfg,$lang,$dbname); } $sql_res = $mysqlcon->query("SELECT * FROM `$dbname`.`stats_nations` ORDER BY `count` DESC")->fetchAll(PDO::FETCH_UNIQUE|PDO::FETCH_ASSOC); diff --git a/stats/nav.php b/stats/nav.php index 43bc9ee..f002d58 100644 --- a/stats/nav.php +++ b/stats/nav.php @@ -8,15 +8,15 @@ if((time() - $job_check['last_update']['timestamp']) < 259200 && !isset($_SESSIO } ?> - + - + TS-N.NET Ranksystem - + + if(isset($cfg['stats_show_site_navigation_switch']) && $cfg['stats_show_site_navigation_switch'] == 0) { ?>