21st Jan, 01:06 am
(19th Jan, 08:17 pm)Legitti Wrote: Also register page: https://gyazo.com/408448371befac19fd583e1790b57ee4
Go to the member_register_referrer template and replace it with the following:
Code:
<tr>
<td class="trow1"><label>{$lang->referrer}</label></td>
<!--<td class="trow1"><span class="smalltext"><label for="referrer">{$lang->referrer_desc}</label></span><br /><span class="smalltext"><label for="referrer">{$lang->referrer_desc}</label></span>-->
<td class="trow1">
<input type="text" class="textbox" name="referrername" id="referrer" value="{$referrername}" />
</td>
<script type="text/javascript" src="{$mybb->asset_url}/jscripts/select2/select2.min.js"></script>
<script type="text/javascript">
<!--
if(use_xmlhttprequest == "1")
{
MyBB.select2();
$("#referrer").select2({
containerCssClass: "textarea",
placeholder: "{$lang->search_user}",
minimumInputLength: 3,
maximumSelectionSize: 3,
multiple: false,
ajax: { // instead of writing the function to execute the request we use Select2's convenient helper
url: "xmlhttp.php?action=get_users",
dataType: 'json',
data: function (term, page) {
return {
query: term, // search term
};
},
results: function (data, page) { // parse the results into the format expected by Select2.
// since we are using custom formatting functions we do not need to alter remote JSON data
return {results: data};
}
},
initSelection: function(element, callback) {
var value = $(element).val();
if (value !== "") {
callback({
id: value,
text: value
});
}
},
});
}
// -->
</script>
</td>
</tr>