<?php
//14、转换公告

truncatetable('forum_announcement');

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

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

	$id				= $a['id'];
	$author			= $a['poster'];
	$subject		= $a['title'];
	$type			= 0;
	$displayorder	= $a['displayorder'];
	$starttime		= timetounix($a['starttime']);
	$endtime		= timetounix($a['endtime']);
	$message		= $a['message'];
	$groups			= '';

	$fields1 = array('id', 'author', 'subject', 'type', 'displayorder', 'starttime', 'endtime', 'message', 'groups');
	$query1 = getinsertsql("{$discuz_tablepre}forum_announcement", $fields1);
	if ($xc->db['discuz']->query($query1)) {
		$convertedrows ++;
	} else {
		reportlog("插入 DZ 公告数据出错 id = $id subject = $subject");
	}
	$totalrows ++;
}
?>