diff options
author | Andrew Dolgov <[email protected]> | 2011-12-13 10:58:30 +0400 |
---|---|---|
committer | Andrew Dolgov <[email protected]> | 2011-12-13 10:58:30 +0400 |
commit | 611efae712769e38e232478b484779d73af263db (patch) | |
tree | b1601297d750f42ca456f3b7de9673905fbc8d9c /classes/article.php | |
parent | 1f203144a278f9765da40e20f09cc653d4d8276e (diff) |
add catchall backend class
Diffstat (limited to 'classes/article.php')
-rw-r--r-- | classes/article.php | 32 |
1 files changed, 16 insertions, 16 deletions
diff --git a/classes/article.php b/classes/article.php index 98141d91e..70ecd2653 100644 --- a/classes/article.php +++ b/classes/article.php @@ -1,20 +1,20 @@ <?php
class Article extends Handler {
-
- function index() {
+
+ function redirect() {
$id = db_escape_string($_REQUEST['id']);
-
+
$result = db_query($this->link, "SELECT link FROM ttrss_entries, ttrss_user_entries
WHERE id = '$id' AND id = ref_id AND owner_uid = '".$_SESSION['uid']."'
LIMIT 1");
-
+
if (db_num_rows($result) == 1) {
$article_url = db_fetch_result($result, 0, 'link');
$article_url = str_replace("\n", "", $article_url);
-
+
header("Location: $article_url");
return;
-
+
} else {
print_error(__("Article not found."));
}
@@ -25,12 +25,12 @@ class Article extends Handler { $cids = explode(",", db_escape_string($_REQUEST["cids"]));
$mode = db_escape_string($_REQUEST["mode"]);
$omode = db_escape_string($_REQUEST["omode"]);
-
+
// in prefetch mode we only output requested cids, main article
// just gets marked as read (it already exists in client cache)
-
+
$articles = array();
-
+
if ($mode == "") {
array_push($articles, format_article($this->link, $id, false));
} else if ($mode == "zoom") {
@@ -40,14 +40,14 @@ class Article extends Handler { header("Content-Type: text/html");
print '<link rel="stylesheet" type="text/css" href="tt-rss.css"/>';
}
-
+
$article = format_article($this->link, $id, false);
print $article['content'];
return;
}
-
+
catchupArticleById($this->link, $id, 0);
-
+
if (!$_SESSION["bw_limit"]) {
foreach ($cids as $cid) {
if ($cid) {
@@ -55,9 +55,9 @@ class Article extends Handler { }
}
}
-
+
print json_encode($articles);
-
+
}
-
-}
\ No newline at end of file +
+}
|