]> git.wh0rd.org - tt-rss.git/commitdiff
fix possible bug in tag-processing part of update_rss_feed
authorAndrew Dolgov <fox@madoka.spb.ru>
Mon, 21 Nov 2005 07:27:17 +0000 (08:27 +0100)
committerAndrew Dolgov <fox@madoka.spb.ru>
Mon, 21 Nov 2005 07:27:17 +0000 (08:27 +0100)
backend.php
functions.php

index 6a0a02ecefc0623dd2a073a812d7464d31eff83b..f1a3f75c0140092de6729f9231c401000f79b158 100644 (file)
                </table>";
 
                $result = db_query($link, "SELECT 
-                               id,login,access_level,last_login
+                               id,login,access_level,
+                               SUBSTRING(last_login,1,16) as last_login
                        FROM 
                                ttrss_users
                        ORDER by login");
 
                print "<div class='infoBoxContents'>";
 
-               $result = db_query($link, "SELECT login,last_login,access_level,
+               $result = db_query($link, "SELECT login,
+                       SUBSTRING(last_login,1,16) AS last_login,
+                       access_level,
                        (SELECT COUNT(int_id) FROM ttrss_user_entries 
                                WHERE owner_uid = id) AS stored_articles
                        FROM ttrss_users 
index 35460efbd95f9f7d2810d9ca56005291265a3411..0d4ee78dec2971f7aae76ea498aed0a8e794b879 100644 (file)
                                                AND feed_id = '$feed' AND ref_id = id
                                                AND owner_uid = '$owner_uid'");
 
-                                       if (!$result || db_num_rows($result) != 1) {
-                                               return;
-                                       }
-
-                                       $entry_id = db_fetch_result($result, 0, "id");
-                                       $entry_int_id = db_fetch_result($result, 0, "int_id");
-                                       
-                                       foreach ($entry_tags as $tag) {
-                                               $tag = db_escape_string(strtolower($tag));
-
-                                               $tag = str_replace("technorati tag: ", "", $tag);
-
-                                               $result = db_query($link, "SELECT id FROM ttrss_tags            
-                                                       WHERE tag_name = '$tag' AND post_int_id = '$entry_int_id' AND 
-                                                       owner_uid = '$owner_uid' LIMIT 1");
-
-//                                             print db_fetch_result($result, 0, "id");
-
-                                               if ($result && db_num_rows($result) == 0) {
-                                                       
-//                                                     print "tagging $entry_id as $tag<br>";
+                                       if (db_num_rows($result) == 1) {
 
-                                                       db_query($link, "INSERT INTO ttrss_tags 
-                                                               (owner_uid,tag_name,post_int_id)
-                                                               VALUES ('$owner_uid','$tag', '$entry_int_id')");
-                                               }                                                       
+                                               $entry_id = db_fetch_result($result, 0, "id");
+                                               $entry_int_id = db_fetch_result($result, 0, "int_id");
+                                               
+                                               foreach ($entry_tags as $tag) {
+                                                       $tag = db_escape_string(strtolower($tag));
+       
+                                                       $tag = str_replace("technorati tag: ", "", $tag);
+       
+                                                       $result = db_query($link, "SELECT id FROM ttrss_tags            
+                                                               WHERE tag_name = '$tag' AND post_int_id = '$entry_int_id' AND 
+                                                               owner_uid = '$owner_uid' LIMIT 1");
+       
+       //                                              print db_fetch_result($result, 0, "id");
+       
+                                                       if ($result && db_num_rows($result) == 0) {
+                                                               
+       //                                                      print "tagging $entry_id as $tag<br>";
+       
+                                                               db_query($link, "INSERT INTO ttrss_tags 
+                                                                       (owner_uid,tag_name,post_int_id)
+                                                                       VALUES ('$owner_uid','$tag', '$entry_int_id')");
+                                                       }                                                       
+                                               }
                                        }
                                } 
                        }