<?php
/*
tag表：pre_ucenter_tags
*/
if($start <= 1) {
	truncatetable('ucenter_tags');
}
$maxtagid = $xc->db['source']->result($xc->db['source']->query("SELECT max(tagid) FROM {$source_tablepre}tags"), 0);
if($start < $maxtagid){
	$converted = 1;
}

$query 		= $xc->db['source']->query("SELECT * FROM {$source_tablepre}tags WHERE tagid >= $start AND tagid < $start + $rpp") or dexit();
while($t 	= $xc->db['source']->fetch_array($query)) {
	$tags 		= daddslashes($tags);
	//pre_uc_tags
	$tagname 	=	$tags['tagname'];
	$appid		=	'';
	$data		=	'';
	$expiration	=	'';

	$field1		=	array('tagname','appid','data','expiration');
	$query1		=	getinsertsql("{$discuz_tablepre}ucenter_tags", $field1);

	if ($xc->db['discuz']->query($query1)) {
		$convertedrows++;
	} else {
		reportlog("插入 UC tag 数据出错, tagname = $tagname");
	}
	$totalrows ++;
	$url = 'index.php?mod=dealdata&step='.$step.'&start='.($t['tagid']+1).'&stay='.$stay.'&totalrows='.$totalrows.'&convertedrows='.$convertedrows.'&sqlfilenum='.$sqlfilenum;
	file_put_contents(XCONVERT_ROOT.'./cache/lock/progress_'.$step.".txt", $url);
}
?>