You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
tt-rss/opml.php

46 lines
1016 B
PHTML

<?php
set_include_path(get_include_path() . PATH_SEPARATOR .
dirname(__FILE__) . "/include");
function __autoload($class) {
$file = "classes/".strtolower(basename($class)).".php";
if (file_exists($file)) {
require $file;
}
}
require_once "functions.php";
18 years ago
require_once "sessions.php";
require_once "sanity_check.php";
19 years ago
require_once "config.php";
require_once "db.php";
19 years ago
require_once "db-prefs.php";
19 years ago
$link = db_connect(DB_HOST, DB_USER, DB_PASS, DB_NAME);
19 years ago
if (!init_connection($link)) return;
$op = $_REQUEST['op'];
if ($op == "publish"){
$key = db_escape_string($_REQUEST["key"]);
$result = db_query($link, "SELECT owner_uid
FROM ttrss_access_keys WHERE
access_key = '$key' AND feed_id = 'OPML:Publish'");
if (db_num_rows($result) == 1) {
$owner_uid = db_fetch_result($result, 0, "owner_uid");
$opml = new Opml($link, $_REQUEST);
$opml->opml_export("", $owner_uid, true, false);
19 years ago
} else {
print "<error>User not found</error>";
}
19 years ago
}
db_close($link);
19 years ago
?>