<?php
//用户在线时间

truncatetable('common_onlinetime');

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

while ($t = $xc->db['source']->fetch_assoc($query)) {

	$t = daddslashes(array_change_key_case($t));
	//pre_common_onlinetime
	$uid			=	$t['uid'];
	$thismonth		=	$t['thismonth'];
	$total			=	$t['total'];
	$lastupdate		=	timetounix($t['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 ++;
}

?>
