add_staffpanel_lang

This commit is contained in:
xiaomlove
2021-01-25 01:23:28 +08:00
parent 4aefdbf744
commit 8930aea3bc
9 changed files with 187 additions and 26 deletions

View File

@@ -3,14 +3,14 @@ if(!defined('IN_TRACKER')) {
die('Hacking attempt!');
}
error_reporting(E_ALL);
ini_set('display_errors', 0);
ini_set('display_errors', 1);
if (!empty($_SERVER['HTTP_X_REQUEST_ID'])) {
define('REQUEST_ID', $_SERVER['HTTP_X_REQUEST_ID']);
} else {
define('REQUEST_ID', intval(NEXUS_START * 10000));
}
define('ROOT_PATH', $rootpath);
define('VERSION', '1.6.0');
define('VERSION_NUMBER', '1.6.0');
define('IS_ANNOUNCE', (basename($_SERVER['SCRIPT_FILENAME']) == 'announce.php'));
require $rootpath . 'include/database/interface_db.php';
@@ -28,6 +28,7 @@ if (!IS_ANNOUNCE) {
$Cache = new RedisCache(); //Load the caching class
$Cache->setLanguageFolderArray(get_langfolder_list());
define('TIMENOW', time());
define('TIMENOW_STRING', date('Y-m-d H:i:s'));
$USERUPDATESET = array();
$query_name=array();

View File

@@ -119,8 +119,16 @@ class DB
return $this->isConnected;
}
public static function insert($table, $data)
{
if (empty($table) || empty($data) || !is_array($data)) {
throw new DatabaseException("require table and data(array).");
}
$fields = array_map(function ($value) {return "`$value`";}, array_keys($data));
$values = array_map(function ($value) {return sqlesc($value);}, array_values($data));
$sql = sprintf("insert into `%s` (%s) values (%s)", $table, implode(', ', $fields), implode(', ', $values));
sql_query($sql);
return mysql_insert_id();
}
}

View File

@@ -2691,10 +2691,14 @@ function get_protocol_prefix()
}
}
function get_langid_from_langcookie()
function get_langid_from_langcookie($lang = '')
{
global $CURLANGDIR;
$row = mysql_fetch_array(sql_query("SELECT id FROM language WHERE site_lang = 1 AND site_lang_folder = " . sqlesc($CURLANGDIR) . "ORDER BY id ASC")) or sqlerr(__FILE__, __LINE__);
if (empty($lang)) {
global $CURLANGDIR;
$lang = $CURLANGDIR;
}
$row = mysql_fetch_array(sql_query("SELECT id FROM language WHERE site_lang = 1 AND site_lang_folder = " . sqlesc($lang) . "ORDER BY id ASC")) or sqlerr(__FILE__, __LINE__);
return $row['id'];
}

View File

