The Arcive of Official vBulletin Modifications Site.It is not a VB3 engine, just a parsed copy! |
|
#1
|
|||
|
|||
Programming a Product: How to add vBulletin options?
I am writing a Product that emails a user when a certain condition is met. I would like the text of the email to be editable by the vBulletin admin. I access the text of the email with $vbulletin->options['testOptions_email_body'] just fine, but I cannot get the option to edit the text to appear in the vBulletin control panel! This is what I tried:
Code:
<?xml version="1.0" encoding="UTF-8"?> <product productid="testOptions" active="1"> <title>Test Options</title> <description>Test Options</description> <version>1.0</version> <phrases> <phrasetype name="vBulletin Settings" fieldname="vbsettings"> <phrase name="setting_testOptions_email_body_title"><![CDATA[Email body]]></phrase> <phrase name="setting_testOptions_email_body_desc"><![CDATA[The body of the email.]]></phrase> </phrasetype> </phrases> <options> <settinggroup name="friendsPost" displayorder="500"> <setting varname="testOptions_email_body" displayorder="510"> <datatype>free</datatype> <optioncode>textarea</optioncode> <defaultvalue><![CDATA[Dear {USERNAME}, This is an email that you will receive when a certain condition is met. Regards, Me]]></defaultvalue> </setting> </settinggroup> </options> </product> Thanks. |
#2
|
|||
|
|||
I can't tell right off what's wrong, but it's easier if you put the site in debug mode, create your product using the adminCP (and new controls that appear when you're in debug mode), then export the product to xml. I think the best way is to have a test site set up so you can not only leave it in debug mode all the time, but also you don't have to worry about crashing your site when testing new code. But if you can't do that you could use one of these methods to set debug mode just for yourself: https://vborg.vbsupport.ru/showthrea...ght=debug+mode
When you do that, go to the settings in the admin CP and you'll see new controls for adding and editing options. Make sure when you add one that you select your product. |
Благодарность от: | ||
MediaHound |
#3
|
|||
|
|||
Thank you kh99! The tips about enabling debug mode are terrific, I may employ that some day. However I am not the owner of the site and I have explicit instructions not to enable debug mode. Even if I could, it would entail restarting Apache so that config.php were reread, and I don't have root access.
From examining other installed Products that do modify the options, it seems that I'm not missing anything. "Seems" being the operative word, and it is Not Working for me! |
#4
|
|||
|
|||
OK, well, I tried importing your product and the setting does appear, but the setting group has no name (is blank). To fix that I think you need a phrase named settingroup_friendsPost.
|
Благодарность от: | ||
MediaHound |
#5
|
|||
|
|||
Thank you kh99, you found it! I very much appreciate that you took the time to triage. Have a great evening!
|
#6
|
|||
|
|||
Quote:
And you don't have to restart Apache, the changes are applied as soon as you save the file. |
Благодарность от: | ||
MediaHound |
#7
|
|||
|
|||
Thank you Yellow, that is important to know.
|
#8
|
|||
|
|||
You need to explain these methods of using debug mode for yourself only to the site owner. Building a control panel manually is very tedious (I've done it before)
Before you edit anything in config.php make a copy, config_save.php, so you have it in pristine form in case you mess something up |
|
|
X vBulletin 3.8.12 by vBS Debug Information | |
---|---|
|
|
More Information | |
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|