标签归档:zblog添加关键词

给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} 继续阅读