www.gusucode.com > Tatter Tools 0.961 SE GB2312 简体中文版 > upload/admin/reader_opml_import.php

    <?
	include("../inc_global.php");
	include("../inc_function.php");

	check_authority();

	if ($mode == "import") {

		if ($opmlurl) {
			list($st, $header, $body, $lmdate, $xmlinfo) = xml_parser($opmlurl,"");
		} else {
			if (!$opmlfile) $opmlfile = $_FILES["opmlfile"][tmp_name];
			if (@move_uploaded_file($opmlfile, $r_root_path."opmlbuf")) {
				$fvalue = trim(implode("", file($r_root_path."opmlbuf")));
				$xmlinfo = tt_xml_parser_into_struct($fvalue);
			}
		}

		if ($xmlinfo) {

			foreach ($xmlinfo as $k => $row) {

				if ($row[attributes][XMLURL]) {

					$surl = $row[attributes][XMLURL];
					$stitle = $row[attributes][TEXT];
					$slink = $row[attributes][HTMLURL];
					$sdesc = $row[attributes][DESCRIPTION];

					$sql = "select count(*) from t3_".$dbid."_rss where xml_url = '".trim($surl)."'";
					list ($cnt) = mysql_fetch_array(mysql_query($sql));

					if ($cnt) continue;

					put_query("
						insert into t3_".$dbid."_rss (
							xml_url, title, link, description, regdate, is_sync
						) values (
							'$surl', '$stitle', '$slink', '$sdesc', '0', '0'
						)
					");
				}

			}

			@unlink($r_root_path."opmlbuf");

			?>
			<script type="text/javascript">
				alert('OPML恢复到初始状态完毕!\t');
				opener.location.reload();
				window.close();
			</script>
			<?
			exit;

		} else {
			error_process("02B3");
		}
	}

	admin_pop_header("if (opml_import.r1[0].checked) { document.all.d1.style.display='block'; document.all.d2.style.display='none'; } else { document.all.d1.style.display='none'; document.all.d2.style.display='block'; }");
?>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=GB2312">
<meta name="keywords" content="TT,TatterTools,Skin,php">
<meta name="description" content="Meyu,梦游,华人中文网">
<meta name="generator" content="TatterTools中文BLOG">
<meta name="MSSmartTagsPreventParsing" content="TRUE">
<meta http-equiv="MSThemeCompatible" content="Yes">
</head>
	<table width=100% style=margin-bottom:3;margin-top:6>
	<form method=post enctype=multipart/form-data name=opml_import action="<?=$PHP_SELF?>">
	<input type=hidden name=temp>
	<input type=hidden name=mode value="import">
	<tr>
	<td width=24 align=right><img src=../images/num_33.gif height=17></td>
	<td width=9><img src=../images/ver_01.gif width=9 height=17></td>
	<td><img src=../images/cap_33.gif height=17></td>
	</tr></table>

	<? print_content_line(); ?>

	<table class=content_back1 cellpadding=0 cellspacing=0 width=100%><tr>
	<td style=padding-top:10;padding-bottom:10>

	<div style=padding-left:15;padding-bottom:10>
	<input type=radio name=r1 value=1 checked onclick="document.getElementById('d1').style.display='block'; document.getElementById('d2').style.display='none';">颇老俊辑 啊廉坷扁
	<input type=radio name=r1 value=2 onclick="document.getElementById('d1').style.display='none'; document.getElementById('d2').style.display='block';"> 牢磐齿 惑狼 林家 涝仿窍扁
	</div>

	<? input_block() ?>

	<div id=d1>
	<table height=30 style=margin-top:10><tr>
	<td style=padding-left:20>本地路径 :: </td>
	<td><input type=file class=text size=42 name=opmlfile></td>
	</tr></table>
	</div>

	<div id=d2 style=display:none>
	<table height=30 style=margin-top:10><tr>
	<td style=padding-left:20>远程导入 :: </td>
	<td><input type=text class=text name=opmlurl style=width:350></td>
	</tr></table>
	</div>

	</td>
	</tr></table>

	<? print_content_line(); ?>

	<table cellpadding=0 cellspacing=0 width=100%><tr>
	<td height=35 align=right style=padding-right:13><img class=ib src=../images/b_import.gif width=68 height=17 onclick="opml_import.submit();" style=margin-right:5><img class=ib src=../images/b_close.gif width=53 height=17 onclick="window.close();"></td>
	</tr></form></table>

<?	admin_pop_footer(); ?>