]> git.wh0rd.org Git - tt-rss.git/commitdiff
remove subselect from theme query, expand password range
authorAndrew Dolgov <fox@bah.spb.su>
Thu, 29 Dec 2005 13:51:08 +0000 (14:51 +0100)
committerAndrew Dolgov <fox@bah.spb.su>
Thu, 29 Dec 2005 13:51:08 +0000 (14:51 +0100)
functions.php

index 11eb267966e0ca16b51e152d1158606c25e991b1..26fcbbdcd5c1ef78e61cd594d36463ad481a09e6 100644 (file)
 //             db_query($link, "BEGIN");
 
                $result = db_query($link, "SELECT feed_url,id,
-                       substring(last_updated,1,19) as last_updated,
+                       SUBSTRING(last_updated,1,19) AS last_updated,
                        update_interval FROM ttrss_feeds WHERE owner_uid = '$user_id'
                        ORDER BY last_updated DESC");
 
        function make_password($length = 8) {
 
                $password = "";
-               $possible = "0123456789bcdfghjkmnpqrstvwxyz"; 
-    
-               $i = 0; 
+               $possible = "0123456789abcdfghjkmnpqrstvwxyzABCDFGHJKMNPQRSTVWXYZ"; 
+               
+       $i = 0; 
     
                while ($i < $length) { 
                        $char = substr($possible, mt_rand(0, strlen($possible)-1), 1);
        }
 
        function get_user_theme_path($link) {
-               $result = db_query($link, "SELECT theme_path FROM ttrss_themes
-                       WHERE id = (SELECT theme_id FROM ttrss_users 
-                               WHERE id = " . $_SESSION["uid"] . ")");
+               $result = db_query($link, "SELECT theme_path 
+                       FROM 
+                               ttrss_themes,ttrss_users
+                       WHERE ttrss_themes.id = theme_id AND ttrss_users.id = " . $_SESSION["uid"]);
                if (db_num_rows($result) != 0) {
                        return db_fetch_result($result, 0, "theme_path");
                } else {