diff --git a/code/app/home/view/videoGpt1/module/list/home_block.html b/code/app/home/view/videoGpt1/module/list/home_block.html index b78805e..2b6e745 100644 --- a/code/app/home/view/videoGpt1/module/list/home_block.html +++ b/code/app/home/view/videoGpt1/module/list/home_block.html @@ -18,6 +18,4 @@ $title = $Slot['title_text'] ?? null; {// ===== Shell + Item ===== } {include file="module/list/shell/_shell_router" /} - - - \ No newline at end of file + diff --git a/code/app/home/view/videoGpt1/module/pager/pager_input.html b/code/app/home/view/videoGpt1/module/pager/pager_input.html index 9146ad3..9661993 100644 --- a/code/app/home/view/videoGpt1/module/pager/pager_input.html +++ b/code/app/home/view/videoGpt1/module/pager/pager_input.html @@ -38,7 +38,7 @@ + onclick="(function(btn){var wrap=btn.parentNode;var inp=wrap.querySelector('input');var max=parseInt(wrap.getAttribute('data-pages')||1);var p=parseInt(inp.value||1);var u='{:$first_url ?? '#'}';p=Math.max(1,Math.min(max,p));if(!u||u==='#'){return;}if(/[?&]page=\\d+/i.test(u)){u=u.replace(/([?&]page=)\\d+/i,'$1'+p);}else if(/[?&]page=\\{page\\}/i.test(u)){u=u.replace(/([?&]page=)\\{page\\}/i,'$1'+p);}else if(/-\\{page\\}(?=$|[?#])/i.test(u)){u=u.replace(/-\\{page\\}(?=$|[?#])/i,'-'+p);}else{u=u.replace(/-(\\d+)(?=$|[?#])/,'-'+p);}window.location.href=u;})(this)">确定 {/case} @@ -118,7 +118,7 @@ + onclick="(function(btn){var wrap=btn.parentNode;var inp=wrap.querySelector('input');var max=parseInt(wrap.getAttribute('data-pages')||1);var p=parseInt(inp.value||1);var u='{:$first_url ?? '#'}';p=Math.max(1,Math.min(max,p));if(!u||u==='#'){return;}if(/[?&]page=\\d+/i.test(u)){u=u.replace(/([?&]page=)\\d+/i,'$1'+p);}else if(/[?&]page=\\{page\\}/i.test(u)){u=u.replace(/([?&]page=)\\{page\\}/i,'$1'+p);}else if(/-\\{page\\}(?=$|[?#])/i.test(u)){u=u.replace(/-\\{page\\}(?=$|[?#])/i,'-'+p);}else{u=u.replace(/-(\\d+)(?=$|[?#])/,'-'+p);}window.location.href=u;})(this)">确定 {/case} @@ -198,7 +198,7 @@ + onclick="(function(btn){var wrap=btn.parentNode;var inp=wrap.querySelector('input');var max=parseInt(wrap.getAttribute('data-pages')||1);var p=parseInt(inp.value||1);var u='{:$first_url ?? '#'}';p=Math.max(1,Math.min(max,p));if(!u||u==='#'){return;}if(/[?&]page=\\d+/i.test(u)){u=u.replace(/([?&]page=)\\d+/i,'$1'+p);}else if(/[?&]page=\\{page\\}/i.test(u)){u=u.replace(/([?&]page=)\\{page\\}/i,'$1'+p);}else if(/-\\{page\\}(?=$|[?#])/i.test(u)){u=u.replace(/-\\{page\\}(?=$|[?#])/i,'-'+p);}else{u=u.replace(/-(\\d+)(?=$|[?#])/,'-'+p);}window.location.href=u;})(this)">确定 {/case} @@ -278,7 +278,7 @@ + onclick="(function(btn){var wrap=btn.parentNode;var inp=wrap.querySelector('input');var max=parseInt(wrap.getAttribute('data-pages')||1);var p=parseInt(inp.value||1);var u='{:$first_url ?? '#'}';p=Math.max(1,Math.min(max,p));if(!u||u==='#'){return;}if(/[?&]page=\\d+/i.test(u)){u=u.replace(/([?&]page=)\\d+/i,'$1'+p);}else if(/[?&]page=\\{page\\}/i.test(u)){u=u.replace(/([?&]page=)\\{page\\}/i,'$1'+p);}else if(/-\\{page\\}(?=$|[?#])/i.test(u)){u=u.replace(/-\\{page\\}(?=$|[?#])/i,'-'+p);}else{u=u.replace(/-(\\d+)(?=$|[?#])/,'-'+p);}window.location.href=u;})(this)">确定 {/case} @@ -358,7 +358,7 @@ + onclick="(function(btn){var wrap=btn.parentNode;var inp=wrap.querySelector('input');var max=parseInt(wrap.getAttribute('data-pages')||1);var p=parseInt(inp.value||1);var u='{:$first_url ?? '#'}';p=Math.max(1,Math.min(max,p));if(!u||u==='#'){return;}if(/[?&]page=\\d+/i.test(u)){u=u.replace(/([?&]page=)\\d+/i,'$1'+p);}else if(/[?&]page=\\{page\\}/i.test(u)){u=u.replace(/([?&]page=)\\{page\\}/i,'$1'+p);}else if(/-\\{page\\}(?=$|[?#])/i.test(u)){u=u.replace(/-\\{page\\}(?=$|[?#])/i,'-'+p);}else{u=u.replace(/-(\\d+)(?=$|[?#])/,'-'+p);}window.location.href=u;})(this)">确定 {/case} @@ -438,7 +438,7 @@ + onclick="(function(btn){var wrap=btn.parentNode;var inp=wrap.querySelector('input');var max=parseInt(wrap.getAttribute('data-pages')||1);var p=parseInt(inp.value||1);var u='{:$first_url ?? '#'}';p=Math.max(1,Math.min(max,p));if(!u||u==='#'){return;}if(/[?&]page=\\d+/i.test(u)){u=u.replace(/([?&]page=)\\d+/i,'$1'+p);}else if(/[?&]page=\\{page\\}/i.test(u)){u=u.replace(/([?&]page=)\\{page\\}/i,'$1'+p);}else if(/-\\{page\\}(?=$|[?#])/i.test(u)){u=u.replace(/-\\{page\\}(?=$|[?#])/i,'-'+p);}else{u=u.replace(/-(\\d+)(?=$|[?#])/,'-'+p);}window.location.href=u;})(this)">确定 {/case} @@ -518,7 +518,7 @@ + onclick="(function(btn){var wrap=btn.parentNode;var inp=wrap.querySelector('input');var max=parseInt(wrap.getAttribute('data-pages')||1);var p=parseInt(inp.value||1);var u='{:$first_url ?? '#'}';p=Math.max(1,Math.min(max,p));if(!u||u==='#'){return;}if(/[?&]page=\\d+/i.test(u)){u=u.replace(/([?&]page=)\\d+/i,'$1'+p);}else if(/[?&]page=\\{page\\}/i.test(u)){u=u.replace(/([?&]page=)\\{page\\}/i,'$1'+p);}else if(/-\\{page\\}(?=$|[?#])/i.test(u)){u=u.replace(/-\\{page\\}(?=$|[?#])/i,'-'+p);}else{u=u.replace(/-(\\d+)(?=$|[?#])/,'-'+p);}window.location.href=u;})(this)">确定 {/case} @@ -598,7 +598,7 @@ + onclick="(function(btn){var wrap=btn.parentNode;var inp=wrap.querySelector('input');var max=parseInt(wrap.getAttribute('data-pages')||1);var p=parseInt(inp.value||1);var u='{:$first_url ?? '#'}';p=Math.max(1,Math.min(max,p));if(!u||u==='#'){return;}if(/[?&]page=\\d+/i.test(u)){u=u.replace(/([?&]page=)\\d+/i,'$1'+p);}else if(/[?&]page=\\{page\\}/i.test(u)){u=u.replace(/([?&]page=)\\{page\\}/i,'$1'+p);}else if(/-\\{page\\}(?=$|[?#])/i.test(u)){u=u.replace(/-\\{page\\}(?=$|[?#])/i,'-'+p);}else{u=u.replace(/-(\\d+)(?=$|[?#])/,'-'+p);}window.location.href=u;})(this)">确定 {/case} @@ -678,7 +678,7 @@ + onclick="(function(btn){var wrap=btn.parentNode;var inp=wrap.querySelector('input');var max=parseInt(wrap.getAttribute('data-pages')||1);var p=parseInt(inp.value||1);var u='{:$first_url ?? '#'}';p=Math.max(1,Math.min(max,p));if(!u||u==='#'){return;}if(/[?&]page=\\d+/i.test(u)){u=u.replace(/([?&]page=)\\d+/i,'$1'+p);}else if(/[?&]page=\\{page\\}/i.test(u)){u=u.replace(/([?&]page=)\\{page\\}/i,'$1'+p);}else if(/-\\{page\\}(?=$|[?#])/i.test(u)){u=u.replace(/-\\{page\\}(?=$|[?#])/i,'-'+p);}else{u=u.replace(/-(\\d+)(?=$|[?#])/,'-'+p);}window.location.href=u;})(this)">确定 {/case} @@ -758,7 +758,7 @@ + onclick="(function(btn){var wrap=btn.parentNode;var inp=wrap.querySelector('input');var max=parseInt(wrap.getAttribute('data-pages')||1);var p=parseInt(inp.value||1);var u='{:$first_url ?? '#'}';p=Math.max(1,Math.min(max,p));if(!u||u==='#'){return;}if(/[?&]page=\\d+/i.test(u)){u=u.replace(/([?&]page=)\\d+/i,'$1'+p);}else if(/[?&]page=\\{page\\}/i.test(u)){u=u.replace(/([?&]page=)\\{page\\}/i,'$1'+p);}else if(/-\\{page\\}(?=$|[?#])/i.test(u)){u=u.replace(/-\\{page\\}(?=$|[?#])/i,'-'+p);}else{u=u.replace(/-(\\d+)(?=$|[?#])/,'-'+p);}window.location.href=u;})(this)">确定 {/case} @@ -834,4 +834,4 @@ {/default} -{/switch} \ No newline at end of file +{/switch} diff --git a/code/app/home/view/videoGpt1/module/pager/pager_numeric.html b/code/app/home/view/videoGpt1/module/pager/pager_numeric.html index aca1acc..f82c50c 100644 --- a/code/app/home/view/videoGpt1/module/pager/pager_numeric.html +++ b/code/app/home/view/videoGpt1/module/pager/pager_numeric.html @@ -327,7 +327,7 @@ + onclick="(function(btn){var wrap=btn.parentNode;var inp=wrap.querySelector('input');var max=parseInt(wrap.getAttribute('data-pages')||1);var p=parseInt(inp.value||1);var u='{:$first_urll ?? '#'}';p=Math.max(1,Math.min(max,p));if(!u||u==='#'){return;}if(/[?&]page=\\d+/i.test(u)){u=u.replace(/([?&]page=)\\d+/i,'$1'+p);}else if(/[?&]page=\\{page\\}/i.test(u)){u=u.replace(/([?&]page=)\\{page\\}/i,'$1'+p);}else if(/-\\{page\\}(?=$|[?#])/i.test(u)){u=u.replace(/-\\{page\\}(?=$|[?#])/i,'-'+p);}else{u=u.replace(/-(\\d+)(?=$|[?#])/,'-'+p);}window.location.href=u;})(this)">确定 @@ -745,7 +745,7 @@ + onclick="(function(btn){var wrap=btn.parentNode;var inp=wrap.querySelector('input');var max=parseInt(wrap.getAttribute('data-pages')||1);var p=parseInt(inp.value||1);var u='{:$first_urll ?? '#'}';p=Math.max(1,Math.min(max,p));if(!u||u==='#'){return;}if(/[?&]page=\\d+/i.test(u)){u=u.replace(/([?&]page=)\\d+/i,'$1'+p);}else if(/[?&]page=\\{page\\}/i.test(u)){u=u.replace(/([?&]page=)\\{page\\}/i,'$1'+p);}else if(/-\\{page\\}(?=$|[?#])/i.test(u)){u=u.replace(/-\\{page\\}(?=$|[?#])/i,'-'+p);}else{u=u.replace(/-(\\d+)(?=$|[?#])/,'-'+p);}window.location.href=u;})(this)">确定 @@ -875,4 +875,4 @@ {/default} -{/switch} \ No newline at end of file +{/switch} diff --git a/code/app/home/view/videoGpt1/public/video-list-phb.html b/code/app/home/view/videoGpt1/public/video-list-phb.html index 771b647..60532d5 100644 --- a/code/app/home/view/videoGpt1/public/video-list-phb.html +++ b/code/app/home/view/videoGpt1/public/video-list-phb.html @@ -4,7 +4,7 @@ {if !empty($arrGrm[$key + [start]])} {$arrGrm[$key+[start]]|raw} {/if} -

- {$Video.v_name} diff --git a/code/app/home/view/videoGpt1/public/video-list-text.html b/code/app/home/view/videoGpt1/public/video-list-text.html index 105882b..1f97561 100644 --- a/code/app/home/view/videoGpt1/public/video-list-text.html +++ b/code/app/home/view/videoGpt1/public/video-list-text.html @@ -4,7 +4,7 @@ {$arrGrm[$key+[start]]|raw} {/if} {$Video.v_name} diff --git a/code/app/home/view/videoGpt1/video/getCategory.html b/code/app/home/view/videoGpt1/video/getCategory.html index 23f5a74..e3ebc78 100644 --- a/code/app/home/view/videoGpt1/video/getCategory.html +++ b/code/app/home/view/videoGpt1/video/getCategory.html @@ -36,7 +36,7 @@ {// 社交媒体标签} - + {switch $Request.route.strParentCategory } {case 'dian-ying' } @@ -64,27 +64,13 @@ "@context": "https://schema.org", "@type": "CollectionPage", "name": "{$DomainModel->d_name} - 最新{site:getval code="strVideoParentCategoryName" /}推荐", - "url": "https://{$DomainModel->d_domain}", + "url": "https://{$DomainModel->d_domain}{site:vclurl parent_category="$Request.route.strParentCategory" category="$Request.route.strCategory" page="$Request.route.intPage" /}", "description": "{site:seotkd code="description" page="category_list" /}", "potentialAction": { "@type": "SearchAction", "target": 'https://{$DomainModel->d_domain}{site:vsurl key="search_term_string" p="1"/}", "query-input": "required name=search_term_string" } - "hasPart": [ - {volist name="resData.data" id="Video" key="key"} - {if $key < 5 } - { - "@type": "VideoObject", - "name": "{$Video.v_name}", - "description": "{$Video.v_description}", - "thumbnailUrl": '{$Video.v_pic}', - "uploadDate": "{:date('Y-m-d')}", - "url": 'https://{$DomainModel->d_domain}{site:vurl v_id="$Video.v_id" v_py="$Video.v_name_en"/}', - }, - {/if} - {/volist} - ] }, { "@context": "https://schema.org", @@ -109,7 +95,7 @@ "item": "https://{$DomainModel->d_domain}{site:vclurl parent_category="$Request.route.strParentCategory" category="$Request.route.strCategory" page="$Request.route.intPage"}" } ] - }, + } ] @@ -130,6 +116,16 @@ {include file="module/list/shell/_shell_router" /} + {video:seocopy scene="category_list" + parent_category="$Request.route.strParentCategory" + category="$Request.route.strCategory" + 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} $pagerArr = $resData['p_data']['pager'] ?? []; @@ -144,4 +140,4 @@ -{/block} \ No newline at end of file +{/block} diff --git a/code/app/home/view/videoGpt1/video/getCategoryType.html b/code/app/home/view/videoGpt1/video/getCategoryType.html index ce65807..681d1c8 100644 --- a/code/app/home/view/videoGpt1/video/getCategoryType.html +++ b/code/app/home/view/videoGpt1/video/getCategoryType.html @@ -14,9 +14,9 @@ - - - + + + {switch $Request.route.strParentCategory } {case 'dian-ying' } @@ -39,37 +39,17 @@ {/block} @@ -170,6 +150,10 @@ {/video:categorytype} + {video:seocopy scene="category_index" + parent_category="$Request.route.strParentCategory" + export_name="seoCopy" /} + {include file="module/seo_copy/collection" /} @@ -178,4 +162,4 @@ {block name="customize"} -{/block} \ No newline at end of file +{/block} diff --git a/code/app/home/view/videoGpt1/video/getMap.html b/code/app/home/view/videoGpt1/video/getMap.html index da9bd45..d95dc31 100644 --- a/code/app/home/view/videoGpt1/video/getMap.html +++ b/code/app/home/view/videoGpt1/video/getMap.html @@ -11,6 +11,15 @@ {block name="head"} + + + + + + + + + {/block} @@ -44,4 +53,4 @@ {/block} {block name="customize"} -{/block} \ No newline at end of file +{/block} diff --git a/code/app/home/view/videoGpt1/video/getRankIndex.html b/code/app/home/view/videoGpt1/video/getRankIndex.html index 08ac495..b022f40 100644 --- a/code/app/home/view/videoGpt1/video/getRankIndex.html +++ b/code/app/home/view/videoGpt1/video/getRankIndex.html @@ -5,20 +5,28 @@ {/block} {block name="title"}{site:seotkd code="title" page="rank_index" /}{/block} -{block name="keywords"}{site:seotkd code="keywords" page="rank_index" /}{/block} +{block name="keywords"}{php} + $strRankKeywords = trim((string)($DomainModel->d_keywords ?: $DomainModel->d_name)); + $strRankKeywords = $strRankKeywords !== '' + ? $strRankKeywords . ',热门榜单,视频排行' + : trim((string)$DomainModel->d_name) . ',热门榜单,视频排行'; +{/php}{$strRankKeywords}{/block} {block name="description"}{site:seotkd code="description" page="rank_index" /}{/block} {block name="head"} +{php} + $strRankCanonicalUrl = 'https://' . $DomainModel->d_domain . $strRankUrlTemp; +{/php} - + {// 社交媒体标签} - - + + @@ -105,6 +95,9 @@ {include file="module/list/shell/_shell_router" /} {/foreach} + + {video:seocopy scene="rank_index" export_name="seoCopy" /} + {include file="module/seo_copy/collection" /} {/block} @@ -113,4 +106,4 @@ {block name="customize"} -{/block} \ No newline at end of file +{/block} diff --git a/code/app/home/view/videoGpt1/video/getRankList.html b/code/app/home/view/videoGpt1/video/getRankList.html index 7e139e6..364dae9 100644 --- a/code/app/home/view/videoGpt1/video/getRankList.html +++ b/code/app/home/view/videoGpt1/video/getRankList.html @@ -12,19 +12,35 @@ p_val="page_data" button_num="10" cache_life="3600" export_name="arrVideoRankLis {site:grm page_code="h5_rank_list_type" diff="$Request.route.intPage" num="100" g_key="arrGrm" /} {site:helper func="initVideoRankListTKD" /} +{php} + $strRankListKeywordsBase = trim((string)($DomainModel->d_keywords ?: $DomainModel->d_name)); + $strRankListKeywordsOrder = trim((string)($strOrderName ?? '热门')); + $strRankListKeywords = $strRankListKeywordsBase !== '' + ? $strRankListKeywordsBase . ',' . $strRankListKeywordsOrder . '榜单,视频排行' + : trim((string)$DomainModel->d_name) . ',' . $strRankListKeywordsOrder . '榜单,视频排行'; + + $strRankListDescCategory = trim((string)(\app\model\ConverterMovel::getVal('strVideoParentCategoryName') ?? '影视')); + if ($strRankListDescCategory === '') { + $strRankListDescCategory = '影视'; + } + $strRankListDescOrder = $strRankListKeywordsOrder !== '' ? $strRankListKeywordsOrder : '热门'; + $strRankListDescription = trim((string)$DomainModel->d_name) . '整理' . $strRankListDescOrder . $strRankListDescCategory . '榜单入口,方便继续查看热度内容、详情页与播放页。'; +{/php} {/block} {block name="title"}{site:seotkd code="title" page="rank_list" /}{/block} -{block name="keywords"}{site:seotkd code="title" page="rank_list" /}{/block} -{block name="description"}{site:seotkd code="title" page="rank_list" /}{/block} +{block name="keywords"}{$strRankListKeywords}{/block} +{block name="description"}{$strRankListDescription}{/block} {block name="head"} + + {// 社交媒体标签} - - + + @@ -35,30 +51,14 @@ p_val="page_data" button_num="10" cache_life="3600" export_name="arrVideoRankLis "@context": "https://schema.org", "@type": "CollectionPage", "name": "{$DomainModel->d_name} - 最新排行榜推荐", - "url": "https://{$DomainModel->d_domain}", + "url": "https://{$DomainModel->d_domain}{site:vrlurl parent_category="$Request.route.strParentCategory" category="$Request.route.strCategory" sort_type="$Request.route.strSortType" page="1"/}", "headline": '{site:seotkd code="title" page="rank_list" /}', - "description": '{site:seotkd code="title" page="rank_list" /}', + "description": '{$strRankListDescription}', "potentialAction": { "@type": "SearchAction", "target": 'https://{$DomainModel->d_domain}{site:vsurl key="search_term_string" p="1"/}", "query-input": "required name=search_term_string" } - "hasPart": [ - {volist name="arrVideoRankList" id="Video" key="key"} - - {if $key < 10 } - { - "@type": "VideoObject", - "name": "{$Video.v_name}", - "description": "{$Video.v_description}", - "thumbnailUrl": '{$Video.v_pic}', - "uploadDate": "{:date('Y-m-d')}", - "url": 'https://{$DomainModel->d_domain}{site:vurl v_id='$vo.v_id' v_py='$vo.v_name_en'/}', - }, - {/if} - {/volist} - - ] }, { "@context": "https://schema.org", @@ -83,7 +83,7 @@ p_val="page_data" button_num="10" cache_life="3600" export_name="arrVideoRankLis "item": "https://{$DomainModel->d_domain}{site:vrlurl parent_category="$Request.route.strParentCategory" category="$Request.route.strCategory" sort_type="$Request.route.strSortType" page="1"/}" } ] - }, + } ] @@ -129,6 +129,17 @@ p_val="page_data" button_num="10" cache_life="3600" export_name="arrVideoRankLis

{site:replace code="VIDEO@GETVIDEORANKLIST@TEXT"}

+ {video:seocopy scene="rank_list" + sort_type="$Request.route.strSortType" + parent_category="$Request.route.strParentCategory" + category="$Request.route.strCategory" + page="1" + total="0" + pages="1" + visible="$arrVideoRankList|count" + export_name="seoCopy" /} + {include file="module/seo_copy/collection" /} +
@@ -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 @@