[geeklog-devtalk] [2] on moderation and plugins

Wim Niemans ri remy at pbsolo.nl
Fri Feb 27 14:23:40 EST 2004


In an earlier message:

>>PLG_notify_user('type_of_notification') for sending specific email



>Hmm, what exactly is this supposed to do? As of Geeklog 1.3.9,

plugins

>can easily use COM_mail to send emails.


The use of it would be to allow people to send on well defined
notifications their own template. Dirk made some example with the
welcome email.
The most convenient way is, btw, to have the text for these emails in
the database, so one could send an email in the language of the
recipient.
I am thinking of a plugin doing these kind of house-keeping. But
maybe there is a better way to get this into the core.
---------

In another earlier message:

>>PLG_render_story('story_text') for extra runtime amendments of the

>>story, f.i. adding links (glossary) or applying styles.



>Sounds like an interesting idea. It could be implemented similar to

what

>we've introduced for extending the user profiles in 1.3.8.


The use of this is, off course, adding links to the text.
They will show up in the what's related block also and smooth.
Another use would be bad-word-censoring, highlighting (see search),
rotating ads and on....
---------

And a fresh proposal:
The moderation engine is pretty sophisticated.
Another use of this engine could be archival of user, stories etc.
having the GL table as submissiontable and the archive as GL table.

I'm thinking of using it in the contacts plugin, to automatically
archive contacts after moderation. However, for some other bells to
GL, there is a pitfall.
The result of PLG_getmoderationvalues is blindly copied into the sql
to dbdelete and dbcopy. There is no check if the table_names do
exist, nor if the $fields array is empty. A plugin could even delete
entries in the users table, mentioning the 'users' table as
submissiontable.

I do have several functions that are triggered thru the moderation
engine. However I do *not* have a submissiontable. F.I. getting a
list of members 1 week before their birthday, or with events older
than 3 months. This list can go on and on....
Adding a check in admin/moderation.php (before db_COPY and
db_Delete):
---->   if (($table == $submissiontable) || (empty($submissiontable)

|| (empty($fields))

would be a must-have, not only for testing purposes.

I remember I pathed them partly into lib-database.php. Unfortunate I
lost these changes when installing 1.3.9.RC1.

Finally I noticed that PLG_showModerationList() is not a plugin API
and can be contained in admin/moderation.php only. Called from
anywhere but admin/moderation.php results in an error (unknown
function 'itemlist').
Maybe the plugin class could use a method 'addSubmissionAction' if we
don't want to approve/delete. Example: Commit or Invoice or just
Acknowledge.
Anyway, a prototype for such transactional additions could be
delivered if GL would consider this as core.

Cheers,
Wim Niemans




More information about the geeklog-devtalk mailing list