]> git.wh0rd.org Git - tt-rss.git/commitdiff
update SITE_TITLE customization to work without needing to be pre-defined, make it...
authorRichard Beales <rich@richbeales.net>
Thu, 21 Mar 2013 20:24:26 +0000 (20:24 +0000)
committerRichard Beales <rich@richbeales.net>
Thu, 21 Mar 2013 20:24:26 +0000 (20:24 +0000)
config.php-dist
include/functions.php
index.php
js/tt-rss.js
prefs.php
register.php

index 4414e77d36fc049bc66018161499ee3141b4eace..176949fd984fb5d21f0a9f72e19b1a59d72e36a3 100644 (file)
        // Users may enable other user plugins from Preferences/Plugins but may not
        // disable plugins specified in this list.
 
-    define('PAGE_TITLE','Tiny Tiny RSS');
+    define('SITE_TITLE', 'Tiny Tiny RSS');
     // Change this value to customize the HTML page title
 
        define('CONFIG_VERSION', 26);
index 5d5550059b5b695c7f5ff3f9d21d69e22fa49925..879a03e3ff7dcc50a0694dea15ee34b34ba0624b 100644 (file)
                return $max_ts;
        }
 
+    function get_site_title() {
+        $original_title = "Tiny Tiny RSS";
+        if (defined("SITE_TITLE")) {
+            return SITE_TITLE;
+        }
+        return $original_title;
+    }
 ?>
index 5a37c0e988a719282e4cda9363cdeb936162ddf8..4669a2080f540781652514504c29434f1e8f8e27 100644 (file)
--- a/index.php
+++ b/index.php
@@ -53,7 +53,7 @@
        "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
 <html>
 <head>
-    <title><?php echo PAGE_TITLE ?></title>
+    <title><?php echo get_site_title() ?></title>
 
        <?php echo stylesheet_tag("lib/dijit/themes/claro/claro.css"); ?>
        <?php echo stylesheet_tag("tt-rss.css"); ?>
index 1d6540dbb47e90c8b6a94551cda23d9e49bbf7e2..91aff8b6878ba55da30f8f8afbb38c2c5f79891c 100644 (file)
@@ -179,9 +179,9 @@ function search() {
 
 function updateTitle() {
        var tmp = document.title; 
-    if (tmp.indexOf('(')>0)
+    if (tmp.indexOf(")") > 0)
     {
-       tmp = tmp.substr(0,tmp.lastIndexOf('('));
+       tmp = tmp.substr(tmp.indexOf(")") + 1);
     }
 
        if (global_unread > 0) {
index 9c59d6c4d6f651cc2fe1a54116b712a111e1bc33..0d27a6e814c246233c9cef8192b72f883cb5ce1b 100644 (file)
--- a/prefs.php
+++ b/prefs.php
@@ -23,7 +23,7 @@
        "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
 <html>
 <head>
-       <title><?php echo PAGE_TITLE ?> : <?php echo __("Preferences") ?></title>
+       <title><?php echo get_site_title() ?> : <?php echo __("Preferences") ?></title>
 
        <?php echo stylesheet_tag("lib/dijit/themes/claro/claro.css"); ?>
        <?php echo stylesheet_tag("tt-rss.css"); ?>
index d7ba7da5f860f3fd97200a1c5fcbe2308903d5f6..69a3dbf5031e0330a05e362691e73173a77bc4d1 100644 (file)
@@ -27,7 +27,7 @@
                print '<?xml version="1.0" encoding="utf-8"?>';
                print "<feed xmlns=\"http://www.w3.org/2005/Atom\">
                        <id>".htmlspecialchars(SELF_URL_PATH . "/register.php")."</id>
-                       <title><?php echo PAGE_TITLE ?> registration slots</title>
+                       <title><?php echo get_site_title() ?> registration slots</title>
                        <link rel=\"self\" href=\"".htmlspecialchars(SELF_URL_PATH . "/register.php?format=feed")."\"/>
                        <link rel=\"alternate\" href=\"".htmlspecialchars(SELF_URL_PATH)."\"/>";