vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vB3 Programming Discussions (https://vborg.vbsupport.ru/forumdisplay.php?f=15)
-   -   xml drop down menu (https://vborg.vbsupport.ru/showthread.php?t=178529)

woostar 05-08-2008 01:22 PM

xml drop down menu
 
In a vB xml how do you program a drop down menu with 3 default values


PHP Code:

<setting varname="var" displayorder="130">
    <
datatype>free</datatype>
    <
optioncode>textarea</optioncode>
    <
defaultvalue>vbulletin.org</defaultvalue>
</
setting

E.G: above is for a text area.

Dismounted 05-09-2008 10:36 AM

You really shouldn't be editing XML files directly, you should enable Debug Mode and build your XML files with the interfaces provided.

woostar 05-09-2008 01:05 PM

Interfaces provided? I'm writing a plugin product from scratch? Are you saying there is an easier way?

PHP Code:

<setting varname="var" displayorder="10">
    <
datatype>free</datatype>
    <
optioncode>select:piped
option1
|var_option1
option2
|var_option1
option3
|var_option1
</optioncode>
    <
validationcode><![CDATA[return in_array($data, array('option1''option2'option3'));]]></validationcode>
    <defaultvalue>option1</defaultvalue>
</setting> 

I found the answer after taking another plugin to pieces ^^ Just incase anyone else is looking.

Lynne 05-09-2008 02:29 PM

Quote:

Originally Posted by woostar (Post 1513734)
Interfaces provided? I'm writing a plugin product from scratch? Are you saying there is an easier way?

I have always turned on debug mode and then added the setting into the vboptions area and set them to be used with my plugin. Then when you export your plugin/product, all the settings get exported with it (instead of you having to write them manually like you are).

woostar 05-09-2008 03:15 PM

wow, you learn something new everyday. I've been writing all my xml's from scratch.
Thanks for your help :)


All times are GMT. The time now is 09:19 PM.

Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2025, vBulletin Solutions Inc.

X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.01011 seconds
  • Memory Usage 1,723KB
  • Queries Executed 10 (?)
More Information
Template Usage:
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (2)bbcode_php_printable
  • (1)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (5)printthreadbit
  • (1)spacer_close
  • (1)spacer_open 

Phrase Groups Available:
  • global
  • postbit
  • showthread
Included Files:
  • ./printthread.php
  • ./global.php
  • ./includes/init.php
  • ./includes/class_core.php
  • ./includes/config.php
  • ./includes/functions.php
  • ./includes/class_hook.php
  • ./includes/modsystem_functions.php
  • ./includes/class_bbcode_alt.php
  • ./includes/class_bbcode.php
  • ./includes/functions_bigthree.php 

Hooks Called:
  • init_startup
  • init_startup_session_setup_start
  • init_startup_session_setup_complete
  • cache_permissions
  • fetch_threadinfo_query
  • fetch_threadinfo
  • fetch_foruminfo
  • style_fetch
  • cache_templates
  • global_start
  • parse_templates
  • global_setup_complete
  • printthread_start
  • bbcode_fetch_tags
  • bbcode_create
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • printthread_post
  • printthread_complete