Page 1 of 1
Cross-plugin config options
Posted: Thu Oct 05, 2006 5:44 pm
by mattsches
I've searched the forum, yet couldn't find an answer to my question: How can I access a config option of one plugin from within another?
Particularly, I need the taglink path that is set by the freetag plugin, and I need it in my socialbookmarks plugin. The db contains several rows that are related to a taglink: a general taglink (default url?), a freetag taglink (the one I entered after installing the freetag plugin), and a socialbookmarks taglink (still empty).
Where are all these options set? And how can I access them?
- Mattsches
Re: Cross-plugin config options
Posted: Fri Oct 06, 2006 10:13 am
by garvinhicking
Hi!
That's a bit tougher to do. The plugins are actually independent from each other, so you would either need to iterate through the list of all available serendipity plugins (serendipity_plugin_api::get_event_plugins) and then do the 'get_config' method call on the plugin you want to use.
Or you go the easier route and just issue a SQL query on the serendipity_config DB table, use a wildcard "serendipity_event_freetag:%" name for the "name" column of that table, and then just fetch the 'value' column of that table for the plugin...
HTH,
Garvin
Posted: Fri Oct 06, 2006 2:19 pm
by mattsches
Thanks for the reply, Garvin! I thought about the iteration method, but didn't like it. Querying the DB directly seems to be a better way.
One questions remains, though: In my DB, there is a row with the name '/taglink' and the wrong url as value. Where does it come from, and do I still need it (or can I just correct the url)?
Posted: Fri Oct 06, 2006 2:38 pm
by garvinhicking
Hi!
Hm, the value of it should come from the configuration of your plugin! I'm not sure what you mean?
Regards,
Garvin
Posted: Fri Oct 06, 2006 3:14 pm
by mattsches
Nevermind, I'm not sure what I'm talking about myself
I will have to double-check my plugin, but thanks to your help it should be easy to fix.
- Mattsches
Posted: Sat Oct 07, 2006 3:33 am
by stm999999999
Posted: Sat Oct 07, 2006 7:02 pm
by mattsches
That's what I've just done, actually

... I'll give it a try tomorrow