<?php
function qiyeseo_thumbnail($related) {
    global $zbp;	
	$temp=mt_rand(1,4);
	$pattern="/<[img|IMG].*?src=[\'|\"](.*?(?:[\.gif|\.jpg|\.png]))[\'|\"].*?[\/]?>/";
	$content = $related->Content; 
	preg_match_all($pattern,$content,$matchContent);
	if(isset($matchContent[1][0])){
		$thumb=$matchContent[1][0]; 
	}
    return $thumb;
}
//热门标签    								
function qiyeseo_hotTags($num){    	 	  		       		  	 
    global $zbp,$str;    	   	       		 		 	 
    $str = '';    		   	      	 			 	 
    $array = $zbp->GetTagList('','',array('tag_Count'=>'DESC'),array($num),'');        		      		 		   
    foreach ($array as $key=>$tag) {    	 		 	 	     	    	 
	$i = $key;  
	 if ($zbp->Config('qiyeseo')->hottags2=="1"){ 	  			       					  
	$str .= '<li><a target="_blank" href="' .$tag->Url. '">' .$tag->Name. '（' . $tag->Count. '）</a></li>'; }
	else{
	$str .= '<li><a target="_blank" href="' .$tag->Url. '">' .$tag->Name. '</a></li>';
	}}    	 	  		     				 	 	
    return $str;      		   	     			 			
} 

function qiyeseo_article_AO(){
global $zbp,$article;
	    if($article->Type=="0"){
        echo "<script type=\"text/javascript\" src=\"1{$zbp->host}zb_users/theme/qiyeseo/style/js/lib.upload.js\"></script>";
        echo '<label for="edtTitle" class="editinputname">--https://mini.s-shot.ru/?http://封面图片</label>（封面图片包括产品封面图片和轮播图）<p class="uploadimg">
        <input name="meta_pic" id="edtTitle" type="text" class="uplod_img" style="width:60%;" value="https://mini.s-shot.ru/?http://" />
        <strong style="color: #ffffff; font-size: 14px;padding: 6px 18px 6px 18px; background: #3a6ea5;cursor: pointer;">浏览文件</strong>
        </p>';
       echo '<p><label class="editinputname">推荐属性</label>&nbsp;&nbsp;';

     echo '<input type="hidden"  name="meta_wtlb" value=""/>
     <input type="checkbox" name="meta_wtlb" value="'.htmlspecialchars('wtlb').'"';
    if ($article->Metas->wtlb == 'wtlb'){echo 'checked="checked"';}
    echo '/><span title="选择该项，在首页轮播图版块显示，图片将显示缩略图或文章中的第一张图片">轮播图</span>&nbsp;&nbsp;&nbsp;&nbsp;';
    echo '</p>';

}}
function qiyeseo_article_seo(){
         global $zbp,$article;
	     if($article->Type=="0"){
	     echo "<script type=\"text/javascript\" src=\"{$zbp->host}zb_system/script/jquery-2.2.4.min.js\"></script>";
	     echo "<script type=\"text/javascript\" src=\"{$zbp->host}zb_users/theme/qiyeseo/admin/css/common.js\"></script>";
	     echo '<div class="editmod">
       <label class="editinputname">SEO设置</span><span style="margin:0 0 0 15px ;color:#1d4c7d" id="seob" class="title">点击展开</span></label>
       <div id="seoshow" style="display:none;">
	   <input type="text" id="edtTitle" style="width:99%;margin-bottom:5px;" name="meta_hyarticletitle" value="'.htmlspecialchars($article->Metas->hyarticletitle).'" placeholder="SEO标题"/>
       <input type="text" id="edtTitle" style="width:99%;margin-bottom:5px;" name="meta_hyarticlekeywords" value="'.htmlspecialchars($article->Metas->hyarticlekeywords).'" placeholder="SEO关键词，注意：1、关键词之间用英文逗号分开；2、这里的关键词不能替代文章标签；3、设置了文章标签可以不用设置这里的关键词。"/>
       <input type="text" id="edtTitle" style="width:99%;margin-bottom:15px;" name="meta_hyarticledescription" value="'.htmlspecialchars($article->Metas->hyarticledescription).'" placeholder="SEO描述"/>
	   </div>
       </div>';
}
}
function qiyeseo_cate_seo(){
         global $zbp,$cate;
		 echo "<script type=\"text/javascript\" src=\"{$zbp->host}zb_system/script/jquery-2.2.4.min.js\"></script>";
         echo "<script type=\"text/javascript\" src=\"{$zbp->host}zb_users/theme/qiyeseo/admin/css/common.js\"></script>";
	     echo '<div class="editmod">
	    <label class="editinputname">SEO设置</span><span style="margin:0 0 0 15px ;color:#1d4c7d" id="seob" class="title">点击展开</span></label>
        <div id="seoshow" style="display:none;margin-top:10px;">
        <input type="text" id="edtTitle" style="width:99%;margin-bottom:15px;" name="meta_hycatetitle" value="'.htmlspecialchars($cate->Metas->hycatetitle).'" placeholder="SEO标题"/>
       <input type="text" id="edtTitle" style="width:99%;margin-bottom:15px;" name="meta_hycatekeywords" value="'.htmlspecialchars($cate->Metas->hycatekeywords).'" placeholder="SEO关键词"/>
       <input type="text" id="edtTitle" style="width:99%;" name="meta_hycatedescription" value="'.htmlspecialchars($cate->Metas->hycatedescription).'" placeholder="SEO描述"/>
	   </div>
       </div>';

}
function qiyeseo_cate_AO(){
         global $zbp,$cate;
	     echo '<div id="alias" class="editmod"><p><span class="title" style="margin:0 5px 0 0;">选择分类列表样式</span>';
         echo '<label>&nbsp;&nbsp;<input type="radio" name="meta_liststyle" value="1" ';
         if ($cate->Metas->liststyle == '1' ){echo 'checked="checked"';}
         echo '/>资讯列表（纯标题）</label>';
		 echo '<label>&nbsp;&nbsp;<input type="radio" name="meta_liststyle" value="2" ';
         if ($cate->Metas->liststyle == '2' ){echo 'checked="checked"';}
         echo '/>产品列表</label></div>';
}
function qiyeseo_tag_seo(){
         global $zbp,$tag;
		 echo "<script type=\"text/javascript\" src=\"{$zbp->host}zb_system/script/jquery-2.2.4.min.js\"></script>";
	     echo "<script type=\"text/javascript\" src=\"{$zbp->host}zb_users/theme/qiyeseo/admin/css/common.js\"></script>";
	     echo '<div class="editmod">
         <label class="editinputname">SEO设置</span><span style="margin:0 0 0 15px ;color:#1d4c7d" id="seob" class="title">点击展开</span></label>
	     <div id="seoshow" style="display:none;margin-top:10px;">
         <input type="text" style="width:99%;margin-bottom:15px;"  name="meta_hytagtitle" value="'.htmlspecialchars($tag->Metas->hytagtitle).'" placeholder="SEO标题"/>
         <input type="text" style="width:99%;margin-bottom:15px;"  name="meta_hytagkeywords" value="'.htmlspecialchars($tag->Metas->hytagkeywords).'" placeholder="SEO关键词"/>
         <input type="text" style="width:99%;"  name="meta_hytagdescription" value="'.htmlspecialchars($tag->Metas->hytagdescription).'" placeholder="SEO描述"/>
	  </div> </div>';
}
?>