11
deka87
Re: profile/search.php dropdowns
  • 2009/1/2 12:11

  • deka87

  • Friend of XOOPS

  • Posts: 1125

  • Since: 2007/10/5


yes I did. please take a look here: http://7.pdvop2sz.z8.ru/modules/profile/register.php
Mind anchors

12
ghia
Re: profile/search.php dropdowns
  • 2009/1/2 16:17

  • ghia

  • Community Support Member

  • Posts: 4953

  • Since: 2008/7/3 1


OK, but how about the change from true to false in line 88?
This should prevent the multiple select and together with a count of 1 in 87, it should make the dropdown.

13
alfred
Re: profile/search.php dropdowns
  • 2009/1/2 16:39

  • alfred

  • Quite a regular

  • Posts: 249

  • Since: 2005/10/29


For the search is always a multiple-choice field.
That is so willed, so you can select several things

14
trabis
Re: profile/search.php dropdowns
  • 2009/1/2 16:44

  • trabis

  • Core Developer

  • Posts: 2269

  • Since: 2006/9/1 1


Using this code has to work(maybe you forgot to upload or something):
case "select":
                
$options $fields[$i]->getVar('field_options');
                
$size MINcount($options), );
                
$element = new XoopsFormSelect($fields[$i]->getVar('field_title'), $fields[$i]->getVar('field_name'), null$sizefalse);
                
asort($options);
                
$element->addOptionArray($options);
                
$searchform->addElement($element);
                unset(
$element);
                break;

15
trabis
Re: profile/search.php dropdowns
  • 2009/1/2 16:49

  • trabis

  • Core Developer

  • Posts: 2269

  • Since: 2006/9/1 1


I recommend using something like this:
case "select":
                
$no_multi = array('field_name1''field_name2');

                if (
in_array($fields[$i]->getVar('field_name'), $no_multi)) {
                    
$options $fields[$i]->getVar('field_options');
                    
$element = new XoopsFormSelect($fields[$i]->getVar('field_title'), $fields[$i]->getVar('field_name'));
                    
asort($options);
                    
$element->addOptionArray($options);
                    
$searchform->addElement($element);
                    unset(
$element);
                    break;
                }
                
                
$options $fields[$i]->getVar('field_options');
                
$size MINcount($options), 10 );
                
$element = new XoopsFormSelect($fields[$i]->getVar('field_title'), $fields[$i]->getVar('field_name'), null$sizetrue);
                
asort($options);
                
$element->addOptionArray($options);
                
$searchform->addElement($element);
                unset(
$element);
                break;


Change $no_multi has desired.

16
deka87
Re: profile/search.php dropdowns
  • 2009/1/3 7:26

  • deka87

  • Friend of XOOPS

  • Posts: 1125

  • Since: 2007/10/5


actually ghia was right, i forgot to change the 88th line to false. thanks guys it works now.
Mind anchors

Login

Who's Online

416 user(s) are online (143 user(s) are browsing Support Forums)


Members: 0


Guests: 416


more...

Donat-O-Meter

Stats
Goal: $100.00
Due Date: Aug 31
Gross Amount: $0.00
Net Balance: $0.00
Left to go: $100.00
Make donations with PayPal!

Latest GitHub Commits