@@ -0,0 +1,72 @@
<?php
$lang_staffpanel = [
'Administration' => '管理组面板',
'For SysOp Only' => '对系统管理员开放',
'Option Name' => '选项名称',
'Info' => '说明',
'Delete disabled users' => '删除被禁用户',
'Delete all disabled users' => '删除所有被禁用的用户',
'Manage tracker forum' => '管理论坛',
'Edit/Delete forum' => '编辑/删除论坛版块',
'MySQL Stats' => 'Mysql 状态',
'See MySql stats' => '查看 Mysql 状态',
'Mass mailer' => '批量邮件',
'Send e-mail to all users on the tracker' => '发送邮件给全部用户',
'Do cleanup' => '做清理',
'Do cleanup functions' => '运行清理函数',
'Ban System' => '禁止系统',
'Ban / Unban IP' => '禁止/取消禁止 IP',
'Failed Logins' => '失败登录',
'Show Failed Login Attempts' => '查看失败的登录尝试',
'Bitbucket' => 'Bitbucket',
'Bitbucket Log' => 'Bitbucket Log',
'Ban EMAIL address' => '禁止邮件地址',
'Ban EMAILs stop registration.' => '禁止邮件地址注册',
'Allow EMAIL address' => '允许邮件地址',
'Allow EMAIL registration.' => '允许邮件地址注册',
'Location' => '位置',
'Manage location and location speed' => '管理地址及地址速度',
'Add Upload' => '增加上传',
'Add upload to certain classes' => '为特定等级用户增加上传量',
'For Administrator Only' => '对管理员开放',
'Add user' => '添加用户',
'Create new user account' => '添加新的用户账号',
'Reset Users Password' => '重置用户密码',
'Rest lost Passwords' => '重置丢失的密码',
'Mass PM' => '批量私信',
'Send PM to all users' => '发送站内私信给全部用户',
'Poll overview' => '投票',
'View poll votes' => '查看全部投票',
'Warned users' => '警告用户',
'See all warned users on tracker' => '查看全部被警告的用户',
'FreeLeech' => '免费下载',
'Set ALL Torrents At Special State.' => '设定全部种子为某种状态',
'FAQ Management' => '常见问题管理',
'Edit/Add/Delete FAQ Page' => '编辑/增加/删除 常见问题',
'Rules Management' => '规则管理',
'Edit/Add/Delete RULES Page' => '编辑/增加/删除 规则',
'Category Manage' => '分类管理',
'Manage torrents categories at your site' => '管理种子分类模式',
'For Moderator Only' => '针对版主开放',
'Abnormal Upload Speed Detector' => '异常上传速度探测',
'See cheaters' => '查看作弊者',
'Duplicate IP Check' => '重复 IP 检测',
'Check for Duplicate IP Users' => '查看相同 IP 用户',
'All Clients (currently)' => '全部客户端(当前)',
'Show All Clients (currently downloading/uploading/seeding)' => '查看全部客户端(当前下载中/上传中/做种中)',
'Ad management' => '广告管理',
'Manage ads at your site' => '管理网站上的广告',
'Uploaders' => '上传者',
'See uploaders stats' => '查看上传者状态',
'Stats' => '统计',
'Tracker Stats' => '服务器相关数据统计',
'IP Test' => 'IP 测试',
'Test if IP is banned' => '测试 IP 是否被禁止',
'Add Bonus Points' => '增加魔力',
'Add Bonus Points to one or All Users.' => '为某个或全部用户增加魔力',
'Clear cache' => '清除缓存',
'Clear cache of memcached' => '清除缓存的数据'
];

View File

@@ -75,7 +75,7 @@ $lang_catmanage = array
'std_missing_form_data' => "有必填項目未填寫。",
'std_invalid_character_in_filename' => "此檔名包含不合法字元:",
'std_must_define_one_selection' => "你必須至少指定一個選取!",
'std_invalid_mode_id' => "無效的型態id。"
'std_invalid_mode_id' => "無效的型態id。",
);
?>

View File

