mirror of
https://github.com/lkddi/nexusphp.git
synced 2026-04-14 20:40:49 +08:00
torrent add&update ignore tags and install&update add timezone
This commit is contained in:
@@ -1 +1 @@
|
|||||||
From v1.6 onwards there is no need to create tables, it is created automatically by the migration file during installation. This directory file is reserved only for.
|
**From v1.6 onwards there is no need to create tables, it is created automatically by the migration file during installation. This directory file is reserved only for.**
|
||||||
|
|||||||
@@ -62,8 +62,11 @@ class Test extends Command
|
|||||||
*/
|
*/
|
||||||
public function handle()
|
public function handle()
|
||||||
{
|
{
|
||||||
$r = urldecode('%E8%8E%B7%E5%8F%96%E7%A8%8B%E5%BA%8F');
|
$tzlist = \DateTimeZone::listIdentifiers(\DateTimeZone::ALL);
|
||||||
echo $r;
|
foreach($tzlist as $value)
|
||||||
|
{
|
||||||
|
echo $value ."\n";
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -21,7 +21,7 @@ class Install
|
|||||||
'searchbox', 'secondicons', 'sources', 'standards', 'stylesheets', 'sysoppanel', 'teams', 'torrents_state', 'uploadspeed',
|
'searchbox', 'secondicons', 'sources', 'standards', 'stylesheets', 'sysoppanel', 'teams', 'torrents_state', 'uploadspeed',
|
||||||
];
|
];
|
||||||
|
|
||||||
protected $envNames = ['DB_HOST', 'DB_PORT', 'DB_USERNAME', 'DB_PASSWORD', 'DB_DATABASE', 'REDIS_HOST', 'REDIS_PORT', 'REDIS_DB'];
|
protected $envNames = ['TIMEZONE', 'DB_HOST', 'DB_PORT', 'DB_USERNAME', 'DB_PASSWORD', 'DB_DATABASE', 'REDIS_HOST', 'REDIS_PORT', 'REDIS_DB'];
|
||||||
|
|
||||||
public function __construct()
|
public function __construct()
|
||||||
{
|
{
|
||||||
@@ -310,10 +310,24 @@ class Install
|
|||||||
foreach ($formControls as $value) {
|
foreach ($formControls as $value) {
|
||||||
$form .= '<div class="flex mt-2">';
|
$form .= '<div class="flex mt-2">';
|
||||||
$form .= sprintf('<div class="w-%s flex justify-end items-center pr-10"><span>%s</span></div>', $labelWidth, $value['label']);
|
$form .= sprintf('<div class="w-%s flex justify-end items-center pr-10"><span>%s</span></div>', $labelWidth, $value['label']);
|
||||||
$form .= sprintf(
|
$form .= sprintf('<div class="w-%s flex justify-start items-center pr-10">', $valueWidth);
|
||||||
'<div class="w-%s flex justify-start items-center pr-10"><input class="border py-2 px-3 text-grey-darkest w-full" type="text" name="%s" value="%s" /></div>',
|
if (isset($value['type']) && $value['type'] == 'select') {
|
||||||
$valueWidth, $value['name'], $value['value'] ?? ''
|
$form .= sprintf('<select class="border py-2 px-3 text-grey-darkest w-full" name="%s"/>', $value['name']);
|
||||||
);
|
foreach ($value['options'] as $option) {
|
||||||
|
$selected = '';
|
||||||
|
if ($option == $value['value']) {
|
||||||
|
$selected = ' selected';
|
||||||
|
}
|
||||||
|
$form .= sprintf('<option value="%s"%s>%s</option>', $option, $selected, $option);
|
||||||
|
}
|
||||||
|
$form .= '</select>';
|
||||||
|
} else {
|
||||||
|
$form .= sprintf(
|
||||||
|
'<input class="border py-2 px-3 text-grey-darkest w-full" type="text" name="%s" value="%s" />',
|
||||||
|
$value['name'], $value['value'] ?? ''
|
||||||
|
);
|
||||||
|
}
|
||||||
|
$form .= '</div>';
|
||||||
$form .= '</div>';
|
$form .= '</div>';
|
||||||
}
|
}
|
||||||
$form .= '</div>';
|
$form .= '</div>';
|
||||||
@@ -351,11 +365,18 @@ class Install
|
|||||||
if (isset($_POST[$name])) {
|
if (isset($_POST[$name])) {
|
||||||
$value = $_POST[$name];
|
$value = $_POST[$name];
|
||||||
}
|
}
|
||||||
$formControls[] = [
|
$item = [
|
||||||
|
'type' => 'text',
|
||||||
|
'options' => [],
|
||||||
'label' => $name,
|
'label' => $name,
|
||||||
'name' => $name,
|
'name' => $name,
|
||||||
'value' => $value,
|
'value' => $value
|
||||||
];
|
];
|
||||||
|
if ($name == 'TIMEZONE') {
|
||||||
|
$item['type'] = 'select';
|
||||||
|
$item['options'] = $this->listTimeZone();
|
||||||
|
}
|
||||||
|
$formControls[] = $item;
|
||||||
}
|
}
|
||||||
|
|
||||||
return $formControls;
|
return $formControls;
|
||||||
@@ -588,4 +609,12 @@ class Install
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public function listTimeZone()
|
||||||
|
{
|
||||||
|
$results = \DateTimeZone::listIdentifiers(\DateTimeZone::ALL);
|
||||||
|
$utc = array_pop($results);
|
||||||
|
array_unshift($results, $utc);
|
||||||
|
return $results;
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -55,7 +55,6 @@ if (!empty($_POST['pt_gen'])) {
|
|||||||
$updateset[] = "pt_gen = ''";
|
$updateset[] = "pt_gen = ''";
|
||||||
}
|
}
|
||||||
|
|
||||||
$updateset[] = "tags = " . array_sum($_POST['tags'] ?? []);
|
|
||||||
$updateset[] = "technical_info = " . sqlesc($_POST['technical_info'] ?? '');
|
$updateset[] = "technical_info = " . sqlesc($_POST['technical_info'] ?? '');
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
@@ -306,8 +306,8 @@ if (empty($url) && !empty($ptGenImdbLink)) {
|
|||||||
$url = str_replace('tt', '', $ptGenImdbInfo['id']);
|
$url = str_replace('tt', '', $ptGenImdbInfo['id']);
|
||||||
}
|
}
|
||||||
|
|
||||||
$ret = sql_query("INSERT INTO torrents (filename, owner, visible, anonymous, name, size, numfiles, type, url, small_descr, descr, ori_descr, category, source, medium, codec, audiocodec, standard, processing, team, save_as, sp_state, added, last_action, nfo, info_hash, pt_gen, tags, technical_info) VALUES (".sqlesc($fname).", ".sqlesc($CURUSER["id"]).", 'yes', ".sqlesc($anonymous).", ".sqlesc($torrent).", ".sqlesc($totallen).", ".count($filelist).", ".sqlesc($type).", ".sqlesc($url).", ".sqlesc($small_descr).", ".sqlesc($descr).", ".sqlesc($descr).", ".sqlesc($catid).", ".sqlesc($sourceid).", ".sqlesc($mediumid).", ".sqlesc($codecid).", ".sqlesc($audiocodecid).", ".sqlesc($standardid).", ".sqlesc($processingid).", ".sqlesc($teamid).", ".sqlesc($dname).", ".sqlesc($sp_state) .
|
$ret = sql_query("INSERT INTO torrents (filename, owner, visible, anonymous, name, size, numfiles, type, url, small_descr, descr, ori_descr, category, source, medium, codec, audiocodec, standard, processing, team, save_as, sp_state, added, last_action, nfo, info_hash, pt_gen, technical_info) VALUES (".sqlesc($fname).", ".sqlesc($CURUSER["id"]).", 'yes', ".sqlesc($anonymous).", ".sqlesc($torrent).", ".sqlesc($totallen).", ".count($filelist).", ".sqlesc($type).", ".sqlesc($url).", ".sqlesc($small_descr).", ".sqlesc($descr).", ".sqlesc($descr).", ".sqlesc($catid).", ".sqlesc($sourceid).", ".sqlesc($mediumid).", ".sqlesc($codecid).", ".sqlesc($audiocodecid).", ".sqlesc($standardid).", ".sqlesc($processingid).", ".sqlesc($teamid).", ".sqlesc($dname).", ".sqlesc($sp_state) .
|
||||||
", " . sqlesc(date("Y-m-d H:i:s")) . ", " . sqlesc(date("Y-m-d H:i:s")) . ", ".sqlesc($nfo).", " . sqlesc($infohash). ", " . sqlesc(json_encode($postPtGen)) . ", " . array_sum($_POST['tags'] ?? []) . ", " . sqlesc($_POST['technical_info'] ?? '') . ")");
|
", " . sqlesc(date("Y-m-d H:i:s")) . ", " . sqlesc(date("Y-m-d H:i:s")) . ", ".sqlesc($nfo).", " . sqlesc($infohash). ", " . sqlesc(json_encode($postPtGen)) . ", " . sqlesc($_POST['technical_info'] ?? '') . ")");
|
||||||
if (!$ret) {
|
if (!$ret) {
|
||||||
if (mysql_errno() == 1062)
|
if (mysql_errno() == 1062)
|
||||||
bark($lang_takeupload['std_torrent_existed']);
|
bark($lang_takeupload['std_torrent_existed']);
|
||||||
|
|||||||
Reference in New Issue
Block a user