Page 1 of 1

Get properties of a plugin

Posted: Thu Aug 31, 2006 7:06 pm
by munk
Hi,

I'm trying to modify a spam statistics plugin to read entries from the spamblock plugin's log. To do this I need to work out what type of logging spamblock is using. How can I find the 'logtype' property of the spamblock plugin from within the spamstats plugin?

I noticed the spamblock logtype is stored in $serendipity, but with the class id(?) as the key:

["serendipity_event_spamblock:29da447ec2de49096452e6037c9a79aa/logtype"]=>
string(4) "file"

is there an efficient way to fetch the value from $serendipity (ie work out the clsid) or is there an easier/more efficient way?

Cheers.

Re: Get properties of a plugin

Posted: Fri Sep 01, 2006 9:52 am
by garvinhicking
Hi!

The most easy way would be:

Code: Select all

<?php
$q = "SELECT value FROM serendipity_config WHERE name LIKE 'serendipity_event_spamblock:%/logtype LIMIT 1";
$logtype = serendipity_db_query($q, true);
print_R($logtype);
The other way would involve fetching a list of all plugins, checking which ones are of the class 'serendipity_event_spamlog', then loading that plugin and gettin gthe config via API methods. That would be slower. :)

Regards,
Garvin

Posted: Fri Sep 01, 2006 5:11 pm
by munk
Thanks garvin,

I didn't know if there was an easier way, it looks like there isn't :(

Many thanks!