@@ -0,0 +1,72 @@
<?php
$lang_staffpanel = [
'Administration' => '管理組面板',
'For SysOp Only' => '對系統管理員開放',
'Option Name' => '選項名稱',
'Info' => '說明',
'Delete disabled users' => '刪除被禁用戶',
'Delete all disabled users' => '刪除所有被禁用的用戶',
'Manage tracker forum' => '管理論壇',
'Edit/Delete forum' => '編輯/刪除論壇版塊',
'MySQL Stats' => 'Mysql 狀態',
'See MySql stats' => '查看 Mysql 狀態',
'Mass mailer' => '批量郵件',
'Send e-mail to all users on the tracker' => '發送郵件給全部用戶',
'Do cleanup' => '做清理',
'Do cleanup functions' => '運行清理函數',
'Ban System' => '禁止系統',
'Ban / Unban IP' => '禁止/取消禁止 IP',
'Failed Logins' => '失敗登錄',
'Show Failed Login Attempts' => '查看失敗的登錄嘗試',
'Bitbucket' => 'Bitbucket',
'Bitbucket Log' => 'Bitbucket Log',
'Ban EMAIL address' => '禁止郵件地址',
'Ban EMAILs stop registration.' => '禁止郵件地址註冊',
'Allow EMAIL address' => '允許郵件地址',
'Allow EMAIL registration.' => '允許郵件地址註冊',
'Location' => '位置',
'Manage location and location speed' => '管理地址及地址速度',
'Add Upload' => '增加上傳',
'Add upload to certain classes' => '為特定等級用戶增加上傳量',
'For Administrator Only' => '對管理員開放',
'Add user' => '添加用戶',
'Create new user account' => '添加新的用戶賬號',
'Reset Users Password' => '重置用戶密碼',
'Rest lost Passwords' => '重置丟失的密碼',
'Mass PM' => '批量私信',
'Send PM to all users' => '發送站內私信給全部用戶',
'Poll overview' => '投票',
'View poll votes' => '查看全部投票',
'Warned users' => '警告用戶',
'See all warned users on tracker' => '查看全部被警告的用戶',
'FreeLeech' => '免費下載',
'Set ALL Torrents At Special State.' => '設定全部種子為某種狀態',
'FAQ Management' => '常見問題管理',
'Edit/Add/Delete FAQ Page' => '編輯/增加/刪除 常見問題',
'Rules Management' => '規則管理',
'Edit/Add/Delete RULES Page' => '編輯/增加/刪除 規則',
'Category Manage' => '分類管理',
'Manage torrents categories at your site' => '管理種子分類模式',
'For Moderator Only' => '針對版主開放',
'Abnormal Upload Speed Detector' => '異常上傳速度探測',
'See cheaters' => '查看作弊者',
'Duplicate IP Check' => '重復 IP 檢測',
'Check for Duplicate IP Users' => '查看相同 IP 用戶',
'All Clients (currently)' => '全部客戶端(當前)',
'Show All Clients (currently downloading/uploading/seeding)' => '查看全部客戶端(當前下載中/上傳中/做種中)',
'Ad management' => '廣告管理',
'Manage ads at your site' => '管理網站上的廣告',
'Uploaders' => '上傳者',
'See uploaders stats' => '查看上傳者狀態',
'Stats' => '統計',
'Tracker Stats' => '服務器相關數據統計',
'IP Test' => 'IP 測試',
'Test if IP is banned' => '測試 IP 是否被禁止',
'Add Bonus Points' => '增加魔力',
'Add Bonus Points to one or All Users.' => '為某個或全部用戶增加魔力',
'Clear cache' => '清除緩存',
'Clear cache of memcached' => '清除緩存的數據'
];

View File

