mirror of
https://github.com/lkddi/nexusphp.git
synced 2026-04-24 03:57:22 +08:00
Merge remote-tracking branch 'origin/php8' into php8
This commit is contained in:
+9
-10
@@ -55,14 +55,13 @@ class Field
|
||||
|
||||
public function getTypeHuman($type)
|
||||
{
|
||||
global $lang_fields;
|
||||
$map = [
|
||||
self::TYPE_TEXT => $lang_fields['field_type_text'],
|
||||
self::TYPE_TEXTAREA => $lang_fields['field_type_textarea'],
|
||||
self::TYPE_RADIO => $lang_fields['field_type_radio'],
|
||||
self::TYPE_CHECKBOX => $lang_fields['field_type_checkbox'],
|
||||
self::TYPE_SELECT => $lang_fields['field_type_select'],
|
||||
self::TYPE_IMAGE => $lang_fields['field_type_image'],
|
||||
self::TYPE_TEXT => nexus_trans('field.type.text'),
|
||||
self::TYPE_TEXTAREA => nexus_trans('field.type.textarea'),
|
||||
self::TYPE_RADIO => nexus_trans('field.type.radio'),
|
||||
self::TYPE_CHECKBOX => nexus_trans('field.type.checkbox'),
|
||||
self::TYPE_SELECT => nexus_trans('field.type.select'),
|
||||
self::TYPE_IMAGE => nexus_trans('field.type.image'),
|
||||
];
|
||||
return $map[$type] ?? '';
|
||||
}
|
||||
@@ -439,7 +438,7 @@ JS;
|
||||
$customFieldDisplay = $field['display'];
|
||||
$customFieldDisplay = str_replace("<%{$field['name']}.label%>", $field['label'], $customFieldDisplay);
|
||||
$customFieldDisplay = str_replace("<%{$field['name']}.value%>", $contentNotFormatted, $customFieldDisplay);
|
||||
$rowByRowHtml .= tr($field['label'], format_comment($customFieldDisplay, false), 1);
|
||||
$rowByRowHtml .= tr($field['label'], format_comment($customFieldDisplay), 1);
|
||||
} else {
|
||||
$contentFormatted = $this->formatCustomFieldValue($field, true);
|
||||
$rowByRowHtml .= tr($field['label'], $contentFormatted, 1);
|
||||
@@ -463,13 +462,13 @@ JS;
|
||||
switch ($customFieldWithValue['type']) {
|
||||
case self::TYPE_TEXT:
|
||||
case self::TYPE_TEXTAREA:
|
||||
$result .= $doFormatComment ? format_comment($fieldValue, false) : $fieldValue;
|
||||
$result .= $doFormatComment ? format_comment($fieldValue) : $fieldValue;
|
||||
break;
|
||||
case self::TYPE_IMAGE:
|
||||
if (substr($fieldValue, 0, 4) == 'http') {
|
||||
$result .= $doFormatComment ? formatImg($fieldValue, true, 700, 0, "attach{$customFieldWithValue['id']}") : $fieldValue;
|
||||
} else {
|
||||
$result .= $doFormatComment ? format_comment($fieldValue, false) : $fieldValue;
|
||||
$result .= $doFormatComment ? format_comment($fieldValue) : $fieldValue;
|
||||
}
|
||||
break;
|
||||
case self::TYPE_RADIO:
|
||||
|
||||
+15
-3
@@ -351,9 +351,17 @@ HTML;
|
||||
|
||||
public function isIyuu(array $bodyArr): bool
|
||||
{
|
||||
return false;
|
||||
//Not support, due to change frequently
|
||||
// return isset($bodyArr['ret']) && $bodyArr['ret'] == 200;
|
||||
$version = (string)($bodyArr['version'] ?? '');
|
||||
switch ($version) {
|
||||
case '2.0.0':
|
||||
return isset($bodyArr['ret'])
|
||||
&& intval($bodyArr['ret']) === 200
|
||||
&& isset($bodyArr['data']['format'])
|
||||
&& is_string($bodyArr['data']['format'])
|
||||
&& $bodyArr['data']['format'] !== '';
|
||||
default:
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
public function listRatings(array $ptGenData, string $imdbLink, string $desc = ''): array
|
||||
@@ -575,6 +583,10 @@ HTML;
|
||||
do_log("$log, site: $site can not be updated: " . $exception->getMessage(), 'error');
|
||||
}
|
||||
}
|
||||
if (empty($ptGenInfo)) {
|
||||
do_log("$log, no pt gen info updated");
|
||||
return false;
|
||||
}
|
||||
$siteIdAndRating = $this->listRatings($ptGenInfo, $torrent->url, $extra->descr);
|
||||
foreach ($siteIdAndRating as $key => $value) {
|
||||
if (!isset($ptGenInfo[$key]['data']) || !is_array($ptGenInfo[$key]['data'])) {
|
||||
|
||||
Reference in New Issue
Block a user