|
|
@ -1,6 +1,21 @@
|
|
|
|
<?php
|
|
|
|
<?php
|
|
|
|
define('TTRSS_SESSION_NAME', 'ttrss_m_sid');
|
|
|
|
define('TTRSS_SESSION_NAME', 'ttrss_m_sid');
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/* TODO replace with interface to db-prefs */
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
function mobile_pref_toggled($link, $id) {
|
|
|
|
|
|
|
|
if ($_SESSION["mobile-prefs"][$id]) return "true";
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
function mobile_get_pref($link, $id) {
|
|
|
|
|
|
|
|
return $_SESSION["mobile-prefs"][$id];
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
function mobile_set_pref($link, $id, $value) {
|
|
|
|
|
|
|
|
$_SESSION["mobile-prefs"][$id] = $value;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
function mobile_feed_has_icon($id) {
|
|
|
|
function mobile_feed_has_icon($id) {
|
|
|
|
$filename = "../".ICONS_DIR."/$id.ico";
|
|
|
|
$filename = "../".ICONS_DIR."/$id.ico";
|
|
|
|
|
|
|
|
|
|
|
@ -10,6 +25,12 @@
|
|
|
|
function render_flat_feed_list($link) {
|
|
|
|
function render_flat_feed_list($link) {
|
|
|
|
$owner_uid = $_SESSION["uid"];
|
|
|
|
$owner_uid = $_SESSION["uid"];
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (mobile_get_pref($link, "SORT_FEEDS_UNREAD")) {
|
|
|
|
|
|
|
|
$order_by = "unread DESC, title";
|
|
|
|
|
|
|
|
} else {
|
|
|
|
|
|
|
|
$order_by = "title";
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
$result = db_query($link, "SELECT id,
|
|
|
|
$result = db_query($link, "SELECT id,
|
|
|
|
title,
|
|
|
|
title,
|
|
|
|
(SELECT COUNT(id) FROM ttrss_entries,ttrss_user_entries
|
|
|
|
(SELECT COUNT(id) FROM ttrss_entries,ttrss_user_entries
|
|
|
@ -21,9 +42,10 @@
|
|
|
|
ttrss_feeds.hidden = false AND
|
|
|
|
ttrss_feeds.hidden = false AND
|
|
|
|
ttrss_feeds.owner_uid = '$owner_uid' AND
|
|
|
|
ttrss_feeds.owner_uid = '$owner_uid' AND
|
|
|
|
parent_feed IS NULL
|
|
|
|
parent_feed IS NULL
|
|
|
|
ORDER BY unread DESC,title");
|
|
|
|
ORDER BY $order_by");
|
|
|
|
|
|
|
|
|
|
|
|
print '<ul id="home" title="Feeds" selected="true">';
|
|
|
|
print '<ul id="home" title="Feeds" selected="true"
|
|
|
|
|
|
|
|
myBackLabel="Logout" myBackHref="logout.php" myBackTarget="_self">';
|
|
|
|
|
|
|
|
|
|
|
|
// print "<li><a href='#cat-actions'>".__('Actions...')."</a></li>";
|
|
|
|
// print "<li><a href='#cat-actions'>".__('Actions...')."</a></li>";
|
|
|
|
|
|
|
|
|
|
|
@ -46,10 +68,12 @@
|
|
|
|
$icon_url = "../images/blank_icon.gif";
|
|
|
|
$icon_url = "../images/blank_icon.gif";
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if ($unread > 0 || !mobile_get_pref($link, "HIDE_READ")) {
|
|
|
|
print "<li class='$class'><a href='feed.php?id=$id'>" .
|
|
|
|
print "<li class='$class'><a href='feed.php?id=$id'>" .
|
|
|
|
"<img class='tinyIcon' src='$icon_url'/>".
|
|
|
|
"<img class='tinyIcon' src='$icon_url'/>".
|
|
|
|
$line["title"] . "</a></li>";
|
|
|
|
$line["title"] . "</a></li>";
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
print "</ul>";
|
|
|
|
print "</ul>";
|
|
|
|
|
|
|
|
|
|
|
@ -68,6 +92,12 @@
|
|
|
|
$cat_query = "cat_id IS NULL";
|
|
|
|
$cat_query = "cat_id IS NULL";
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (mobile_get_pref($link, "SORT_FEEDS_UNREAD")) {
|
|
|
|
|
|
|
|
$order_by = "unread DESC, title";
|
|
|
|
|
|
|
|
} else {
|
|
|
|
|
|
|
|
$order_by = "title";
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
$result = db_query($link, "SELECT id,
|
|
|
|
$result = db_query($link, "SELECT id,
|
|
|
|
title,
|
|
|
|
title,
|
|
|
|
(SELECT COUNT(id) FROM ttrss_entries,ttrss_user_entries
|
|
|
|
(SELECT COUNT(id) FROM ttrss_entries,ttrss_user_entries
|
|
|
@ -80,7 +110,7 @@
|
|
|
|
ttrss_feeds.owner_uid = '$owner_uid' AND
|
|
|
|
ttrss_feeds.owner_uid = '$owner_uid' AND
|
|
|
|
parent_feed IS NULL AND
|
|
|
|
parent_feed IS NULL AND
|
|
|
|
$cat_query
|
|
|
|
$cat_query
|
|
|
|
ORDER BY unread DESC,title");
|
|
|
|
ORDER BY $order_by");
|
|
|
|
|
|
|
|
|
|
|
|
$title = getCategoryTitle($link, $cat_id);
|
|
|
|
$title = getCategoryTitle($link, $cat_id);
|
|
|
|
|
|
|
|
|
|
|
@ -108,10 +138,12 @@
|
|
|
|
$icon_url = "../images/blank_icon.gif";
|
|
|
|
$icon_url = "../images/blank_icon.gif";
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if ($unread > 0 || !mobile_get_pref($link, "HIDE_READ")) {
|
|
|
|
print "<li class='$class'><a href='feed.php?id=$id&cat=$cat_id'>" .
|
|
|
|
print "<li class='$class'><a href='feed.php?id=$id&cat=$cat_id'>" .
|
|
|
|
"<img class='tinyIcon' src='$icon_url'/>".
|
|
|
|
"<img class='tinyIcon' src='$icon_url'/>".
|
|
|
|
$line["title"] . "</a></li>";
|
|
|
|
$line["title"] . "</a></li>";
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
print "</ul>";
|
|
|
|
print "</ul>";
|
|
|
|
} else if ($cat_id == -1) {
|
|
|
|
} else if ($cat_id == -1) {
|
|
|
@ -132,9 +164,11 @@
|
|
|
|
$class = 'oldItem';
|
|
|
|
$class = 'oldItem';
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if ($unread > 0 || !mobile_get_pref($link, "HIDE_READ")) {
|
|
|
|
print "<li class='$class'>
|
|
|
|
print "<li class='$class'>
|
|
|
|
<a href='feed.php?id=$id&cat_id=-1'>$title</a></li>";
|
|
|
|
<a href='feed.php?id=$id&cat_id=-1'>$title</a></li>";
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
print "</ul>";
|
|
|
|
print "</ul>";
|
|
|
|
} else if ($cat_id == -2) {
|
|
|
|
} else if ($cat_id == -2) {
|
|
|
@ -163,9 +197,10 @@
|
|
|
|
$class = 'oldItem';
|
|
|
|
$class = 'oldItem';
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if ($unread > 0 || !mobile_get_pref($link, "HIDE_READ")) {
|
|
|
|
print "<li class='$class'>
|
|
|
|
print "<li class='$class'>
|
|
|
|
<a href='feed.php?id=$id&cat=-2'>$title</a></li>";
|
|
|
|
<a href='feed.php?id=$id&cat=-2'>$title</a></li>";
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
print "</ul>";
|
|
|
|
print "</ul>";
|
|
|
|
}
|
|
|
|
}
|
|
|
@ -175,7 +210,8 @@
|
|
|
|
$owner_uid = $_SESSION["uid"];
|
|
|
|
$owner_uid = $_SESSION["uid"];
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
print '<ul id="home" title="Feeds" selected="true">';
|
|
|
|
print '<ul id="home" title="'.__('Categories').'" selected="true"
|
|
|
|
|
|
|
|
myBackLabel="Logout" myBackHref="logout.php" myBackTarget="_self">';
|
|
|
|
|
|
|
|
|
|
|
|
foreach (array(-1, -2) as $id) {
|
|
|
|
foreach (array(-1, -2) as $id) {
|
|
|
|
$title = getCategoryTitle($link, $id);
|
|
|
|
$title = getCategoryTitle($link, $id);
|
|
|
@ -202,8 +238,6 @@
|
|
|
|
ttrss_feed_categories.title
|
|
|
|
ttrss_feed_categories.title
|
|
|
|
ORDER BY ttrss_feed_categories.title");
|
|
|
|
ORDER BY ttrss_feed_categories.title");
|
|
|
|
|
|
|
|
|
|
|
|
$cat_ids = array();
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
while ($line = db_fetch_assoc($result)) {
|
|
|
|
while ($line = db_fetch_assoc($result)) {
|
|
|
|
|
|
|
|
|
|
|
|
if ($line["num_feeds"] > 0) {
|
|
|
|
if ($line["num_feeds"] > 0) {
|
|
|
@ -218,12 +252,10 @@
|
|
|
|
$class = 'oldItem';
|
|
|
|
$class = 'oldItem';
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if ($unread > 0 || !mobile_get_pref($link, "HIDE_READ")) {
|
|
|
|
print "<li class='$class'><a href='cat.php?id=$id'>" .
|
|
|
|
print "<li class='$class'><a href='cat.php?id=$id'>" .
|
|
|
|
$line["title"] . "</a></li>";
|
|
|
|
$line["title"] . "</a></li>";
|
|
|
|
|
|
|
|
}
|
|
|
|
array_push($cat_ids, $id);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
@ -244,10 +276,10 @@
|
|
|
|
$class = 'oldItem';
|
|
|
|
$class = 'oldItem';
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
array_push($cat_ids, 0);
|
|
|
|
if ($unread > 0 || !mobile_get_pref($link, "HIDE_READ")) {
|
|
|
|
|
|
|
|
|
|
|
|
print "<li class='$class'><a href='cat.php?id=0'>$title</a></li>";
|
|
|
|
print "<li class='$class'><a href='cat.php?id=0'>$title</a></li>";
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
print "</ul>";
|
|
|
|
print "</ul>";
|
|
|
|
}
|
|
|
|
}
|
|
|
@ -367,6 +399,10 @@
|
|
|
|
$content = sanitize_rss($link, $line["content"]);
|
|
|
|
$content = sanitize_rss($link, $line["content"]);
|
|
|
|
$content = preg_replace("/href=/i", "target=\"_blank\" href=", $content);
|
|
|
|
$content = preg_replace("/href=/i", "target=\"_blank\" href=", $content);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (!mobile_get_pref($link, "SHOW_IMAGES")) {
|
|
|
|
|
|
|
|
$content = preg_replace('/<img[^>]+>/is', '', $content);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
print "<p>$content</p>";
|
|
|
|
print "<p>$content</p>";
|
|
|
|
|
|
|
|
|
|
|
|
print "<fieldset>";
|
|
|
|
print "<fieldset>";
|
|
|
@ -386,6 +422,5 @@
|
|
|
|
print "</div>";
|
|
|
|
print "</div>";
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
?>
|
|
|
|
?>
|
|
|
|