PDA

View Full Version : Calling the AJAX memberlist search


SwalyAaron
08-23-2013, 06:35 PM
I have a custom vbulletin powered page, one of the field asks to input a name of a member on the forums, I know that vbulletin has an ajax function in private.php?do=newpm and in profile.php?do?newbuddy tried looking in the files couldn't find anything.

Anyways how can I call that ajax function?

nerbert
08-23-2013, 09:37 PM
<label for="bccpmrecips_ctrl" class="full">{vb:rawphrase bcc}:</label>
<div id="bccpmrecips" class="popupmenu nomouseover noclick nohovermenu">
<input type="text" class="primary full textbox popupctrl" id="bccpmrecips_ctrl" name="bccrecipients" />
</div>
<script type="text/javascript" src="clientscript/vbulletin_ajax_suggest.js?v={vb:raw vboptions.simpleversion}"></script>
<script type="text/javascript">
<!--
bccrecip_sugg = new vB_AJAX_NameSuggest('bccrecip_sugg', 'bccpmrecips_ctrl', 'bccpmrecips');
//bccrecip_sugg.allow_multiple = true;
//-->
</script>


I think this will do it. I got this out of the PM page template and modified it a bit. you can change those element id's, just observe how they match up with params in the JS function. I doubt you want multiple names so I commented out that part

SwalyAaron
08-24-2013, 07:39 AM
<label for="bccpmrecips_ctrl" class="full">{vb:rawphrase bcc}:</label>
<div id="bccpmrecips" class="popupmenu nomouseover noclick nohovermenu">
<input type="text" class="primary full textbox popupctrl" id="bccpmrecips_ctrl" name="bccrecipients" />
</div>
<script type="text/javascript" src="clientscript/vbulletin_ajax_suggest.js?v={vb:raw vboptions.simpleversion}"></script>
<script type="text/javascript">
<!--
bccrecip_sugg = new vB_AJAX_NameSuggest('bccrecip_sugg', 'bccpmrecips_ctrl', 'bccpmrecips');
//bccrecip_sugg.allow_multiple = true;
//-->
</script>


I think this will do it. I got this out of the PM page template and modified it a bit. you can change those element id's, just observe how they match up with params in the JS function. I doubt you want multiple names so I commented out that part


I've actually tried that before, even copied the whole PM box just can't get it to work. Thanks though.

tbworld
08-24-2013, 08:35 AM
I will take a look at this tomorrow when I am watching a crappy football game -- Beginning of professional season, they are worse then high school players. Looks to me like that code should work as long as you have the right dependencies.