vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vB3 Programming Discussions (https://vborg.vbsupport.ru/forumdisplay.php?f=15)
-   -   Product ACP Checkbox? (https://vborg.vbsupport.ru/showthread.php?t=161558)

Coders Shack 10-30-2007 08:55 PM

Product ACP Checkbox?
 
Is is possible to add checkbox options in the ACP for products?

Analogpoint 10-30-2007 11:10 PM

Sure, go in debug mode and examine one of the built-in options that uses checkboxes.

Coders Shack 10-31-2007 12:20 AM

hmm
Code:

                <settinggroup name="bbcode" displayorder="300">
                        <setting varname="allowedbbcodes" displayorder="10">
                                <datatype>bitfield</datatype>
                                <optioncode>bitfield:nocache|allowedbbcodes</optioncode>
                                <defaultvalue>1023</defaultvalue>
                        </setting>
                </settinggroup>

is an example of a checkbox optioncode if put in a install product and its using the bit field option (bitfiled_vbulletin.xml)
Code:

                        <group name="allowedbbcodes">
                                <bitfield name="allow_bbcode_basic">1</bitfield>
                                <bitfield name="allow_bbcode_color">2</bitfield>
                                <bitfield name="allow_bbcode_size">4</bitfield>
                                <bitfield name="allow_bbcode_font">8</bitfield>
                                <bitfield name="allow_bbcode_align">16</bitfield>
                                <bitfield name="allow_bbcode_list">32</bitfield>
                                <bitfield name="allow_bbcode_link">64</bitfield>
                                <bitfield name="allow_bbcode_code">128</bitfield>
                                <bitfield name="allow_bbcode_php">256</bitfield>
                                <bitfield name="allow_bbcode_html">512</bitfield>
                        </group>

my question is how can i create a checkbox field from a product install. (im tryin lol)

--------------- Added [DATE]1193862860[/DATE] at [TIME]1193862860[/TIME] ---------------

i still cant figure it out.

Coders Shack 11-01-2007 04:43 AM

anyone?

Analogpoint 11-01-2007 06:38 AM

Examine the Inferno vBshout mod, it uses them.

Coders Shack 11-01-2007 02:03 PM

Quote:

Originally Posted by Analogpoint (Post 1373278)
Examine the Inferno vBshout mod, it uses them.

thx man!

Analogpoint 11-01-2007 02:51 PM

Quote:

Originally Posted by Coders Shack (Post 1373458)
thx man!

No problem. I've never had to use them, so I can't offer any direct help, but hopefully you can figure something out from the examples.

Coders Shack 11-03-2007 01:00 AM

Ok so i was able to do it... Wow its easier than i though but still confusing how the actual check boxes are processed.

Values:
1
2
4
8
16
32
64
....

I used 19 boxes and it sure multiplies fast... the 20th box's value would be 524288 lol... around 35 the actual value length is over 11 digits and i think it may messup inside the database, im not sure.

Analogpoint 11-03-2007 04:00 AM

How is the bitfield represented in vB's php code? If it's an int it should be 32 bits on most hardware, giving you a max value of about 2 billion. There shouldn't be any problems in the database, since setting values are stored as text.

Coders Shack 11-03-2007 04:21 AM

oh i thought they were stored in an INT field, INT is 11

Marco van Herwaarden 11-03-2007 06:57 AM

They are not stored as text, but as an UNSIGNED INT().

Paul M 11-03-2007 11:38 AM

Which as mentioned earlier, is 32 bits in length, so one variable can only handle a max of 32 checkboxes.

Coders Shack 11-03-2007 06:11 PM

Quote:

Originally Posted by Paul M (Post 1374764)
Which as mentioned earlier, is 32 bits in length, so one variable can only handle a max of 32 checkboxes.

got it :D thx

Analogpoint 11-03-2007 07:41 PM

Quote:

Originally Posted by Marco van Herwaarden (Post 1374686)
They are not stored as text, but as an UNSIGNED INT().

Aren't setting values stored in the value field of the setting table?


All times are GMT. The time now is 04:06 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.13831 seconds
  • Memory Usage 1,744KB
  • 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_code_printable
  • (4)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (14)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