[geeklog-devel] Replacing/Extending Core Functions.

Tom Willett tomw at pigstye.net
Mon Jun 7 17:43:30 EDT 2004


Simply I would just add a call to check the plugins to see if they wanted to 
process the comment before saving and then check the plugins return to see 
if it should be saved or not.

So in functions.inc you would have:
Assume passing all variables in an array

plugin_checkcomment_spamx($a)

in lib-plugins.php 

PLG_checkcomment($a)

and in comment.php 

at the beginning of savecomment()

$a=array();
$a[]=$uid;
$a[]$title;
etc.....
a call to PLG_checkcomment($a)
the plugin should return the array with a save flag set in it, if true save 
comment if false don't.
restore the variables from the array incase the plugin changed them.

I would also suggest you do the same for stories.

That would allow for postprocessing of stories and comments doing such 
things as checking for urls and making them clickable, etc.

If you want me to code this for you just say so.


This would
--
Tom Willett
tomw at pigstye.net

---------- Original Message -----------
From: "Dirk Haun" <dirk at haun-online.de>
To: <geeklog-devel at lists.geeklog.net>
Sent: Mon, 7 Jun 2004 22:29:14 +0200
Subject: Re: [geeklog-devel] Replacing/Extending Core Functions.

> Tom,
> 
> >The Comment Spam plugin intercepts the SaveComment function call to 
examine 
> >the comment and take appropriate action.  I did this by renaming the core 
> >savecomment function to savecomment1 and creating a new savecomment 
function 
> >in the functions.inc of the plugin.  This allows me to process the 
comment 
> >and pass it on to the savecomment function if needed.  Inelegant because 
it 
> >requires patching comment.php.
> 
> Can you suggest how a new plugin API function should work that mimics
> this without having to patch Geeklog?
> 
> With comment spam becoming a problem, I'd envision that your plugin will
> become very popular and I'd like to make its installation as easy as 
possible.
> 
> bye, Dirk
> 
> -- 
> http://www.haun-online.de/
> http://www.haun.info/
> 
> _______________________________________________
> geeklog-devel mailing list
> geeklog-devel at lists.geeklog.net
> http://lists.geeklog.net/listinfo/geeklog-devel
------- End of Original Message -------




More information about the geeklog-devel mailing list