2006-08-19 08:52:33 +00:00
|
|
|
<?php
|
2007-03-05 16:27:48 +00:00
|
|
|
error_reporting(E_ERROR | E_WARNING | E_PARSE);
|
|
|
|
|
2008-12-16 07:13:09 +00:00
|
|
|
define('MOBILE_VERSION', true);
|
|
|
|
|
2006-05-23 05:07:38 +00:00
|
|
|
require_once "../config.php";
|
2006-03-27 02:46:22 +00:00
|
|
|
require_once "functions.php";
|
2006-05-23 05:07:38 +00:00
|
|
|
require_once "../functions.php";
|
2006-03-24 10:00:57 +00:00
|
|
|
|
|
|
|
require_once "../sessions.php";
|
|
|
|
|
|
|
|
require_once "../version.php";
|
|
|
|
require_once "../db-prefs.php";
|
|
|
|
|
2008-12-16 06:43:49 +00:00
|
|
|
$link = db_connect(DB_HOST, DB_USER, DB_PASS, DB_NAME);
|
2006-03-27 02:46:22 +00:00
|
|
|
|
2008-11-10 05:29:19 +00:00
|
|
|
init_connection($link);
|
2007-08-26 10:51:17 +00:00
|
|
|
|
2007-03-05 16:27:48 +00:00
|
|
|
login_sequence($link, true);
|
2006-03-27 02:46:22 +00:00
|
|
|
|
2006-03-27 04:31:17 +00:00
|
|
|
/* perform various redirect-needing subops */
|
|
|
|
|
|
|
|
$subop = db_escape_string($_GET["subop"]);
|
|
|
|
$go = $_GET["go"];
|
|
|
|
|
|
|
|
if ($subop == "tc" && !$go) {
|
|
|
|
|
|
|
|
$cat_id = db_escape_string($_GET["id"]);
|
|
|
|
|
|
|
|
if ($cat_id != 0) {
|
|
|
|
db_query($link, "UPDATE ttrss_feed_categories SET
|
|
|
|
collapsed = NOT collapsed WHERE id = '$cat_id' AND owner_uid = " .
|
|
|
|
$_SESSION["uid"]);
|
2006-03-27 04:37:06 +00:00
|
|
|
} else {
|
|
|
|
if ($_COOKIE["ttrss_vf_uclps"] != 1) {
|
|
|
|
setcookie("ttrss_vf_uclps", 1);
|
|
|
|
} else {
|
|
|
|
setcookie("ttrss_vf_uclps", 0);
|
|
|
|
}
|
2006-03-27 04:31:17 +00:00
|
|
|
}
|
2006-03-27 04:37:06 +00:00
|
|
|
|
|
|
|
header("Location: tt-rss.php");
|
|
|
|
return;
|
2006-03-27 04:31:17 +00:00
|
|
|
}
|
|
|
|
|
2006-03-27 08:59:48 +00:00
|
|
|
$ts_id = db_escape_string($_GET["ts"]);
|
|
|
|
|
|
|
|
if ($go == "vf" && $ts_id) {
|
2007-12-05 06:42:18 +00:00
|
|
|
|
|
|
|
toggleMarked($link, $ts_id);
|
|
|
|
|
2006-03-27 08:59:48 +00:00
|
|
|
$query_string = preg_replace("/&ts=[0-9]*/", "", $_SERVER["QUERY_STRING"]);
|
|
|
|
header("Location: tt-rss.php?$query_string");
|
|
|
|
return;
|
|
|
|
}
|
2007-12-05 06:28:19 +00:00
|
|
|
|
|
|
|
$tp_id = db_escape_string($_GET["tp"]);
|
|
|
|
|
|
|
|
if ($go == "vf" && $tp_id) {
|
2007-12-05 06:42:18 +00:00
|
|
|
|
|
|
|
togglePublished($link, $tp_id);
|
|
|
|
|
2007-12-05 06:28:19 +00:00
|
|
|
$query_string = preg_replace("/&tp=[0-9]*/", "", $_SERVER["QUERY_STRING"]);
|
|
|
|
header("Location: tt-rss.php?$query_string");
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
2007-12-05 06:42:18 +00:00
|
|
|
$sop = db_escape_string($_GET["sop"]);
|
|
|
|
|
2009-04-30 07:23:38 +00:00
|
|
|
if ($sop) {
|
|
|
|
if ($go == "view") {
|
|
|
|
$a_id = db_escape_string($_GET["id"]);
|
|
|
|
} elseif ($go == "vf") {
|
|
|
|
$a_id = db_escape_string($_GET["aid"]);
|
|
|
|
}
|
2007-12-05 06:42:18 +00:00
|
|
|
|
|
|
|
if ($a_id) {
|
|
|
|
|
|
|
|
if ($sop == "tp") {
|
|
|
|
togglePublished($link, $a_id);
|
|
|
|
}
|
|
|
|
|
|
|
|
if ($sop == "ts") {
|
|
|
|
toggleMarked($link, $a_id);
|
|
|
|
}
|
|
|
|
|
2009-04-30 07:23:38 +00:00
|
|
|
if ($sop == "mu") {
|
|
|
|
markUnread($link, $a_id);
|
|
|
|
}
|
|
|
|
|
|
|
|
$query_string = str_replace("&sop=$sop", "", $_SERVER["QUERY_STRING"]);
|
2007-12-05 06:42:18 +00:00
|
|
|
header("Location: tt-rss.php?$query_string");
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2006-03-24 10:00:57 +00:00
|
|
|
?>
|
|
|
|
<html>
|
|
|
|
<head>
|
|
|
|
<title>Tiny Tiny RSS - Mobile</title>
|
|
|
|
<link rel="stylesheet" type="text/css" href="mobile.css">
|
2006-03-27 03:44:43 +00:00
|
|
|
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
|
2007-12-05 07:59:12 +00:00
|
|
|
<script type="text/javascript" src="tt-rss.js"></script>
|
2008-07-17 04:13:49 +00:00
|
|
|
|
|
|
|
<?php $user_css_url = get_pref($link, 'USER_STYLESHEET_URL'); ?>
|
|
|
|
<?php if ($user_css_url) { ?>
|
|
|
|
<link rel="stylesheet" type="text/css" href="<?php echo $user_css_url ?>"/>
|
|
|
|
<?php } ?>
|
2006-03-24 10:00:57 +00:00
|
|
|
</head>
|
2008-07-17 04:13:49 +00:00
|
|
|
<body id="ttrssMobile">
|
2006-03-24 10:00:57 +00:00
|
|
|
|
2006-03-27 03:10:46 +00:00
|
|
|
<div id="content">
|
2006-08-19 08:52:33 +00:00
|
|
|
<?php
|
2006-03-27 04:31:17 +00:00
|
|
|
if (!$go) {
|
2006-03-27 02:46:22 +00:00
|
|
|
render_feeds_list($link);
|
2006-03-27 03:44:43 +00:00
|
|
|
} else if ($go == "vf") {
|
|
|
|
render_headlines($link);
|
2006-03-27 04:31:17 +00:00
|
|
|
} else if ($go == "view") {
|
|
|
|
render_article($link);
|
2007-06-08 07:01:42 +00:00
|
|
|
} else if ($go == "sform") {
|
|
|
|
render_search_form($link, $_GET["aid"], $_GET["ic"]);
|
2006-03-27 03:10:46 +00:00
|
|
|
} else {
|
2007-03-05 16:27:48 +00:00
|
|
|
print __("Internal error: Function not implemented");
|
2006-03-27 02:46:22 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
?>
|
2006-03-27 03:10:46 +00:00
|
|
|
</div>
|
|
|
|
|
2008-07-25 09:31:08 +00:00
|
|
|
<?php if (!$go) { ?>
|
|
|
|
|
2006-03-27 03:10:46 +00:00
|
|
|
<div id="footer">
|
2008-12-16 06:43:49 +00:00
|
|
|
<a href="http://tt-rss.org/">Tiny-Tiny RSS</a>
|
2008-08-08 05:08:38 +00:00
|
|
|
<?php if (!defined('HIDE_VERSION')) { ?>
|
|
|
|
v<?php echo VERSION ?>
|
|
|
|
<?php } ?>
|
2009-01-17 07:28:16 +00:00
|
|
|
© 2005-2009 Andrew Dolgov
|
2006-03-27 03:10:46 +00:00
|
|
|
</div>
|
2006-03-27 02:46:22 +00:00
|
|
|
|
2008-07-25 09:31:08 +00:00
|
|
|
<?php } ?>
|
|
|
|
|
2006-03-24 10:00:57 +00:00
|
|
|
</body>
|
|
|
|
</html>
|