minutils / feed-on-feeds

Released in 2003, saw the rise and fall of Google Reader, reached perfection in 2011
http://feedonfeeds.com/
GNU General Public License v2.0
14 stars 9 forks source link

Can't delete feeds #55

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
Brand new installation of FonF 0.5, with a large number of feeds imported
via OPML.  Some of the feeds have gone bad, and I'd like to delete them. 
Clicking the 'd' link in the feed listing produces the following error:

Warning: join() [function.join]: Invalid arguments passed in [server
path]/fonf/fof-db.php on line 255
Cannot query database. Have you run install.php to create or upgrade your
installation? MySQL says: You have an error in your SQL syntax; check the
manual that corresponds to your MySQL server version for the right syntax
to use near ')' at line 1

This installation is hosted on Dreamhost, Apache 2.0.63, PHP 5.2.6

Original issue reported on code.google.com by fluffy%b...@gtempaccount.com on 6 May 2009 at 7:15

GoogleCodeExporter commented 9 years ago
It turns out this problem only occurs on feeds which have had other problems 
due to
what I mentioned in ticket #56.  The issues are probably related.

Original comment by fluffy%b...@gtempaccount.com on 7 May 2009 at 6:30

GoogleCodeExporter commented 9 years ago
Got sick of Google again so switched back to FonF. Still having this problem, 
two years later. C'est la vie.

Original comment by flu...@beesbuzz.biz on 5 Aug 2011 at 8:39

GoogleCodeExporter commented 9 years ago
Easy fix, by changing fof_db_delete_subscription:

function fof_db_delete_subscription($user_id, $feed_id)
{
    global $FOF_SUBSCRIPTION_TABLE, $FOF_ITEM_TAG_TABLE;

        $result = fof_db_get_items($user_id, $feed_id, $what="all", NULL, NULL);

    $items = array();
    foreach($result as $r)
    {
        $items[] = $r['item_id'];
    }

    fof_safe_query("delete from $FOF_SUBSCRIPTION_TABLE where feed_id = %d and user_id = %d", $feed_id, $user_id);

    if (count($items)) {
        $itemclause = join(", ", $items);
        fof_safe_query("delete from $FOF_ITEM_TAG_TABLE where user_id = %d and item_id in ($itemclause)", $user_id);
    }
}

Original comment by jsha...@gmail.com on 15 Sep 2011 at 5:11