overall directory tree cleanup

This commit is contained in:
Andrew Dolgov 2011-12-11 23:59:25 +04:00
parent 31303c6bbd
commit 107d0cf39e
49 changed files with 285 additions and 4342 deletions

View File

@ -1,4 +1,6 @@
<?php <?php
set_include_path(get_include_path() . PATH_SEPARATOR . "include");
/* remove ill effects of magic quotes */ /* remove ill effects of magic quotes */
if (get_magic_quotes_gpc()) { if (get_magic_quotes_gpc()) {

View File

@ -1,4 +1,6 @@
<?php <?php
set_include_path(get_include_path() . PATH_SEPARATOR . "include");
require_once "functions.php"; require_once "functions.php";
require_once "sessions.php"; require_once "sessions.php";
require_once "sanity_check.php"; require_once "sanity_check.php";
@ -87,7 +89,7 @@ function confirmOP() {
} else { } else {
print_notice(__("Tiny Tiny RSS database is up to date.")); print_notice(__("Tiny Tiny RSS database is up to date."));
print "<form method=\"GET\" action=\"tt-rss.php\"> print "<form method=\"GET\" action=\"index.php\">
<input type=\"submit\" value=\"".__("Return to Tiny Tiny RSS")."\"> <input type=\"submit\" value=\"".__("Return to Tiny Tiny RSS")."\">
</form>"; </form>";
} }

View File

@ -1,4 +1,6 @@
<?php <?php
set_include_path(get_include_path() . PATH_SEPARATOR . "include");
require_once "functions.php"; require_once "functions.php";
require_once "sessions.php"; require_once "sessions.php";
require_once "sanity_check.php"; require_once "sanity_check.php";
@ -37,9 +39,9 @@
<script type="text/javascript" src="lib/scriptaculous/scriptaculous.js?load=effects,dragdrop,controls"></script> <script type="text/javascript" src="lib/scriptaculous/scriptaculous.js?load=effects,dragdrop,controls"></script>
<script type="text/javascript" src="lib/dojo/dojo.js" djConfig="parseOnLoad: true"></script> <script type="text/javascript" src="lib/dojo/dojo.js" djConfig="parseOnLoad: true"></script>
<script type="text/javascript" charset="utf-8" src="localized_js.php?<?php echo $dt_add ?>"></script> <script type="text/javascript" charset="utf-8" src="localized_js.php?<?php echo $dt_add ?>"></script>
<script type="text/javascript" charset="utf-8" src="functions.js?<?php echo $dt_add ?>"></script>
<script type="text/javascript" src="digest.js"></script> <script type="text/javascript" charset="utf-8" src="js/functions.js?<?php echo $dt_add ?>"></script>
<script type="text/javascript" src="js/digest.js"></script>
<script type="text/javascript"> <script type="text/javascript">
Event.observe(window, 'load', function() { Event.observe(window, 'load', function() {

View File

@ -1,4 +1,6 @@
<?php <?php
set_include_path(get_include_path() . PATH_SEPARATOR . "include");
require_once "functions.php"; require_once "functions.php";
$ERRORS[0] = ""; $ERRORS[0] = "";

View File

@ -1,4 +1,6 @@
<?php <?php
set_include_path(get_include_path() . PATH_SEPARATOR . "include");
require_once "config.php"; require_once "config.php";
require_once "lib/simplepie/simplepie.inc"; require_once "lib/simplepie/simplepie.inc";

View File

@ -1,5 +1,4 @@
<?php <?php
date_default_timezone_set('UTC'); date_default_timezone_set('UTC');
if (defined('E_DEPRECATED')) { if (defined('E_DEPRECATED')) {
error_reporting(E_ALL & ~E_NOTICE & ~E_DEPRECATED); error_reporting(E_ALL & ~E_NOTICE & ~E_DEPRECATED);
@ -7539,7 +7538,7 @@
case "logout": case "logout":
logout_user(); logout_user();
header("Location: tt-rss.php"); header("Location: index.php");
break; // logout break; // logout
case "fbexport": case "fbexport":

212
index.php
View File

@ -1 +1,211 @@
<?php header("Location: tt-rss.php"); ?> <?php
set_include_path(get_include_path() . PATH_SEPARATOR . "include");
require_once "functions.php";
require_once "sessions.php";
require_once "sanity_check.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);
init_connection($link);
login_sequence($link);
$dt_add = time();
no_cache_incantation();
header('Content-Type: text/html; charset=utf-8');
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html>
<head>
<title>Tiny Tiny RSS</title>
<link rel="stylesheet" type="text/css" href="lib/dijit/themes/claro/claro.css"/>
<link rel="stylesheet" type="text/css" href="tt-rss.css?<?php echo $dt_add ?>"/>
<link rel="stylesheet" type="text/css" href="cdm.css?<?php echo $dt_add ?>"/>
<?php print_theme_includes($link) ?>
<?php print_user_stylesheet($link) ?>
<link rel="shortcut icon" type="image/png" href="images/favicon.png"/>
<script type="text/javascript" src="lib/prototype.js"></script>
<script type="text/javascript" src="lib/scriptaculous/scriptaculous.js?load=effects,dragdrop,controls"></script>
<script type="text/javascript" src="lib/dojo/dojo.js"></script>
<script type="text/javascript" src="lib/dijit/dijit.js"></script>
<script type="text/javascript" src="lib/dojo/tt-rss-layer.js"></script>
<script type="text/javascript" charset="utf-8" src="localized_js.php?<?php echo $dt_add ?>"></script>
<script type="text/javascript" charset="utf-8" src="js/tt-rss.js?<?php echo $dt_add ?>"></script>
<script type="text/javascript" charset="utf-8" src="js/functions.js?<?php echo $dt_add ?>"></script>
<script type="text/javascript" charset="utf-8" src="js/feedlist.js?<?php echo $dt_add ?>"></script>
<script type="text/javascript" charset="utf-8" src="js/viewfeed.js?<?php echo $dt_add ?>"></script>
<script type="text/javascript" charset="utf-8" src="errors.php?mode=js"></script>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
<script type="text/javascript">
Event.observe(window, 'load', function() {
init();
});
</script>
</head>
<body id="ttrssMain" class="claro">
<div id="overlay" style="display : block">
<div id="overlay_inner">
<div class="insensitive"><?php echo __("Loading, please wait...") ?></div>
<div dojoType="dijit.ProgressBar" places="0" style="width : 300px" id="loading_bar"
progress="0" maximum="100">
</div>
<noscript><br/><?php print_error('Javascript is disabled. Please enable it.') ?></noscript>
</div>
</div>
<div id="header">
<?php if (!SINGLE_USER_MODE) { ?>
<?php echo __('Hello,') ?> <b><?php echo $_SESSION["name"] ?></b> |
<?php } ?>
<a href="prefs.php"><?php echo __('Preferences') ?></a>
<?php if (defined('FEEDBACK_URL') && FEEDBACK_URL) { ?>
| <a target="_blank" class="feedback" href="<?php echo FEEDBACK_URL ?>">
<?php echo __('Comments?') ?></a>
<?php } ?>
<?php if (!SINGLE_USER_MODE) { ?>
| <a href="backend.php?op=logout"><?php echo __('Logout') ?></a>
<?php } ?>
<img id="newVersionIcon" style="display:none" onclick="newVersionDlg()"
width="13" height="13"
src="<?php echo theme_image($link, 'images/new_version.png') ?>"
title="<?php echo __('New version of Tiny Tiny RSS is available!') ?>"
alt="new_version_icon"/>
</div>
<div id="hotkey_help_overlay" style="display : none" onclick="Element.hide(this)">
<?php include "help/3.php" ?>
</div>
<div id="notify" class="notify"><span id="notify_body">&nbsp;</span></div>
<div id="cmdline" style="display : none"></div>
<div id="auxDlg" style="display : none"></div>
<div id="headlines-tmp" style="display : none"></div>
<div id="main" dojoType="dijit.layout.BorderContainer">
<div id="feeds-holder" dojoType="dijit.layout.ContentPane" region="leading" style="width : 20%" splitter="true">
<div id="feedlistLoading">
<img src='images/indicator_tiny.gif'/>
<?php echo __("Loading, please wait..."); ?></div>
<div id="feedTree"></div>
</div>
<div dojoType="dijit.layout.BorderContainer" region="center" id="header-wrap" gutters="false">
<div dojoType="dijit.layout.TabContainer" region="center" id="content-tabs">
<div dojoType="dijit.layout.BorderContainer" region="center" id="content-wrap"
title="<?php echo __("News") ?>">
<div id="toolbar" dojoType="dijit.layout.ContentPane" region="top">
<div id="main-toolbar" dojoType="dijit.Toolbar">
<form id="main_toolbar_form" action="" onsubmit='return false'>
<button dojoType="dijit.form.Button" id="collapse_feeds_btn"
onclick="collapse_feedlist()"
title="<?php echo __('Collapse feedlist') ?>" style="display : inline">
&lt;&lt;</button>
<select name="view_mode" title="<?php echo __('Show articles') ?>"
onchange="viewModeChanged()"
dojoType="dijit.form.Select">
<option selected="selected" value="adaptive"><?php echo __('Adaptive') ?></option>
<option value="all_articles"><?php echo __('All Articles') ?></option>
<option value="marked"><?php echo __('Starred') ?></option>
<option value="published"><?php echo __('Published') ?></option>
<option value="unread"><?php echo __('Unread') ?></option>
<!-- <option value="noscores"><?php echo __('Ignore Scoring') ?></option> -->
<option value="updated"><?php echo __('Updated') ?></option>
</select>
<select title="<?php echo __('Sort articles') ?>"
onchange="viewModeChanged()"
dojoType="dijit.form.Select" name="order_by">
<option selected="selected" value="default"><?php echo __('Default') ?></option>
<option value="date"><?php echo __('Date') ?></option>
<option value="title"><?php echo __('Title') ?></option>
<option value="score"><?php echo __('Score') ?></option>
</select>
<button dojoType="dijit.form.Button" name="update"
onclick="scheduleFeedUpdate()">
<?php echo __('Update') ?></button>
<button dojoType="dijit.form.Button"
onclick="catchupCurrentFeed()">
<?php echo __('Mark as read') ?></button>
</form>
<div class="actionChooser">
<div dojoType="dijit.form.DropDownButton">
<span><?php echo __('Actions...') ?></span>
<div dojoType="dijit.Menu" style="display: none">
<div dojoType="dijit.MenuItem" onclick="quickMenuGo('qmcSearch')"><?php echo __('Search...') ?></div>
<div dojoType="dijit.MenuItem" disabled="1"><?php echo __('Feed actions:') ?></div>
<div dojoType="dijit.MenuItem" onclick="quickMenuGo('qmcAddFeed')"><?php echo __('Subscribe to feed...') ?></div>
<div dojoType="dijit.MenuItem" onclick="quickMenuGo('qmcEditFeed')"><?php echo __('Edit this feed...') ?></div>
<div dojoType="dijit.MenuItem" onclick="quickMenuGo('qmcRescoreFeed')"><?php echo __('Rescore feed') ?></div>
<div dojoType="dijit.MenuItem" onclick="quickMenuGo('qmcRemoveFeed')"><?php echo __('Unsubscribe') ?></div>
<div dojoType="dijit.MenuItem" disabled="1"><?php echo __('All feeds:') ?></div>
<div dojoType="dijit.MenuItem" onclick="quickMenuGo('qmcCatchupAll')"><?php echo __('Mark as read') ?></div>
<div dojoType="dijit.MenuItem" onclick="quickMenuGo('qmcShowOnlyUnread')"><?php echo __('(Un)hide read feeds') ?></div>
<div dojoType="dijit.MenuItem" disabled="1"><?php echo __('Other actions:') ?></div>
<div dojoType="dijit.MenuItem" onclick="quickMenuGo('qmcDigest')"><?php echo __('Switch to digest...') ?></div>
<div dojoType="dijit.MenuItem" onclick="quickMenuGo('qmcTagCloud')"><?php echo __('Show tag cloud...') ?></div>
<div dojoType="dijit.MenuItem" onclick="quickMenuGo('qmcTagSelect')"><?php echo __('Select by tags...') ?></div>
<div dojoType="dijit.MenuItem" onclick="quickMenuGo('qmcAddLabel')"><?php echo __('Create label...') ?></div>
<div dojoType="dijit.MenuItem" onclick="quickMenuGo('qmcAddFilter')"><?php echo __('Create filter...') ?></div>
<div dojoType="dijit.MenuItem" onclick="quickMenuGo('qmcHKhelp')"><?php echo __('Keyboard shortcuts help') ?></div>
<div dojoType="dijit.MenuItem" onclick="quickMenuGo('qmcAbout')"><?php echo __('About...') ?></div>
</div>
</div>
</div>
</div> <!-- toolbar -->
</div> <!-- toolbar pane -->
<div id="headlines-wrap-inner" dojoType="dijit.layout.BorderContainer" region="center">
<div id="headlines-toolbar" dojoType="dijit.layout.ContentPane" region="top">
</div>
<div id="headlines-frame" dojoType="dijit.layout.ContentPane"
onscroll="headlines_scroll_handler(this)" region="center">
<div id="headlinesInnerContainer">
<div class="whiteBox"><?php echo __('Loading, please wait...') ?></div>
</div>
</div>
<?php if (!get_pref($link, 'COMBINED_DISPLAY_MODE')) { ?>
<div id="content-insert" dojoType="dijit.layout.ContentPane" region="bottom"
style="height : 50%" splitter="true"></div>
<?php } ?>
</div>
</div>
</div>
</div>
</div>
<?php db_close($link); ?>
</body>
</html>

View File

@ -274,7 +274,7 @@ function gotoPreferences() {
} }
function gotoMain() { function gotoMain() {
document.location.href = "tt-rss.php"; document.location.href = "index.php";
} }
function gotoExportOpml(filename, settings) { function gotoExportOpml(filename, settings) {
@ -504,7 +504,7 @@ function fatalError(code, msg, ext_info) {
try { try {
if (code == 6) { if (code == 6) {
window.location.href = "tt-rss.php"; window.location.href = "index.php";
} else if (code == 5) { } else if (code == 5) {
window.location.href = "db-updater.php"; window.location.href = "db-updater.php";
} else { } else {

View File

@ -925,7 +925,7 @@ function init() {
try { try {
dojo.registerModulePath("lib", ".."); dojo.registerModulePath("lib", "..");
dojo.registerModulePath("fox", "../.."); dojo.registerModulePath("fox", "../../js/");
dojo.require("lib.CheckBoxTree"); dojo.require("lib.CheckBoxTree");
dojo.require("fox.PrefFeedTree"); dojo.require("fox.PrefFeedTree");

View File

@ -274,7 +274,7 @@ function genericSanityCheck() {
function init() { function init() {
try { try {
dojo.registerModulePath("fox", "../.."); dojo.registerModulePath("fox", "../../js/");
dojo.require("fox.FeedTree"); dojo.require("fox.FeedTree");

View File

@ -1,4 +1,6 @@
<?php <?php
set_include_path(get_include_path() . PATH_SEPARATOR . "include");
define('DISABLE_SESSIONS', true); define('DISABLE_SESSIONS', true);
require "functions.php"; require "functions.php";

File diff suppressed because it is too large Load Diff

View File

@ -6,13 +6,7 @@
define('MOBILE_VERSION', true); define('MOBILE_VERSION', true);
require_once "../config.php"; require_once "../config.php";
require_once "functions.php"; require_once "mobile-functions.php";
require_once "../functions.php";
require_once "../sessions.php";
require_once "../version.php";
require_once "../db-prefs.php";
$link = db_connect(DB_HOST, DB_USER, DB_PASS, DB_NAME); $link = db_connect(DB_HOST, DB_USER, DB_PASS, DB_NAME);

View File

@ -6,13 +6,7 @@
define('MOBILE_VERSION', true); define('MOBILE_VERSION', true);
require_once "../config.php"; require_once "../config.php";
require_once "functions.php"; require_once "mobile-functions.php";
require_once "../functions.php";
require_once "../sessions.php";
require_once "../version.php";
require_once "../db-prefs.php";
$link = db_connect(DB_HOST, DB_USER, DB_PASS, DB_NAME); $link = db_connect(DB_HOST, DB_USER, DB_PASS, DB_NAME);

View File

@ -1,789 +0,0 @@
<?php
define('TTRSS_SESSION_NAME', 'ttrss_m_sid');
function render_feeds_list($link) {
$tags = $_GET["tags"];
print "<div id=\"heading\">";
if ($tags) {
print __("Tags")."<span id=\"headingAddon\">
(<a href=\"index.php\">".__("View feeds")."</a>, ";
} else {
print __("Feeds")." <span id=\"headingAddon\">
(<a href=\"index.php?tags=1\">".__("View tags")."</a>, ";
}
print "<a href=\"index.php?go=sform\">".__("Search")."</a>, ";
print "<a href=\"logout.php\">".__("Logout")."</a>)</span>";
print "</div>";
print "<ul class=\"feedList\">";
$owner_uid = $_SESSION["uid"];
if (!$tags) {
/* virtual feeds */
if (get_pref($link, 'ENABLE_FEED_CATS')) {
$collapsed = get_pref($link, "_COLLAPSED_SPECIAL");
if ($collapsed == "t" || $collapsed == "1") {
$holder_class = "invisible";
$ellipsis = "...";
} else {
$holder_class = "feedCatHolder";
$ellipsis = "";
}
$tmp_category = __("Special");
print "<li class=\"feedCat\">
<a href=\"?subop=tc&id=-1\">$tmp_category</a>$ellipsis
</li>";
print "<li class=\"$holder_class\"><ul class=\"feedCatList\">";
}
foreach (array(-4, -3, -1, -2, 0) as $i) {
printMobileFeedEntry($i, "virt", false, false,
false, $link);
}
if (get_pref($link, 'ENABLE_FEED_CATS')) {
print "</ul>";
}
$result = db_query($link, "SELECT id,caption FROM
ttrss_labels2 WHERE owner_uid = '$owner_uid' ORDER by caption");
if (db_num_rows($result) > 0) {
if (get_pref($link, 'ENABLE_FEED_CATS')) {
$collapsed = get_pref($link, "_COLLAPSED_LABELS");
if ($collapsed == "t" || $collapsed == "1") {
$holder_class = "invisible";
$ellipsis = "...";
} else {
$holder_class = "feedCatHolder";
$ellipsis = "";
}
$tmp_category = __("Labels");
print "<li class=\"feedCat\">
<a href=\"?subop=tc&id=-2\">$tmp_category</a>$ellipsis
</li>";
print "<li class=\"$holder_class\"><ul class=\"feedCatList\">";
} else {
// print "<li><hr></li>";
}
}
while ($line = db_fetch_assoc($result)) {
$count = getFeedUnread($link, -$line["id"]-11);
$class = "label";
printMobileFeedEntry(-$line["id"]-11,
$class, $line["caption"], $count, false, $link);
}
if (db_num_rows($result) > 0) {
if (get_pref($link, 'ENABLE_FEED_CATS')) {
print "</ul>";
}
}
if (get_pref($link, 'ENABLE_FEED_CATS')) {
$order_by_qpart = "category,title";
} else {
$order_by_qpart = "title";
}
$result = db_query($link, "SELECT ttrss_feeds.*,
".SUBSTRING_FOR_DATE."(last_updated,1,19) AS last_updated_noms,
(SELECT COUNT(id) FROM ttrss_entries,ttrss_user_entries
WHERE feed_id = ttrss_feeds.id AND
ttrss_user_entries.ref_id = ttrss_entries.id AND
owner_uid = '$owner_uid') AS total,
(SELECT COUNT(id) FROM ttrss_entries,ttrss_user_entries
WHERE feed_id = ttrss_feeds.id AND unread = true
AND ttrss_user_entries.ref_id = ttrss_entries.id
AND owner_uid = '$owner_uid') as unread,
cat_id,last_error,
ttrss_feed_categories.title AS category,
ttrss_feed_categories.collapsed
FROM ttrss_feeds LEFT JOIN ttrss_feed_categories
ON (ttrss_feed_categories.id = cat_id)
WHERE
ttrss_feeds.owner_uid = '$owner_uid'
ORDER BY $order_by_qpart");
$actid = $_GET["actid"];
/* real feeds */
$lnum = 0;
$category = "";
while ($line = db_fetch_assoc($result)) {
if (get_pref($link, 'HIDE_READ_FEEDS') && (int)$line['unread']==0) {
continue;
}
$feed = db_unescape_string($line["title"]);
$feed_id = $line["id"];
$subop = $_GET["subop"];
$total = $line["total"];
$unread = $line["unread"];
$rtl_content = sql_bool_to_bool($line["rtl_content"]);
if ($rtl_content) {
$rtl_tag = "dir=\"RTL\"";
} else {
$rtl_tag = "";
}
$cat_id = $line["cat_id"];
$tmp_category = $line["category"];
if (!$tmp_category) {
$tmp_category = "Uncategorized";
}
// $class = ($lnum % 2) ? "even" : "odd";
if ($line["last_error"]) {
$class = "error";
} else {
$class = "feed";
}
if ($category != $tmp_category && get_pref($link, 'ENABLE_FEED_CATS')) {
if ($category) {
print "</ul></li>";
}
$category = $tmp_category;
$collapsed = $line["collapsed"];
// workaround for NULL category
if ($category == "Uncategorized") {
$collapsed = get_pref($link, "_COLLAPSED_UNCAT");
}
if ($collapsed == "t" || $collapsed == "1") {
$holder_class = "invisible";
$ellipsis = "...";
} else {
$holder_class = "feedCatHolder";
$ellipsis = "";
}
if ($cat_id) {
$cat_id_qpart = "cat_id = '$cat_id'";
} else {
$cat_id_qpart = "cat_id IS NULL";
}
$cat_id = sprintf("%d", $cat_id);
$cat_unread = getCategoryUnread($link, $cat_id);
if ($cat_unread > 0) {
$catctr_class = "";
} else {
$catctr_class = "invisible";
}
print "<li class=\"feedCat\">
<a href=\"?subop=tc&id=$cat_id\">$tmp_category</a>
<a href=\"?go=vf&id=$cat_id&cat=true\">
<span class=\"$catctr_class\">($cat_unread)$ellipsis</span>
</a></li>";
print "<li id=\"feedCatHolder\" class=\"$holder_class\">
<ul class=\"feedCatList\">";
}
printMobileFeedEntry($feed_id, $class, $feed, $unread,
false, $link, $rtl_content);
++$lnum;
}
} else {
// tags
$result = db_query($link, "SELECT tag_name,SUM((SELECT COUNT(int_id)
FROM ttrss_user_entries WHERE int_id = post_int_id
AND unread = true)) AS count FROM ttrss_tags
WHERE owner_uid = '".$_SESSION['uid']."' GROUP BY tag_name ORDER BY tag_name");
$tags = array();
while ($line = db_fetch_assoc($result)) {
$tags[$line["tag_name"]] += $line["count"];
}
foreach (array_keys($tags) as $tag) {
$unread = $tags[$tag];
$class = "tag";
printMobileFeedEntry($tag, $class, $tag, $unread,
"../images/tag.png", $link);
}
}
}
function printMobileFeedEntry($feed_id, $class, $feed_title, $unread, $icon_file, $link,
$rtl_content = false) {
if (!$feed_title) $feed_title = getFeedTitle($link, $feed_id, false);
if (!$unread) $unread = getFeedUnread($link, $feed_id);
if ($unread > 0) $class .= "Unread";
if (!$icon_file) $icon_file = "../../" . getFeedIcon($feed_id);
if (file_exists($icon_file) && filesize($icon_file) > 0) {
$feed_icon = "<img src=\"$icon_file\">";
} else {
$feed_icon = "<img src=\"../../images/blank_icon.gif\">";
}
if ($rtl_content) {
$rtl_tag = "dir=\"rtl\"";
} else {
$rtl_tag = "dir=\"ltr\"";
}
$feed = "<a href=\"?go=vf&id=$feed_id\">$feed_title</a>";
print "<li class=\"$class\">";
print "$feed_icon";
print "<span $rtl_tag>$feed</span> ";
if ($unread != 0) {
print "<span $rtl_tag>($unread)</span>";
}
print "</li>";
}
function render_headlines($link) {
$feed = db_escape_string($_GET["id"]);
$limit = db_escape_string($_GET["limit"]);
$view_mode = db_escape_string($_GET["viewmode"]);
$cat_view = db_escape_string($_GET["cat"]);
$subop = $_GET["subop"];
$catchup_op = $_GET["catchup_op"];
if (!$view_mode) {
if ($_SESSION["mobile:viewmode"]) {
$view_mode = $_SESSION["mobile:viewmode"];
} else {
$view_mode = "adaptive";
}
}
$_SESSION["mobile:viewmode"] = $view_mode;
if (!$limit) $limit = 30;
if (!$feed) $feed = 0;
if (preg_match("/^-?[0-9][0-9]*$/", $feed) != false) {
$result = db_query($link, "SELECT rtl_content FROM ttrss_feeds
WHERE id = '$feed' AND owner_uid = " . $_SESSION["uid"]);
if (db_num_rows($result) == 1) {
$rtl_content = sql_bool_to_bool(db_fetch_result($result, 0, "rtl_content"));
} else {
$rtl_content = false;
}
if ($rtl_content) {
$rtl_tag = "dir=\"RTL\"";
} else {
$rtl_tag = "";
}
} else {
$rtl_content = false;
$rtl_tag = "";
}
print "<div id=\"headlines\" $rtl_tag>";
if ($subop == "ForceUpdate" && sprintf("%d", $feed) > 0) {
update_generic_feed($link, $feed, $cat_view, true);
}
if ($subop == "MarkAllRead" || $catchup_op == "feed") {
catchup_feed($link, $feed, $cat_view);
}
if ($catchup_op == "selection") {
if (is_array($_GET["sel_ids"])) {
$ids_to_mark = array_keys($_GET["sel_ids"]);
if ($ids_to_mark) {
foreach ($ids_to_mark as $id) {
db_query($link, "UPDATE ttrss_user_entries SET
unread = false,last_read = NOW()
WHERE ref_id = '$id' AND owner_uid = " . $_SESSION["uid"]);
}
}
}
}
if ($subop == "MarkPageRead" || $catchup_op == "page") {
$ids_to_mark = $_SESSION["last_page_ids.$feed"];
if ($ids_to_mark) {
foreach ($ids_to_mark as $id) {
db_query($link, "UPDATE ttrss_user_entries SET
unread = false,last_read = NOW()
WHERE ref_id = '$id' AND owner_uid = " . $_SESSION["uid"]);
}
}
}
/// START /////////////////////////////////////////////////////////////////////////////////
$search = db_escape_string($_GET["query"]);
$search_mode = db_escape_string($_GET["search_mode"]);
$match_on = db_escape_string($_GET["match_on"]);
if (!$match_on) {
$match_on = "both";
}
$real_offset = $offset * $limit;
if ($_GET["debug"]) $timing_info = print_checkpoint("H0", $timing_info);
$qfh_ret = queryFeedHeadlines($link, $feed, $limit, $view_mode, $cat_view,
$search, $search_mode, $match_on, false, $real_offset);
if ($_GET["debug"]) $timing_info = print_checkpoint("H1", $timing_info);
$result = $qfh_ret[0];
$feed_title = $qfh_ret[1];
$feed_site_url = $qfh_ret[2];
$last_error = $qfh_ret[3];
/// STOP //////////////////////////////////////////////////////////////////////////////////
if (!$result) {
print "<div align='center'>".
__("Could not display feed (query failed). Please check label match syntax or local configuration.").
"</div>";
return;
}
print "<div id=\"heading\">";
# if (!$cat_view && file_exists("../icons/$feed.ico") && filesize("../icons/$feed.ico") > 0) {
# print "<img class=\"feedIcon\" src=\"../icons/$feed.ico\">";
# }
print "$feed_title <span id=\"headingAddon\">(";
print "<a href=\"index.php\">".__("Back")."</a>, ";
print "<a href=\"index.php?go=sform&aid=$feed&ic=$cat_view\">".__("Search")."</a>, ";
print "<a href=\"index.php?go=vf&id=$feed&subop=ForceUpdate\">".__("Update")."</a>";
# print "Mark as read: ";
# print "<a href=\"index.php?go=vf&id=$feed&subop=MarkAsRead\">Page</a>, ";
# print "<a href=\"index.php?go=vf&id=$feed&subop=MarkAllRead\">Feed</a>";
print ")</span>";
print "&nbsp;" . __('View:');
print "<form style=\"display : inline\" method=\"GET\" action=\"index.php\">";
/* print "<select name=\"viewmode\">
<option selected value=\"adaptive\"> " . __('Adaptive') . "</option>
<option value=\"all_articles\">" . __('All Articles') . "</option>
<option value=\"marked\">" . __('Starred') . "</option>
<option value=\"unread\">" . __('Unread') . "</option>
</select>"; */
$sel_values = array(
"adaptive" => __("Adaptive"),
"all_articles" => __("All Articles"),
"unread" => __("Unread"),
"marked" => __("Starred"));
print_select_hash("viewmode", $view_mode, $sel_values);
print "<input type=\"hidden\" name=\"id\" value=\"$feed\">
<input type=\"hidden\" name=\"cat\" value=\"$cat_view\">
<input type=\"hidden\" name=\"go\" value=\"vf\">
<input type=\"submit\" value=\"".__('Refresh')."\">";
print "</form>";
print "</div>";
if (db_num_rows($result) > 0) {
print "<form method=\"GET\" action=\"index.php\">";
print "<input type=\"hidden\" name=\"go\" value=\"vf\">";
print "<input type=\"hidden\" name=\"id\" value=\"$feed\">";
print "<input type=\"hidden\" name=\"cat\" value=\"$cat_view\">";
print "<ul class=\"headlines\" id=\"headlines\">";
$page_art_ids = array();
$lnum = 0;
error_reporting (DEFAULT_ERROR_LEVEL);
$num_unread = 0;
while ($line = db_fetch_assoc($result)) {
$class = ($lnum % 2) ? "even" : "odd";
$id = $line["id"];
$feed_id = $line["feed_id"];
array_push($page_art_ids, $id);
if ($line["last_read"] == "" &&
($line["unread"] != "t" && $line["unread"] != "1")) {
$update_pic = "<img id='FUPDPIC-$id' src=\"images/updated.png\"
alt=\"".__("Updated")."\">";
} else {
$update_pic = "<img id='FUPDPIC-$id' src=\"images/blank_icon.gif\"
alt=\"".__("Updated")."\">";
}
if ($line["unread"] == "t" || $line["unread"] == "1") {
$class .= "Unread";
++$num_unread;
$is_unread = true;
} else {
$is_unread = false;
}
if ($line["marked"] == "t" || $line["marked"] == "1") {
$marked_pic = "<img alt=\"S\" class='marked' src=\"../../images/mark_set.png\">";
} else {
$marked_pic = "<img alt=\"s\" class='marked' src=\"../../images/mark_unset.png\">";
}
if ($line["published"] == "t" || $line["published"] == "1") {
$published_pic = "<img alt=\"P\" class='marked' src=\"../../images/pub_set.gif\">";
} else {
$published_pic = "<img alt=\"p\" class='marked' src=\"../../images/pub_unset.gif\">";
}
$content_link = "<a href=\"?go=view&id=$id&cat=$cat_view&ret_feed=$feed&feed=$feed_id\">" .
$line["title"] . "</a>";
$updated_fmt = make_local_datetime($link, $line['updated'], false);
print "<li class='$class' id=\"HROW-$id\">";
print "<input type=\"checkbox\" name=\"sel_ids[$id]\"
id=\"HSCB-$id\" onchange=\"toggleSelectRow(this, $id)\">";
print "<a href=\"?go=vf&id=$feed&ts=$id&cat=$cat_view\">$marked_pic</a>";
print "<a href=\"?go=vf&id=$feed&tp=$id&cat=$cat_view\">$published_pic</a>";
print $content_link;
if ($line["feed_title"]) {
print " (<a href='?go=vf&id=$feed_id'>".
$line["feed_title"]."</a>)";
}
print "<span class='hlUpdated'> ($updated_fmt)</span>";
print "</li>";
++$lnum;
}
print "</ul>";
print "<div class='footerAddon'>";
$_SESSION["last_page_ids.$feed"] = $page_art_ids;
/* print "<a href=\"index.php?go=vf&id=$feed&subop=MarkPageRead\">Page</a>, ";
print "<a href=\"index.php?go=vf&id=$feed&subop=MarkAllRead\">Feed</a></div>"; */
print "Select:
<a href=\"javascript:selectHeadlines(1)\">".__("All")."</a>,
<a href=\"javascript:selectHeadlines(2)\">".__("Unread")."</a>,
<a href=\"javascript:selectHeadlines(3)\">".__("None")."</a>,
<a href=\"javascript:selectHeadlines(4)\">".__("Invert")."</a>";
print " ";
print "<select name=\"catchup_op\">
<option value=\"selection\">".__("Selection")."</option>
<option value=\"page\">".__("Page")."</option>
<option value=\"feed\">".__("Entire feed")."</option>
</select>
<input type=\"hidden\" name=\"cat\" value=\"$cat_view\">
<input type=\"submit\" value=\"".__("Mark as read")."\">";
print "</form>";
} else {
print "<div align='center'>No articles found.</div>";
}
}
function render_article($link) {
$id = db_escape_string($_GET["id"]);
$feed_id = db_escape_string($_GET["feed"]);
$ret_feed_id = db_escape_string($_GET["ret_feed"]);
$cat_view = db_escape_string($_GET["cat"]);
$result = db_query($link, "SELECT rtl_content FROM ttrss_feeds
WHERE id = '$feed_id' AND owner_uid = " . $_SESSION["uid"]);
if (db_num_rows($result) == 1) {
$rtl_content = sql_bool_to_bool(db_fetch_result($result, 0, "rtl_content"));
} else {
$rtl_content = false;
}
if ($rtl_content) {
$rtl_tag = "dir=\"RTL\"";
$rtl_class = "RTL";
} else {
$rtl_tag = "";
$rtl_class = "";
}
$result = db_query($link, "UPDATE ttrss_user_entries
SET unread = false,last_read = NOW()
WHERE ref_id = '$id' AND feed_id = '$feed_id' AND owner_uid = " . $_SESSION["uid"]);
$result = db_query($link, "SELECT title,link,content,feed_id,comments,int_id,
marked,published,
".SUBSTRING_FOR_DATE."(updated,1,16) as updated,
(SELECT icon_url FROM ttrss_feeds WHERE id = feed_id) as icon_url,
num_comments,
author
FROM ttrss_entries,ttrss_user_entries
WHERE id = '$id' AND ref_id = id");
if ($result) {
$line = db_fetch_assoc($result);
$num_comments = $line["num_comments"];
$entry_comments = "";
if ($num_comments > 0) {
if ($line["comments"]) {
$comments_url = $line["comments"];
} else {
$comments_url = $line["link"];
}
$entry_comments = "<a href=\"$comments_url\">$num_comments comments</a>";
} else {
if ($line["comments"] && $line["link"] != $line["comments"]) {
$entry_comments = "<a href=\"".$line["comments"]."\">comments</a>";
}
}
$tmp_result = db_query($link, "SELECT DISTINCT tag_name FROM
ttrss_tags WHERE post_int_id = " . $line["int_id"] . "
ORDER BY tag_name");
$tags_str = "";
$f_tags_str = "";
$num_tags = 0;
while ($tmp_line = db_fetch_assoc($tmp_result)) {
$num_tags++;
$tag = $tmp_line["tag_name"];
$tag_str = "<a href=\"?go=vf&id=$tag\">$tag</a>, ";
$tags_str .= $tag_str;
}
$tags_str = preg_replace("/, $/", "", $tags_str);
$parsed_updated = date(get_pref($link, 'SHORT_DATE_FORMAT'),
strtotime($line["updated"]));
print "<div id=\"heading\">";
# if (file_exists("../icons/$feed_id.ico") && filesize("../icons/$feed_id.ico") > 0) {
# print "<img class=\"feedIcon\" src=\"../icons/$feed_id.ico\">";
# }
if (!$cat_view) {
$feed_title = getFeedTitle($link, $ret_feed_id);
} else {
$feed_title = getCategoryTitle($link, $ret_feed_id);
$feed_title_native = getFeedTitle($link, $feed_id);
}
if ($feed_title_native) {
$feed_link = "<a href=\"index.php?go=vf&id=$feed_id\">$feed_title_native</a>";
$feed_link .= " in <a href=\"index.php?go=vf&id=$ret_feed_id&cat=$cat_view\">
$feed_title</a>";
} else {
$feed_link = "<a href=\"index.php?go=vf&id=$ret_feed_id\">$feed_title</a>";
}
$feedlist = "<a href=\"index.php\">".__('Back to feedlist')."</a>";
print "<a href=\"" . $line["link"] . "\">" .
truncate_string($line["title"], 30) . "</a>";
print " <span id=\"headingAddon\">$parsed_updated ($feed_link, $feedlist)</span>";
print "</div>";
if ($num_tags > 0) {
print "<div class=\"postTags\">".__("Tags:")." $tags_str</div>";
}
if ($line["marked"] == "t" || $line["marked"] == "1") {
$marked_pic = "<img class='marked' src=\"../../images/mark_set.png\">";
} else {
$marked_pic = "<img class='marked' src=\"../../images/mark_unset.png\">";
}
if ($line["published"] == "t" || $line["published"] == "1") {
$published_pic = "<img class='marked' src=\"../../images/pub_set.gif\">";
} else {
$published_pic = "<img class='marked' src=\"../../images/pub_unset.gif\">";
}
print "<div class=\"postStarOps\">";
print "<a title=\"".__('Toggle starred')."\"href=\"?go=view&id=$id&ret_feed=$ret_feed_id&feed=$feed_id&sop=ts\">$marked_pic</a>";
print "<a title=\"".__('Toggle published')."\" href=\"?go=view&id=$id&ret_feed=$ret_feed_id&feed=$feed_id&sop=tp\">$published_pic</a>";
// Mark unread
print "<a title=\"".__('Mark as unread')."\" href=\"?go=vf&id=$ret_feed_id&feed=$feed_id&sop=mu&aid=$id";
if ($cat_view) { print "&cat=$cat_view"; }
print "\"><img class='marked' src=\"../../images/art-set-unread.png\"></a>";
print "</div>";
print sanitize_rss($link, $line["content"], true);;
}
print "</body></html>";
}
function render_search_form($link, $active_feed_id = false, $is_cat = false) {
print "<div id=\"heading\">";
print __("Search")." <span id=\"headingAddon\">
(<a href=\"index.php\">".__("Go back")."</a>)</span></div>";
print "<form method=\"GET\" action=\"index.php\" class=\"searchForm\">";
print "<input type=\"hidden\" name=\"go\" value=\"vf\">";
print "<input type=\"hidden\" name=\"id\" value=\"$active_feed_id\">";
print "<input type=\"hidden\" name=\"cat\" value=\"$is_cat\">";
print "<table><tr><td>".__('Search:')."</td><td>";
print "<input name=\"query\"></td></tr>";
print "<tr><td>".__('Where:')."</td><td>";
print "<select name=\"search_mode\">
<option value=\"all_feeds\">".__('All feeds')."</option>";
$feed_title = getFeedTitle($link, $active_feed_id);
if (!$is_cat) {
$feed_cat_title = getFeedCatTitle($link, $active_feed_id);
} else {
$feed_cat_title = getCategoryTitle($link, $active_feed_id);
}
if ($active_feed_id && !$is_cat) {
print "<option selected value=\"this_feed\">$feed_title</option>";
} else {
print "<option disabled>".__('This feed')."</option>";
}
if ($is_cat) {
$cat_preselected = "selected";
}
if (get_pref($link, 'ENABLE_FEED_CATS') && ($active_feed_id > 0 || $is_cat)) {
print "<option $cat_preselected value=\"this_cat\">$feed_cat_title</option>";
} else {
//print "<option disabled>".__('This category')."</option>";
}
print "</select></td></tr>";
print "<tr><td>".__('Match on:')."</td><td>";
$search_fields = array(
"title" => __("Title"),
"content" => __("Content"),
"both" => __("Title or content"));
print_select_hash("match_on", 3, $search_fields);
print "</td></tr></table>";
print "<input type=\"submit\" value=\"".__('Search')."\">";
print "</form>";
print "</div>";
}
function toggleMarked($link, $ts_id) {
$result = db_query($link, "UPDATE ttrss_user_entries SET marked = NOT marked
WHERE ref_id = '$ts_id' AND owner_uid = " . $_SESSION["uid"]);
}
function togglePublished($link, $tp_id) {
$result = db_query($link, "UPDATE ttrss_user_entries SET published = NOT published
WHERE ref_id = '$tp_id' AND owner_uid = " . $_SESSION["uid"]);
}
function markUnread($link, $mu_id) {
$result = db_query($link, "UPDATE ttrss_user_entries SET unread = true
WHERE ref_id = '$mu_id' AND owner_uid = " . $_SESSION["uid"]);
}
?>

View File

@ -1,114 +0,0 @@
<?php
error_reporting(E_ERROR | E_WARNING | E_PARSE);
define('MOBILE_VERSION', true);
require_once "../../config.php";
require_once "functions.php";
require_once "../../functions.php";
require_once "../../sessions.php";
require_once "../../version.php";
require_once "../../db-prefs.php";
$link = db_connect(DB_HOST, DB_USER, DB_PASS, DB_NAME);
init_connection($link);
login_sequence($link, 2);
/* 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"]);
toggle_collapse_cat($link, $cat_id);
header("Location: index.php");
return;
}
$ts_id = db_escape_string($_GET["ts"]);
if ($go == "vf" && $ts_id) {
toggleMarked($link, $ts_id);
$query_string = preg_replace("/&ts=[0-9]*/", "", $_SERVER["QUERY_STRING"]);
header("Location: index.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: index.php?$query_string");
return;
}
$sop = db_escape_string($_GET["sop"]);
if ($sop) {
if ($go == "view") {
$a_id = db_escape_string($_GET["id"]);
} elseif ($go == "vf") {
$a_id = db_escape_string($_GET["aid"]);
}
if ($a_id) {
if ($sop == "tp") {
togglePublished($link, $a_id);
}
if ($sop == "ts") {
toggleMarked($link, $a_id);
}
if ($sop == "mu") {
markUnread($link, $a_id);
}
$query_string = str_replace("&sop=$sop", "", $_SERVER["QUERY_STRING"]);
header("Location: index.php?$query_string");
}
}
?>
<html>
<head>
<title>Tiny Tiny RSS</title>
<link rel="stylesheet" type="text/css" href="mobile.css">
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<script type="text/javascript" src="mobile.js"></script>
<?php print_user_stylesheet($link) ?>
</head>
<body id="ttrssMobile">
<div id="content">
<?php
if (!$go) {
render_feeds_list($link);
} else if ($go == "vf") {
render_headlines($link);
} else if ($go == "view") {
render_article($link);
} else if ($go == "sform") {
render_search_form($link, $_GET["aid"], $_GET["ic"]);
} else {
print __("Internal error: Function not implemented");
}
?>
</div>
</body>
</html>

View File

@ -1,79 +0,0 @@
<html>
<head>
<title>Tiny Tiny RSS : Login</title>
<link rel="stylesheet" type="text/css" href="mobile.css">
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<script type="text/javascript" charset="utf-8" src="mobile.js"></script>
</head>
<script type="text/javascript">
function init() {
if (arguments.callee.done) return;
arguments.callee.done = true;
var login = document.forms["loginForm"].login;
var click = document.forms["loginForm"].click;
login.focus();
click.disabled = false;
}
function languageChange(elem) {
try {
document.forms['loginForm']['click'].disabled = true;
var lang = elem[elem.selectedIndex].value;
setCookie("ttrss_lang", lang, <?php print SESSION_COOKIE_LIFETIME ?>);
window.location.reload();
} catch (e) {
exception_error("languageChange", e);
}
}
</script>
<script type="text/javascript">
if (document.addEventListener) {
document.addEventListener("DOMContentLoaded", init, null);
}
window.onload = init;
</script>
<body>
<div id="content">
<div id="heading">Tiny Tiny RSS</div>
<form action="index.php" method="POST" name="loginForm">
<input type="hidden" name="rt" value="<?php echo $_GET['rt'] ?>">
<input type="hidden" name="login_action" value="do_login">
<?php if ($_SESSION['login_error_msg']) { ?>
<div class="loginError"><?php echo $_SESSION['login_error_msg'] ?></div>
<?php $_SESSION['login_error_msg'] = ""; ?>
<?php } ?>
<table>
<tr><td align='right'><?php echo __("Login:") ?></td><td><input type="text" name="login"></td>
<tr><td align='right'><?php echo __("Password:") ?></td><td><input type="password" name="password"></tr>
<tr><td align="right"><?php echo __("Language:") ?></td>
<td>
<?php
print_select_hash("language", $_COOKIE["ttrss_lang"], get_translations(),
"style='width : 100%' onchange='languageChange(this)'");
?>
</td></tr>
<tr><td colspan='2'>
<input type="submit" class="button" value="<?php echo __('Log in') ?>" name="click">
</td></tr>
</table>
</form>
</div>
</body>
</html>

View File

@ -1,9 +0,0 @@
<?php
require_once "functions.php";
require_once "../../sessions.php";
require_once "../../functions.php";
logout_user();
header("Location: index.php");
?>

View File

@ -1,216 +0,0 @@
body {
padding : 0px;
margin : 0px;
font-family : sans-serif;
}
h1 {
font-size : medium;
}
h2 {
font-size : medium;
font-weight : bold;
border-width : 0px 0px 1px 0px;
border-style : solid;
border-color : #88b0ff;
}
h3 {
font-size : medium;
font-weight : bold;
border-width : 0px 0px 1px 0px;
border-style : solid;
border-color : #e0e0e0;
}
#heading {
font-size : small;
border-width : 0px 0px 1px 0px;
border-style : solid;
border-color : #f0f0f0;
color : #88b0ff;
font-weight : bold;
}
#content {
background : white;
}
#footer {
font-size : x-small;
color : gray;
margin-top : 5px;
}
form {
padding : 0px;
margin : 0px;
}
li.feedCatHolder {
display : inline;
}
ul.feedList {
list-style-type : none;
margin : 0px;
padding : 0px;
}
ul.feedList li.feedCat {
margin : 0px;
padding : 0px;
color : #707070;
}
ul.feedList li.feedCat a {
color : #707070;
}
ul.feedList li.feedCat a:hover {
color : #4684ff;
}
ul.feedCatList {
list-style-type : none;
margin : 0px 0px 0px 1em;
padding : 0px;
}
ul.feedCatList li {
margin : 0px;
padding : 0px;
color : black;
}
ul.feedList li {
margin : 0px;
}
hr {
border-width : 0px 0px 1px 0px;
border-style : dashed;
border-color : #e0e0e0;
}
ul.headlines a, ul.feedList a {
color : black;
}
a {
color : #4684ff;
text-decoration : none;
}
a:hover {
color : black;
}
ul.feedList img, img.tinyFeedIcon {
margin : 0px 3px 0px 0px;
width : 16px;
height : 16px;
border-width : 0px;
}
ul.feedlist li.feedUnread,
ul.feedlist li.errorUnread,
ul.feedlist li.labelUnread,
ul.feedlist li.virtUnread,
ul.feedlist li.tagUnread {
font-weight : bold;
}
.even {
/* background-color : #9bbdff; */
border-width : 0px 0px 1px 0px;
border-color : #88b0ff;
border-style : solid;
background-color : #cbddff;
}
.odd {
border-width : 0px 0px 1px 0px;
border-color : #88b0ff;
border-style : solid;
}
.evenUnread {
border-width : 0px 0px 1px 0px;
border-color : #88b0ff;
border-style : solid;
/* background-color : #9bbdff; */
font-weight : bold;
background-color : #cbddff;
}
.oddUnread {
border-width : 0px 0px 1px 0px;
border-color : #88b0ff;
border-style : solid;
font-weight : bold;
}
.evenSelected, .oddSelected, .evenUnreadSelected, .oddUnreadSelected {
background-color : #fff7d5;
border-width : 0px 0px 1px 0px;
border-color : #88b0ff;
border-style : solid;
}
.evenUnreadSelected, .oddUnreadSelected {
font-weight : bold;
}
.invisible {
display : none;
}
ul.headlines {
list-style-type : none;
margin : 0px;
padding : 0px;
}
ul.headlines span.hlUpdated {
color : gray;
}
ul.headlines img.feedIcon {
width : 25px;
text-align : center;
}
ul.headlines img.marked {
border-width : 0px;
}
div.postStarOps img.marked {
border-width : 0px;
}
div.postTags {
color : gray;
font-size : small;
}
div.footerAddon {
font-size : small;
}
.loginError {
color : red;
margin : 0.5em;
}
form.searchForm {
margin : 5px;
}
div.postStarOps {
float : right;
}

View File

@ -1,94 +0,0 @@
function toggleSelectRow(cb, id) {
try {
var row = document.getElementById("HROW-" + id);
var checked = cb.checked;
if (row) {
var unread = row.className.match("Unread");
var new_classname = row.className;
new_classname = new_classname.replace("Selected", "");
new_classname = new_classname.replace("Unread", "");
if (unread) new_classname = new_classname + "Unread";
if (checked) new_classname = new_classname + "Selected";
row.className = new_classname;
}
} catch (e) {
exception_error("toggleSelectRow", e);
}
}
function selectHeadlines(mode) {
try {
var cboxes = document.getElementsByTagName("INPUT");
for (var i = 0; i < cboxes.length; i++) {
if (cboxes[i].id && cboxes[i].id.match("HSCB-")) {
var row_id = cboxes[i].id.replace("HSCB-", "")
var row = document.getElementById("HROW-" + row_id);
if (row) {
if (mode == 1) {
cboxes[i].checked = true;
toggleSelectRow(cboxes[i], row_id);
}
if (mode == 2) {
var unread = row.className.match("Unread");
if (unread) {
cboxes[i].checked = true;
} else {
cboxes[i].checked = false;
}
}
if (mode == 3) {
cboxes[i].checked = false;
}
if (mode == 4) {
cboxes[i].checked = !cboxes[i].checked;
}
toggleSelectRow(cboxes[i], row_id);
}
}
}
} catch (e) {
exception_error("selectHeadlines", e);
}
}
function exception_error(location, e, silent) {
var msg;
if (e.fileName) {
var base_fname = e.fileName.substring(e.fileName.lastIndexOf("/") + 1);
msg = "Exception: " + e.name + ", " + e.message +
"\nFunction: " + location + "()" +
"\nLocation: " + base_fname + ":" + e.lineNumber;
} else if (e.description) {
msg = "Exception: " + e.description + "\nFunction: " + location + "()";
} else {
msg = "Exception: " + e + "\nFunction: " + location + "()";
}
debug("<b>EXCEPTION: " + msg + "</b>");
if (!silent) {
alert(msg);
}
}

View File

@ -6,13 +6,7 @@
define('MOBILE_VERSION', true); define('MOBILE_VERSION', true);
require_once "../config.php"; require_once "../config.php";
require_once "functions.php"; require_once "mobile-functions.php";
require_once "../functions.php";
require_once "../sessions.php";
require_once "../version.php";
require_once "../db-prefs.php";
$link = db_connect(DB_HOST, DB_USER, DB_PASS, DB_NAME); $link = db_connect(DB_HOST, DB_USER, DB_PASS, DB_NAME);

View File

@ -6,13 +6,7 @@
define('MOBILE_VERSION', true); define('MOBILE_VERSION', true);
require_once "../config.php"; require_once "../config.php";
require_once "functions.php"; require_once "mobile-functions.php";
require_once "../functions.php";
require_once "../sessions.php";
require_once "../version.php";
require_once "../db-prefs.php";
$link = db_connect(DB_HOST, DB_USER, DB_PASS, DB_NAME); $link = db_connect(DB_HOST, DB_USER, DB_PASS, DB_NAME);

View File

@ -6,13 +6,7 @@
define('MOBILE_VERSION', true); define('MOBILE_VERSION', true);
require_once "../config.php"; require_once "../config.php";
require_once "functions.php"; require_once "mobile-functions.php";
require_once "../functions.php";
require_once "../sessions.php";
require_once "../version.php";
require_once "../db-prefs.php";
$link = db_connect(DB_HOST, DB_USER, DB_PASS, DB_NAME); $link = db_connect(DB_HOST, DB_USER, DB_PASS, DB_NAME);

View File

@ -1,7 +1,5 @@
<?php <?php
require_once "functions.php"; require_once "mobile-functions.php";
require_once "../sessions.php";
require_once "../functions.php";
logout_user(); logout_user();

View File

@ -1,4 +1,14 @@
<?php <?php
set_include_path(get_include_path() . PATH_SEPARATOR .
dirname(__FILE__) . PATH_SEPARATOR .
dirname(dirname(__FILE__)) . PATH_SEPARATOR .
dirname(dirname(__FILE__)) . "/include" );
require_once "include/functions.php";
require_once "include/sessions.php";
require_once "include/version.php";
require_once "include/db-prefs.php";
define('TTRSS_SESSION_NAME', 'ttrss_m_sid'); define('TTRSS_SESSION_NAME', 'ttrss_m_sid');
/* TODO replace with interface to db-prefs */ /* TODO replace with interface to db-prefs */

View File

@ -6,13 +6,7 @@
define('MOBILE_VERSION', true); define('MOBILE_VERSION', true);
require_once "../config.php"; require_once "../config.php";
require_once "functions.php"; require_once "mobile-functions.php";
require_once "../functions.php";
require_once "../sessions.php";
require_once "../version.php";
require_once "../db-prefs.php";
$link = db_connect(DB_HOST, DB_USER, DB_PASS, DB_NAME); $link = db_connect(DB_HOST, DB_USER, DB_PASS, DB_NAME);

View File

@ -1,4 +1,6 @@
<?php <?php
set_include_path(get_include_path() . PATH_SEPARATOR . "include");
require_once "functions.php"; require_once "functions.php";
require_once "sessions.php"; require_once "sessions.php";
require_once "sanity_check.php"; require_once "sanity_check.php";

View File

@ -1,4 +1,6 @@
<?php <?php
set_include_path(get_include_path() . PATH_SEPARATOR . "include");
require_once "functions.php"; require_once "functions.php";
require_once "sessions.php"; require_once "sessions.php";
require_once "sanity_check.php"; require_once "sanity_check.php";
@ -41,10 +43,9 @@
<script type="text/javascript" charset="utf-8" src="localized_js.php?<?php echo $dt_add ?>"></script> <script type="text/javascript" charset="utf-8" src="localized_js.php?<?php echo $dt_add ?>"></script>
<script type="text/javascript" charset="utf-8" src="functions.js?<?php echo $dt_add ?>"></script> <script type="text/javascript" charset="utf-8" src="js/functions.js?<?php echo $dt_add ?>"></script>
<script type="text/javascript" charset="utf-8" src="deprecated.js?<?php echo $dt_add ?>"></script> <script type="text/javascript" charset="utf-8" src="js/deprecated.js?<?php echo $dt_add ?>"></script>
<script type="text/javascript" charset="utf-8" src="js/prefs.js?<?php echo $dt_add ?>"></script>
<script type="text/javascript" charset="utf-8" src="prefs.js?<?php echo $dt_add ?>"></script>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8"/> <meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>

View File

@ -4,6 +4,8 @@
// 1) templates/register_notice.txt - displayed above the registration form // 1) templates/register_notice.txt - displayed above the registration form
// 2) register_expire_do.php - contains user expiration queries when necessary // 2) register_expire_do.php - contains user expiration queries when necessary
set_include_path(get_include_path() . PATH_SEPARATOR . "include");
require_once 'lib/phpmailer/class.phpmailer.php'; require_once 'lib/phpmailer/class.phpmailer.php';
$action = $_REQUEST["action"]; $action = $_REQUEST["action"];
@ -93,7 +95,7 @@
<title>Create new account</title> <title>Create new account</title>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8"> <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<link rel="stylesheet" type="text/css" href="utility.css"> <link rel="stylesheet" type="text/css" href="utility.css">
<script type="text/javascript" src="functions.js"></script> <script type="text/javascript" src="js/functions.js"></script>
<script type="text/javascript" src="lib/prototype.js"></script> <script type="text/javascript" src="lib/prototype.js"></script>
<script type="text/javascript" src="lib/scriptaculous/scriptaculous.js?load=effects,dragdrop,controls"></script> <script type="text/javascript" src="lib/scriptaculous/scriptaculous.js?load=effects,dragdrop,controls"></script>
</head> </head>
@ -232,7 +234,7 @@
</table> </table>
</form> </form>
<?php print "<p><form method=\"GET\" action=\"tt-rss.php\"> <?php print "<p><form method=\"GET\" action=\"index.php\">
<input type=\"submit\" value=\"".__("Return to Tiny Tiny RSS")."\"> <input type=\"submit\" value=\"".__("Return to Tiny Tiny RSS")."\">
</form>"; ?> </form>"; ?>
@ -245,7 +247,7 @@
if (!$login || !$email || !$test) { if (!$login || !$email || !$test) {
print_error(__("Your registration information is incomplete.")); print_error(__("Your registration information is incomplete."));
print "<p><form method=\"GET\" action=\"tt-rss.php\"> print "<p><form method=\"GET\" action=\"index.php\">
<input type=\"submit\" value=\"".__("Return to Tiny Tiny RSS")."\"> <input type=\"submit\" value=\"".__("Return to Tiny Tiny RSS")."\">
</form>"; </form>";
return; return;
@ -260,7 +262,7 @@
if ($is_registered) { if ($is_registered) {
print_error(__('Sorry, this username is already taken.')); print_error(__('Sorry, this username is already taken.'));
print "<p><form method=\"GET\" action=\"tt-rss.php\"> print "<p><form method=\"GET\" action=\"index.php\">
<input type=\"submit\" value=\"".__("Return to Tiny Tiny RSS")."\"> <input type=\"submit\" value=\"".__("Return to Tiny Tiny RSS")."\">
</form>"; </form>";
} else { } else {
@ -278,7 +280,7 @@
if (db_num_rows($result) != 1) { if (db_num_rows($result) != 1) {
print_error(__('Registration failed.')); print_error(__('Registration failed.'));
print "<p><form method=\"GET\" action=\"tt-rss.php\"> print "<p><form method=\"GET\" action=\"index.php\">
<input type=\"submit\" value=\"".__("Return to Tiny Tiny RSS")."\"> <input type=\"submit\" value=\"".__("Return to Tiny Tiny RSS")."\">
</form>"; </form>";
} else { } else {
@ -363,7 +365,7 @@
print_notice(__("Account created successfully.")); print_notice(__("Account created successfully."));
print "<p><form method=\"GET\" action=\"tt-rss.php\"> print "<p><form method=\"GET\" action=\"index.php\">
<input type=\"submit\" value=\"".__("Return to Tiny Tiny RSS")."\"> <input type=\"submit\" value=\"".__("Return to Tiny Tiny RSS")."\">
</form>"; </form>";
@ -373,7 +375,7 @@
} else { } else {
print_error('Plese check the form again, you have failed the robot test.'); print_error('Plese check the form again, you have failed the robot test.');
print "<p><form method=\"GET\" action=\"tt-rss.php\"> print "<p><form method=\"GET\" action=\"index.php\">
<input type=\"submit\" value=\"".__("Return to Tiny Tiny RSS")."\"> <input type=\"submit\" value=\"".__("Return to Tiny Tiny RSS")."\">
</form>"; </form>";
@ -385,7 +387,7 @@
<?php print_notice(__('New user registrations are currently closed.')) ?> <?php print_notice(__('New user registrations are currently closed.')) ?>
<?php print "<p><form method=\"GET\" action=\"tt-rss.php\"> <?php print "<p><form method=\"GET\" action=\"index.php\">
<input type=\"submit\" value=\"".__("Return to Tiny Tiny RSS")."\"> <input type=\"submit\" value=\"".__("Return to Tiny Tiny RSS")."\">
</form>"; ?> </form>"; ?>

View File

@ -1,209 +0,0 @@
<?php
require_once "functions.php";
require_once "sessions.php";
require_once "sanity_check.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);
init_connection($link);
login_sequence($link);
$dt_add = time();
no_cache_incantation();
header('Content-Type: text/html; charset=utf-8');
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html>
<head>
<title>Tiny Tiny RSS</title>
<link rel="stylesheet" type="text/css" href="lib/dijit/themes/claro/claro.css"/>
<link rel="stylesheet" type="text/css" href="tt-rss.css?<?php echo $dt_add ?>"/>
<link rel="stylesheet" type="text/css" href="cdm.css?<?php echo $dt_add ?>"/>
<?php print_theme_includes($link) ?>
<?php print_user_stylesheet($link) ?>
<link rel="shortcut icon" type="image/png" href="images/favicon.png"/>
<script type="text/javascript" src="lib/prototype.js"></script>
<script type="text/javascript" src="lib/scriptaculous/scriptaculous.js?load=effects,dragdrop,controls"></script>
<script type="text/javascript" src="lib/dojo/dojo.js"></script>
<script type="text/javascript" src="lib/dijit/dijit.js"></script>
<script type="text/javascript" src="lib/dojo/tt-rss-layer.js"></script>
<script type="text/javascript" charset="utf-8" src="localized_js.php?<?php echo $dt_add ?>"></script>
<script type="text/javascript" charset="utf-8" src="tt-rss.js?<?php echo $dt_add ?>"></script>
<script type="text/javascript" charset="utf-8" src="functions.js?<?php echo $dt_add ?>"></script>
<script type="text/javascript" charset="utf-8" src="feedlist.js?<?php echo $dt_add ?>"></script>
<script type="text/javascript" charset="utf-8" src="viewfeed.js?<?php echo $dt_add ?>"></script>
<script type="text/javascript" charset="utf-8" src="errors.php?mode=js"></script>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
<script type="text/javascript">
Event.observe(window, 'load', function() {
init();
});
</script>
</head>
<body id="ttrssMain" class="claro">
<div id="overlay" style="display : block">
<div id="overlay_inner">
<div class="insensitive"><?php echo __("Loading, please wait...") ?></div>
<div dojoType="dijit.ProgressBar" places="0" style="width : 300px" id="loading_bar"
progress="0" maximum="100">
</div>
<noscript><br/><?php print_error('Javascript is disabled. Please enable it.') ?></noscript>
</div>
</div>
<div id="header">
<?php if (!SINGLE_USER_MODE) { ?>
<?php echo __('Hello,') ?> <b><?php echo $_SESSION["name"] ?></b> |
<?php } ?>
<a href="prefs.php"><?php echo __('Preferences') ?></a>
<?php if (defined('FEEDBACK_URL') && FEEDBACK_URL) { ?>
| <a target="_blank" class="feedback" href="<?php echo FEEDBACK_URL ?>">
<?php echo __('Comments?') ?></a>
<?php } ?>
<?php if (!SINGLE_USER_MODE) { ?>
| <a href="backend.php?op=logout"><?php echo __('Logout') ?></a>
<?php } ?>
<img id="newVersionIcon" style="display:none" onclick="newVersionDlg()"
width="13" height="13"
src="<?php echo theme_image($link, 'images/new_version.png') ?>"
title="<?php echo __('New version of Tiny Tiny RSS is available!') ?>"
alt="new_version_icon"/>
</div>
<div id="hotkey_help_overlay" style="display : none" onclick="Element.hide(this)">
<?php include "help/3.php" ?>
</div>
<div id="notify" class="notify"><span id="notify_body">&nbsp;</span></div>
<div id="cmdline" style="display : none"></div>
<div id="auxDlg" style="display : none"></div>
<div id="headlines-tmp" style="display : none"></div>
<div id="main" dojoType="dijit.layout.BorderContainer">
<div id="feeds-holder" dojoType="dijit.layout.ContentPane" region="leading" style="width : 20%" splitter="true">
<div id="feedlistLoading">
<img src='images/indicator_tiny.gif'/>
<?php echo __("Loading, please wait..."); ?></div>
<div id="feedTree"></div>
</div>
<div dojoType="dijit.layout.BorderContainer" region="center" id="header-wrap" gutters="false">
<div dojoType="dijit.layout.TabContainer" region="center" id="content-tabs">
<div dojoType="dijit.layout.BorderContainer" region="center" id="content-wrap"
title="<?php echo __("News") ?>">
<div id="toolbar" dojoType="dijit.layout.ContentPane" region="top">
<div id="main-toolbar" dojoType="dijit.Toolbar">
<form id="main_toolbar_form" action="" onsubmit='return false'>
<button dojoType="dijit.form.Button" id="collapse_feeds_btn"
onclick="collapse_feedlist()"
title="<?php echo __('Collapse feedlist') ?>" style="display : inline">
&lt;&lt;</button>
<select name="view_mode" title="<?php echo __('Show articles') ?>"
onchange="viewModeChanged()"
dojoType="dijit.form.Select">
<option selected="selected" value="adaptive"><?php echo __('Adaptive') ?></option>
<option value="all_articles"><?php echo __('All Articles') ?></option>
<option value="marked"><?php echo __('Starred') ?></option>
<option value="published"><?php echo __('Published') ?></option>
<option value="unread"><?php echo __('Unread') ?></option>
<!-- <option value="noscores"><?php echo __('Ignore Scoring') ?></option> -->
<option value="updated"><?php echo __('Updated') ?></option>
</select>
<select title="<?php echo __('Sort articles') ?>"
onchange="viewModeChanged()"
dojoType="dijit.form.Select" name="order_by">
<option selected="selected" value="default"><?php echo __('Default') ?></option>
<option value="date"><?php echo __('Date') ?></option>
<option value="title"><?php echo __('Title') ?></option>
<option value="score"><?php echo __('Score') ?></option>
</select>
<button dojoType="dijit.form.Button" name="update"
onclick="scheduleFeedUpdate()">
<?php echo __('Update') ?></button>
<button dojoType="dijit.form.Button"
onclick="catchupCurrentFeed()">
<?php echo __('Mark as read') ?></button>
</form>
<div class="actionChooser">
<div dojoType="dijit.form.DropDownButton">
<span><?php echo __('Actions...') ?></span>
<div dojoType="dijit.Menu" style="display: none">
<div dojoType="dijit.MenuItem" onclick="quickMenuGo('qmcSearch')"><?php echo __('Search...') ?></div>
<div dojoType="dijit.MenuItem" disabled="1"><?php echo __('Feed actions:') ?></div>
<div dojoType="dijit.MenuItem" onclick="quickMenuGo('qmcAddFeed')"><?php echo __('Subscribe to feed...') ?></div>
<div dojoType="dijit.MenuItem" onclick="quickMenuGo('qmcEditFeed')"><?php echo __('Edit this feed...') ?></div>
<div dojoType="dijit.MenuItem" onclick="quickMenuGo('qmcRescoreFeed')"><?php echo __('Rescore feed') ?></div>
<div dojoType="dijit.MenuItem" onclick="quickMenuGo('qmcRemoveFeed')"><?php echo __('Unsubscribe') ?></div>
<div dojoType="dijit.MenuItem" disabled="1"><?php echo __('All feeds:') ?></div>
<div dojoType="dijit.MenuItem" onclick="quickMenuGo('qmcCatchupAll')"><?php echo __('Mark as read') ?></div>
<div dojoType="dijit.MenuItem" onclick="quickMenuGo('qmcShowOnlyUnread')"><?php echo __('(Un)hide read feeds') ?></div>
<div dojoType="dijit.MenuItem" disabled="1"><?php echo __('Other actions:') ?></div>
<div dojoType="dijit.MenuItem" onclick="quickMenuGo('qmcDigest')"><?php echo __('Switch to digest...') ?></div>
<div dojoType="dijit.MenuItem" onclick="quickMenuGo('qmcTagCloud')"><?php echo __('Show tag cloud...') ?></div>
<div dojoType="dijit.MenuItem" onclick="quickMenuGo('qmcTagSelect')"><?php echo __('Select by tags...') ?></div>
<div dojoType="dijit.MenuItem" onclick="quickMenuGo('qmcAddLabel')"><?php echo __('Create label...') ?></div>
<div dojoType="dijit.MenuItem" onclick="quickMenuGo('qmcAddFilter')"><?php echo __('Create filter...') ?></div>
<div dojoType="dijit.MenuItem" onclick="quickMenuGo('qmcHKhelp')"><?php echo __('Keyboard shortcuts help') ?></div>
<div dojoType="dijit.MenuItem" onclick="quickMenuGo('qmcAbout')"><?php echo __('About...') ?></div>
</div>
</div>
</div>
</div> <!-- toolbar -->
</div> <!-- toolbar pane -->
<div id="headlines-wrap-inner" dojoType="dijit.layout.BorderContainer" region="center">
<div id="headlines-toolbar" dojoType="dijit.layout.ContentPane" region="top">
</div>
<div id="headlines-frame" dojoType="dijit.layout.ContentPane"
onscroll="headlines_scroll_handler(this)" region="center">
<div id="headlinesInnerContainer">
<div class="whiteBox"><?php echo __('Loading, please wait...') ?></div>
</div>
</div>
<?php if (!get_pref($link, 'COMBINED_DISPLAY_MODE')) { ?>
<div id="content-insert" dojoType="dijit.layout.ContentPane" region="bottom"
style="height : 50%" splitter="true"></div>
<?php } ?>
</div>
</div>
</div>
</div>
</div>
<?php db_close($link); ?>
</body>
</html>

View File

@ -1,4 +1,6 @@
<?php <?php
set_include_path(get_include_path() . PATH_SEPARATOR . "include");
require_once "functions.php"; require_once "functions.php";
require_once "sessions.php"; require_once "sessions.php";
require_once "sanity_check.php"; require_once "sanity_check.php";

View File

@ -1,5 +1,7 @@
#!/usr/bin/php #!/usr/bin/php
<?php <?php
set_include_path(get_include_path() . PATH_SEPARATOR . "include");
define('DISABLE_SESSIONS', true); define('DISABLE_SESSIONS', true);
chdir(dirname(__FILE__)); chdir(dirname(__FILE__));

View File

@ -1,5 +1,7 @@
#!/usr/bin/php #!/usr/bin/php
<?php <?php
set_include_path(get_include_path() . PATH_SEPARATOR . "include");
// This is an experimental multiprocess update daemon. // This is an experimental multiprocess update daemon.
// Some configurable variable may be found below. // Some configurable variable may be found below.