[geeklog-devel] Plugin API's for comments

Vincent Furia vfuria at gmail.com
Mon Feb 7 00:27:57 EST 2005

On Sun, 6 Feb 2005 17:35:46 -0500, Blaine Lang <geeklog at langfamily.ca> wrote:
> Vinny, 
> I am writting new functions for the filemgmt plugin to use the new comment
> API's. Once I have these working well on a new install, I can provide some
> updated docs. Looks like I will need to also have a update script since
> there will be some data changes. 
> Looking at the commentbar - I see the URL {parent_url} set for plugins is an
> assumed plugin_dir/index.php. 
> This may not be too bad for most plugins and I can add code to handle this
> in my case since it's not the script I want to use. 
> But .. I have no idea when the plugin index.php is called that it's being
> called from the commentbar or that I should now show the comments. 
> The parm passed is $_POST['id'] which is too generic and most plugins
> already use a parm called id. 
> There needs to be another parm used or a parm passed indicating the mode is
> to displaycomments. 
That ID refers to the plugins "item".  It should be the unique
identifier for whatever item the comments are about.  It is only used
as a link back up to the "item" that the comments are about.  It is up
to the plugin if/how comments are displayed on that page.

> I'd prefer a way that we could set the URL or maybe even just have it call a
> PLG function to handle the commentbar. 
> We have PLG_displayComment that is used in comment.php
I think this would be overkill.  Unless you can think of a time when a
plugin would not have index.php?id=XXX go to the general view of the
"item" described by XXX.
> We could possibly set the parent_url for the "refresh" to comment.php as
> well. We already have a $type parm in this form. 
> comment.php already has the logic to handle plugin comments. 
Once on the comments page, all "refreshes" stay on the comment page. 
The only thing the index.php?id=XXX link is used for is to link the
title to the "item".  A "refresh" should stay on the comment page if
that is where the comments are currently being viewed.

> I noticed on other oddity with the commentbar. There is a hidden variable
> called $mode set and can be used to hold "display or view" I believe. 
> Problem is there is a second variable in the same form called $mode as well
> - the selectbox for the display mode. 
The select box changes to "format" on comment.php (instead of mode). 
A mode form variable name should never appear twice (if it does let me
> Regards, 
> Blaine 

More information about the geeklog-devel mailing list