debug
This commit is contained in:
@@ -215,6 +215,14 @@ class SiteStyle
|
||||
// 页面规则
|
||||
$homePage = self::buildHomePageCfg($seed);
|
||||
$categoryIndexPage = self::buildCategoryIndexPageCfg($seed);
|
||||
$categoryHomePage = [
|
||||
// 3 套母型:A / B / C
|
||||
'family' => ['A', 'B', 'C'][$seed % 3],
|
||||
|
||||
// 每套母型 10 个子变体(0–9)
|
||||
'variant' => ($seed >> 4) % 10,
|
||||
];
|
||||
|
||||
$categoryPage = self::buildCategoryPageCfg($seed);
|
||||
$categoryListPage = self::buildCategoryListPageCfg($seed);
|
||||
$searchPage = self::buildSearchPageCfg($seed);
|
||||
@@ -297,6 +305,7 @@ class SiteStyle
|
||||
|
||||
'pages' => [
|
||||
'home' => $homePage,
|
||||
'category_home' => $categoryHomePage,
|
||||
'category_index' => $categoryIndexPage,
|
||||
'category' => $categoryPage,
|
||||
'category_list' => $categoryListPage,
|
||||
@@ -484,6 +493,8 @@ class SiteStyle
|
||||
"seowords/layout/layout_" . $cfg['pages']['detail']['seowords']['layout'] . ".css",
|
||||
"pinlun/_pinlun_layout_" . $cfg['pages']['detail']['pinlun']['layout'] . ".css",
|
||||
|
||||
"category/category_home/family_" . $cfg['pages']['category_home']['family'] . ".css",
|
||||
|
||||
"banner/banner_" . sprintf('%02d', $tpl['banner_tpl']) . ".css",
|
||||
"list/list_" . sprintf('%02d', $tpl['list_tpl']) . ".css",
|
||||
"detail/detail_" . sprintf('%02d', $tpl['detail_tpl']) . ".css",
|
||||
|
||||
@@ -20,83 +20,6 @@ class SeoRenderer
|
||||
// $this->pool = SiteStyle::SEO_POOL[$poolId]['seo_phrase'] ?? [];
|
||||
}
|
||||
|
||||
/**
|
||||
* 只负责:选一条模板
|
||||
*/
|
||||
// public function getTemplate(string $field, string $strPage): string
|
||||
// {
|
||||
|
||||
// // 1️⃣ 取当前字段 + 页面类型的文案池
|
||||
// $phrases = loadSeoFile(
|
||||
// $this->cfg['pool_id'],
|
||||
// $strPage,
|
||||
// $field
|
||||
// );
|
||||
|
||||
// if (!$phrases) {
|
||||
// return '';
|
||||
// }
|
||||
|
||||
// // 2️⃣ 冻结的 slot
|
||||
// $slot = $this->cfg['phrase_pick'][$strPage][$field] ?? 0;
|
||||
|
||||
// // slot 是二维
|
||||
// if (isset($phrases[$slot]) && is_array($phrases[$slot])) {
|
||||
// $list = $phrases[$slot];
|
||||
// } else {
|
||||
// $list = $phrases;
|
||||
// }
|
||||
|
||||
// // 3️⃣ 稳定消费 index(不受扩容影响)
|
||||
// $len = $this->cfg['slot_len'][$strPage][$field] ?? count($list);
|
||||
// $len = max(1, min($len, count($list)));
|
||||
|
||||
// // $idx = abs(crc32(
|
||||
// // Request::pathinfo() ?: Request::host()
|
||||
// // )) % $len;
|
||||
// $idx = $this->cfg['phrase_idx'][$strPage][$field] ?? 0;
|
||||
// return $list[$idx] ?? '';
|
||||
|
||||
|
||||
// return $list[$idx] ?? '';
|
||||
// }
|
||||
// public function getTemplate(string $field, string $strPage): string
|
||||
// {
|
||||
// if (empty($this->cfg['pool_id'])) {
|
||||
// return '';
|
||||
// }
|
||||
|
||||
// // 1️⃣ 加载运行期文案池(不冻结)
|
||||
// $phrases = loadSeoFile(
|
||||
// $this->cfg['pool_id'],
|
||||
// $strPage,
|
||||
// $field
|
||||
// );
|
||||
|
||||
// if (!$phrases || !is_array($phrases)) {
|
||||
// return '';
|
||||
// }
|
||||
|
||||
// // 2️⃣ 冻结 slot
|
||||
// $slot = $this->cfg['phrase_pick'][$strPage][$field] ?? 0;
|
||||
|
||||
// if (isset($phrases[$slot]) && is_array($phrases[$slot])) {
|
||||
// $list = $phrases[$slot];
|
||||
// } else {
|
||||
// // 兜底:当成单 slot
|
||||
// $list = $phrases;
|
||||
// }
|
||||
|
||||
// if (!$list) {
|
||||
// return '';
|
||||
// }
|
||||
|
||||
// // 3️⃣ 冻结 idx(核心)
|
||||
// $idx = $this->cfg['phrase_idx'][$strPage][$field] ?? 0;
|
||||
|
||||
// return $list[$idx] ?? '';
|
||||
// }
|
||||
|
||||
|
||||
public function getTemplate(string $field, string $strPage): string
|
||||
{
|
||||
|
||||
@@ -48,7 +48,7 @@
|
||||
{include file="module/list/title/_title_router" /}
|
||||
{assign name="listCfg" value="$TpStyle.template_cfg.list_layout.lunli"}
|
||||
{assign name="limit" value="$listCfg.layout['max_items']"}
|
||||
{video:listexp count="$limit" v_parent_category_en="dian-ying"
|
||||
{video:listexp count="$limit"
|
||||
v_category_en="lun-li-pian" d_key="key" d_val="Video" cache_life="3600"
|
||||
export_name="__LIST__" /}
|
||||
{include file="module/list/shell/_shell_router" /}
|
||||
|
||||
@@ -0,0 +1,58 @@
|
||||
<div class="ch-a v{$TpStyle.template_cfg.pages.category_home.variant}">
|
||||
|
||||
<div class="breadcrumb">
|
||||
<a href="/">{$DomainModel->d_name}</a> > 分类导航
|
||||
</div>
|
||||
|
||||
{video:categorytype category_type="ONE" d_key="key" d_val="val"}
|
||||
<section class="cat-box">
|
||||
|
||||
<header class="cat-hd">
|
||||
{if $TpStyle.template_cfg.pages.category_home.variant < 5}
|
||||
<h2>{$val.v_category}</h2>
|
||||
{elseif $TpStyle.template_cfg.pages.category_home.variant < 10 /}
|
||||
<h2>{$val.v_category}分类</h2>
|
||||
{elseif $TpStyle.template_cfg.pages.category_home.variant < 15 /}
|
||||
<h3>{$val.v_category}频道</h3>
|
||||
{else /}
|
||||
<h3>{$val.v_category}类型导航</h3>
|
||||
{/if}
|
||||
|
||||
{if $TpStyle.template_cfg.pages.category_home.variant < 10}
|
||||
<a class="more"
|
||||
href="{site:vciurl parent_category="$val.v_category_en" /}">
|
||||
更多
|
||||
</a>
|
||||
{/if}
|
||||
</header>
|
||||
|
||||
{if in_array($TpStyle.template_cfg.pages.category_home.variant,[2,5,9,13,17])}
|
||||
<p class="intro">
|
||||
提供{$val.v_category}相关热门分类,持续更新。
|
||||
</p>
|
||||
{/if}
|
||||
|
||||
<ul class="cat-list">
|
||||
{if $TpStyle.template_cfg.pages.category_home.variant % 2 == 0}
|
||||
{foreach $val.children as $child}
|
||||
<li>
|
||||
<a href="{site:vclurl parent_category="$val.v_category_en" category="$child.v_category_en" page="1"}">
|
||||
{$child.v_category}
|
||||
</a>
|
||||
</li>
|
||||
{/foreach}
|
||||
{else /}
|
||||
{foreach array_reverse($val.children) as $child}
|
||||
<li>
|
||||
<a href="{site:vclurl parent_category="$val.v_category_en" category="$child.v_category_en" page="1"}">
|
||||
{$child.v_category}
|
||||
</a>
|
||||
</li>
|
||||
{/foreach}
|
||||
{/if}
|
||||
</ul>
|
||||
|
||||
</section>
|
||||
{/video:categorytype}
|
||||
|
||||
</div>
|
||||
@@ -0,0 +1,40 @@
|
||||
<div class="ch-b v{$TpStyle.template_cfg.pages.category_home.variant}">
|
||||
|
||||
{video:categorytype category_type="ONE" d_key="key" d_val="val"}
|
||||
<section class="cat-channel">
|
||||
|
||||
<header class="channel-hd">
|
||||
{if $TpStyle.template_cfg.pages.category_home.variant < 10}
|
||||
<h2>{$val.v_category}频道</h2>
|
||||
{else /}
|
||||
<h3>{$val.v_category}内容分类</h3>
|
||||
{/if}
|
||||
|
||||
{if in_array($TpStyle.template_cfg.pages.category_home.variant,[1,6,11,16])}
|
||||
<p class="desc">
|
||||
汇集{$val.v_category}下的热门类型,便于快速查找。
|
||||
</p>
|
||||
{/if}
|
||||
</header>
|
||||
|
||||
<div class="channel-grid">
|
||||
{foreach $val.children as $child}
|
||||
<a class="channel-card"
|
||||
href="{site:vclurl parent_category="$val.v_category_en" category="$child.v_category_en" page="1"}">
|
||||
<span>{$child.v_category}</span>
|
||||
</a>
|
||||
{/foreach}
|
||||
</div>
|
||||
|
||||
{if $TpStyle.template_cfg.pages.category_home.variant >= 10}
|
||||
<div class="channel-more">
|
||||
<a href="{site:vciurl parent_category="$val.v_category_en" /}">
|
||||
查看{$val.v_category}全部分类
|
||||
</a>
|
||||
</div>
|
||||
{/if}
|
||||
|
||||
</section>
|
||||
{/video:categorytype}
|
||||
|
||||
</div>
|
||||
@@ -0,0 +1,31 @@
|
||||
<div class="ch-c v{$TpStyle.template_cfg.pages.category_home.variant}">
|
||||
|
||||
{video:categorytype category_type="ONE" d_key="key" d_val="val"}
|
||||
<article class="cat-article">
|
||||
|
||||
{if $TpStyle.template_cfg.pages.category_home.variant < 7}
|
||||
<h2>{$val.v_category}分类导航</h2>
|
||||
{elseif $TpStyle.template_cfg.pages.category_home.variant < 14 /}
|
||||
<h3>{$val.v_category}内容索引</h3>
|
||||
{else /}
|
||||
<h3>{$val.v_category}类型入口</h3>
|
||||
{/if}
|
||||
|
||||
{if !in_array($TpStyle.template_cfg.pages.category_home.variant,[4,9,16])}
|
||||
<p class="intro">
|
||||
本页整理{$val.v_category}相关的多个细分类型,方便浏览与筛选。
|
||||
</p>
|
||||
{/if}
|
||||
|
||||
<nav class="cat-nav">
|
||||
{foreach $val.children as $child}
|
||||
<a href="{site:vclurl parent_category="$val.v_category_en" category="$child.v_category_en" page="1"}">
|
||||
{$child.v_category}
|
||||
</a>
|
||||
{/foreach}
|
||||
</nav>
|
||||
|
||||
</article>
|
||||
{/video:categorytype}
|
||||
|
||||
</div>
|
||||
@@ -19,7 +19,7 @@
|
||||
<title>
|
||||
<?php echo html_entity_decode($Video['v_name'], ENT_QUOTES | ENT_XML1, 'UTF-8'); ?> {$Video.v_remarks}
|
||||
</title>
|
||||
<link>https://{$DomainModel->d_domain}{site:vurl v_id='$vo.v_id' v_py='$vo.v_name_en'/}</link>
|
||||
<link>https://{$DomainModel->d_domain}{site:vurl v_id='$Video.v_id' v_py='$Video.v_name_en'/}</link>
|
||||
<author>
|
||||
{volist name='$Video.v_actor' id='vo' key='index'}
|
||||
{$vo} ,
|
||||
|
||||
@@ -9,7 +9,7 @@ sort_type="news"
|
||||
d_key="d_key" d_val="Video" cache_life="86400"}
|
||||
|
||||
<sitemap>
|
||||
<loc>https://www.{$DomainModel->d_domain}{site:vurl v_id='$vo.v_id' v_py='$vo.v_name_en'/}</loc>
|
||||
<loc>https://www.{$DomainModel->d_domain}{site:vurl v_id='$Video.v_id' v_py='$Video.v_name_en'/}</loc>
|
||||
<lastmod>{$Video.v_publish_date}</lastmod>
|
||||
</sitemap>
|
||||
|
||||
|
||||
@@ -1,88 +1,17 @@
|
||||
{extend name="base" /}
|
||||
|
||||
{block name="get-data"}
|
||||
{video:pagerexp page="$Request.get.page" limit="12"
|
||||
key="$Request.get.keyword"
|
||||
d_key="d_key"
|
||||
d_val="Video"
|
||||
p_val="page_data" button_num="5" cache_life="3600" func="generateSearchPager" export_name="resData" /}
|
||||
{site:grm page_code="h5_video_search" diff="0" num="30" g_key="arrGrm" /}
|
||||
|
||||
{/block}
|
||||
|
||||
|
||||
{block name="title"}{site:replace code="VIDEO@GETSEARCHVIDEO@TITLE"}{/block}
|
||||
{block name="keywords"}{site:replace code="VIDEO@GETSEARCHVIDEO@KEYWORDS"}{/block}
|
||||
{block name="description"}{site:replace code="VIDEO@GETSEARCHVIDEO@DESCRIPTION"}{/block}
|
||||
{block name="title"}{site:seotkd code="title" page="category_home" /}{/block}
|
||||
{block name="keywords"}{site:seotkd code="keywords" page="category_home" /}{/block}
|
||||
{block name="description"}{site:seotkd code="description" page="category_home" /}{/block}
|
||||
|
||||
|
||||
{block name="head"}
|
||||
<meta property="og:title" content='{site:replace code="VIDEO@GETSEARCHVIDEO@TITLE"}'>
|
||||
<meta property="og:description" content='{site:replace code="VIDEO@GETSEARCHVIDEO@DESCRIPTION"}'>
|
||||
<meta property="og:url" content='https://{$DomainModel->d_domain}{site:vsurl key="search_term_string" p="1"/}'>
|
||||
<meta property="og:type" content="website">
|
||||
<meta property="og:site_name" content='{$DomainModel->d_name}'>
|
||||
<meta name="twitter:card" content="summary_large_image">
|
||||
<meta name="twitter:title" content='{site:replace code="VIDEO@GETSEARCHVIDEO@TITLE"}'>
|
||||
<meta name="twitter:description" content='{site:replace code="VIDEO@GETSEARCHVIDEO@DESCRIPTION"}'>
|
||||
<meta name="twitter:image:alt" content="动作电影 搜索结果第1页">
|
||||
|
||||
{// 结构化数据}
|
||||
<script type="application/ld+json">
|
||||
[
|
||||
{
|
||||
"@type": "WebSite",
|
||||
"name": "{$DomainModel->d_name}",
|
||||
"url": "https://{$DomainModel->d_domain}",
|
||||
"alternateName": "{$DomainModel->d_domain}",
|
||||
"description": "{site:replace code="VIDEO@INDEX@INDEX@DESCRIPTION"}",
|
||||
"potentialAction": {
|
||||
"@type": "SearchAction",
|
||||
"target": 'https://{$DomainModel->d_domain}{site:vsurl key="search_term_string" p="1"/}',
|
||||
"query-input": "required name=search_term_string"
|
||||
}
|
||||
|
||||
},
|
||||
{
|
||||
"@type": "CollectionPage",
|
||||
"name": "{$DomainModel->d_name} - {$DomainModel->d_logo_text}",
|
||||
"url": "https://{$DomainModel->d_domain}",
|
||||
"alternateName": "{$DomainModel->d_domain}",
|
||||
"description": '{site:replace code="VIDEO@GETSEARCHVIDEO@DESCRIPTION"}',
|
||||
"mainEntity": {
|
||||
"@type": "ItemList",
|
||||
"itemListElement": [
|
||||
{volist name="resData.data" id="Video" key="key"}
|
||||
{if $key < 5 }
|
||||
{
|
||||
"@type": "ListItem",
|
||||
"position": {$key},
|
||||
"item": {
|
||||
"@type": "Movies",
|
||||
"name": "{$Video.v_name}",
|
||||
"url": 'https://{$DomainModel->d_domain}{site:vurl v_id='$vo.v_id' v_py='$vo.v_name_en'/}',
|
||||
"description": "{$Video.v_description}",
|
||||
"actor": [
|
||||
{foreach $Video.v_actor as $strActorKey=>$strActor }
|
||||
{if $strActorKey < 5 }
|
||||
{ "@type": "Person", "name": "{$strActor}" },
|
||||
{/if}
|
||||
{/foreach}
|
||||
],
|
||||
"numberOfEpisodes": {$Video.v_play_url|count},
|
||||
"image": "{$Video.v_pic}",
|
||||
"aggregateRating": {
|
||||
"@type": "AggregateRating",
|
||||
"ratingValue": "{$Video.v_score}",
|
||||
}
|
||||
}
|
||||
},
|
||||
{/if}
|
||||
{/volist}
|
||||
]
|
||||
}
|
||||
}
|
||||
]
|
||||
</script>
|
||||
{/block}
|
||||
|
||||
|
||||
@@ -96,49 +25,21 @@ p_val="page_data" button_num="5" cache_life="3600" func="generateSearchPager" ex
|
||||
|
||||
{block name="main"}
|
||||
|
||||
<div class="container">
|
||||
<div class=" layout-box top-weizhi hidden-xs">
|
||||
<label>当前位置:</label>
|
||||
<a href="/">{$DomainModel->d_name}</a><i>></i><a href="/sitemap.html">网站地图</a>
|
||||
</div>
|
||||
{switch name="TpStyle.template_cfg.pages.category_home.family"}
|
||||
|
||||
{video:categorytype category_type="ONE" d_key="key" d_val="val"}
|
||||
<div class=" layout-box">
|
||||
<div class="box-title">
|
||||
<!-- <span class="title-lb"></span> -->
|
||||
<h2>
|
||||
<a class=" font16" href='{site:vciurl parent_category="$val.v_category_en" /}'>{$val.v_category}</a>
|
||||
</h2>
|
||||
<a class=" box-more pull-right" href='{site:vciurl parent_category="$val.v_category_en" /}' title="{$val.v_category}">
|
||||
<span class=" iconfont icon-weizhi"></span>
|
||||
更多
|
||||
<i>>
|
||||
</i>
|
||||
</a>
|
||||
</div>
|
||||
{case value="A"}
|
||||
{include file="module/category/category_home/family_A" /}
|
||||
{/case}
|
||||
|
||||
<div class=" sitemap">
|
||||
<ul class=" clearfix">
|
||||
<li class=" title"><span class=" text-color">类型</span></li>
|
||||
{foreach $val.children as $intChildrenKey=>$arrChildrenCategory }
|
||||
<li>
|
||||
<a target="_blank"
|
||||
href='{site:vclurl parent_category="$Request.route.strParentCategory" category="$arrChildrenCategory.v_category_en" area="all" lang="all" year="all" order="all" page="1"}'
|
||||
title="{$arrChildrenCategory.v_category}">
|
||||
{$arrChildrenCategory.v_category}
|
||||
</a>
|
||||
</li>
|
||||
{/foreach}
|
||||
|
||||
</ul>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
||||
{/video:categorytype}
|
||||
{case value="B"}
|
||||
{include file="module/category/category_home/family_B" /}
|
||||
{/case}
|
||||
|
||||
|
||||
</div>
|
||||
{case value="C"}
|
||||
{include file="module/category/category_home/family_C" /}
|
||||
{/case}
|
||||
|
||||
{/switch}
|
||||
|
||||
{/block}
|
||||
{block name="customize"}
|
||||
|
||||
@@ -653,11 +653,22 @@ class VideoService
|
||||
|
||||
// 更新值
|
||||
$arrAllVideoClass = StaticConfig::getVideoCategoryFilter();
|
||||
$strNCategory = $arrAllVideoClass[$strVCategoryEn];
|
||||
//$strNCategory = $arrAllVideoClass[$strVCategoryEn];
|
||||
$strNCategory = ($strVCategoryEn === 'all' || !isset($arrAllVideoClass[$strVCategoryEn]))
|
||||
? ''
|
||||
: $arrAllVideoClass[$strVCategoryEn];
|
||||
|
||||
|
||||
ConverterMovel::setVal([
|
||||
'intPage' => $intPage,
|
||||
'strVideoParentCategoryName' => empty($strVParentCategory) || $strVParentCategory == 'all' ? '' : StaticConfig::$arrVideoClass[$strVParentCategory],
|
||||
'strVideoParentCategoryName' =>
|
||||
empty($strVParentCategory)
|
||||
|| $strVParentCategory === 'all'
|
||||
|| !isset(StaticConfig::$arrVideoClass[$strVParentCategory])
|
||||
? ''
|
||||
: StaticConfig::$arrVideoClass[$strVParentCategory],
|
||||
|
||||
//'strVideoParentCategoryName' => empty($strVParentCategory) || $strVParentCategory == 'all' ? '' : StaticConfig::$arrVideoClass[$strVParentCategory],
|
||||
'strVideoCategoryName' => empty($strNCategory) ? '' : str_replace("视频", "", $strNCategory),
|
||||
'strVideoStatus' => empty($strVStatus) ? '' : StaticConfig::$arrVideoStatus[$strVStatus],
|
||||
'strVideoOrder' => empty($strSortType) ? '' : StaticConfig::$arrVideoSortType[$strSortType],
|
||||
@@ -808,9 +819,9 @@ class VideoService
|
||||
|
||||
// 线路映射(可持续扩展)
|
||||
$arrMap = [
|
||||
'maotai' => '茅台',
|
||||
'douban' => '豆瓣',
|
||||
'youzhi' => '优质',
|
||||
'maotai' => '茅台资源',
|
||||
'douban' => '豆瓣资源',
|
||||
'youzhi' => '优质资源',
|
||||
'default' => '默认',
|
||||
'vip' => 'VIP线路',
|
||||
|
||||
|
||||
Reference in New Issue
Block a user