<?php
//13、转换友情链接

truncatetable('common_friendlink');

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

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

	$id				= $f['id'];
	$displayorder	= $f['displayorder'];
	$name			= $f['name'];
	$url			= $f['url'];
	$description	= $f['note'];
	$logo			= $f['logo'];
	$type			= 2;

	$fields1		= array('id', 'displayorder', 'name', 'url', 'description', 'logo', 'type');
	$query1			= getinsertsql("{$discuz_tablepre}common_friendlink", $fields1);
	if ($xc->db['discuz']->query($query1)) {
		$convertedrows ++;
	} else {
		reportlog("插入 DZ 友情链接数据出错 id = $id name = $name");
	}
	$totalrows ++;
}

?>