[geeklog-devel] Deleting comments

Vincent Furia vfuria at gmail.com
Sat Jan 22 21:22:49 EST 2005


With Dirk's blessing to break the comment plugin API.  Here is my idea thus far:

CMT_deleteComment and CMT_saveComment will be limited to exactly that
functionality.  They will act no different for articles or polls as
they would for any other variable.  They will return 0 for success or
>0 for failure (and log the failure to the errorLog).  I plan on doing
something similar for CMT_commentForm.

So there will now be plugin functions for saving and deleting comments
which should simply call these functions when they are ready (and
determine that the correct permissions hold, etc).

I'll continue with this approach if it sounds good to everyone.  I'd
especially like some feedback from anyone currently using the plugin
comment functionality.

-Vinny


On Sat, 22 Jan 2005 11:00:58 +0100, Dirk Haun <dirk at haun-online.de> wrote:
> Vincent Furia wrote:
> 
> >Next step is to look at redoing the comment API (especially for
> >deletes).
> 
> For the trackback comments, I've introduced a function that only checks
> with the plugin if it would be okay for the current user to delete a
> comment on an object under the plugin's control. The actual delete is
> then done by Geeklog.
> 
> /**
> * Ask plugins to handle a trackback comment operation.
> *
> * Operations:
> * 'accept' - does the plugin accept a trackback comment for its entry $id,
> *            returns: true or false
> * 'delete' - does the user have permission to delete comments on entry $id,
> *            returns: true or false
> * 'info'   - plugin is asked to provide information on entry $id,
> *            returns: array (url, title, excerpt)
> *
> * @param    string  $type       plugin type
> * @param    string  $id         ID of an entry under the plugin's control
> * @param    string  $operation  operation to perform
> * @return   mixed               depends on the operation (see above)
> *
> */
> function PLG_handleTrackbackComment ($type, $id, $operation)
> 
> Since this isn't used anywhere yet, we could easily change it to keep it
> in sync with the plugin API for "normal" comments.
> 
> 
> >The tough part of that will be keeping it backwards compatible.
> 
> Since the current delete is actually messing up the comments, I'd say we
> should break it on purpose ...
> 
> bye, Dirk
> 
> --
> http://www.haun-online.de/
> http://mypod.de/
> 
> _______________________________________________
> geeklog-devel mailing list
> geeklog-devel at lists.geeklog.net
> http://lists.geeklog.net/listinfo/geeklog-devel
>



More information about the geeklog-devel mailing list