Announcement

Collapse
No announcement yet.

How do configure a custom profile field with 325 options?

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • How do configure a custom profile field with 325 options?

    Hi!

    I am receiving the folowing error:

    You may only specify up to 32 options for checkbox or select_multiple input types. You entered 325 options for this field.

    Why is this limit set to 32 options? And if I would like to extend it, could you provide me with a tip on how to do it ?

    I want users to select their favorite parrot species and to be able to search on it for users who also love that specific parrot.

    Best Regards,
    Jan Jaap

  • #2
    Found it!~

    Open admincp/profilefield.php in a text editor like Windows Notepad (not MS word!)

    Find the folowing code on line 115 (vBulletin 3.6.3)
    PHP Code:
    if (sizeof($data) > 32 AND ($vbulletin->GPC['type'] == 'checkbox' OR $vbulletin->GPC['type'] == 'select_multiple')) 
    Change the number 32 to the amount of options you would like, it will work perfectly with 325 options.

    Best Regards,
    Jan Jaap

    Comment


    • #3
      Hi!

      There still is a problem.

      vBulletin converts the configured multiple selected options using the PHP mathemethic function pow() wich in it's current configuration doesn't work with more then 32 options.

      This is the current code to calculate the pow:
      PHP Code:
      foreach($value AS $key => $val)
            {
             
      $val--;
             
      $bitfield += pow(2$val);
             
      $cfield .= (!empty($cfield) ? ', ' '') . $data["$val"];
            } 
      Could anyone from vBulletin Technical support offer me a tip on how to change it to work with unlimited options?

      Best Regards,
      Jan Jaap

      Comment


      • #4
        Bump

        Comment


        • #5
          Please wait at least 24 hours before bumping your posts.

          From the forum rules:
          http://www.vbulletin.com/forum/showthread.php?t=42918

          Please wait a reasonable amount of time before bumping posts. For style changes and general 'how-to' questions this should be 24 hours. For specific troubleshooting issues, use 12 hours as a guideline.
          There is no function to do this. This requires modifying the code. We cannot officially support code modifications or forums running modified code, however you can try searching or asking for help with this over at www.vbulletin.org.
          Steve Machol, former vBulletin Customer Support Manager (and NOT retired!)
          Change CKEditor Colors to Match Style (for 4.1.4 and above)

          Steve Machol Photography


          Mankind is the only creature smart enough to know its own history, and dumb enough to ignore it.


          Comment


          • #6
            Why not subcategorize this information? Instead of listing 325 options, maybe break it down into categories (ie. what clubs you like, who foods you like, what fetish you like, etc etc).?

            Just a helpful solution.

            Comment


            • #7
              You could also just use a multiple-Dropdown list.

              I have a dropdown list for Country and for State. The country field lists 220 countries. The state field lists 50 states. It works perfect.

              They can select multiple entries if i enable it, by pressing ctrl + clicking on each entry.

              Comment


              • #8
                Ok, thanks a lot!

                I will test it!

                Comment


                • #9
                  While this is a great idea, control clicking can be very uncomfortable once you have more than 20-30 choices. Checkboxes are so much cleaner and I hope this gets changed to at least acommodate 64 entries.
                  My law forum, lawyers and legal help site

                  Comment


                  • #10
                    Originally posted by slinky View Post
                    While this is a great idea, control clicking can be very uncomfortable once you have more than 20-30 choices. Checkboxes are so much cleaner and I hope this gets changed to at least acommodate 64 entries.
                    Its currently a design/php limitation.

                    Comment


                    • #11
                      Originally posted by Zachery View Post
                      Its currently a design/php limitation.
                      My understanding is that there is a workaround for this that was discussed almost 3 years ago. I was wondering whether that workaround is still feasible and whether someone has decided to pursue it as was mentioned back then. Thanks for the reply.
                      My law forum, lawyers and legal help site

                      Comment


                      • #12
                        You can do it yourself by editing the source code of the profile fields factory.

                        You could then simply create a text input field and instead display a drop down menu with sertain options that could be retrieved from the database and displayed using the default drop down menu template (for dropdown menu profile fields) or your own custom template.

                        I have managed to do it like this and it works well.

                        Comment


                        • #13
                          Originally posted by slinky View Post
                          My understanding is that there is a workaround for this that was discussed almost 3 years ago. I was wondering whether that workaround is still feasible and whether someone has decided to pursue it as was mentioned back then. Thanks for the reply.
                          Report it as a bug now so it can get looked at again.

                          Comment

                          Loading...
                          Working...
                          X