mirror of
https://github.com/lkddi/nexusphp.git
synced 2026-04-14 20:40:49 +08:00
custom fields i18n finish
This commit is contained in:
@@ -1705,7 +1705,7 @@ CREATE TABLE `searchbox` (
|
|||||||
`catpadding` smallint(5) unsigned NOT NULL DEFAULT '25',
|
`catpadding` smallint(5) unsigned NOT NULL DEFAULT '25',
|
||||||
`custom_fields` text,
|
`custom_fields` text,
|
||||||
`custom_fields_display_name` varchar(255) NOT NULL DEFAULT '',
|
`custom_fields_display_name` varchar(255) NOT NULL DEFAULT '',
|
||||||
`custom_fields_display_order` text,
|
`custom_fields_display` text,
|
||||||
PRIMARY KEY (`id`)
|
PRIMARY KEY (`id`)
|
||||||
) ENGINE=MyISAM DEFAULT CHARSET=utf8;
|
) ENGINE=MyISAM DEFAULT CHARSET=utf8;
|
||||||
/*!40101 SET character_set_client = @saved_cs_client */;
|
/*!40101 SET character_set_client = @saved_cs_client */;
|
||||||
|
|||||||
@@ -75,7 +75,11 @@ $lang_catmanage = array
|
|||||||
'std_missing_form_data' => "有必填项目未填写。",
|
'std_missing_form_data' => "有必填项目未填写。",
|
||||||
'std_invalid_character_in_filename' => "此文件名包含不合法字符:",
|
'std_invalid_character_in_filename' => "此文件名包含不合法字符:",
|
||||||
'std_must_define_one_selection' => "你必须至少指定一个选择!",
|
'std_must_define_one_selection' => "你必须至少指定一个选择!",
|
||||||
'std_invalid_mode_id' => "无效的模式id。"
|
'std_invalid_mode_id' => "无效的模式id。",
|
||||||
|
'row_enable_custom_field' => '启用自字义字段',
|
||||||
|
'row_custom_field_display_name' => '自定义字段展示名称',
|
||||||
|
'row_custom_field_display' => '自定义字段展示',
|
||||||
|
'row_custom_field_display_help' => '使用特殊的标签代表字段的名称和值,如某字段其 Name 为 artist,则它的名称为:<%artist.label%>,它的值为:<%artist.value%>',
|
||||||
);
|
);
|
||||||
|
|
||||||
?>
|
?>
|
||||||
|
|||||||
@@ -9,13 +9,13 @@ $lang_fields = [
|
|||||||
'text_edit' => '编辑',
|
'text_edit' => '编辑',
|
||||||
'col_id' => 'ID',
|
'col_id' => 'ID',
|
||||||
'col_name' => 'Name',
|
'col_name' => 'Name',
|
||||||
'col_name_helptext' => '仅允许数字、字母、下划线',
|
'col_name_help' => '仅允许数字、字母、下划线',
|
||||||
'col_label' => '显示标签',
|
'col_label' => '显示标签',
|
||||||
'col_type' => '类型',
|
'col_type' => '类型',
|
||||||
'col_required' => '不能为空',
|
'col_required' => '不能为空',
|
||||||
'col_help' => '辅助说明',
|
'col_help' => '辅助说明',
|
||||||
'col_options' => '选项',
|
'col_options' => '选项',
|
||||||
'col_options_helptext' => '类型为单选、多选、下拉时必填,一行一个,格式:选项值|选项描述文本',
|
'col_options_help' => '类型为单选、多选、下拉时必填,一行一个,格式:选项值|选项描述文本',
|
||||||
'col_action' => '操作',
|
'col_action' => '操作',
|
||||||
'col_is_single_row' => '展示时单独一行',
|
'col_is_single_row' => '展示时单独一行',
|
||||||
'js_sure_to_delete_this' => '你确信要删除此项目吗?',
|
'js_sure_to_delete_this' => '你确信要删除此项目吗?',
|
||||||
@@ -26,6 +26,5 @@ $lang_fields = [
|
|||||||
'field_type_checkbox' => '横向多选',
|
'field_type_checkbox' => '横向多选',
|
||||||
'field_type_select' => '下拉单选',
|
'field_type_select' => '下拉单选',
|
||||||
'field_type_image' => '图片',
|
'field_type_image' => '图片',
|
||||||
'field_type_file' => '文件',
|
|
||||||
|
|
||||||
];
|
];
|
||||||
@@ -703,7 +703,7 @@ $lang_settings = array
|
|||||||
'row_login_secret_lifetime' => '登录密钥有效期',
|
'row_login_secret_lifetime' => '登录密钥有效期',
|
||||||
'text_login_secret_lifetime_deadline' => '当前密钥有效期至',
|
'text_login_secret_lifetime_deadline' => '当前密钥有效期至',
|
||||||
'row_enable_technical_info' => '启用技术信息',
|
'row_enable_technical_info' => '启用技术信息',
|
||||||
'text_enable_technical_info' => "默认'否'。文件技术信息来自软件 <b><a href=\"https://mediaarea.net/en/MediaInfo\" target='_blank'>MediaInfo</a></b> Text 视图的结果",
|
'text_enable_technical_info' => "默认'否'。技术信息来自软件 <b><a href=\"https://mediaarea.net/en/MediaInfo\" target='_blank'>MediaInfo</a></b> Text 视图的结果",
|
||||||
);
|
);
|
||||||
|
|
||||||
?>
|
?>
|
||||||
|
|||||||
@@ -76,6 +76,10 @@ $lang_catmanage = array
|
|||||||
'std_invalid_character_in_filename' => "此檔名包含不合法字元:",
|
'std_invalid_character_in_filename' => "此檔名包含不合法字元:",
|
||||||
'std_must_define_one_selection' => "你必須至少指定一個選取!",
|
'std_must_define_one_selection' => "你必須至少指定一個選取!",
|
||||||
'std_invalid_mode_id' => "無效的型態id。",
|
'std_invalid_mode_id' => "無效的型態id。",
|
||||||
|
'row_enable_custom_field' => '啟用自字義字段',
|
||||||
|
'row_custom_field_display_name' => '自定義字段展示名稱',
|
||||||
|
'row_custom_field_display' => '自定義字段展示',
|
||||||
|
'row_custom_field_display_help' => '使用特殊的標簽代表字段的名稱和值,如某字段其 Name 為 artist,則它的名稱為:<%artist.label%>,它的值為:<%artist.value%>',
|
||||||
);
|
);
|
||||||
|
|
||||||
?>
|
?>
|
||||||
|
|||||||
@@ -9,13 +9,13 @@ $lang_fields = [
|
|||||||
'text_edit' => '編輯',
|
'text_edit' => '編輯',
|
||||||
'col_id' => 'ID',
|
'col_id' => 'ID',
|
||||||
'col_name' => 'Name',
|
'col_name' => 'Name',
|
||||||
'col_name_helptext' => '僅允許數字、字母、下劃線',
|
'col_name_help' => '僅允許數字、字母、下劃線',
|
||||||
'col_label' => '顯示標簽',
|
'col_label' => '顯示標簽',
|
||||||
'col_type' => '類型',
|
'col_type' => '類型',
|
||||||
'col_required' => '不能為空',
|
'col_required' => '不能為空',
|
||||||
'col_help' => '輔助說明',
|
'col_help' => '輔助說明',
|
||||||
'col_options' => '選項',
|
'col_options' => '選項',
|
||||||
'col_options_helptext' => '類型為單選、多選、下拉時必填,一行一個,格式:選項值|選項描述文本',
|
'col_options_help' => '類型為單選、多選、下拉時必填,一行一個,格式:選項值|選項描述文本',
|
||||||
'col_action' => '操作',
|
'col_action' => '操作',
|
||||||
'col_is_single_row' => '展示時單獨一行',
|
'col_is_single_row' => '展示時單獨一行',
|
||||||
'js_sure_to_delete_this' => '你確信要刪除此項目嗎?',
|
'js_sure_to_delete_this' => '你確信要刪除此項目嗎?',
|
||||||
@@ -25,7 +25,5 @@ $lang_fields = [
|
|||||||
'field_type_radio' => '橫向單選',
|
'field_type_radio' => '橫向單選',
|
||||||
'field_type_checkbox' => '橫向多選',
|
'field_type_checkbox' => '橫向多選',
|
||||||
'field_type_select' => '下拉單選',
|
'field_type_select' => '下拉單選',
|
||||||
'field_type_image' => '圖片',
|
|
||||||
'field_type_file' => '文件',
|
|
||||||
|
|
||||||
];
|
];
|
||||||
@@ -703,7 +703,7 @@ $lang_settings = array
|
|||||||
'row_login_secret_lifetime' => '登錄密鑰有效期',
|
'row_login_secret_lifetime' => '登錄密鑰有效期',
|
||||||
'text_login_secret_lifetime_deadline' => '當前密鑰有效期至',
|
'text_login_secret_lifetime_deadline' => '當前密鑰有效期至',
|
||||||
'row_enable_technical_info' => '啟用技術信息',
|
'row_enable_technical_info' => '啟用技術信息',
|
||||||
'text_enable_technical_info' => "默認'否'。文件技術信息來自軟件 <b><a href=\"https://mediaarea.net/en/MediaInfo\" target='_blank'>MediaInfo</a></b> Text 視圖的結果",
|
'text_enable_technical_info' => "默認'否'。技術信息來自軟件 <b><a href=\"https://mediaarea.net/en/MediaInfo\" target='_blank'>MediaInfo</a></b> Text 視圖的結果",
|
||||||
);
|
);
|
||||||
|
|
||||||
?>
|
?>
|
||||||
|
|||||||
@@ -75,7 +75,11 @@ $lang_catmanage = array
|
|||||||
'std_missing_form_data' => "Missing form data.",
|
'std_missing_form_data' => "Missing form data.",
|
||||||
'std_invalid_character_in_filename' => "Invalid character in filename ",
|
'std_invalid_character_in_filename' => "Invalid character in filename ",
|
||||||
'std_must_define_one_selection' => "You must define at least one selection!",
|
'std_must_define_one_selection' => "You must define at least one selection!",
|
||||||
'std_invalid_mode_id' => "Invalid mode id."
|
'std_invalid_mode_id' => "Invalid mode id.",
|
||||||
|
'row_enable_custom_field' => 'Enable custom field',
|
||||||
|
'row_custom_field_display_name' => 'Custom field display name',
|
||||||
|
'row_custom_field_display' => 'Custom field display',
|
||||||
|
'row_custom_field_display_help' => "Use 'specific label' to represent custom field's label and value,such as one custom field's name is 'artist',<br/>then it's label:<%artist.label%>,it's value:<%artist.value%>",
|
||||||
);
|
);
|
||||||
|
|
||||||
?>
|
?>
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
<?php
|
<?php
|
||||||
|
|
||||||
$lang_fields = [
|
$lang_fields = [
|
||||||
'field_management' => 'Custom field managent',
|
'field_management' => 'Custom field management',
|
||||||
'text_manage' => 'Manage',
|
'text_manage' => 'Manage',
|
||||||
'text_add' => 'Add',
|
'text_add' => 'Add',
|
||||||
'text_field' => 'Field',
|
'text_field' => 'Field',
|
||||||
@@ -9,23 +9,22 @@ $lang_fields = [
|
|||||||
'text_edit' => 'Edit',
|
'text_edit' => 'Edit',
|
||||||
'col_id' => 'ID',
|
'col_id' => 'ID',
|
||||||
'col_name' => 'Name',
|
'col_name' => 'Name',
|
||||||
'col_name_helptext' => 'Only allow digit, alphabet, underline',
|
'col_name_help' => 'Only allow digit, alphabet, underline',
|
||||||
'col_label' => 'Display label',
|
'col_label' => 'Display label',
|
||||||
'col_type' => 'Type',
|
'col_type' => 'Type',
|
||||||
'col_required' => 'Required',
|
'col_required' => 'Required',
|
||||||
'col_help' => 'Helptext',
|
'col_help' => 'Help text',
|
||||||
'col_options' => 'Options',
|
'col_options' => 'Options',
|
||||||
'col_options_helptext' => '类型为单选、多选、下拉时必填,一行一个,格式:选项值|选项描述文本',
|
'col_options_help' => 'Required when type is radio, checkbox, select. One line, one option, format: value|display text',
|
||||||
'col_action' => '操作',
|
'col_action' => 'Action',
|
||||||
'col_is_single_row' => '展示时单独一行',
|
'col_is_single_row' => 'Display on a single row',
|
||||||
'js_sure_to_delete_this' => '你确信要删除此项目吗?',
|
'js_sure_to_delete_this' => 'Sure to delete?',
|
||||||
'submit_submit' => '提交',
|
'submit_submit' => 'Submit',
|
||||||
'field_type_text' => '短文本',
|
'field_type_text' => 'Short text',
|
||||||
'field_type_textarea' => '长文本',
|
'field_type_textarea' => 'Long text',
|
||||||
'field_type_radio' => '横向单选',
|
'field_type_radio' => 'Horizontal single select',
|
||||||
'field_type_checkbox' => '横向多选',
|
'field_type_checkbox' => 'Horizontal multiple select',
|
||||||
'field_type_select' => '下拉单选',
|
'field_type_select' => 'Vertical single select',
|
||||||
'field_type_image' => '图片',
|
'field_type_image' => 'Image',
|
||||||
'field_type_file' => '文件',
|
|
||||||
|
|
||||||
];
|
];
|
||||||
@@ -316,7 +316,7 @@ $lang_functions = array
|
|||||||
'text_tag_mother_language_subtitle' => 'Mother language subtitle',
|
'text_tag_mother_language_subtitle' => 'Mother language subtitle',
|
||||||
'text_required' => 'Required',
|
'text_required' => 'Required',
|
||||||
'text_invalid' => 'Invalid',
|
'text_invalid' => 'Invalid',
|
||||||
'text_technical_info' => 'Technical Information',
|
'text_technical_info' => 'Technical Info',
|
||||||
'text_technical_info_help_text' => 'Technical Information comes from software <b><a href="https://mediaarea.net/en/MediaInfo" target=\'_blank\'>MediaInfo</a></b>,open file, click the view menu > text > right click in the box > select all > copy > past into this box.'
|
'text_technical_info_help_text' => 'Technical Information comes from software <b><a href="https://mediaarea.net/en/MediaInfo" target=\'_blank\'>MediaInfo</a></b>,open file, click the view menu > text > right click in the box > select all > copy > past into this box.'
|
||||||
);
|
);
|
||||||
|
|
||||||
|
|||||||
@@ -66,7 +66,7 @@ class Field
|
|||||||
{
|
{
|
||||||
$out = [];
|
$out = [];
|
||||||
foreach (self::$types as $key => $value) {
|
foreach (self::$types as $key => $value) {
|
||||||
$out[$key] = sprintf('%s(%s)', $this->getTypeHuman($key), $value['text']);
|
$out[$key] = sprintf('%s(%s)', $value['text'], $this->getTypeHuman($key));
|
||||||
}
|
}
|
||||||
return $out;
|
return $out;
|
||||||
}
|
}
|
||||||
@@ -87,18 +87,18 @@ class Field
|
|||||||
function buildFieldForm(array $row = [])
|
function buildFieldForm(array $row = [])
|
||||||
{
|
{
|
||||||
global $lang_fields, $lang_functions;
|
global $lang_fields, $lang_functions;
|
||||||
$trName = tr($lang_fields['col_name'] . '<font color="red">*</font>', '<input type="text" name="name" value="' . ($row['name'] ?? '') . '" style="width: 300px" /> ' . $lang_fields['col_name_helptext'], 1, '', true);
|
$trName = tr($lang_fields['col_name'] . '<font color="red">*</font>', '<input type="text" name="name" value="' . ($row['name'] ?? '') . '" style="width: 300px" /> ' . $lang_fields['col_name_help'], 1, '', true);
|
||||||
$trLabel = tr($lang_fields['col_label'] . '<font color="red">*</font>', '<input type="text" name="label" value="' . ($row['label'] ?? '') . '" style="width: 300px" />', 1, '', true);
|
$trLabel = tr($lang_fields['col_label'] . '<font color="red">*</font>', '<input type="text" name="label" value="' . ($row['label'] ?? '') . '" style="width: 300px" />', 1, '', true);
|
||||||
$trType = tr($lang_fields['col_type'] . '<font color="red">*</font>', $this->radio('type', $this->getTypeRadioOptions(), $row['type'] ?? null), 1, '', true);
|
$trType = tr($lang_fields['col_type'] . '<font color="red">*</font>', $this->radio('type', $this->getTypeRadioOptions(), $row['type'] ?? null), 1, '', true);
|
||||||
$trRequired = tr($lang_fields['col_required'] . '<font color="red">*</font>', $this->radio('required', ['0' => $lang_functions['text_no'], '1' => $lang_functions['text_yes']], $row['required'] ?? null), 1, '', true);
|
$trRequired = tr($lang_fields['col_required'] . '<font color="red">*</font>', $this->radio('required', ['0' => $lang_functions['text_no'], '1' => $lang_functions['text_yes']], $row['required'] ?? null), 1, '', true);
|
||||||
$trHelp = tr($lang_fields['col_help'], '<textarea name="help" rows="4" cols="80">' . ($row['help'] ?? '') . '</textarea>', 1, '', true);
|
$trHelp = tr($lang_fields['col_help'], '<textarea name="help" rows="4" cols="80">' . ($row['help'] ?? '') . '</textarea>', 1, '', true);
|
||||||
$trOptions = tr($lang_fields['col_options'], '<textarea name="options" rows="6" cols="80">' . ($row['options'] ?? '') . '</textarea><br/>' . $lang_fields['col_options_helptext'], 1, '', true);
|
$trOptions = tr($lang_fields['col_options'], '<textarea name="options" rows="6" cols="80">' . ($row['options'] ?? '') . '</textarea><br/>' . $lang_fields['col_options_help'], 1, '', true);
|
||||||
$trIsSingleRow = tr($lang_fields['col_is_single_row'] . '<font color="red">*</font>', $this->radio('is_single_row', ['0' => $lang_functions['text_no'], '1' => $lang_functions['text_yes']], $row['is_single_row'] ?? null), 1, '', true);
|
$trIsSingleRow = tr($lang_fields['col_is_single_row'] . '<font color="red">*</font>', $this->radio('is_single_row', ['0' => $lang_functions['text_no'], '1' => $lang_functions['text_yes']], $row['is_single_row'] ?? null), 1, '', true);
|
||||||
$id = $row['id'] ?? 0;
|
$id = $row['id'] ?? 0;
|
||||||
$form = <<<HTML
|
$form = <<<HTML
|
||||||
<div>
|
<div>
|
||||||
<h1 align="center"><a class="faqlink" href="?action=view&type=">{$lang_fields['text_field']}</a></h1>
|
<h1 align="center"><a class="faqlink" href="?action=view">{$lang_fields['text_field']}</a></h1>
|
||||||
<form method="post" action="fields.php?action=submit&type=">
|
<form method="post" action="fields.php?action=submit">
|
||||||
<div>
|
<div>
|
||||||
<table border="1" cellspacing="0" cellpadding="10" width="100%">
|
<table border="1" cellspacing="0" cellpadding="10" width="100%">
|
||||||
<input type="hidden" name="id" value="{$id}"/>
|
<input type="hidden" name="id" value="{$id}"/>
|
||||||
@@ -143,24 +143,16 @@ HTML;
|
|||||||
$row['is_single_row_text'] = $row['is_single_row'] ? $lang_functions['text_yes'] : $lang_functions['text_no'];
|
$row['is_single_row_text'] = $row['is_single_row'] ? $lang_functions['text_yes'] : $lang_functions['text_no'];
|
||||||
$row['type_text'] = sprintf('%s(%s)', $this->getTypeHuman($row['type']), $row['type']);
|
$row['type_text'] = sprintf('%s(%s)', $this->getTypeHuman($row['type']), $row['type']);
|
||||||
$row['action'] = sprintf(
|
$row['action'] = sprintf(
|
||||||
"<a href=\"javascript:confirm_delete('%s', '%s', '');\">%s</a> | <a href=\"?action=edit&type=&id=%s\">%s</a>",
|
"<a href=\"javascript:confirm_delete('%s', '%s', '');\">%s</a> | <a href=\"?action=edit&id=%s\">%s</a>",
|
||||||
$row['id'], $lang_fields['js_sure_to_delete_this'], $lang_fields['text_delete'], $row['id'], $lang_fields['text_edit']
|
$row['id'], $lang_fields['js_sure_to_delete_this'], $lang_fields['text_delete'], $row['id'], $lang_fields['text_edit']
|
||||||
);
|
);
|
||||||
$rows[] = $row;
|
$rows[] = $row;
|
||||||
}
|
}
|
||||||
$head = <<<HEAD
|
$head = <<<HEAD
|
||||||
<h1 align="center">{$lang_fields['field_management']} - </h1>
|
<h1 align="center">{$lang_fields['field_management']}</h1>
|
||||||
<div style="margin-bottom: 8px;">
|
<div style="margin-bottom: 8px;">
|
||||||
<span id="item" onclick="dropmenu(this);">
|
|
||||||
<span style="cursor: pointer;" class="big"><b>{$lang_fields['text_manage']}</b></span>
|
|
||||||
<div id="itemlist" class="dropmenu" style="display: none">
|
|
||||||
<ul>
|
|
||||||
<li><a href="?action=view&type=field">{$lang_fields['text_field']}</a></li>
|
|
||||||
</ul>
|
|
||||||
</div>
|
|
||||||
</span>
|
|
||||||
<span id="add">
|
<span id="add">
|
||||||
<a href="?action=add&type=" class="big"><b>{$lang_fields['text_add']}</b></a>
|
<a href="?action=add" class="big"><b>{$lang_fields['text_add']}</b></a>
|
||||||
</span>
|
</span>
|
||||||
</div>
|
</div>
|
||||||
HEAD;
|
HEAD;
|
||||||
@@ -252,7 +244,7 @@ HEAD;
|
|||||||
while ($row = mysql_fetch_assoc($res)) {
|
while ($row = mysql_fetch_assoc($res)) {
|
||||||
$checkbox .= sprintf(
|
$checkbox .= sprintf(
|
||||||
'<label style="margin-right: 4px;"><input type="checkbox" name="%s" value="%s"%s>%s</label>',
|
'<label style="margin-right: 4px;"><input type="checkbox" name="%s" value="%s"%s>%s</label>',
|
||||||
$name, $row['id'], in_array($row['id'], $current) ? ' checked' : '', "{$row['label']}[{$row['id']}]"
|
$name, $row['id'], in_array($row['id'], $current) ? ' checked' : '', "{$row['name']}[{$row['label']}]"
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
$checkbox .= '';
|
$checkbox .= '';
|
||||||
@@ -414,9 +406,9 @@ JS;
|
|||||||
{
|
{
|
||||||
global $browsecatmode;
|
global $browsecatmode;
|
||||||
$displayName = get_searchbox_value($browsecatmode, 'custom_fields_display_name');
|
$displayName = get_searchbox_value($browsecatmode, 'custom_fields_display_name');
|
||||||
$displayOrder = get_searchbox_value($browsecatmode, 'custom_fields_display_order');
|
$display = get_searchbox_value($browsecatmode, 'custom_fields_display');
|
||||||
$customFields = $this->listTorrentCustomField($torrentId);
|
$customFields = $this->listTorrentCustomField($torrentId);
|
||||||
$mixedRowContent = nl2br($displayOrder);
|
$mixedRowContent = nl2br($display);
|
||||||
$rowByRowHtml = '';
|
$rowByRowHtml = '';
|
||||||
foreach ($customFields as $field) {
|
foreach ($customFields as $field) {
|
||||||
$content = $this->formatCustomFieldValue($field);
|
$content = $this->formatCustomFieldValue($field);
|
||||||
|
|||||||
@@ -236,11 +236,10 @@ function print_category_editor($type, $row='')
|
|||||||
tr($lang_catmanage['row_items_per_row']."<font color=\"red\">*</font>", "<input type=\"text\" name=\"catsperrow\" value=\"".$catsperrow."\" style=\"width: 100px\" /> " . $lang_catmanage['text_items_per_row_note'], 1);
|
tr($lang_catmanage['row_items_per_row']."<font color=\"red\">*</font>", "<input type=\"text\" name=\"catsperrow\" value=\"".$catsperrow."\" style=\"width: 100px\" /> " . $lang_catmanage['text_items_per_row_note'], 1);
|
||||||
tr($lang_catmanage['row_padding_between_items']."<font color=\"red\">*</font>", "<input type=\"text\" name=\"catpadding\" value=\"".$catpadding."\" style=\"width: 100px\" /> " . $lang_catmanage['text_padding_between_items_note'], 1);
|
tr($lang_catmanage['row_padding_between_items']."<font color=\"red\">*</font>", "<input type=\"text\" name=\"catpadding\" value=\"".$catpadding."\" style=\"width: 100px\" /> " . $lang_catmanage['text_padding_between_items_note'], 1);
|
||||||
$field = new \Nexus\Field\Field();
|
$field = new \Nexus\Field\Field();
|
||||||
tr('启用自字义字段', $field->buildFieldCheckbox('custom_fields[]', $row['custom_fields'] ?? ''), 1);
|
tr($lang_catmanage['row_enable_custom_field'], $field->buildFieldCheckbox('custom_fields[]', $row['custom_fields'] ?? ''), 1);
|
||||||
tr('自定义字段显示名称', '<input type="text" name="custom_fields_display_name" style="width: 300px" value="' . ($row['custom_fields_display_name'] ?? '') . '" />', 1);
|
tr($lang_catmanage['row_custom_field_display_name'], '<input type="text" name="custom_fields_display_name" style="width: 300px" value="' . ($row['custom_fields_display_name'] ?? '') . '" />', 1);
|
||||||
$helpText = '<br/>使用标签代表字段,如某字段其 Name 为 artist,则它的标签为:<%artist%>';
|
$helpText = '<br/>' . $lang_catmanage['row_custom_field_display_help'];
|
||||||
$helpText .= '<br/><font color="#a52a2a">仅针对非单独占一行的字段有效</font>';
|
tr($lang_catmanage['row_custom_field_display'], '<textarea name="custom_fields_display" style="width: 300px" rows="8">' . ($row['custom_fields_display'] ?? '') . '</textarea>' . $helpText, 1);
|
||||||
tr('自定义字段显示顺序', '<textarea name="custom_fields_display_order" style="width: 300px" rows="8">' . ($row['custom_fields_display_order'] ?? '') . '</textarea>' . $helpText, 1);
|
|
||||||
}
|
}
|
||||||
elseif ($type=='caticon')
|
elseif ($type=='caticon')
|
||||||
{
|
{
|
||||||
@@ -708,7 +707,7 @@ elseif($action == 'submit')
|
|||||||
$updateset[] = "showaudiocodec=".sqlesc($showaudiocodec);
|
$updateset[] = "showaudiocodec=".sqlesc($showaudiocodec);
|
||||||
$updateset[] = "custom_fields=" . sqlesc(implode(',', $_POST['custom_fields'] ?? []));
|
$updateset[] = "custom_fields=" . sqlesc(implode(',', $_POST['custom_fields'] ?? []));
|
||||||
$updateset[] = "custom_fields_display_name=" . sqlesc($_POST['custom_fields_display_name'] ?? '');
|
$updateset[] = "custom_fields_display_name=" . sqlesc($_POST['custom_fields_display_name'] ?? '');
|
||||||
$updateset[] = "custom_fields_display_order=" . sqlesc($_POST['custom_fields_display_order'] ?? '');
|
$updateset[] = "custom_fields_display=" . sqlesc($_POST['custom_fields_display'] ?? '');
|
||||||
if ($showsource || $showmedium || $showcodec || $showstandard || $showprocessing || $showteam || $showaudiocodec)
|
if ($showsource || $showmedium || $showcodec || $showstandard || $showprocessing || $showteam || $showaudiocodec)
|
||||||
$updateset[] = "showsubcat=1";
|
$updateset[] = "showsubcat=1";
|
||||||
else
|
else
|
||||||
|
|||||||
@@ -23,20 +23,20 @@ if ($action == 'view') {
|
|||||||
} elseif ($action == 'submit') {
|
} elseif ($action == 'submit') {
|
||||||
try {
|
try {
|
||||||
$result = $field->save($_REQUEST);
|
$result = $field->save($_REQUEST);
|
||||||
redirect('fields.php?action=view&type=');
|
redirect('fields.php?action=view');
|
||||||
} catch (\Exception $e) {
|
} catch (\Exception $e) {
|
||||||
stderr($lang_fields['field_management']." - ".$lang_fields['text_field'], $e->getMessage());
|
stderr($lang_fields['field_management']." - ".$lang_fields['text_field'], $e->getMessage());
|
||||||
}
|
}
|
||||||
} elseif ($action == 'edit') {
|
} elseif ($action == 'edit') {
|
||||||
$id = intval($_GET['id'] ?? 0);
|
$id = intval($_GET['id'] ?? 0);
|
||||||
if ($id == 0) {
|
if ($id == 0) {
|
||||||
stderr($lang_fields['field_management'], "invalid id");
|
stderr($lang_fields['field_management'], "Invalid id");
|
||||||
}
|
}
|
||||||
$sql = "select * from torrents_custom_fields where id = $id";
|
$sql = "select * from torrents_custom_fields where id = $id";
|
||||||
$res = sql_query($sql);
|
$res = sql_query($sql);
|
||||||
$row = mysql_fetch_assoc($res);
|
$row = mysql_fetch_assoc($res);
|
||||||
if (empty($row)) {
|
if (empty($row)) {
|
||||||
stderr('', 'invlaid id');
|
stderr('', 'Invalid id');
|
||||||
}
|
}
|
||||||
stdhead($lang_fields['field_management']." - ".$lang_fields['text_edit']);
|
stdhead($lang_fields['field_management']." - ".$lang_fields['text_edit']);
|
||||||
begin_main_frame();
|
begin_main_frame();
|
||||||
@@ -44,11 +44,11 @@ if ($action == 'view') {
|
|||||||
} elseif ($action == 'del') {
|
} elseif ($action == 'del') {
|
||||||
$id = intval($_GET['id'] ?? 0);
|
$id = intval($_GET['id'] ?? 0);
|
||||||
if ($id == 0) {
|
if ($id == 0) {
|
||||||
stderr($lang_fields['field_management'], "invalid id");
|
stderr($lang_fields['field_management'], "Invalid id");
|
||||||
}
|
}
|
||||||
$sql = "delete from torrents_custom_fields where id = $id";
|
$sql = "delete from torrents_custom_fields where id = $id";
|
||||||
$res = sql_query($sql);
|
$res = sql_query($sql);
|
||||||
redirect('fields.php?action=view&type=');
|
redirect('fields.php?action=view');
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -131,7 +131,7 @@ else
|
|||||||
$time = strftime("%m.%d %H:%M",$arr["date"]);
|
$time = strftime("%m.%d %H:%M",$arr["date"]);
|
||||||
else $time = get_elapsed_time($arr["date"]).$lang_shoutbox['text_ago'];
|
else $time = get_elapsed_time($arr["date"]).$lang_shoutbox['text_ago'];
|
||||||
print("<tr><td class=\"shoutrow\"><span class='date'>[".$time."]</span> ".
|
print("<tr><td class=\"shoutrow\"><span class='date'>[".$time."]</span> ".
|
||||||
$del ." ". $username." " . format_comment($arr["text"],true,false,true,true,600,true,false)."
|
$del ." ". $username." " . format_comment($arr["text"],true,false,true,true,600,false,false)."
|
||||||
</td></tr>\n");
|
</td></tr>\n");
|
||||||
}
|
}
|
||||||
print("</table>");
|
print("</table>");
|
||||||
|
|||||||
Reference in New Issue
Block a user