]> git.wh0rd.org - tt-rss.git/commitdiff
add config.php defines for twitter, only enable twitter pane when they are filled in
authorAndrew Dolgov <fox@madoka.volgo-balt.ru>
Mon, 22 Nov 2010 13:31:01 +0000 (16:31 +0300)
committerAndrew Dolgov <fox@madoka.volgo-balt.ru>
Mon, 22 Nov 2010 13:31:01 +0000 (16:31 +0300)
config.php-dist
modules/pref-feeds.php

index a7ab86283815ec2d710a0a315c33920c2b2ce278..824b843c7719bc6312101eef1d1ecc39a09daaa9 100644 (file)
        define('ENABLE_TWEET_BUTTON', false);
        // Enable 'tweet this' button for articles
 
+       define('CONSUMER_KEY', '');
+       define('CONSUMER_SECRET', '');
+       // Your OAuth instance authentication information for Twitter, visit
+       // http://twitter.com/oauth_clients to register your instance.
+
        define('CONFIG_VERSION', 20);
        // Expected config version. Please update this option in config.php
        // if necessary (after migrating all new options from this file).
index df854f35ee73177f332badf194d01424b9705ba3..ed320d191a4cab90719aa450bcf690e7beb6cbd7 100644 (file)
 
                print "</div>"; #pane
 
-               print "<div id=\"pref-feeds-twitter\" dojoType=\"dijit.layout.AccordionPane\" title=\"".__('Twitter')."\">";
+               if (defined('CONSUMER_KEY') && CONSUMER_KEY != '') {
 
-               $result = db_query($link, "SELECT COUNT(*) AS cid FROM ttrss_users
-                       WHERE twitter_oauth IS NOT NULL AND twitter_oauth != '' AND
-                       id = " . $_SESSION['uid']);
-
-               $is_registered = db_fetch_result($result, 0, "cid") != 0;
+                       print "<div id=\"pref-feeds-twitter\" dojoType=\"dijit.layout.AccordionPane\" title=\"".__('Twitter')."\">";
+       
+                       $result = db_query($link, "SELECT COUNT(*) AS cid FROM ttrss_users
+                               WHERE twitter_oauth IS NOT NULL AND twitter_oauth != '' AND
+                               id = " . $_SESSION['uid']);
+       
+                       $is_registered = db_fetch_result($result, 0, "cid") != 0;
+       
+                       if (!$is_registered) {
+                               print_notice(__('Before you can update your Twitter feeds, you must register this instance of Tiny Tiny RSS with Twitter.com.'));
+                       } else {
+                               print_notice(__('You have been successfully registered with Twitter.com and should be able to access your Twitter feeds.'));
+                       }
+       
+                       print "<button dojoType=\"dijit.form.Button\" onclick=\"window.location.href = 'twitter.php?op=register'\">".
+                               __("Register with Twitter.com")."</button>";
+       
+                       print " ";
+       
+                       print "<button dojoType=\"dijit.form.Button\" 
+                               onclick=\"return clearTwitterCredentials()\">".
+                               __("Clear stored credentials")."</button>";
+       
+                       print "</div>"; # pane
 
-               if (!$is_registered) {
-                       print_notice(__('Before you can update your Twitter feeds, you must register this instance of Tiny Tiny RSS with Twitter.com.'));
-               } else {
-                       print_notice(__('You have been successfully registered with Twitter.com and should be able to access your Twitter feeds.'));
                }
 
-               print "<button dojoType=\"dijit.form.Button\" onclick=\"window.location.href = 'twitter.php?op=register'\">".
-                       __("Register with Twitter.com")."</button>";
-
-               print " ";
-
-               print "<button dojoType=\"dijit.form.Button\" 
-                       onclick=\"return clearTwitterCredentials()\">".
-                       __("Clear stored credentials")."</button>";
-
-               print "</div>";
-
                print "</div>"; #container
 
        }