@@ -616,7 +616,7 @@ elseif($action == 'edit')
else
{
$typename=return_type_name($type);
stdhead($lang_catmanage['head_edit']." - ".$typename);
stdhead($typename);
print("<form method=\"post\" action=\"?action=submit&amp;type=".$type."\">");
print("<input type=\"hidden\" name=\"isedit\" value=\"1\" />");
print("<input type=\"hidden\" name=\"id\" value=\"".$id."\" />");

View File

@@ -6,8 +6,8 @@ loggedinorreturn();
if (get_user_class() < UC_SYSOP) {
die("access denied.");
}
mysql_connect($mysql_host,$mysql_user,$mysql_pass, $BASIC['mysql_db'], $BASIC['mysql_port']);
mysql_select_db($mysql_db);
$config = config('database.mysql');
mysql_connect($config['host'],$config['username'],$config['password'], $config['database'], $config['port']);
stdhead("Manage Locations");
begin_main_frame("",false,100);
begin_frame("Manage Locations",true,10,"100%","center");

View File

@@ -3,8 +3,12 @@ ob_start();
require_once("../include/bittorrent.php");
dbconn();
loggedinorreturn();
stdhead("Administration");
print("<h1 align=center>Administration</h1>");
$langFile = ROOT_PATH . get_langfile_path();
if (file_exists($langFile)) {
require $langFile;
}
stdhead($lang_staffpanel["Administration"] ?? 'Administration');
print("<h1 align=center>" . ($lang_staffpanel["Administration"] ?? 'Administration') . "</h1>");
if (get_user_class() < UC_MODERATOR)
{
stdmsg("Error", "Access denied!!!");
@@ -15,18 +19,18 @@ begin_main_frame();
///////////////////// SysOp Only \\\\\\\\\\\\\\\\\\\\\\\\\\\\
if (get_user_class() >= UC_SYSOP) {
echo("<h1 align=center>..:: For SysOp Only ::..</h1>");
echo("<h1 align=center>..:: " . ($lang_staffpanel["For SysOp Only"] ?? 'For SysOp Only') . " ::..</h1>");
print("<br />");
print("<br />");
print("<table width=80% border=1 cellspacing=0 cellpadding=5 align=center>");
echo("<td class=colhead align=left>Option Name</td><td class=colhead align=left>Info</td>");
echo("<td class=colhead align=left>" . ($lang_staffpanel["Option Name"] ?? 'Option Name') . "</td><td class=colhead align=left>" . ($lang_staffpanel["Info"] ?? 'Info') . "</td>");
$query = "SELECT * FROM sysoppanel";
$sql = sql_query($query);
while ($row = mysql_fetch_array($sql)) {
$id = $row['id'];
$name = $row['name'];
$name = $lang_staffpanel[$row['name']] ?? $row['name'];
$url = $row['url'];
$info = $row['info'];
$info = $lang_staffpanel[$row['info']] ?? $row['info'];
echo("<tr><td class=rowfollow align=left><strong><a href=$url>$name</a></strong></td> <td class=rowfollow align=left>$info</td></tr>");
}
@@ -36,18 +40,18 @@ if (get_user_class() >= UC_SYSOP) {
}
///////////////////// Admin Only \\\\\\\\\\\\\\\\\\\\\\\\\\\\
if (get_user_class() >= UC_ADMINISTRATOR) {
echo("<h1 align=center>..:: For Administrator Only :..</h1>");
echo("<h1 align=center>..:: " . ($lang_staffpanel["For Administrator Only"] ?? 'For Administrator Only') . " :..</h1>");
print("<br />");
print("<br />");
print("<table width=80% border=1 cellspacing=0 cellpadding=5 align=center>");
echo("<td class=colhead align=left>Option Name</td><td class=colhead align=left>Info</td>");
echo("<td class=colhead align=left>" . ($lang_staffpanel["Option Name"] ?? 'Option Name') . "</td><td class=colhead align=left>" . ($lang_staffpanel["Info"] ?? 'Info') . "</td>");
$query = "SELECT * FROM adminpanel";
$sql = sql_query($query);
while ($row = mysql_fetch_array($sql)) {
$id = $row['id'];
$name = $row['name'];
$name = $lang_staffpanel[$row['name']] ?? $row['name'];
$url = $row['url'];
$info = $row['info'];
$info = $lang_staffpanel[$row['info']] ?? $row['info'];
echo("<tr><td class=rowfollow align=left><strong><a href=$url>$name</a></strong></td> <td class=rowfollow align=left>$info</td></tr>");
}
@@ -57,18 +61,18 @@ if (get_user_class() >= UC_ADMINISTRATOR) {
}
///////////////////// Moderator Only \\\\\\\\\\\\\\\\\\\\\\\\\\\\
if (get_user_class() >= UC_MODERATOR) {
echo("<h1 align=center>..:: For Moderator Only ::..</h1>");
echo("<h1 align=center>..:: " . ($lang_staffpanel["For Moderator Only"] ?? 'For Moderator Only') . " ::..</h1>");
print("<br />");
print("<br />");
print("<table width=80% border=1 cellspacing=0 cellpadding=5 align=center>");
echo("<td class=colhead align=left>Option Name</td><td class=colhead align=left>Info</td>");
echo("<td class=colhead align=left>" . ($lang_staffpanel["Option Name"] ?? 'Option Name') . "</td><td class=colhead align=left>" . ($lang_staffpanel["Info"] ?? 'Info') . "</td>");
$query = "SELECT * FROM modpanel";
$sql = sql_query($query);
while ($row = mysql_fetch_array($sql)) {
$id = $row['id'];
$name = $row['name'];
$name = $lang_staffpanel[$row['name']] ?? $row['name'];
$url = $row['url'];
$info = $row['info'];
$info = $lang_staffpanel[$row['info']] ?? $row['info'];
echo("<tr><td class=rowfollow align=left><strong><a href=$url>$name</a></strong></td> <td class=rowfollow align=left>$info</td></tr>");
}