JonMarkGo Posted January 14, 2011 Share Posted January 14, 2011 I have addon fields that are set in mymodule_config() - in the admin interface it sets and saves them fine... I then have a hook for ClientAreaPage - how can I access myfield in my hook? 0 Quote Link to comment Share on other sites More sharing options...
JonMarkGo Posted January 17, 2011 Author Share Posted January 17, 2011 Bump. Anyone know how I could do this? I'm trying to write an addon for WHMCS to release. 0 Quote Link to comment Share on other sites More sharing options...
Grizzlyware Josh Posted January 17, 2011 Share Posted January 17, 2011 (edited) They're in the MySQL Table `tbladdonmodules`. So you'll need... $sql = "SELECT value FROM `tbladdonmodules` WHERE setting = 'TheSetting' AND module = 'mymodule';"; $sql = mysql_query($sql); if(mysql_num_rows($sql) > 0) { $data = mysql_fetch_assoc($sql); $value = $data["value"]; } You'll then have the value of 'TheSetting' inside $value. I haven't tested that code, but it looks Ok. Edited January 17, 2011 by bdigitalstudios Missing bracket 0 Quote Link to comment Share on other sites More sharing options...
JonMarkGo Posted January 18, 2011 Author Share Posted January 18, 2011 Was hoping it could be done through some kind of pre-set variable but this works, thanks 0 Quote Link to comment Share on other sites More sharing options...
jeremyhaber Posted January 18, 2011 Share Posted January 18, 2011 You can't store variables in tbladdonmodules! Only settings that can be changed by the user. Every time you hit submit in the settings area your variables seem to get erased. Best solution is to make you own settings table. 0 Quote Link to comment Share on other sites More sharing options...
JonMarkGo Posted January 18, 2011 Author Share Posted January 18, 2011 If you set it in module_config() as a field it gets stored there. 0 Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.