<?php
/*
pre_common_onlinetime
*/

if($start <= 1) {
	truncatetable('common_onlinetime');
}

$query = $xc->db['source']->query("SELECT * FROM {$source_tablepre}onlinetime")
	or die("检索数据表 '{$source_tablepre}onlinetime' 错误！请将表 '{$source_tablepre}onlinetime' 字段类型为 nText 的改为 Text 类型。");

while($o = $xc->db['source']->fetch_array($query)) {
	$o = daddslashes(array_change_key_case($o));

	$uid		=	$o['uid'];
	$thismonth	=	$o['thismonth'];
	$total		=	$o['total'];
	$lastupdate	=	timetounix($o['lastupdate']);

	$fields1 = array('uid', 'thismonth', 'total', 'lastupdate');
	$query1 = getinsertsql("{$discuz_tablepre}common_onlinetime", $fields1);

	if ($xc->db['discuz']->query($query1)) {
		$convertedrows ++;
	} else {
		reportlog("插入在线时间出错 uid = $uid");
	}
	$totalrows ++;

}
?>