给zblog添加关键词 描述

zblogphp添加关键词、描述的方法:

{php}
if($type=='index'){
$keywords = $zbp->option['ZC_BLOG_SUBNAME'];
$description = $zbp->option['ZC_BLOG_COPYRIGHT'];
}elseif($type=='category'){
$keywords = $category->Name;
$description = $category->Intro;
}elseif($type=='article'||$type=='page'){
$aryTags = array();
foreach($article->Tags as $key){
$aryTags[] = $key->Name;
}
if(count($aryTags)>0) $keywords = implode(',',$aryTags);
$description = preg_replace('/[\r\n\s]+/', '', trim(SubStrUTF8(TransferHTML($article->Content,'[nohtml]'),100)).'...');
}
{/php}

{if isset($keywords)&&strlen($keywords)>0}
{/if}
{if isset($description)&&strlen($description)>0}
{/if}

发表评论

电子邮件地址不会被公开。 必填项已用*标注

您可以使用这些HTML标签和属性: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>