[geeklog-devtalk] geeklog-devel digest, Vol 1 #328 - 3 msgs
geeklog-devel-request at lists.geeklog.net
geeklog-devel-request at lists.geeklog.net
Tue Jun 8 13:00:02 EDT 2004
Send geeklog-devel mailing list submissions to
geeklog-devel at lists.geeklog.net
To subscribe or unsubscribe via the World Wide Web, visit
http://lists.geeklog.net/listinfo/geeklog-devel
or, via email, send a message with subject or body 'help' to
geeklog-devel-request at lists.geeklog.net
You can reach the person managing the list at
geeklog-devel-admin at lists.geeklog.net
When replying, please edit your Subject line so it is more specific
than "Re: Contents of geeklog-devel digest..."
Today's Topics:
1. Re: Replacing/Extending Core Functions. (Dirk Haun)
2. Re: PDF feature.... (Tony Bibbs)
3. Re: Replacing/Extending Core Functions. (Tom Willett)
--__--__--
Message: 1
From: "Dirk Haun" <dirk at haun-online.de>
To: <geeklog-devel at lists.geeklog.net>
Subject: Re: [geeklog-devel] Replacing/Extending Core Functions.
Date: Mon, 7 Jun 2004 22:29:14 +0200
Organization: Terra Software Systems
Reply-To: geeklog-devel at lists.geeklog.net
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/
--__--__--
Message: 2
Date: Mon, 07 Jun 2004 16:09:17 -0500
From: Tony Bibbs <tony at tonybibbs.com>
To: geeklog-devel at lists.geeklog.net
Subject: Re: [geeklog-devel] PDF feature....
Reply-To: geeklog-devel at lists.geeklog.net
Ok, I've updated CVS for, hopefully, the last time. Here is a quick
feature rundown of the PDF functionality:
1) PDF feature completely driven by config.php and is disabled by
default since it requires installation of third party software.
2) Stories now have a pdf icon (similar to print and email icons) that
will take the HTML Geeklog generates during the print mode and generates
the PDF from it
3) Optionally, admins can enable an ad-hoc PDF generation feature that
would allow users to enter any URL and generate a PDF. This is disabled
by default but
is always excessible by Root users when the PDF feature is enabled.
4) Optional support of HTML tidy. Again, this requires yet another
third party tool to be installed so this is disabled by default
5) Font point size is configurable
6) TTL on generated PDF's is supported (i.e. you can tell Geeklog to
delete PDF's more than one day old) NOTE: untested
7) Supports get & post parameters so integration with other GL plugins
is easy.
This needs testing, particularly on windows. The original code I had was
very unix-centric and I did my best to make it OS independent. I
haven't confirmed the TTL feature
is working yet (next on my to-do list) but the code is there and looks
right ;-). Also, thinking of forward compatibility, this feature uses
the $_REQUEST PHP super global which means that a fairly recent version
of PHP is required. I plan to add some code soon to check the PHP
version and manually build the $_REQUEST array if it isn't supported but
I didn't get around to that yet. Finally, I did some refactoring of the
code I got but a lot more is needed. I had grand visions of making this
100% OO but just didn't have the time.
This code also deserves a look from the security perspective. I'm
thinking some sort of speed limit would be a good start. Anything else?
One last time, if you have a chance to test this a quick note on whether
it worked or not and what your configuration is would sure be helpful.
--Tony
Rob Griffiths wrote:
> On Jun 4, 2004, at 6:35 AM, Tony Bibbs wrote:
>
>> Yeah, the generator take a simple URL as an argument. It then
>> downloads the HTML for the URL and converts it to PDF. That should
>> make integration into GL's plugins a breeze.
>
>
> What's wrong with File -> Print -> Save as PDF ... oops, sometimes I
> forget we're not all using OS X. Couldn't resist :) :)
>
> Actually sounds quite cool, and I know some PC using friends who would
> love such a feature for sites like Groklaw...
>
> cheers;
> -rob.
--__--__--
Message: 3
From: "Tom Willett" <tomw at pigstye.net>
To: geeklog-devel at lists.geeklog.net
Subject: Re: [geeklog-devel] Replacing/Extending Core Functions.
Date: Mon, 7 Jun 2004 21:43:30 +0000
Reply-To: geeklog-devel at lists.geeklog.net
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 -------
--__--__--
_______________________________________________
geeklog-devel mailing list
geeklog-devel at lists.geeklog.net
http://lists.geeklog.net/listinfo/geeklog-devel
End of geeklog-devel Digest
More information about the geeklog-devtalk
mailing list