geeklog at langfamily.ca
Thu Jan 27 14:07:06 EST 2005
Uh ok - went back through my emails and it was last Sept/Oct that I worked
Here was the email I sent to Dirk that raised this very question when I was
adding the spamx API's.
Have a read and see if this made sense.
I'm wondering if there is a reason to preserve the new API that Tony added
to support the SPAMX feature in comments. Tony wrote a API that is very
generic and can be used for other purposes. It's passed a lot of PARMS which
would be useful by a Plugin if it needed to do something with that coment.
function PLG_commentPreSave($uid, $title, $comment, $sid, $pid, $type,
The SPAMX API now only needs 2 parms ($text and $action)
Tom's first idea was to change the PLG_commentPreSave API and I'm wondering
if we should keep it. This API is only called from comment.php - since that
is the only un-moderated way to add content to stories. But if we really
want a generic hook then it should be for new stories as well as comments I
think. I don't quite have the application in mind of how this would be used
other then for parsing bbcode tags or wiki language. In both those cases, I
think only the textual content would need to be passed as well.
So I'm not sure what to do with the PLG_commentPreSave API.
I'm thinking of adding a new PLG_checkforSpam($content,$action) API and that
would be called from comment.php. The PLG_checkforSpam is a wrapper to call
The other idea is to add the call to plugin_checkforSpam_spamx in the
PLG_commentPreSave() so that it will be called plus what ever plugin related
functions that may be available.
Sorry to make this sound more complex - it's the current API and what to do
with it that make me stop and ask.
----- Original Message -----
From: "Tony Bibbs" <tony at tonybibbs.com>
To: <geeklog-devel at lists.geeklog.net>
Sent: Thursday, January 27, 2005 1:22 PM
Subject: Re: [geeklog-devel] PLG_commentPreSave
Right, Vinny's question is why couldn't the spamx plugin just have used
Vincent Furia wrote:
>On Thu, 27 Jan 2005 12:00:27 -0500, Blaine Lang <geeklog at langfamily.ca>
>>Dirk, Tom and I talked about this when implementing the new SPAMX API's
>>decided that it was best to still have a Non-Spamx API to allow other
>>plugins to add any other comment related filtering or handling that may be
>I'm still confused as to why different APIs are needed since they
>appear to do the same thing. They are even called one after the
>I think one plugin call would be enough, something like:
>PLG_commentPreSave(title, comment, ...) and have it return HTML to
>output if there is an error (this can include a COM_refresh) otherwise
>just return 0. If I can work it into the plugin API to pass the
>comment and title by reference, plugins could modify those and still
>return a "success" status.
>geeklog-devel mailing list
>geeklog-devel at lists.geeklog.net
geeklog-devel mailing list
geeklog-devel at lists.geeklog.net
More information about the geeklog-devel