1
0
mirror of https://git.tt-rss.org/git/tt-rss.git synced 2025-12-13 17:35:56 +00:00

implement sharing articles by unique url

This commit is contained in:
Andrew Dolgov
2011-10-04 13:11:07 +04:00
parent 359fc686dd
commit 83cd33fcec
11 changed files with 136 additions and 8 deletions

View File

@@ -59,7 +59,7 @@
}
if (!($_SESSION["uid"] && validate_session($link)) && $op != "globalUpdateFeeds" &&
$op != "rss" && $op != "getUnread" && $op != "getProfiles" &&
$op != "rss" && $op != "getUnread" && $op != "getProfiles" && $op != "share" &&
$op != "fbexport" && $op != "logout" && $op != "pubsub") {
if ($op == 'pref-feeds' && $_REQUEST['subop'] == 'add') {
@@ -633,6 +633,28 @@
}
break; // fbexport
case "share":
$uuid = db_escape_string($_REQUEST["key"]);
$result = db_query($link, "SELECT ref_id, owner_uid FROM ttrss_user_entries WHERE
uuid = '$uuid'");
if (db_num_rows($result) != 0) {
header("Content-Type: text/html");
$id = db_fetch_result($result, 0, "ref_id");
$owner_uid = db_fetch_result($result, 0, "owner_uid");
$article = format_article($link, $id, false, true);
print_r($article['content']);
} else {
print "Article not found.";
}
break;
default:
header("Content-Type: text/plain");
print json_encode(array("error" => array("code" => 7)));