]> git.wh0rd.org - tt-rss.git/blobdiff - index.php
support comments on simplepie properly
[tt-rss.git] / index.php
index 9d17da7bc9837a21ffe1a36d732fbded1c23a4b9..445a8fa75e2b5b8da50990b62d3f6f545cb7f907 100644 (file)
--- a/index.php
+++ b/index.php
@@ -5,8 +5,8 @@
                exit;
        }
 
-       set_include_path(get_include_path() . PATH_SEPARATOR .
-               dirname(__FILE__) ."/include");
+       set_include_path(dirname(__FILE__) ."/include" . PATH_SEPARATOR .
+               get_include_path());
 
        require_once "functions.php";
        require_once "sessions.php";
        require_once "version.php";
        require_once "config.php";
        require_once "db-prefs.php";
+       require_once "lib/Mobile_Detect.php";
+
+       $mobile = new Mobile_Detect();
+
+       if (!$_REQUEST['mobile']) {
+               if ($mobile->isTablet()) {
+                       header('Location: digest.php');
+                       exit;
+               } else if ($mobile->isMobile()) {
+                       header('Location: mobile/index.php');
+                       exit;
+               }
+       }
 
        $link = db_connect(DB_HOST, DB_USER, DB_PASS, DB_NAME);
 
        <?php print_user_stylesheet($link) ?>
 
        <script type="text/javascript">
-       <?php foreach (explode(",", ARTICLE_BUTTON_PLUGINS) as $p) {
-               $jsf = "js/${p}_button.js";
-               if (file_exists($jsf)) {
-                       include $jsf;
-                       print "</script>";
-               }
-       } ?>
        </script>
 
        <link rel="shortcut icon" type="image/png" href="images/favicon.png"/>
        <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>
 
+       <script type="text/javascript">
+       <?php
+               require 'lib/jsmin.php';
+
+               foreach (explode(",", ARTICLE_BUTTON_PLUGINS) as $p) {
+                       $jsf = "js/".trim($p)."_button.js";
+                       if (file_exists($jsf)) {
+                               echo JSMin::minify(file_get_contents($jsf));
+                       }
+               }
+
+               foreach (array("tt-rss", "functions", "feedlist", "viewfeed", "FeedTree") as $js) {
+                       if (!isset($_GET['debug'])) {
+                               echo JSMin::minify(file_get_contents("js/$js.js"));
+                       } else {
+                               echo file_get_contents("js/$js.js");
+                       }
+               }
+       ?>
+       </script>
+
        <meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
 
        <script type="text/javascript">
 </div>
 
 <div id="header">
-       <?php if (!SINGLE_USER_MODE) { ?>
+       <?php if (!$_SESSION["hide_hello"]) { ?>
                        <?php echo __('Hello,') ?> <b><?php echo $_SESSION["name"] ?></b> |
        <?php } ?>
        <a href="prefs.php"><?php echo __('Preferences') ?></a>
                                <?php echo __('Comments?') ?></a>
        <?php } ?>
 
-       <?php if (!SINGLE_USER_MODE) { ?>
+       <?php if (!$_SESSION["hide_logout"]) { ?>
                        | <a href="backend.php?op=logout"><?php echo __('Logout') ?></a>
        <?php } ?>
 
                </select>
 
                <button dojoType="dijit.form.Button" name="update"
-                       onclick="scheduleFeedUpdate()">
+                       onclick="viewCurrentFeed()">
                        <?php echo __('Update') ?></button>
 
                <button dojoType="dijit.form.Button"