Matchmaking - Is it possible?

I wonder if this is possible in some way. Maybe someone did before?

I set up a page with a questionnaire on it. You can answer each question by clicking a radio button which represents 5 answers.

 

Is money important for you? Answer: no - littlebit - neither - yes - very

 

The answer is saved into a custom profile field as a number from 1 to 5. So each profile field can hold a number from 1 to 5. Everything is already working! But now here comes the question.

 

Is it possible to not only add the % set in the field to the overall score if both fields match exactly?

I want something like this, so a questionnaire makes more sense. If two answers are close to each other it should not count it as a totally miss.

 

 
Member 1 (answer) Member 2 (answer) % (set in field) % (should be used for matchmaking)
1 5 10 0
2 4 10 5
3 3 10 10
1 3 10 5
2 4 10 5
2 5 10 2
1 4 10 2

 

Can I do this in some way?

Check my GeoDistance, Watermark, TorBlock and Android Push Notifications mods | http://goo.gl/H3Vp81
Quote · 14 May 2012

Because I didn't find a solution through the admin panel I changed the code in function getProfilesMatch() in /inc/match.inc.php to suite my needs.

That was an easy one. Case closed.

Check my GeoDistance, Watermark, TorBlock and Android Push Notifications mods | http://goo.gl/H3Vp81
Quote · 15 May 2012

well that is an easy  way I did it with 5 separate columns  Would you care to share :O) and can this be extended to say 20 questions ?

Many thanks

Quote · 15 May 2012

I can use as many as i want as long as i can add new profile fields :) Currently i have 25.

The code i have written is to specific to my site and profile fields. I can tell you the steps and what i did. I thought about writing a tutorial, but it will be no use for people i think. Because copy paste will fail in most times.

1) I created profile fields for each question in page builder (profiles). Only move them up in "edit profile" tab for admin, so only he can see. I used number min:1 max:5 default:3 nothing else

2) Create a new page and add a PHP block using Deanos Tool. You can find it here on Boonex. Then add this page to a menu or somewhere else.

3) Add PHP code to the php block which reads the values from these fields. Based on these values output html code which creates a form including radiobutton groups representing the values 1 to 5

4) Add a button to submit the values. So you can handle write back to the database (do a form self submit). Please also read this, maybe its a help to you

http://www.boonex.com/forums/topic/How-to-access-profile-fields-directly-.htm

5) After members can read and write values to these profile fields its time to take care of the machmaking

6) Open /inc/match.inc.php and find function getProfilesMatch() at the end of the file (7.0.9 in my case)

7) This function is very easy to understand, as you can see at the end the line

$iMatch += (int)$aFields['MatchPercent'];

counts the match-values of all fields together and returns this as the overall score of 2 people to dolphin.

8) You just need take out your special question fields from being used in the functions loop and add you own routine in to calculate a value which should be added to $iMatch (instead of $aFields['MatchPercent'])

I just subtracted ProfileSpecialField1Member1 from ProfileSpecialField1Member2 and used the unsigned value of it. Then i did a switch case on this result . In case its 5 or 4 i added 0 to $iMatch, 3 i added 50% of $aFields['MatchPercent'], and so on. Don't compare to my example table above, because i already distributed the points in some other way.

Check my GeoDistance, Watermark, TorBlock and Android Push Notifications mods | http://goo.gl/H3Vp81
Quote · 16 May 2012

Thank you for the advice

 

Happy thoughts

Quote · 17 May 2012
 
 
Below is the legacy version of the Boonex site, maintained for Dolphin.Pro 7.x support.
The new Dolphin solution is powered by UNA Community Management System.