By Alexandre Cayer on Friday, 21 November 2014
Posted in Technical Issues
Replies 4
Likes 0
Views 691
Votes 0
Hi Guys,

I have looked into the view.html of users, its method search and the template of the mod search. I'm aware that the mod push 4 array: conditions, criteria, datakeys & operators.

Operators is pretty straightforward... however could you provide the full list. (A)
Conditions seems to push the field value to analyse against.

I'm less sure about how criteria and datakeys are working... especially since I'm not aware how the method, and it's option ($model->getUsersByFilter('0', $options, $searchOptions) are really working. (B)

I will want to had a select field (or select2 whatsoever) to check against a custom field in one's profile. Like Profession with a lot of profession.

Not sure about the CLEAN UP loop (C) ... which seems a clean up method for complex condition... and the searchOption if-statement (D)

A little crash course would be welcome, in general, and on A, B, C & D above, which I'm sure could become a future page of your I-HOPE-SOON-TO-BE documentation

Thanks Guys,

EDIT... : and why the criterias is XXXXXX/xxxxxxx

[criterias] => Array
(
[0] => JOOMLA_FULLNAME|joomla_fullname
[1] => GENDER|gender
)
Subscribe
·
Friday, 21 November 2014 17:28
·
0 Likes
·
0 Votes
·
0 Comments
·
Hey guys...never got an answer :P
·
Wednesday, 03 December 2014 02:32
·
0 Likes
·
0 Votes
·
0 Comments
·
subscribe++
·
Wednesday, 03 December 2014 03:05
·
0 Likes
·
0 Votes
·
0 Comments
·
Hi Alexandre,

I am sorry for the delay of this reply. Look like we've missed this topic

>> Operators is pretty straightforward... however could you provide the full list. (A)


You may take a look at this file 'JOOMLA/administrator/components/com_easysocial/includes/advancedsearch/helpers/user.php' and look for the getOperators() method.


>> I'm less sure about how criteria and datakeys are working... especially since I'm not aware how the method,
>> and it's option ($model->getUsersByFilter('0', $options, $searchOptions) are really working. (B)


Some fields the value are break into few portion, e.g. the address field, it consist of address1, address2, city, state and country. When user updated their address field, EasySocial actually store these information accordingly to the datakey. Aagain not all fields has this data keys. Because the dating search module ( the search module in users page ) is calling the advanced search API, thus the data that pass in to the API must meet certain format. Hence, even if your field do not require the datakey, but you still need to pass in the datakey with empty value. Please see http://screen.stackideas.com/2014-12-03_1157.png

If you see the distance search, that actually the address field and with the datakey value of 'distance'. Please see http://screen.stackideas.com/2014-12-03_1159.png

>> Not sure about the CLEAN UP loop (C) ... which seems a clean up method for complex condition...


Regarding the 'clean up' processing, since you are adding a 'select' field, you do not need the change the code. That clean up process is actually used to
process the user entered value after user perform the search and the page returned from the server.


>> and the searchOption if-statement (D)


Not sure which seachOption the if-statement you referring. Can you tell me where or which file you are seeing this?

>> EDIT... : and why the criterias is XXXXXX/xxxxxxx


The XXXXX is the field unique key, and the xxxxxx is the field element. E.g. JOOMLA_FULLNAME|joomla_fullname, the JOOMLA_FULLNAME is the unique key that you've entered from your field option. Please see http://screen.stackideas.com/2014-12-03_1215.png and the 'joomla_fullname' is the field's element that used in EasySocial.


Anyway, if you just want to add a drop down field for your profession field, try add the below code at file 'JOOMLA/modules/mod_easysocial_dating_search/tmpl/default.php'


<div data-mod-dating-search-item class="form-group form-group-sm">
<label class="control-label col-sm-3">Profession</label>
<div class="col-sm-9">
<select style="min-width:130px" data-condition="" name="conditions[]" class="form-control input-sm" autocomplete="off">
<option value="One">One</option>
<option value="Two">Two</option>
<option value="Three">Three</option>
<option value="Four">Four</option>
</select>
</div>
<input class="form-control input-sm" type="hidden" value="YOUR_FIELD_UNIQUE_KEY|dropdown" name="criterias[]" data-criterias />
<input class="form-control input-sm" type="hidden" value="" name="datakeys[]" data-datakeys />
<input class="form-control input-sm" type="hidden" value="equal" name="operators[]" data-operators />
</div>



Change the YOUR_FIELD_UNIQUE_KEY to the correct unique key that you've entered for your profession field also the label/value in the option list. Let me know if the above work for you or not.


Hope this help and have a nice day
Sam
·
Wednesday, 03 December 2014 12:28
·
0 Likes
·
0 Votes
·
0 Comments
·
View Full Post