@@ -200,4 +211,4 @@ p_val="page_data" button_num="10" cache_life="3600" export_name="arrVideoRankLis
{/block}
{block name="customize"}
-{/block}
\ No newline at end of file
+{/block}
diff --git a/code/app/home/view/videoGpt1/video/getSearchVideo.html b/code/app/home/view/videoGpt1/video/getSearchVideo.html
index dff3093..fee4a10 100644
--- a/code/app/home/view/videoGpt1/video/getSearchVideo.html
+++ b/code/app/home/view/videoGpt1/video/getSearchVideo.html
@@ -18,20 +18,27 @@ p_val="page_data" button_num="5" cache_life="3600" func="generateSearchPager" ex
{block name="description"}{site:seotkd code="description" page="search" /}{/block}
{block name="head"}
+{php}
+ $strSearchKeyword = trim((string)($Request->get('keyword', '')));
+ $urlBuilder = new \app\common\helper\UrlBuilder($TpStyle);
+ $strSearchCanonicalUrl = $strSearchKeyword !== ''
+ ? 'https://' . $DomainModel->d_domain . $urlBuilder->searchResult($strSearchKeyword)
+ : 'https://' . $DomainModel->d_domain;
+{/php}
-
+
-
+
-
+
{// 结构化数据}
@@ -112,6 +87,14 @@ p_val="page_data" button_num="5" cache_life="3600" func="generateSearchPager" ex
{assign name="__LIST__" value="$resData.data"}
{include file="module/list/shell/_shell_router" /}
+{video:seocopy scene="search"
+keyword="$Request.get.keyword"
+page="$resData.p_data.page|default=1"
+total="$resData.p_data.total|default=0"
+pages="$resData.p_data.pages|default=1"
+visible="$resData.data|count"
+export_name="seoCopy" /}
+{include file="module/seo_copy/collection" /}
{// ===== Pagination ===== }
{php}
@@ -129,4 +112,4 @@ $pagerCfg = $TpStyle['template_cfg']['components']['pager'] ?? [];
{/block}
{block name="customize"}
-{/block}
\ No newline at end of file
+{/block}
diff --git a/code/app/home/view/videoGpt1/video/getVideoInfo.html b/code/app/home/view/videoGpt1/video/getVideoInfo.html
index 6b41666..c631e9b 100644
--- a/code/app/home/view/videoGpt1/video/getVideoInfo.html
+++ b/code/app/home/view/videoGpt1/video/getVideoInfo.html
@@ -3,9 +3,9 @@
{block name="get-data"}
{if $Request.route.intVId && $Request.route.intVForgeId}
- {video:info v_id="$Request.route.intVId" v_key="arrVideo" v_fid="$Request.route.intVForgeId" export_name="arrVideo"/}
- {elseif $Request.route.intVId}
- {video:info v_id="$Request.route.intVId" v_key="arrVideo" export_name="arrVideo"/}
+ {video:info v_id="$Request.route.intVId" v_pinyin="$Request.route.strPinyin" v_key="arrVideo" v_fid="$Request.route.intVForgeId" export_name="arrVideo"/}
+ {elseif $Request.route.intVId || $Request.route.strPinyin}
+ {video:info v_id="$Request.route.intVId" v_pinyin="$Request.route.strPinyin" v_key="arrVideo" export_name="arrVideo"/}
{else}
{video:info v_id="$DomainModel->info_id" n_key="arrVideo" export_name="arrVideo" /}
{/if}
@@ -26,11 +26,11 @@
{/block}
-{block name="title"}{if $DomainModel->info_id == $Request.route.intVId || empty($Request.route.intVId)}{site:replace code="VIDEO@INDEX@INDEX@TITLE" /}{else/}{site:seotkd code="title" page="detail" /}{/if}{/block}
+{block name="title"}{if !empty($arrVideo.v_id) && ((int)$arrVideo.v_id !== (int)$DomainModel->info_id || !empty($Request.route.strPinyin))}{site:seotkd code="title" page="detail" /}{else/}{site:seotkd code="title" page="home" /}{/if}{/block}
-{block name="keywords"}{if $DomainModel->info_id == $Request.route.intVId || empty($Request.route.intVId)}{site:replace code="VIDEO@INDEX@INDEX@KEYWORDS" /}{else/}{site:seotkd code="keywords" page="detail" /}{/if}{/block}
+{block name="keywords"}{if !empty($arrVideo.v_id) && ((int)$arrVideo.v_id !== (int)$DomainModel->info_id || !empty($Request.route.strPinyin))}{site:seotkd code="keywords" page="detail" /}{else/}{site:seotkd code="keywords" page="home" /}{/if}{/block}
-{block name="description"}{if $DomainModel->info_id == $Request.route.intVId || empty($Request.route.intVId)}{site:replace code="VIDEO@INDEX@INDEX@DESCRIPTION" /}{else/}{site:seotkd code="description" page="detail" /}{/if}{/block}
+{block name="description"}{if !empty($arrVideo.v_id) && ((int)$arrVideo.v_id !== (int)$DomainModel->info_id || !empty($Request.route.strPinyin))}{site:seotkd code="description" page="detail" /}{else/}{site:seotkd code="description" page="home" /}{/if}{/block}
{block name="head"}
diff --git a/code/app/model/VideoCategoryModel.php b/code/app/model/VideoCategoryModel.php
index b0b6391..354f5d0 100644
--- a/code/app/model/VideoCategoryModel.php
+++ b/code/app/model/VideoCategoryModel.php
@@ -369,6 +369,41 @@ class VideoCategoryModel extends MongoModel
return self::$arrCategory;
}
+ /**
+ * Resolve category display name by slug.
+ */
+ static public function getNameBySlug(string $strSlug): string
+ {
+ $strSlug = trim($strSlug);
+ if ($strSlug === '') {
+ return '';
+ }
+
+ if (isset(self::$arrCategory[$strSlug])) {
+ return (string)self::$arrCategory[$strSlug];
+ }
+
+ foreach (self::getCustomCategory() as $arrParentCategory) {
+ if (!is_array($arrParentCategory)) {
+ continue;
+ }
+
+ if ((string)($arrParentCategory['v_category_en'] ?? '') === $strSlug) {
+ return trim((string)($arrParentCategory['v_category'] ?? ''));
+ }
+
+ foreach ((array)($arrParentCategory['children'] ?? []) as $arrChildCategory) {
+ if ((string)($arrChildCategory['v_category_en'] ?? '') !== $strSlug) {
+ continue;
+ }
+
+ return trim((string)($arrChildCategory['v_category'] ?? ''));
+ }
+ }
+
+ return '';
+ }
+
/**
* get pinyin based on chinese characters
*
diff --git a/code/app/model/VideoModel.php b/code/app/model/VideoModel.php
index db0afeb..e1f79b7 100644
--- a/code/app/model/VideoModel.php
+++ b/code/app/model/VideoModel.php
@@ -145,6 +145,20 @@ class VideoModel extends MongoModel
}
}
+ /**
+ * Compatibility wrapper for callers that expect a sorted cached query helper.
+ */
+ public function findManySortedWithCache(
+ array $arrFilter,
+ int $intCount = 0,
+ array $arrSort = [],
+ string $strKey = '',
+ int $intLifeTime = 24 * 3600,
+ array $arrOptions = []
+ ): null|array {
+ return $this->findManyWithCache($arrFilter, $intCount, $arrSort, $arrOptions, $strKey, $intLifeTime);
+ }
+
/**
* find one Video
*
@@ -179,6 +193,16 @@ class VideoModel extends MongoModel
return $this->findOne($arrFilter);
}
+ public function getVideoByNameEn(string $strNameEn): null|array
+ {
+ $strNameEn = trim($strNameEn);
+ if ($strNameEn === '') {
+ return null;
+ }
+
+ return $this->findOne(['v_name_en' => $strNameEn]);
+ }
+
/**
* 查询符合条件的随机多条小说
diff --git a/code/app/services/SiteContext.php b/code/app/services/SiteContext.php
index a76e2c3..e19e3b7 100644
--- a/code/app/services/SiteContext.php
+++ b/code/app/services/SiteContext.php
@@ -909,6 +909,12 @@ class SiteContext
protected function normalizeSeoKeywords(string $strValue): string
{
+ $strSanitized = @iconv('UTF-8', 'UTF-8//IGNORE', $strValue);
+ if ($strSanitized !== false) {
+ $strValue = $strSanitized;
+ }
+ $strValue = str_replace("\u{FFFD}", '', $strValue);
+ $strValue = preg_replace('/排�+/u', '排行', $strValue) ?? $strValue;
$strValue = str_replace([',', '、', ';', ';', '|', '|'], ',', $strValue);
$arrRawParts = preg_split('/\s*,\s*/u', $strValue) ?: [];
$arrNoiseSuffixes = [
@@ -933,6 +939,7 @@ class SiteContext
'疗愈力',
'英雄塑造',
'人性挖掘',
+ '隐喻意义',
];
$arrStopWords = [
'在线',
@@ -970,6 +977,10 @@ class SiteContext
}
$strPart = trim($strPart, " \t\n\r\0\x0B-_|,。;、,;");
+ $strPart = preg_replace('/排�+/u', '排行', $strPart) ?? $strPart;
+ if (preg_match('/榜排$/u', $strPart) || preg_match('/视频排$/u', $strPart)) {
+ $strPart .= '行';
+ }
if (in_array($strPart, $arrStopWords, true)) {
continue;
@@ -994,6 +1005,14 @@ class SiteContext
return '';
}
+ $strSanitized = @iconv('UTF-8', 'UTF-8//IGNORE', $strValue);
+ if ($strSanitized !== false) {
+ $strValue = $strSanitized;
+ }
+
+ $strValue = str_replace("\u{FFFD}", '', $strValue);
+ $strValue = preg_replace('/排�+/u', '排行', $strValue) ?? $strValue;
+
$strSiteName = trim((string)($this->DomainModel->d_name ?? ''));
$strSiteKeywords = trim((string)(ConverterMovel::getVal('strSiteKeywords') ?? ''));
$strVideoName = trim((string)(ConverterMovel::getVal('strVideoName') ?? ''));
@@ -1019,6 +1038,9 @@ class SiteContext
'的叙事模型',
'的英雄之旅',
'的成长母题',
+ '的精神内核',
+ '的文化符号',
+ '的隐喻意义',
];
$strValue = str_replace($arrNoisePhrases, '', $strValue);
@@ -1044,6 +1066,18 @@ class SiteContext
$boolDescriptionLooksWeak = true;
}
+ if (preg_match('/精神内核|文化符号|隐喻意义|叙事模型|英雄之旅|成长母题/u', $strValue)) {
+ $boolDescriptionLooksWeak = true;
+ }
+
+ if ($strPage === 'play' && preg_match('/解析/u', $strValue)) {
+ $boolDescriptionLooksWeak = true;
+ }
+
+ if ($strPage === 'play' && mb_strlen($strValue) > 80) {
+ $boolDescriptionLooksWeak = true;
+ }
+
if ($boolDescriptionLooksWeak) {
return $this->buildSeoDescriptionFallback($strPage, $strSiteName, $strVideoName, $strVideoCategoryName);
}
diff --git a/code/app/services/VideoService.php b/code/app/services/VideoService.php
index 8255259..1d932bf 100644
--- a/code/app/services/VideoService.php
+++ b/code/app/services/VideoService.php
@@ -376,6 +376,21 @@ class VideoService
$arrFilter['v_parent_category_en'],
);
+ if (empty($arrVideo) || !is_array($arrVideo)) {
+ $arrVideo = $this->getVideoList([
+ 'count' => $intCount,
+ 'v_category_en' => $arrFilter['v_category_en'] ?? 'all',
+ 'v_parent_category_en' => $arrFilter['v_parent_category_en'] ?? 'all',
+ 'v_lang_en' => 'all',
+ 'v_area_en' => 'all',
+ 'v_year' => 'all',
+ 'sort_type' => 'news',
+ 'v_status' => $strVStatus,
+ 'diff_key' => $strDiffKey !== '' ? $strDiffKey . ':rank_fallback' : 'rank_fallback',
+ 'cache_life' => $intCacheLifeTime,
+ ]);
+ }
+
return $arrVideo;
}
@@ -1180,11 +1195,9 @@ class VideoService
$arrPageKeys = $this->buildSeoCopyPageKeys($strScene, $arrOptions);
- if ($this->shouldSuppressDefaultOnlySeoCopy($strScene, $strHost, $arrPageKeys)) {
- return [];
- }
+ $boolSuppressDefaultOnlySeoCopy = $this->shouldSuppressDefaultOnlySeoCopy($strScene, $strHost, $arrPageKeys);
- $arrData = !empty($arrPageKeys)
+ $arrData = (!$boolSuppressDefaultOnlySeoCopy && !empty($arrPageKeys))
? SeoCopyStore::getPreferredPageData($strHost, $strScene, $arrPageKeys)
: [];
diff --git a/code/public/initdata/video/pools/pool_v1/detail/description.php b/code/public/initdata/video/pools/pool_v1/detail/description.php
index 8a85c35..d0de408 100644
--- a/code/public/initdata/video/pools/pool_v1/detail/description.php
+++ b/code/public/initdata/video/pools/pool_v1/detail/description.php
@@ -1,30 +1,30 @@