}
		foreach($allindexs as $k){
			if(strlen($keywords)>=50) break;
			else if(!in_array($k,$titleindexs)) $keywords .= $k." ";
	  }
	}
	$sp->Clear();
	unset($sp);
	$keywords = preg_replace("/#p#|#e#/","",$keywords);
	$keywords = addslashes($keywords);
}

//自动分页
$sptype = (empty($sptype) ? '' : $sptype);
if($sptype=="auto"){
	$body = SpLongBody($body,$spsize*1024,"#p#分页标题#e#");
}

//自动获取缩略图
if($autolitpic==1 && $litpic==''){
  $litpic = GetDDImgFromBody($body);
}

$body = addslashes($body);
if($keywords!="") $keywords = trim(cn_substr($keywords,60))." ";
$adminID = $cuserLogin->getUserID();

$dsql = new DedeSql(false);
$cts = GetChannelTable($dsql,$channelid);
$arcID = GetIndexKey($dsql,$typeid,$channelid);
			$addquery = ' where '.implode(' and ', $where);
		}else{
			$addquery = '';
		}
		$fquery = "Select aid,$rpfield From $addtable $addquery $limitSql ;";

		$dsql->SetQuery($fquery);
		$dsql->Execute();
		while($row=$dsql->GetArray())
		{
			$tjnum++;
			$body = $row[$rpfield];
			$aid = $row['aid'];
			if(strlen($body) < $cfg_arcautosp_size*1024) continue;
			if(!preg_match("/#p#/iU",$body)){
				$body = SpLongBody($body,$cfg_arcautosp_size*1024,"#p#分页标题#e#");
				$body = addslashes($body);
				$dsql->ExecuteNoneQuery("Update $addtable set $rpfield='$body' where aid='$aid' ; ");
			}
		}
	}//end if limit

	//返回进度提示
	if($totalnum>0) $tjlen = ceil( ($tjnum/$totalnum) * 100 );
	else $tjlen=100;

	$dvlen = $tjlen * 2;

	$tjsta = "<div style='width:200;height:15;border:1px solid #898989;text-align:left'><div style='width:$dvlen;height:15;background-color:#829D83'></div></div>";
	$tjsta .= "<br/>完成处理文档总数的:$tjlen %,继续执行任务...";