1. 程式人生 > 實用技巧 >deatoon針對head.html新增360智慧摘要程式碼【僅限show頁面】

deatoon針對head.html新增360智慧摘要程式碼【僅限show頁面】

在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>