]> git.wh0rd.org - tt-rss.git/blobdiff - index.php
support comments on simplepie properly
[tt-rss.git] / index.php
index 80e3ebf9ee3d25b93448e9234b81692985083d61..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);
 
                }
 
                foreach (array("tt-rss", "functions", "feedlist", "viewfeed", "FeedTree") as $js) {
-                       echo JSMin::minify(file_get_contents("js/$js.js"));
+                       if (!isset($_GET['debug'])) {
+                               echo JSMin::minify(file_get_contents("js/$js.js"));
+                       } else {
+                               echo file_get_contents("js/$js.js");
+                       }
                }
        ?>
        </script>
 </div>
 
 <div id="header">
-       <?php if (!SINGLE_USER_MODE && !(ALLOW_REMOTE_USER_AUTH && AUTO_LOGIN)) { ?>
+       <?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 && !(ALLOW_REMOTE_USER_AUTH && AUTO_LOGIN)) { ?>
+       <?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"