[geeklog-devel] Fwd: Geeklog Comments

Dirk Haun dirk at haun-online.de
Sun Feb 21 14:36:44 EST 2010

Forwarding this to the list to get some feedback from plugin authors.
This is about getting plugin comments into the What's New block,

My gut feeling seems to advise against relying on SQL provided by the
plugin. But the alternative would require more work in the plugins.

---------------- Anfang Weiterleitung ----------------
Betreff: Geeklog Comments
Gesendet: Samstag, 20. Februar 2010 13:56 Uhr
Von: Tom <websitemaster at cogeco.net>
An: 'Dirk Haun' <dirk at haun-online.de>

Hey Dirk,


I have been looking at the What's New Block to add comment support for more
than just Stories.


Returning the newest comments for plugins is easy but then you start to run
into problems when handling things like, what table do you use to access the
parent item, permissions of the parent item or any other status variables
(similar to the draft flag for stories).


I think the best approach would be to create a new plugin api for this
called PLG_getWhatsNewComment


There is 2 ways it could work. The easiest would be that it would just
return an array of SELECT statement(s) similar to stories


$sql['mysql'] = "SELECT DISTINCT COUNT(*) AS
count,{$_TABLES['stories']}.title,t.sid,max(t.date) AS lastdate FROM
{$_TABLES['trackback']} AS t,{$_TABLES['stories']} WHERE (t.type =
'article') AND (t.sid = {$_TABLES['stories']}.sid) AND (t.date >=
(DATE_SUB(NOW(), INTERVAL {$_CONF['newtrackbackinterval']} SECOND)))" .
COM_getPermSQL( 'AND', 0, 2, $_TABLES['stories'] ) . " AND
({$_TABLES['stories']}.draft_flag = 0) AND
({$_TABLES['stories']}.trackbackcode = 0)" . $topicsql . COM_getLangSQL(
'sid', 'AND', $_TABLES['stories'] ) . " GROUP BY t.sid,
{$_TABLES['stories']}.title ORDER BY lastdate DESC LIMIT 15";


That select statement would then be executed by COM_whatsNewBlock and It
would then use the current What's New Block comment code (with a few tweaks)
to create the list. I would use PLG_getItemInfo to create the links to the


The second solution would have PLG_getWhatsNewComment to do all of the work,
create the select statement, execute and then create the list (similar to
how PLG_getWhatsNew works).


What do you think?



----------------- Ende Weiterleitung -----------------


More information about the geeklog-devel mailing list