Another bug in LastComments
  • Sorry for flooding you with complaints and questions, but this is because I like FlatPress and am using it.
    Now, a reader had called my attention to the fact that deleted comments stay listed in LastComments. I have no idea what to do, where and how, but isn’t it possible to rebuild the LastComments cache after deleting a comment, or simply to remove its record?
  • that's because lastcomments is a quick & dirty plugin, just like postViews.
    the cache is in fp-content/cache/lastcomments.tmp
    if you delete it, it won't be recreated. Comments are added to the cache only on submission. I think @pierovdfn might have written a better plugin, but I'm not sure.
  • I think it's a nice feature but it's, as you know, flat files make some things difficult.
    I've just made a plugin to keep the cache of last_comments when you delete the cache but I haven't written a plugin that it's a good replacement for last comments.
    I think that if I would have this feature I would use the hooks of admin panel, but last comments would remain a quick & dirty plugin.
    Maybe if in the comment_delete function there were a hook it could be easy to do a good job.
  • now there is 
    do_action('comment_delete', $id, $comment_id);
    in SVN
  • Thanks :-)
    However I have a doubt: all handlers of this hook must return $id, otherwise the functions that are called later won't have they id, will they?
    So, if I am right, it should be better using an empty parameter as first param.
  • it's an action, not a filter. actions are void
  • Sorry, what does SVN mean?
  • There is a ready to use plugin from fabrix for the lastcomments. With this plugin you can manually rebuild all comments in Flatpress.

    http://flatpress.org/vanilla2/discussion/comment/5528#Comment_5528

    And SVN means "subversion", which means, the current developer version. You can get it here:

    http://flatpress.svn.sourceforge.net/viewvc/flatpress/


  • Thank you, Laborix, this helped a lot. Now my last comments list is up to date. :)

In this Discussion