示例#1
0
require ROOT . '/library/preprocessor.php';
requireStrictRoute();
set_time_limit(60);
?>
<!DOCTYPE html>
<html>
<head profile="http://gmpg.org/xfn/11">
	<meta charset="utf-8">
	<title>OPML Uploading</title>
</head>
<body>
	<script type="text/javascript">
		//<![CDATA[
<?php 
if ($xml = @file_get_contents($_FILES['opmlFile']['tmp_name'])) {
    list($status, $result) = importOPMLFromFile($blogid, $xml);
    if ($status == 0) {
        if ($result['total'] == 1) {
            ?>
					var str = "<?php 
            echo _f('하나의 피드를 가져왔습니다.\\n피드를 업데이트 해 주십시오.', $result['total']);
            ?>
";
<?php 
        } else {
            ?>
					var str = "<?php 
            echo _f('%1개의 피드를 가져왔습니다.\\n피드를 업데이트 해 주십시오.', $result['total']);
            ?>
";
<?php 
示例#2
0
function importOPMLFromURL($blogid, $url)
{
    global $database, $service;
    $request = new HTTPRequest($url);
    if (!$request->send()) {
        return array('error' => 1);
    }
    $result = importOPMLFromFile($blogid, $request->responseText);
    if ($result[0] == 0) {
        return array('error' => 0, 'total' => $result[1]['total'], 'success' => $result[1]['success']);
    } else {
        return array('error' => $result[0] + 1);
    }
}