debug-video-seowords
This commit is contained in:
@@ -281,6 +281,25 @@ $arrRoutes = [
|
||||
|
||||
],
|
||||
|
||||
/**
|
||||
* 视频详情-伪造
|
||||
* /voddetail/strVideoPinyin-1-1
|
||||
*/
|
||||
'video_info_forge' => [
|
||||
'/voddetail/:strPinyin-:intVId-:intVForgeId',
|
||||
'/vodinfo/:strPinyin-:intVId-:intVForgeId',
|
||||
'/vod/:strPinyin-:intVId-:intVForgeId',
|
||||
|
||||
'/video-info/:strPinyin-:intVId-:intVForgeId',
|
||||
'/video-detail/:strPinyin-:intVId-:intVForgeId',
|
||||
'/video/:strPinyin-:intVId-:intVForgeId',
|
||||
|
||||
'/shipin/:strPinyin-:intVId-:intVForgeId',
|
||||
'/shipin-xiangqing/:strPinyin-:intVId-:intVForgeId',
|
||||
'/shipin-neiron/:strPinyin-:intVId-:intVForgeId',
|
||||
|
||||
],
|
||||
|
||||
/**
|
||||
* 视频详情
|
||||
* /voddetail/strVideoPinyin-1
|
||||
@@ -440,6 +459,19 @@ foreach ($arrRoutes['prefixes'] as $platform => $prefixes) {
|
||||
'intPage' => '\d*', // 允许空值
|
||||
]);
|
||||
break;
|
||||
|
||||
case 'video_info_forge':
|
||||
//详情
|
||||
$strView = 'pc/getVideoInfo.html';
|
||||
if ($platform == 'h5') {
|
||||
$strView = 'video/getVideoInfo.html';
|
||||
}
|
||||
Route::get($strRoute, function () use ($strView) {
|
||||
return view($strView);
|
||||
})
|
||||
->pattern(['intVId' => '\d+', 'strPinyin' => '[\w-]+','intVForgeId' => '\d+']);
|
||||
|
||||
break;
|
||||
case 'video_info':
|
||||
//详情
|
||||
$strView = 'pc/getVideoInfo.html';
|
||||
|
||||
@@ -2,11 +2,14 @@
|
||||
|
||||
{block name="get-data"}
|
||||
|
||||
{if $Request.route.intVId}
|
||||
{if $Request.route.intVId && $Request.route.intVForgeId}
|
||||
{video:info v_id="$Request.route.intVId" v_key="arrVideo" v_fid="$Request.route.intVForgeId" /}
|
||||
{elseif $Request.route.intVId}
|
||||
{video:info v_id="$Request.route.intVId" v_key="arrVideo" /}
|
||||
{else}
|
||||
{video:info v_id="$DomainModel->info_id" n_key="arrVideo" n_forge_id="0" /}
|
||||
{video:info v_id="$DomainModel->info_id" n_key="arrVideo" /}
|
||||
{/if}
|
||||
|
||||
{site:grm page_code="h5_video_info" diff="$arrVideo.v_id" num="120" g_key="arrGrm" /}
|
||||
|
||||
{/block}
|
||||
@@ -132,6 +135,8 @@
|
||||
{/block}
|
||||
|
||||
{block name="main"}
|
||||
|
||||
|
||||
<div class="container">
|
||||
<h1 class="view-title">
|
||||
{site:replace code="VIDEO@GETVIDEOINFO@H1" diff="$arrVideo.v_id"}
|
||||
@@ -165,7 +170,6 @@
|
||||
</a>
|
||||
</div>
|
||||
|
||||
|
||||
<div class="stui-content__detail">
|
||||
<h2 class="title">
|
||||
《{$arrVideo.v_name}》<span class="score text-red">{$arrVideo.v_score}</span>
|
||||
@@ -269,6 +273,29 @@
|
||||
</div>
|
||||
</div>
|
||||
|
||||
{if !empty($arrVideo.v_seo_words)}
|
||||
<div class="stui-pannel stui-pannel-bg clearfix" id="desc">
|
||||
<div class="stui-pannel-box">
|
||||
<div class="stui-pannel_hd">
|
||||
<div class="stui-pannel__head active bottom-line clearfix">
|
||||
<h3 class="title">
|
||||
<img src="/template/videodadi/icon/icon_30.png" />相关推荐
|
||||
</h3>
|
||||
</div>
|
||||
</div>
|
||||
<div class="stui-pannel_bd">
|
||||
<p class="col-pd">
|
||||
|
||||
{volist name='$arrVideo.v_seo_words' key="index" id='SeoWords' }
|
||||
<a
|
||||
href='{site:vfurl v_id="$arrVideo.v_id" v_py="$arrVideo.v_name_en" v_fid="$index"/}'>{$SeoWords}</a>
|
||||
{/volist}
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
{/if}
|
||||
|
||||
|
||||
<div class="stui-pannel stui-pannel-bg clearfix" id="desc">
|
||||
<div class="stui-pannel-box">
|
||||
|
||||
@@ -78,6 +78,25 @@ class VideoService
|
||||
return (string)$strUrl;
|
||||
}
|
||||
|
||||
/**
|
||||
* 伪造视频
|
||||
*
|
||||
* @param integer $intVId
|
||||
* @param string $intPinYin
|
||||
* @param integer $intVForgeId
|
||||
* @return string
|
||||
*/
|
||||
public function getForgeVideoInfoUrl(int $intVId, string $intPinYin, int $intVForgeId): string
|
||||
{
|
||||
$strKey = 'FORGE_VIDEO_INFO_URL';
|
||||
$strUrl = $this->SiteContext->DomainModel->getFomartUrl($strKey, [
|
||||
'intVId' => $intVId,
|
||||
'strPinYin' => $intPinYin,
|
||||
'intVForgeId' => $intVForgeId,
|
||||
]);
|
||||
return (string)$strUrl;
|
||||
}
|
||||
|
||||
/**
|
||||
* 视频播放
|
||||
*
|
||||
@@ -678,9 +697,10 @@ class VideoService
|
||||
* 根据VId获取视频详情
|
||||
*
|
||||
* @param integer $intVId
|
||||
* @param integer|NULL $intVForgeId
|
||||
* @return void
|
||||
*/
|
||||
public function getVideoByVId(int $intVId)
|
||||
public function getVideoByVId(int $intVId, int|NULL $intVForgeId)
|
||||
{
|
||||
|
||||
// 视频详情
|
||||
@@ -690,6 +710,10 @@ class VideoService
|
||||
throw new HttpException(404, '视频不存在');
|
||||
}
|
||||
|
||||
if($intVForgeId >= 0 && !empty($arrVideo['v_seo_words'])){
|
||||
$arrVideo['v_name'] = $arrVideo['v_seo_words'][$intVForgeId-1];
|
||||
}
|
||||
|
||||
// 取前5个元素
|
||||
$strTopActor = (is_array($arrVideo['v_actor'] ?? null)) ? array_slice($arrVideo['v_actor'], 0, 5) : '';
|
||||
|
||||
|
||||
@@ -70,7 +70,7 @@ class VideoSeoLogic
|
||||
{
|
||||
try {
|
||||
|
||||
$strUrl = 'https://suggestion.baidu.com/su?wd=%s&json=1&p=3&cb=callback';
|
||||
$strUrl = 'https://suggestion.baidu.com/su?wd=%s&json=1&p=1&cb=callback';
|
||||
|
||||
$strUrl = sprintf($strUrl, $strVName);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user