首页 > Web开发 > 详细

deatoon针对head.html添加360智能摘要代码【仅限show页面】

时间:2020-08-09 16:30:25      阅读:80      评论:0      收藏:0      [点我收藏+]

在api文件夹下extend.func.php的添加代码:

//判断页面url
function py_show($name) {
    $str=$_SERVER[REQUEST_URI];
      return strpos($str,$name);
}

在head.html中添加智能摘要代码:

{if py_show(show)}
{if $moduleid == 5 || $moduleid == 16}
<meta property="og:type" content="product"/>
<meta property="og:image" content="{$albums[0]}"/>
<meta property="og:title" content="{$title}"/>
<meta property="og:description" content="{$head_description}"/>
<meta property="og:product:price" content="{php echo $price+mt_rand(10,50)}"/>
<meta property="og:product:orgprice" content="{$price}"/>
<meta property="og:product:currency" content="CNY"/>
<meta property="og:product:score" content="9.{php echo mt_rand(0,9)}"/>
<meta property="og:product:base_score" content="10"/>
<meta property="og:product:brand" content="{$brand}"/>
<meta property="og:product:category" content="{$CAT[catname]}"/>
<meta property="og:product:nick" content="name={$item[company]}; url= https://www.fykou.com/com/{$username}/"/>
{elseif $moduleid == 21}
<meta property="og:type" content="article"/>
<meta property="og:image" content="{$thumb}"/>
<meta property="og:release_date" content="{date(‘Y-m-d H:i:s‘, $addtime)}"/>
<meta property="og:title" content="{$title}"/>
<meta property="og:description" content="{$head_description}"/>
{elseif $moduleid == 12}
<meta property="og:type" content="image"/>
<meta property="og:image" content="{$thumb}"/>
{elseif $moduleid == 14}
<meta property="og:type" content="video"/>
<meta property="og:title" content="{$title}"/>
<meta property="og:description" content="{$head_description}"/>
<meta property="og:image" content="{$thumb}"/>
<meta property="og:video" content="{$video_s}"/>
<meta property="og:url" content="{$DT_URL}"/>
<meta property="og:video:release_date" content="{date(‘Y-m-d H:i:s‘, $addtime)}"/>
<meta property="og:video:update_date" content="{date(‘Y-m-d H:i:s‘, time())}"/>
{/if}
{/if}

实现效果参考:https://www.fykou.com/supply/show-2987.html

查看源代码可得出效果为:

<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html;charset=UTF-8" />
<meta http-equiv="x-ua-compatible" content="IE=edge" />
<meta http-equiv="Cache-Control" content="no-transform" />
<meta http-equiv="Cache-Control" content="no-siteapp" />
<meta name="applicable-device"content="pc">
<link rel="canonical" href="https://www.fykou.com/supply/show-2987.html" />
<meta name="mobile-agent" content="format=html5;url=http://m.fykou.com/supply/show-2987.html">
<meta name="mobile-agent" content="format=xhtml;url=http://m.fykou.com/supply/show-2987.html">
<title>南宁圆柱子模板 - 供应 - 方圆网</title>
<meta name="keywords" content="南宁圆柱子模板" />
<meta name="description" content="供应南宁圆柱子模板,方圆网圆柱子模板栏目下,涵盖南宁圆柱子模板的价格、品牌、厂家等信息,  讲求策略,重视营销人才,或许源于从前高毛利率、低竞争的市场状态,使圆柱模板行业较少注重营销策略,但对于现今激烈的市场" />
<meta http-equiv="mobile-agent" content="format=html5;url=http://m.fykou.com/supply/show-2987.html">
<link rel="shortcut icon" type="image/x-icon" href="https://www.fykou.com/favicon.ico" />
<link rel="bookmark" type="image/x-icon" href="https://www.fykou.com/favicon.ico" />
<link rel="archives" title="方圆网" href="https://www.fykou.com/archiver/" />
<link rel="stylesheet" href="https://www.fykou.com/skin/st06h/css/muban.css" type="text/css" />
<link rel="stylesheet" href="https://www.fykou.com/skin/st06h/css/muban-indexh.css" type="text/css" />
<link rel="stylesheet" href="https://www.fykou.com/skin/st06h/style.css" type="text/css" />
<link rel="stylesheet" type="text/css" href="https://www.fykou.com/skin/st06h/sell.css" /><!--[if lte IE 6]>
<link rel="stylesheet" type="text/css" href="https://www.fykou.com/skin/st06h/ie6.css" />
<![endif]-->
<meta property="og:type" content="product"/>
<meta property="og:image" content="https://www.fykou.com/file/upload/202006/29/170922100.jpg.middle.jpg"/>
<meta property="og:title" content="南宁圆柱子模板"/>
<meta property="og:description" content="供应南宁圆柱子模板,方圆网圆柱子模板栏目下,涵盖南宁圆柱子模板的价格、品牌、厂家等信息,  讲求策略,重视营销人才,或许源于从前高毛利率、低竞争的市场状态,使圆柱模板行业较少注重营销策略,但对于现今激烈的市场"/>
<meta property="og:product:price" content="203"/>
<meta property="og:product:orgprice" content="158.00"/>
<meta property="og:product:currency" content="CNY"/>
<meta property="og:product:score" content="9.5"/>
<meta property="og:product:base_score" content="10"/>
<meta property="og:product:brand" content="方圆建筑模具"/>
<meta property="og:product:category" content="圆柱子模板"/>
<meta property="og:product:nick" content="name=贵阳圆柱模板直供厂家; url= https://www.fykou.com/com/gyyzmb/"/>
<script type="text/javascript">window.onerror=function(){return true;}</script><script type="text/javascript" src="https://www.fykou.com/lang/zh-cn/lang.js"></script>
<script type="text/javascript" src="https://www.fykou.com/file/script/config.js"></script>
<script type="text/javascript" src="https://www.fykou.com/skin/st06h/js/jquery-1.11.1.min.js"></script>
<!--[if (gte IE 10)|!(IE)]><!-->
<script type="text/javascript" src="https://www.fykou.com/file/script/jquery-2.1.1.min.js"></script>
<!--<![endif]-->
<script type="text/javascript" src="https://www.fykou.com/file/script/common.js"></script>
<script type="text/javascript" src="https://www.fykou.com/skin/st06h/js/page.js"></script>
<script type="text/javascript" src="https://www.fykou.com/skin/st06h/js/superslide.2.1.js"></script>
<script type="text/javascript">
GoMobile(http://m.fykou.com/supply/show-2987.html);
var searchid = 5;
document.oncontextmenu=function(e){return false;};
document.onselectstart=function(e){return false;};
window.onerror=function(){return true;} 
</script>
</head>

 

deatoon针对head.html添加360智能摘要代码【仅限show页面】

原文:https://www.cnblogs.com/fymuban/p/13463191.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!