ttrss/mobile/tt-rss.php

133 lines
2.8 KiB
PHP
Raw Normal View History

<?php
error_reporting(E_ERROR | E_WARNING | E_PARSE);
2006-05-23 07:07:38 +02:00
require_once "../config.php";
2006-03-27 04:46:22 +02:00
require_once "functions.php";
2006-05-23 07:07:38 +02:00
require_once "../functions.php";
2006-03-24 11:00:57 +01:00
require_once "../sessions.php";
require_once "../version.php";
require_once "../config.php";
require_once "../db-prefs.php";
$link = db_connect(DB_HOST, DB_USER, DB_PASS, DB_NAME);
2006-03-27 04:46:22 +02:00
init_connection($link);
2007-08-26 12:51:17 +02:00
login_sequence($link, true);
2006-03-27 04:46:22 +02: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 06:37:06 +02:00
} else {
if ($_COOKIE["ttrss_vf_uclps"] != 1) {
setcookie("ttrss_vf_uclps", 1);
} else {
setcookie("ttrss_vf_uclps", 0);
}
}
2006-03-27 06:37:06 +02:00
header("Location: tt-rss.php");
return;
}
2006-03-27 10:59:48 +02:00
$ts_id = db_escape_string($_GET["ts"]);
if ($go == "vf" && $ts_id) {
toggleMarked($link, $ts_id);
2006-03-27 10:59:48 +02:00
$query_string = preg_replace("/&ts=[0-9]*/", "", $_SERVER["QUERY_STRING"]);
header("Location: tt-rss.php?$query_string");
return;
}
$tp_id = db_escape_string($_GET["tp"]);
if ($go == "vf" && $tp_id) {
togglePublished($link, $tp_id);
$query_string = preg_replace("/&tp=[0-9]*/", "", $_SERVER["QUERY_STRING"]);
header("Location: tt-rss.php?$query_string");
return;
}
$sop = db_escape_string($_GET["sop"]);
if ($sop && $go == "view") {
$a_id = db_escape_string($_GET["id"]);
if ($a_id) {
if ($sop == "tp") {
togglePublished($link, $a_id);
}
if ($sop == "ts") {
toggleMarked($link, $a_id);
}
$query_string = preg_replace("/&sop=t[sp]/", "", $_SERVER["QUERY_STRING"]);
header("Location: tt-rss.php?$query_string");
}
}
2006-03-24 11:00:57 +01:00
?>
<html>
<head>
<title>Tiny Tiny RSS - Mobile</title>
<link rel="stylesheet" type="text/css" href="mobile.css">
2006-03-27 05:44:43 +02:00
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<script type="text/javascript" src="tt-rss.js"></script>
<?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 11:00:57 +01:00
</head>
<body id="ttrssMobile">
2006-03-24 11:00:57 +01:00
2006-03-27 05:10:46 +02:00
<div id="content">
<?php
if (!$go) {
2006-03-27 04:46:22 +02:00
render_feeds_list($link);
2006-03-27 05:44:43 +02:00
} else if ($go == "vf") {
render_headlines($link);
} else if ($go == "view") {
render_article($link);
2007-06-08 09:01:42 +02:00
} else if ($go == "sform") {
render_search_form($link, $_GET["aid"], $_GET["ic"]);
2006-03-27 05:10:46 +02:00
} else {
print __("Internal error: Function not implemented");
2006-03-27 04:46:22 +02:00
}
?>
2006-03-27 05:10:46 +02:00
</div>
<?php if (!$go) { ?>
2006-03-27 05:10:46 +02:00
<div id="footer">
2008-08-08 07:08:38 +02:00
<a href="http://tt-rss.spb.ru/">Tiny-Tiny RSS</a>
<?php if (!defined('HIDE_VERSION')) { ?>
v<?php echo VERSION ?>
<?php } ?>
&copy; 2005-2008 Andrew Dolgov
2006-03-27 05:10:46 +02:00
</div>
2006-03-27 04:46:22 +02:00
<?php } ?>
2006-03-24 11:00:57 +01:00
</body>
</html>