<?php\r
class Article extends Handler {\r
- \r
- function index() {\r
+\r
+ function redirect() {\r
$id = db_escape_string($_REQUEST['id']);\r
- \r
+\r
$result = db_query($this->link, "SELECT link FROM ttrss_entries, ttrss_user_entries\r
WHERE id = '$id' AND id = ref_id AND owner_uid = '".$_SESSION['uid']."'\r
LIMIT 1");\r
- \r
+\r
if (db_num_rows($result) == 1) {\r
$article_url = db_fetch_result($result, 0, 'link');\r
$article_url = str_replace("\n", "", $article_url);\r
- \r
+\r
header("Location: $article_url");\r
return;\r
- \r
+\r
} else {\r
print_error(__("Article not found."));\r
}\r
$cids = explode(",", db_escape_string($_REQUEST["cids"]));\r
$mode = db_escape_string($_REQUEST["mode"]);\r
$omode = db_escape_string($_REQUEST["omode"]);\r
- \r
+\r
// in prefetch mode we only output requested cids, main article\r
// just gets marked as read (it already exists in client cache)\r
- \r
+\r
$articles = array();\r
- \r
+\r
if ($mode == "") {\r
array_push($articles, format_article($this->link, $id, false));\r
} else if ($mode == "zoom") {\r
header("Content-Type: text/html");\r
print '<link rel="stylesheet" type="text/css" href="tt-rss.css"/>';\r
}\r
- \r
+\r
$article = format_article($this->link, $id, false);\r
print $article['content'];\r
return;\r
}\r
- \r
+\r
catchupArticleById($this->link, $id, 0);\r
- \r
+\r
if (!$_SESSION["bw_limit"]) {\r
foreach ($cids as $cid) {\r
if ($cid) {\r
}\r
}\r
}\r
- \r
+\r
print json_encode($articles);\r
- \r
+\r
}\r
- \r
-}
\ No newline at end of file
+\r
+}\r
var d = new Date();
var ts = d.getTime();
- var w = window.open('backend.php?op=loading', 'ttrss_tweet',
+ var w = window.open('backend.php?op=backend&method=loading', 'ttrss_tweet',
"status=0,toolbar=0,location=0,width=500,height=400,scrollbars=1,menubar=0");
new Ajax.Request("backend.php", {
function openArticleInNewWindow(id) {
toggleUnread(id, 0, false);
- window.open("backend.php?op=article&id=" + id);
+ window.open("backend.php?op=article&method=redirect&id=" + id);
}
function isCdmMode() {
var d = new Date();
var ts = d.getTime();
- var w = window.open('backend.php?op=loading', 'ttrss_tweet',
+ var w = window.open('backend.php?op=backend&method=loading', 'ttrss_tweet',
"status=0,toolbar=0,location=0,width=500,height=400,scrollbars=1,menubar=0");
new Ajax.Request("backend.php", {