We build. You grow.

Get best community software here

Start a social network, a fan-site, an education project with oxwall - free opensource community software

any way to increase the options in some profile questions to greater than 31? | Forum

Michael Leader
Michael Jan 6 '11
topic subject says it all...

any way to increase the options in some profile questions to greater than 31?
Den Team
Den Jan 6 '11
Currently there no such way. Let me explain:
All values of profile questions like "select", "multicheckbox" are stored as power of 2. It was done to make search function optimized. When you chose some values of field like multicheckbox on search form, system must find all users which has one of selected values. System sum selected values (every present as power of 2) and make binary comparison with field's value of every profile in database.
Michael Leader
Michael Jan 7 '11
I was figuring something like that 31 being hex FFFFF but then that is assuming you cannot user 0 which would increate the functionality to 32.
Pity because my site is for Ireland and it has 32 counties! :O)
Any way of haveing like a nested question?
Where you can have a selection of options and depending on what picked will expose a pulldown menu associated to THAT selection?
Emil Team
Emil Jan 8 '11
Michael,

That is possible in future.
Michael Leader
Michael Jan 9 '11
good... TY
(What r u doing working on a saturday!!!)
Mickael
Mickael Sep 11 '11

Quote from Emil Michael,

That is possible in future.
(Any way of haveing like a nested question?
Where you can have a selection of options and depending on what picked will expose a pulldown menu associated to THAT selection?)

Is it now ?
The Forum post is edited by Mickael Sep 11 '11
Emil Team
Emil Sep 13 '11
Not yet. We anticipated such situations but deliberately made profile questions simple first. We are yet to see if it's worth making profile questions more complex for everybody to enable things like these.
Mickael
Mickael Sep 18 '11

Quote from Emil Not yet. We anticipated such situations but deliberately made profile questions simple first. We are yet to see if it's worth making profile questions more complex for everybody to enable things like these.

Regarding the kind of website build with oxwall it seems to me that people will find some uses for that; but as i'don't know how diffilicult it is to implement that i let you decide. Maybe you can give directives to the ones more tech savy to set that up for their site.

Regards
The Forum post is edited by Mickael Sep 18 '11
Michael I.
Michael I. Dec 18 '12
Topic was moved from Hacks.
Jason
Jason Jan 19 '16
I work in the adult industry. specifically adult dating. Its pretty easy to need more than 31 options. eg a member may be required to fill in his or her personal interestes or 'likes' 

eg. heels, stockings, boots, corsetry, gloves, etc etc.  My current list has over 50 so im probab;ly going to pay someone to get the mod done, but ive fiddled it myself and i ALMOST have it working.


In the admin i can now add up to 63 options and save them. my only issue so far is that the correct boxes arent being checked in the member section once i check any boxes that are options 32 and upwards.. i think its a variable SIGN issue. ive only been at it for an hour. i should come back in a bit and give you an update..


if i dont, feel free to PM me to remind me. :)



Jason
Jason Jan 20 '16
I was able to increase the options to 48(can go higher i would guess) by doing this


1) 

ow_base_question_data -> intValue,  and ow_base_question_value -> value are both defined as INT and should be set to BIGINT with a length of 16(may need more but 16 suits my purposes as im using 48 options)


2)  

in ow_static/plugins/admin/js/questions.js there is the following code

 for ( var i = 0; i < 32; i++ )

and in ow_system_plugins/admin/classes/form_fields.php there is the following code
 if ( $count >= 32 )


change both 32s to 48


3)
in ow_system_plugins/base/bol/question_service.php

Line 2449: for ( $i = 0; $i < 31; $i++)

Line 2510: for ( $i = 0; $i < 31; $i++)


change 31 to 47


I still cant get the question sorting order correct though so questions may be out of order but the sort order can be easily modified by playing with the table/column

ow_base_question_value -> sortOrder


i'd consider waiting for oxwall to fix it, but if you want to try this, then make sure you back up first!



The Forum post is edited by Jason Jan 21 '16
Jason
Jason Jan 30 '16
I have it working almost perfectly now.

I found the following line
ow_system_plugins/base/bol/question_service.php

inside function prepareFieldValueForSearch { 

Line 2449: for ( $i = 0; $i < 31; $i++)

}

inside function prepareFieldValue { 

Line 2510: for ( $i = 0; $i < 31; $i++)

}


i changed the 31 in both lines to 47, along with the changes in my previous post, and i can now add approx 48 variables

the only issue left is when i add variables above 31, i cant place them in the proper order but its easy to manually change the database for that ow_base_question_value -> sortOrder holds the question order values..