access db info from in-side a plugin?

Help each other out

access db info from in-side a plugin?

Postby S Pittaway on Wed Mar 22, 2006 10:57 am

Apologies in advance if i am asking a stupid question :)


how do you access db info from inside a plugin.

eg, say i wanted to get the currently selected albums name and genre is there an easy way to do it?
S Pittaway
 
Posts: 651
Joined: Wed Jan 25, 2006 11:08 am
Location: Manchester, England

Postby m_ski on Wed Mar 22, 2006 12:28 pm

Use the xhelper.ConvertVariables() command. Pass the string of the parameter you wish to get inside the brackets. (The same string you would use to display the parameter in a screen)

e.g.
Code: Select all
plugin_string = xhelper.convertvariables("category>music>albumname")

or
Code: Select all
plugin_string = xhelper.convertvariables("category>music>genre")


See http://www.xlobby.com/forum/viewtopic.php?t=3086&highlight=convertvariables
m_ski
 
Posts: 204
Joined: Wed Dec 08, 2004 7:57 am
Location: Kent, United Kingdom

Postby S Pittaway on Wed Mar 22, 2006 1:11 pm

I downloaded the xstats pluging and started off with that...


The copy of XPluginSDK.dll in there is from 2004, i dropped in a the new one from the xlobby folder and a lot more functions now show up :)

Cheers.
S Pittaway
 
Posts: 651
Joined: Wed Jan 25, 2006 11:08 am
Location: Manchester, England