[geeklog-devtalk] Plugin What's New Enhancement
Michael Askew
michaelaskew at mac.com
Sat Apr 10 00:24:37 EDT 2004
Howdy,
I've been getting ready to install geeklog 1.3.9 and filemgmt 1.3 RC2
on my site (club-lu.net). I'm thrilled about the What's New block's
plugin support but I thought it looked kind of awkward having the
comments for plugin objects (e.g. files) under the plugin's heading
instead of the "COMMENTS" heading.
So I decided to try enhancing the plugin interface a bit to support
showing comments on plugin objects. I like the way it turned out. I've
added support for these features to the filemgmt and geekary plugins.
Patches are attached; the affected files are lib-common.php and
lib-plugins.php (geeklog), and functions.inc (filemgmt, geekary). To
see full copies of the changed files you can download the tarball of my
sites code at
http://demo.club-lu.net/filemgmt/singlefile.php?lid=1
You can also see the new code in action there. Please let me know what
you think. I would appreciate it if you would roll the geeklog changes
into the official geeklog distribution.
Here's an explanation of, err, What's New:
* A new plugin API function has been added; it's called
"plugin_getwhatsnewcommentsinfo_{pi_name}". It takes one argument, the
id of an item that has new comments (the "sid" column from the comments
table) and returns a two item array consisting of a name for the item
and the URL for the item. If for some reason (permissions problems,
configuration options) the items new comments should not be shown the
function should return false.
* The COM_whatsNewBlock function now selects all new comments (grouped
by sid and type) for plugins that support the What's New comment
section (plus those for articles and polls); for each one it asks the
appropriate plugin for the name and URL of the item the comments apply
to, and if appropriate, adds the item to the list of recent comments.
When 15 items with new comments have been found it stops.
* Two new functions were added to lib-plugins.php to build a list of
plugins supporting the What's New comment section and to call the
getWhatsNewCommentInfo function for a given plugin.
-Michael Askew
-------------- next part --------------
A non-text attachment was scrubbed...
Name: whats_new_filemgmt.patch
Type: application/octet-stream
Size: 3543 bytes
Desc: not available
Url : <http://eight.pairlist.net/pipermail/geeklog-devtalk/attachments/20040409/fc8e69d4/attachment.obj>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: whats_new_geekary.patch
Type: application/octet-stream
Size: 3781 bytes
Desc: not available
Url : <http://eight.pairlist.net/pipermail/geeklog-devtalk/attachments/20040409/fc8e69d4/attachment-0001.obj>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: whats_new_geeklog.patch
Type: application/octet-stream
Size: 11100 bytes
Desc: not available
Url : <http://eight.pairlist.net/pipermail/geeklog-devtalk/attachments/20040409/fc8e69d4/attachment-0002.obj>
More information about the geeklog-devtalk
mailing list