Commit 92abbe70 authored by Sebastian Reichel's avatar Sebastian Reichel

Imported Upstream version 1.7.6+dfsg

parent 4aa037ae

Too many changes to show.

To preserve performance only 1000 of 1000+ files are displayed.

<?xml version="1.0" encoding="UTF-8"?>
<classpath>
<classpathentry kind="src" path="">
<attributes>
<attribute name="provider" value="org.eclipse.wst.jsdt.web.core.internal.project.ModuleSourcePathProvider"/>
</attributes>
</classpathentry>
<classpathentry kind="con" path="org.eclipse.wst.jsdt.launching.JRE_CONTAINER"/>
<classpathentry kind="con" path="org.eclipse.wst.jsdt.launching.WebProject">
<attributes>
<attribute name="hide" value="true"/>
</attributes>
</classpathentry>
<classpathentry kind="con" path="org.eclipse.wst.jsdt.launching.baseBrowserLibrary"/>
<classpathentry kind="output" path=""/>
</classpath>
#Sat Dec 10 20:07:32 MSK 2011
eclipse.preferences.version=1
include_path=0;/tt-rss
org.eclipse.wst.jsdt.launching.baseBrowserLibrary
\ No newline at end of file
......@@ -17,6 +17,8 @@
require_once "functions.php";
require_once "sessions.php";
ini_set("session.gc_maxlifetime", 86400);
define('AUTH_DISABLE_OTP', true);
if (defined('ENABLE_GZIP_OUTPUT') && ENABLE_GZIP_OUTPUT &&
......@@ -46,10 +48,11 @@
if ($_REQUEST["sid"]) {
session_id($_REQUEST["sid"]);
@session_start();
} else if (defined('_API_DEBUG_HTTP_ENABLED')) {
@session_start();
}
@session_start();
if (!init_connection($link)) return;
$method = strtolower($_REQUEST["op"]);
......
......@@ -41,7 +41,6 @@
<p><a href="{enclosure/@url}">Extra...</a></p>
</xsl:if>
<hr/>
</xsl:for-each>
......
......@@ -43,8 +43,6 @@
require_once "db.php";
require_once "db-prefs.php";
no_cache_incantation();
startup_gettext();
$script_started = microtime(true);
......
......@@ -63,17 +63,59 @@ div.cdmContentInner img {
}
div.cdmFooter {
background-color : #f0f0f0;
background-image : url("images/cdm_footer_tile.png");
padding : 5px;
font-weight : normal;
color : gray;
clear : both;
}
.Selected div.cdmFooter {
background-color : #FFE587;
background-image : url("images/cdm_footer_selected.png");
div.cdm {
border-width : 0px 1px 1px 0px;
border-collapse : collapse;
border-color : #c0c0c0;
border-style : solid;
background : #fafafa;
}
div.cdm.expandable {
background : #f0f0f0;
}
div.cdm.expanded, div.cdm.expandable {
margin : 4px 4px 0px 4px;
border-width : 1px;
border-color : #c0c0c0;
box-shadow : 0px 0px 3px #ccc;
}
div.cdm.expanded div.cdmHeader {
background : #e0e0e0;
}
div.cdm.Unread {
background : white;
}
div.cdm.Unread div.cdmHeader {
background : #ecf4ff;
}
div.cdm.active {
border-color : #88b0f0;
background : white ! important;
box-shadow : 0px 0px 3px #4684ff;
}
div.cdm.active div.cdmHeader {
background : #ecf4ff;
}
div.cdm.active div.cdmHeader a.title {
color : #4684ff;
}
div.cdm.active div.cdmContent {
background : white;
}
span.cdmExcerpt {
......@@ -120,30 +162,6 @@ div.cdmHeader span.hlFeed {
font-style : italic;
}
div.cdm.expanded .cdmHeader {
background : #EEF6FD;
}
div.cdm.expanded.Unread div.cdmHeader {
background : #DCECFB;
}
div.cdm.expanded.Unread.Selected div.cdmHeader, div.cdm.expanded.Selected div.cdmHeader {
background : #FFEA9E;
}
div.cdm.active.Selected div.cdmHeader {
background : #FFEA9E;
}
div.cdm.expanded.even.Unread, div.cdm.expanded.odd.Unread {
background : white;
}
div.cdm.expanded.even, div.cdm.expanded.odd {
background : #f9f9f9;
}
div.cdmHeader div.hlFeed, div.cdmHeader div.hlFeed a {
vertical-align : middle;
color : gray;
......@@ -174,3 +192,4 @@ div.cdm.expanded div.cdmHeader a.title, div.cdm.active div.cdmHeader a.title {
font-size : 13px;
}
......@@ -2,7 +2,7 @@
class API extends Handler {
const API_LEVEL = 4;
const API_LEVEL = 5;
const STATUS_OK = 0;
const STATUS_ERR = 1;
......@@ -47,6 +47,9 @@ class API extends Handler {
}
function login() {
@session_destroy();
@session_start();
$login = db_escape_string($this->link, $_REQUEST["user"]);
$password = $_REQUEST["password"];
$password_base64 = base64_decode($_REQUEST["password"]);
......@@ -122,6 +125,7 @@ class API extends Handler {
function getCategories() {
$unread_only = sql_bool_to_bool($_REQUEST["unread_only"]);
$enable_nested = sql_bool_to_bool($_REQUEST["enable_nested"]);
$include_empty = sql_bool_to_bool($_REQUEST['include_empty']);
// TODO do not return empty categories, return Uncategorized and standard virtual cats
......@@ -133,7 +137,10 @@ class API extends Handler {
$result = db_query($this->link, "SELECT
id, title, order_id, (SELECT COUNT(id) FROM
ttrss_feeds WHERE
ttrss_feed_categories.id IS NOT NULL AND cat_id = ttrss_feed_categories.id) AS num_feeds
ttrss_feed_categories.id IS NOT NULL AND cat_id = ttrss_feed_categories.id) AS num_feeds,
(SELECT COUNT(id) FROM
ttrss_feed_categories AS c2 WHERE
c2.parent_cat = ttrss_feed_categories.id) AS num_cats
FROM ttrss_feed_categories
WHERE $nested_qpart AND owner_uid = " .
$_SESSION["uid"]);
......@@ -141,7 +148,7 @@ class API extends Handler {
$cats = array();
while ($line = db_fetch_assoc($result)) {
if ($line["num_feeds"] > 0) {
if ($include_empty || $line["num_feeds"] > 0 || $line["num_cats"] > 0) {
$unread = getFeedUnread($this->link, $line["id"], true);
if ($enable_nested)
......@@ -158,12 +165,14 @@ class API extends Handler {
}
foreach (array(-2,-1,0) as $cat_id) {
$unread = getFeedUnread($this->link, $cat_id, true);
if ($include_empty || !$this->isCategoryEmpty($cat_id)) {
$unread = getFeedUnread($this->link, $cat_id, true);
if ($unread || !$unread_only) {
array_push($cats, array("id" => $cat_id,
"title" => getCategoryTitle($this->link, $cat_id),
"unread" => $unread));
if ($unread || !$unread_only) {
array_push($cats, array("id" => $cat_id,
"title" => getCategoryTitle($this->link, $cat_id),
"unread" => $unread));
}
}
}
......@@ -190,13 +199,23 @@ class API extends Handler {
$include_nested = sql_bool_to_bool($_REQUEST["include_nested"]);
$sanitize_content = true;
$override_order = false;
switch ($_REQUEST["order_by"]) {
case "date_reverse":
$override_order = "date_entered, updated";
break;
case "feed_dates":
$override_order = "updated DESC";
break;
}
/* do not rely on params below */
$search = db_escape_string($this->link, $_REQUEST["search"]);
$search_mode = db_escape_string($this->link, $_REQUEST["search_mode"]);
$headlines = $this->api_get_headlines($this->link, $feed_id, $limit, $offset,
$filter, $is_cat, $show_excerpt, $show_content, $view_mode, false,
$filter, $is_cat, $show_excerpt, $show_content, $view_mode, $override_order,
$include_attachments, $since_id, $search, $search_mode,
$include_nested, $sanitize_content);
......@@ -321,6 +340,12 @@ class API extends Handler {