mirror of
https://github.com/lkddi/nexusphp.git
synced 2026-04-29 08:27:23 +08:00
add imdb language
This commit is contained in:
+14
-5
@@ -1,20 +1,29 @@
|
|||||||
<?php
|
<?php
|
||||||
|
|
||||||
function get_langfolder_cookie()
|
function get_langfolder_cookie($transToLocale = false)
|
||||||
{
|
{
|
||||||
global $deflang;
|
global $deflang;
|
||||||
|
$lang = "";
|
||||||
if (!isset($_COOKIE["c_lang_folder"])) {
|
if (!isset($_COOKIE["c_lang_folder"])) {
|
||||||
return $deflang;
|
$lang = $deflang;
|
||||||
} else {
|
} else {
|
||||||
$langfolder_array = get_langfolder_list();
|
$langfolder_array = get_langfolder_list();
|
||||||
$enabled = \App\Models\Language::listEnabled();
|
$enabled = \App\Models\Language::listEnabled();
|
||||||
foreach($langfolder_array as $lf)
|
foreach($langfolder_array as $lf)
|
||||||
{
|
{
|
||||||
if($lf == $_COOKIE["c_lang_folder"] && in_array($lf, $enabled))
|
if($lf == $_COOKIE["c_lang_folder"] && in_array($lf, $enabled)) {
|
||||||
return $_COOKIE["c_lang_folder"];
|
$lang = $_COOKIE["c_lang_folder"];
|
||||||
|
break;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
return $deflang;
|
|
||||||
}
|
}
|
||||||
|
if (!$lang) {
|
||||||
|
$lang = $deflang;
|
||||||
|
}
|
||||||
|
if (!$transToLocale) {
|
||||||
|
return $lang;
|
||||||
|
}
|
||||||
|
return \App\Http\Middleware\Locale::$languageMaps[$lang] ?? 'en';
|
||||||
}
|
}
|
||||||
|
|
||||||
function get_user_lang($user_id)
|
function get_user_lang($user_id)
|
||||||
|
|||||||
@@ -762,6 +762,8 @@ $lang_settings = array
|
|||||||
'text_approval_status_icon_enabled_note' => "是否在种子列表展示审核状态图标,默认: '否'。",
|
'text_approval_status_icon_enabled_note' => "是否在种子列表展示审核状态图标,默认: '否'。",
|
||||||
'row_approval_status_none_visible' => '未审核种子是否可见',
|
'row_approval_status_none_visible' => '未审核种子是否可见',
|
||||||
'text_approval_status_none_visible_note' => "默认:'是'。若改为'否',审核不为[通过]状态时强制显示审核状态图标。",
|
'text_approval_status_none_visible_note' => "默认:'是'。若改为'否',审核不为[通过]状态时强制显示审核状态图标。",
|
||||||
|
'row_imdb_language' => 'IMDB 语言',
|
||||||
|
'text_imdb_language_note' => '抓取 IMDB 数据使用的语言。',
|
||||||
);
|
);
|
||||||
|
|
||||||
?>
|
?>
|
||||||
|
|||||||
@@ -762,6 +762,8 @@ $lang_settings = array
|
|||||||
'text_approval_status_icon_enabled_note' => "是否在種子列表展示審核狀態圖標,默認: '否'。",
|
'text_approval_status_icon_enabled_note' => "是否在種子列表展示審核狀態圖標,默認: '否'。",
|
||||||
'row_approval_status_none_visible' => '未審核種子是否可見',
|
'row_approval_status_none_visible' => '未審核種子是否可見',
|
||||||
'text_approval_status_none_visible_note' => "默認:'是'。若改為'否',審核不為[通過]狀態時強製顯示審核狀態圖標。",
|
'text_approval_status_none_visible_note' => "默認:'是'。若改為'否',審核不為[通過]狀態時強製顯示審核狀態圖標。",
|
||||||
|
'row_imdb_language' => 'IMDB 語言',
|
||||||
|
'text_imdb_language_note' => '抓取 IMDB 數據使用的語言。',
|
||||||
);
|
);
|
||||||
|
|
||||||
?>
|
?>
|
||||||
|
|||||||
@@ -762,6 +762,8 @@ $lang_settings = array
|
|||||||
'text_approval_status_icon_enabled_note' => "Whether to show the approval status icon in the torrent list, default: 'No'.",
|
'text_approval_status_icon_enabled_note' => "Whether to show the approval status icon in the torrent list, default: 'No'.",
|
||||||
'row_approval_status_none_visible' => 'Visibility of not reviewed torrents',
|
'row_approval_status_none_visible' => 'Visibility of not reviewed torrents',
|
||||||
'text_approval_status_none_visible_note' => "Default: 'Yes'. If change to 'No', force to show approval status icon when audit is not [allow] status.",
|
'text_approval_status_none_visible_note' => "Default: 'Yes'. If change to 'No', force to show approval status icon when audit is not [allow] status.",
|
||||||
|
'row_imdb_language' => 'IMDB Language',
|
||||||
|
'text_imdb_language_note' => 'Languages used to crawl IMDB data.',
|
||||||
);
|
);
|
||||||
|
|
||||||
?>
|
?>
|
||||||
|
|||||||
@@ -28,9 +28,16 @@ class Imdb
|
|||||||
$config->cachedir = $cacheDir;
|
$config->cachedir = $cacheDir;
|
||||||
$config->photodir = $photoDir;
|
$config->photodir = $photoDir;
|
||||||
$config->photoroot = $photoRoot;
|
$config->photoroot = $photoRoot;
|
||||||
|
$config->language = get_setting('main.imdb_language', 'en-US');
|
||||||
$this->config = $config;
|
$this->config = $config;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public static function listSupportLanguages(): array
|
||||||
|
{
|
||||||
|
$data = require_once sprintf('%s/resources/lang/%s/imdb.php', ROOT_PATH, get_langfolder_cookie(true));
|
||||||
|
return $data['languages'];
|
||||||
|
}
|
||||||
|
|
||||||
public function setDebug($debug)
|
public function setDebug($debug)
|
||||||
{
|
{
|
||||||
$this->config->debug = $debug;
|
$this->config->debug = $debug;
|
||||||
|
|||||||
@@ -90,6 +90,7 @@ return array (
|
|||||||
'enable_technical_info' => 'no',
|
'enable_technical_info' => 'no',
|
||||||
'site_language_enabled' => \App\Models\Language::DEFAULT_ENABLED,
|
'site_language_enabled' => \App\Models\Language::DEFAULT_ENABLED,
|
||||||
'show_top_uploader' => 'no',
|
'show_top_uploader' => 'no',
|
||||||
|
'imdb_language' => 'en-US',
|
||||||
),
|
),
|
||||||
'smtp' =>
|
'smtp' =>
|
||||||
array (
|
array (
|
||||||
|
|||||||
+9
-1
@@ -43,7 +43,7 @@ if ($action == 'savesettings_main') // save main
|
|||||||
'showpolls','showstats','showlastxtorrents', 'showtrackerload','showshoutbox','showfunbox','showoffer','sptime','showhelpbox','enablebitbucket',
|
'showpolls','showstats','showlastxtorrents', 'showtrackerload','showshoutbox','showfunbox','showoffer','sptime','showhelpbox','enablebitbucket',
|
||||||
'smalldescription','altname','extforum','extforumurl','defaultlang','defstylesheet', 'donation','spsct','browsecat','specialcat','waitsystem',
|
'smalldescription','altname','extforum','extforumurl','defaultlang','defstylesheet', 'donation','spsct','browsecat','specialcat','waitsystem',
|
||||||
'maxdlsystem','bitbucket','torrentnameprefix', 'showforumstats','verification','invite_count','invite_timeout', 'seeding_leeching_time_calc_start',
|
'maxdlsystem','bitbucket','torrentnameprefix', 'showforumstats','verification','invite_count','invite_timeout', 'seeding_leeching_time_calc_start',
|
||||||
'startsubid', 'logo', 'showlastxforumposts', 'enable_technical_info', 'site_language_enabled', 'show_top_uploader',
|
'startsubid', 'logo', 'showlastxforumposts', 'enable_technical_info', 'site_language_enabled', 'show_top_uploader', 'imdb_language',
|
||||||
);
|
);
|
||||||
GetVar($validConfig);
|
GetVar($validConfig);
|
||||||
$MAIN = [];
|
$MAIN = [];
|
||||||
@@ -728,6 +728,14 @@ elseif ($action == 'mainsettings') // main settings
|
|||||||
yesorno($lang_settings['row_show_classic'],'showclassicmovies', $MAIN['showclassicmovies'], $lang_settings['text_show_classic_note']);
|
yesorno($lang_settings['row_show_classic'],'showclassicmovies', $MAIN['showclassicmovies'], $lang_settings['text_show_classic_note']);
|
||||||
yesorno($lang_settings['row_show_top_uploader'],'show_top_uploader', $MAIN['show_top_uploader'], $lang_settings['text_show_top_uploader_note']);
|
yesorno($lang_settings['row_show_top_uploader'],'show_top_uploader', $MAIN['show_top_uploader'], $lang_settings['text_show_top_uploader_note']);
|
||||||
yesorno($lang_settings['row_enable_imdb_system'],'showimdbinfo', $MAIN['showimdbinfo'], $lang_settings['text_imdb_system_note']);
|
yesorno($lang_settings['row_enable_imdb_system'],'showimdbinfo', $MAIN['showimdbinfo'], $lang_settings['text_imdb_system_note']);
|
||||||
|
|
||||||
|
$imdbLanguages = "<select name=imdb_language>";
|
||||||
|
foreach (\Nexus\Imdb\Imdb::listSupportLanguages() as $key => $value) {
|
||||||
|
$imdbLanguages .= sprintf('<option value="%s"%s>%s</option>', $key, $key == $MAIN['imdb_language'] ? ' selected' : '', $value);
|
||||||
|
}
|
||||||
|
$imdbLanguages .= "</select>";
|
||||||
|
tr($lang_settings['row_imdb_language'], $imdbLanguages."<br />".$lang_settings['text_imdb_language_note'], 1);
|
||||||
|
|
||||||
yesorno($lang_settings['row_enable_pt_gen_system'],'enable_pt_gen_system', $MAIN['enable_pt_gen_system'], $lang_settings['text_enable_pt_gen_system_note']);
|
yesorno($lang_settings['row_enable_pt_gen_system'],'enable_pt_gen_system', $MAIN['enable_pt_gen_system'], $lang_settings['text_enable_pt_gen_system_note']);
|
||||||
tr($lang_settings['row_pt_gen_api_point'],"<input type='text' name=\"pt_gen_api_point\" style=\"width: 300px\" value={$MAIN['pt_gen_api_point']}> ".$lang_settings['text_pt_gen_api_point_note'], 1);
|
tr($lang_settings['row_pt_gen_api_point'],"<input type='text' name=\"pt_gen_api_point\" style=\"width: 300px\" value={$MAIN['pt_gen_api_point']}> ".$lang_settings['text_pt_gen_api_point_note'], 1);
|
||||||
yesorno($lang_settings['row_enable_nfo'],'enablenfo', $MAIN['enablenfo'], $lang_settings['text_enable_nfo_note']);
|
yesorno($lang_settings['row_enable_nfo'],'enablenfo', $MAIN['enablenfo'], $lang_settings['text_enable_nfo_note']);
|
||||||
|
|||||||
@@ -77,11 +77,10 @@ if($showrows < 1 || $showrows > 50)
|
|||||||
$showrows = 10;
|
$showrows = 10;
|
||||||
$limit .= $showrows;
|
$limit .= $showrows;
|
||||||
|
|
||||||
$where = '';
|
|
||||||
//approval status
|
//approval status
|
||||||
$approvalStatusNoneVisible = get_setting('torrent.approval_status_none_visible');
|
$approvalStatusNoneVisible = get_setting('torrent.approval_status_none_visible');
|
||||||
if ($approvalStatusNoneVisible == 'no' && get_user_class() < $staffmem_class) {
|
if ($approvalStatusNoneVisible == 'no' && get_user_class() < $staffmem_class) {
|
||||||
$where = "torrents.approval_status = " . \App\Models\Torrent::APPROVAL_STATUS_ALLOW;
|
$where .= ($where ? " AND " : "") . "torrents.approval_status = " . \App\Models\Torrent::APPROVAL_STATUS_ALLOW;
|
||||||
}
|
}
|
||||||
|
|
||||||
function get_where($tablename = "sources", $itemname = "source", $getname = "sou")
|
function get_where($tablename = "sources", $itemname = "source", $getname = "sou")
|
||||||
|
|||||||
+2
-2
@@ -1055,10 +1055,10 @@ if ($allsec != 1 || $enablespecial != 'yes'){ //do not print searchbox if showin
|
|||||||
<tr>
|
<tr>
|
||||||
<td class="bottom" style="padding: 1px;padding-left: 10px">
|
<td class="bottom" style="padding: 1px;padding-left: 10px">
|
||||||
<select class="med" name="approval_status" style="width: 100px;">
|
<select class="med" name="approval_status" style="width: 100px;">
|
||||||
<option value="0"><?php echo $lang_torrents['select_all'] ?></option>
|
<option value=""><?php echo $lang_torrents['select_all'] ?></option>
|
||||||
<?php
|
<?php
|
||||||
foreach (\App\Models\Torrent::listApprovalStatus(true) as $key => $value) {
|
foreach (\App\Models\Torrent::listApprovalStatus(true) as $key => $value) {
|
||||||
printf('<option value="%s"%s>%s</option>', $key, isset($approvalStatus) && $approvalStatus == $key ? ' selected' : '', $value);
|
printf('<option value="%s"%s>%s</option>', $key, isset($approvalStatus) && (string)$approvalStatus === (string)$key ? ' selected' : '', $value);
|
||||||
}
|
}
|
||||||
?>
|
?>
|
||||||
</select>
|
</select>
|
||||||
|
|||||||
@@ -0,0 +1,15 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
return [
|
||||||
|
'languages' => [
|
||||||
|
'en-US' => 'English (United States)',
|
||||||
|
'fr-CA' => 'French (Canada)',
|
||||||
|
'fr-FR' => 'French (France)',
|
||||||
|
'de-DE' => 'German',
|
||||||
|
'hi-IN' => 'Hindi',
|
||||||
|
'it-IT' => 'Italian',
|
||||||
|
'pt-BR' => 'Portuguese (Brazil)',
|
||||||
|
'es-ES' => 'Spanish (Spain)',
|
||||||
|
'es-MX' => 'Spanish (Mexico)',
|
||||||
|
],
|
||||||
|
];
|
||||||
@@ -0,0 +1,15 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
return [
|
||||||
|
'languages' => [
|
||||||
|
'en-US' => '英语(美国)',
|
||||||
|
'fr-CA' => '法语(加拿大)',
|
||||||
|
'fr-FR' => '法语(法国)',
|
||||||
|
'de-DE' => '德语(德国)',
|
||||||
|
'hi-IN' => '北印度语(印度)',
|
||||||
|
'it-IT' => '意大利语(意大利)',
|
||||||
|
'pt-BR' => '葡萄牙语(巴西)',
|
||||||
|
'es-ES' => '西班牙语(墨西哥)',
|
||||||
|
'es-MX' => '西班牙语(西班牙)',
|
||||||
|
],
|
||||||
|
];
|
||||||
@@ -0,0 +1,15 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
return [
|
||||||
|
'languages' => [
|
||||||
|
'en-US' => '英語(美國)',
|
||||||
|
'fr-CA' => '法語(加拿大)',
|
||||||
|
'fr-FR' => '法語(法國)',
|
||||||
|
'de-DE' => '德語(德國)',
|
||||||
|
'hi-IN' => '北印度語(印度)',
|
||||||
|
'it-IT' => '意大利語(意大利)',
|
||||||
|
'pt-BR' => '葡萄牙語(巴西)',
|
||||||
|
'es-ES' => '西班牙語(墨西哥)',
|
||||||
|
'es-MX' => '西班牙語(西班牙)',
|
||||||
|
],
|
||||||
|
];
|
||||||
Reference in New Issue
Block a user