27
4006-5666-83
当前位置:首页 > 资讯 > 建站知识

基于discuz在线分词批量优化Dedecms文章关键词

2011-12-22 酷站科技

 根据discuz线上词性标注大批量优化Dedecms文章关键字

dedecms自身内置tag(keywords)获取作用(北京市网站制作),但词性标注一直不足精准。自然,针对日升级十数篇且对seo精准实行的客户而言,手工制作键入能更强的操纵(高档网站建设)。但针对主题风格较为广泛、內容升级量大的客户而言,dede split是并不大极致的。

  discuz线上词性标注是一个免费在线的提词插口。后有数十万中文论坛、supsite客户,针对情境、体细胞词典的健全有大量的数据信息。 这一微信小程序是根据discuz线上词性标注批量更新已发內容的keywords(tag),假如信息量大(超过五万)的或是云虚拟主机客户得话,最好是自然环境搭到当地。速率会快一点。

  操作方法,cms安装文件,在建c.php,拷入以下几点,自身相匹配编号用notepad设定相对gbk或utf8。运作 yourwebsite/c.php?id=1

<?php
require_once(dirname(__FILE__).”/include/common.inc.php”);

$id = isset($id) && is_numeric($id) ? $id : 0;

for ($a=$id; $a<$id 10; $a ){

 $row = $dsql->GetOne(” SELECT arc.title,tp.body FROM `@__archives` arc LEFT JOIN `@__addonarticle` tp ON arc.id=tp.aid where arc.id=’$a’ “);
 if(is_array($row))
 {
  $title = $row['title'];
  $body = $row['body'];
  $keywords=zhgetkey($title.$body);
  $dsql->ExecuteNoneQuery(” Update `@__archives` set keywords=’$keywords’ where id=’$a’ “);
  echo $a.’:’.$keywords.’<br />’;
 }
}
 
 if ($a>80000){break;}

echo “<script>”;
echo “setTimeout(”location.replace(‘c.php?id=$a’)”,0)”;
echo “</script>”;

function zhgetkey($content s){
$rows = strip_tags($contents);
$arr = array(‘ ‘,’ ‘,”s”, “rn”, “n”, “r”, “t”, “>”, ““”, “””,”<br />”);
$qc_rows = str_replace($arr, ”, $rows);
if(strlen($qc_rows)>2400){
$qc_rows = substr($qc_rows, ’0′, ’2400′);
}
$data = @implode(”, file(“http://keyword.discuz.com/related_kw.html?title=$qc_rows&ics=gbk&ocs=gbk”));
preg_match_all(“/<kw>(.*)A[(.*)]](.*)></kw>/”,$data, $out, PREG_SET_ORDER);
$key=”";
for($i=0;$i<5;$i ){
$key=$key.$out[$i][2];
if($out[$i][2])$key=$key.”,”;
}
return $key;
}

function cutstr_html($string, $sublen)   

 {

  $string = strip_tags($string);

  $string = preg_replace (‘/n/is’, ”, $string);

  $string = preg_replace (‘/ | /is’, ”, $string);

  $string = preg_replace (‘/&nbsp;/is’, ”, $string);

    preg_match_all(“/[x01-x7f]|[xc2-xdf][x80-xbf]|xe0[xa0-xbf][x80-xbf]|[xe1-xef][x80-xbf][x80-xbf]|xf0[x90-xbf][x80-xbf][x80-xbf]|[xf1-xf7][x80-xbf][x80-xbf][x80-xbf]/”, $string, $t_string);  

  if(count($t_string[0]) – 0 > $sublen) $string = join(”, array_slice($t_string[0], 0, $sublen)).”…”;  

  else $string = join(”, array_slice($t_string[0], 0, $sublen));

    return $string;

 }

?>

来源于申明:以上内容一部分(包括照片、文本)来自互联网,若有侵权行为,请立即与本网站联络(010-57218159)。
如没特殊注明,文章均为酷站科技原创,转载请注明来自http://www.bjkuzhan.com/jianzhanzhishi/4822.html
联系专业的商务顾问,制定方案,专业设计,一对一咨询及其报价详情
服务热线服务热线 4006-5666-83
联系我们 contact us
4006-5666-83
400-6566-683 — 海淀营业部
400-6566-683 — 昌平营业部
+

酷站科技为你提供上门/网站策略方案

留下联系方式,我们将会在一个工作日内与你联系

隐私条款信息保护中,请放心填写