]> git.wh0rd.org - tt-rss.git/blobdiff - classes/handler/public.php
upd: default css url if no theme
[tt-rss.git] / classes / handler / public.php
index 56fe59b715596784afc2f3bfcdb1311b5440d09e..9fccf884b45a3ea915855e57193662949f8c7978 100644 (file)
@@ -15,14 +15,11 @@ class Handler_Public extends Handler {
                if (!$limit) $limit = 60;
 
                $date_sort_field = "date_entered DESC, updated DESC";
-               $date_check_field = "date_entered";
 
                if ($feed == -2 && !$is_cat) {
                        $date_sort_field = "last_published DESC";
-                       $date_check_field = "last_published";
                } else if ($feed == -1 && !$is_cat) {
                        $date_sort_field = "last_marked DESC";
-                       $date_check_field = "last_marked";
                }
 
                switch ($order) {
@@ -36,39 +33,6 @@ class Handler_Public extends Handler {
                        $date_sort_field = "updated DESC";
                        break;
                }
-
-               $params = array(
-                       "owner_uid" => $owner_uid,
-                       "feed" => $feed,
-                       "limit" => 1,
-                       "view_mode" => $view_mode,
-                       "cat_view" => $is_cat,
-                       "search" => $search,
-                       "override_order" => $date_sort_field,
-                       "include_children" => true,
-                       "ignore_vfeed_group" => true,
-                       "offset" => $offset,
-                       "start_ts" => $start_ts
-               );
-
-               $qfh_ret = Feeds::queryFeedHeadlines($params);
-
-               $result = $qfh_ret[0];
-
-               if (db_num_rows($result) != 0) {
-
-                       $ts = strtotime(db_fetch_result($result, 0, $date_check_field));
-
-                       if (isset($_SERVER['HTTP_IF_MODIFIED_SINCE']) &&
-                                       strtotime($_SERVER['HTTP_IF_MODIFIED_SINCE']) >= $ts) {
-                     header('HTTP/1.0 304 Not Modified');
-                     return;
-                       }
-
-                       $last_modified = gmdate("D, d M Y H:i:s", $ts) . " GMT";
-                       header("Last-Modified: $last_modified", true);
-               }
-
                $params = array(
                        "owner_uid" => $owner_uid,
                        "feed" => $feed,
@@ -106,7 +70,7 @@ class Handler_Public extends Handler {
                        $tpl->setVariable('FEED_URL', htmlspecialchars($feed_self_url), true);
 
                        $tpl->setVariable('SELF_URL', htmlspecialchars(get_self_url_prefix()), true);
-                       while ($line = db_fetch_assoc($result)) {
+                       while ($line = $result->fetch()) {
 
                                $line["content_preview"] = sanitize(truncate_string(strip_tags($line["content"]), 100, '...'));
 
@@ -194,7 +158,7 @@ class Handler_Public extends Handler {
 
                        $feed['articles'] = array();
 
-                       while ($line = db_fetch_assoc($result)) {
+                       while ($line = $result->fetch()) {
 
                                $line["content_preview"] = sanitize(truncate_string(strip_tags($line["content_preview"]), 100, '...'));
 
@@ -328,7 +292,7 @@ class Handler_Public extends Handler {
        function rss() {
                $feed = $_REQUEST["id"];
                $key = $_REQUEST["key"];
-               $is_cat = sql_bool_to_bool($_REQUEST["is_cat"]);
+               $is_cat = $_REQUEST["is_cat"];
                $limit = (int)$_REQUEST["limit"];
                $offset = (int)$_REQUEST["offset"];
 
@@ -338,7 +302,7 @@ class Handler_Public extends Handler {
                $start_ts = $_REQUEST["ts"];
 
                $format = $_REQUEST['format'];
-               $orig_guid = sql_bool_to_bool($_REQUEST["orig_guid"]);
+               $orig_guid = $_REQUEST["orig_guid"];
 
                if (!$format) $format = 'atom';
 
@@ -574,14 +538,16 @@ class Handler_Public extends Handler {
                        header('Content-Type: text/html; charset=utf-8');
                        print "<html>
                                <head>
-                                       <title>Tiny Tiny RSS</title>
-                                       <link rel=\"stylesheet\" type=\"text/css\" href=\"css/utility.css\">
-                                       <meta http-equiv=\"Content-Type\" content=\"text/html; charset=utf-8\"/>
-                                       <link rel=\"shortcut icon\" type=\"image/png\" href=\"images/favicon.png\">
-                                       <link rel=\"icon\" type=\"image/png\" sizes=\"72x72\" href=\"images/favicon-72px.png\">
+                                       <title>Tiny Tiny RSS</title>";
+            print stylesheet_tag("css/utility.css");
+                       print stylesheet_tag("css/default.css");
+
+            print "<meta http-equiv=\"Content-Type\" content=\"text/html; charset=utf-8\"/>
+                <link rel=\"shortcut icon\" type=\"image/png\" href=\"images/favicon.png\">
+                <link rel=\"icon\" type=\"image/png\" sizes=\"72x72\" href=\"images/favicon-72px.png\">
 
                                </head>
-                               <body>
+                               <body class='claro'>
                                <img class=\"floatingLogo\" src=\"images/logo_small.png\"
                                        alt=\"Tiny Tiny RSS\"/>
                                        <h1>".__("Subscribe to feed...")."</h1><div class='content'>";
@@ -888,7 +854,7 @@ class Handler_Public extends Handler {
 
                        <?php
                                @$op = $_REQUEST["subop"];
-                               $updater = new DbUpdater(Db::get(), DB_TYPE, SCHEMA_VERSION);
+                               $updater = new DbUpdater(Db::pdo(), DB_TYPE, SCHEMA_VERSION);
 
                                if ($op == "performupdate") {
                                        if ($updater->isUpdateRequired()) {