![]() |
Using a vbulletin variable as the default for a setting in XML file
Hello,
I am working on modifying a product I wrote, and for the product's option settings in the AdminCP, I want to present the user with radio buttons to select a forum, rather than having to enter the forumid manually. This I have working, however, I want the default value to be the forum that has been chosen to receive user-reporting of posts. Here is my code for the setting: Code:
<setting varname="markfl_par_report_forumid" displayorder="35"> |
I'm not 100% sure, but I think the defaultvalue in the xml is only used at the time the product is actually being installed, and I don't think you can put code there. Maybe what you want is to include some install code that sets the initial value of your option by reading the other option?
|
...but it looks like it's a bit complicated bcause when the install code is run, the settings haven't been created yet. So I think what you want to do is set
Code:
$arr['options']['settinggroup']['groupname']['setting']['settingname']['defaultvalue'] |
I wasn't able to get this to work, so what I decided to do as a workaround is if the user does not select a forum, then the report forum is used as the default. Perhaps I can get the report forum to be checked by default for a future update.
|
All times are GMT. The time now is 07:59 AM. |
Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2025, vBulletin Solutions Inc.
X vBulletin 3.8.12 by vBS Debug Information | |
---|---|
|
|
![]() |
|
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|