<?php
/*
日志分类：pre_home_class
*/
if($start <= 1) {
	truncatetable('home_class');
}

$maxdtid = $xc->db['source']->result($xc->db['source']->query("SELECT max(dtid) FROM {$source_tablepre}diarytype"), 0);
if($start < $maxdtid) {
	$converted = 1;
}

$query = $xc->db['source']->query("SELECT * FROM {$source_tablepre}diarytype WHERE dtid >= $start AND dtid < $start + $rpp") or dexit();
while ($dtype = $xc->db['source']->fetch_array($query)) {
	$dtype = daddslashes($dtype);

	$classid	=	$dtype['dtid'];
	$classname	=	$dtype['name'];
	$uid		=	$dtype['uid'];
	$dateline	=	time();

	$field1 = array('classid', 'classname', 'uid', 'dateline');
	$query1 = getinsertsql("{$discuz_tablepre}home_class", $field1);

	if ($xc->db['discuz']->query($query1)) {
		$convertedrows ++;
	} else {
		reportlog("无法转换日志记录 classid = $classid ，SQL 语句如下 ：<br><textarea rows=\"3\" style=\"width: 100%;\">".$query1."</textarea>");
	}
	$converted = 1;
	$totalrows ++;
}
?>
