[geeklog-modules] Plugins and comments

geeklog-modules-admin at lists.geeklog.net geeklog-modules-admin at lists.geeklog.net
Tue Apr 29 12:36:48 EDT 2003


Dirk,

PLG_handlePluginComment was added to lib-plugins to handle save and delete
of comments via the operation parameter. I'd agree with your suggestion. It
will call all plugins if the function exists.

Blaine
----- Original Message -----
From: <geeklog-modules-admin at lists.geeklog.net>
To: <geeklog-modules at lists.geeklog.net>
Sent: Tuesday, April 29, 2003 10:49 AM
Subject: [geeklog-modules] Plugins and comments


> Well, it seems we still have some problems with plugins and comments.
> Take this, for example (from comments.php):
>
> function deletecomment($cid,$sid,$type)
> {
>     global $_TABLES, $_CONF, $_USER, $REMOTE_ADDR;
>
>     if (!empty ($sid) && !empty ($cid) && is_numeric ($cid)) {
>         $result = DB_query ("SELECT o
> wner_id,group_id,perm_owner,perm_group,perm_members,perm_anon FROM
> {$_TABLES['stories']} WHERE sid = '{$sid}'");
>         $P = DB_fetchArray ($result);
>         if (SEC_hasAccess ($A['owner_id'], $A['group_id'],
> $A['perm_owner'], $A['perm_group'], $A['perm_members'], $A['perm_anon'])
> == 3) {
>
>
> Ignore that stupid typo ("$P = DB_fetchArray" should be "$A = ...") for
> the moment. The problem here is that this code prevents deletion of
> comments from anything but stories.
>
> So how are plugins handling deletion of comments currently? A bit further
> down in comments.php, this function is called:
>
>     PLG_handlePluginComment($type,$sid,'delete');
>
> But, of course, as things are now, this will never be called.
>
> Since Geeklog can't really know how the plugin's tables are named and how
> (if at all) it handles permissions, I'd suggest that Geeklog should leave
> the deletion of comments entirely to plugins, i.e. something like:
>
>     if (comment_type == 'article' || comment_type == 'poll')
>         geeklog_handles_it
>     else
>         let_the_plugin_handle_it
>
> Comments?
>
> bye, Dirk
>
>
> --
> http://www.haun-online.de/
> http://mypod.de/
>
> _______________________________________________
> geeklog-modules mailing list
> geeklog-modules at lists.geeklog.net
> http://lists.geeklog.net/listinfo/geeklog-modules




More information about the geeklog-modules mailing list