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
Cross-plugin config options
-
garvinhicking
- Core Developer
- Posts: 30022
- Joined: Tue Sep 16, 2003 9:45 pm
- Location: Cologne, Germany
- Contact:
Re: Cross-plugin config options
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
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
# Garvin Hicking (s9y Developer)
# Did I help you? Consider making me happy: http://wishes.garv.in/
# or use my PayPal account "paypal {at} supergarv (dot) de"
# My "other" hobby: http://flickr.garv.in/
# Did I help you? Consider making me happy: http://wishes.garv.in/
# or use my PayPal account "paypal {at} supergarv (dot) de"
# My "other" hobby: http://flickr.garv.in/
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)?
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)?
-
garvinhicking
- Core Developer
- Posts: 30022
- Joined: Tue Sep 16, 2003 9:45 pm
- Location: Cologne, Germany
- Contact:
Hi!
Hm, the value of it should come from the configuration of your plugin! I'm not sure what you mean?
Regards,
Garvin
Hm, the value of it should come from the configuration of your plugin! I'm not sure what you mean?
Regards,
Garvin
# Garvin Hicking (s9y Developer)
# Did I help you? Consider making me happy: http://wishes.garv.in/
# or use my PayPal account "paypal {at} supergarv (dot) de"
# My "other" hobby: http://flickr.garv.in/
# Did I help you? Consider making me happy: http://wishes.garv.in/
# or use my PayPal account "paypal {at} supergarv (dot) de"
# My "other" hobby: http://flickr.garv.in/
-
stm999999999
- Regular
- Posts: 1531
- Joined: Tue Mar 07, 2006 11:25 pm
- Location: Berlin, Germany
- Contact:
That's what I've just done, actuallystm999999999 wrote:have a look at http://www.s9y.org/forums/viewtopic.php?t=6198#33976