vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vB3 Programming Discussions (https://vborg.vbsupport.ru/forumdisplay.php?f=15)
-   -   Calling the AJAX memberlist search (https://vborg.vbsupport.ru/showthread.php?t=301534)

SwalyAaron 08-23-2013 06:35 PM

Calling the AJAX memberlist search
 
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

Code:

<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

Quote:

Originally Posted by nerbert (Post 2440582)
Code:

<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.


All times are GMT. The time now is 02:46 PM.

Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2025, vBulletin Solutions Inc.

X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.01162 seconds
  • Memory Usage 1,718KB
  • Queries Executed 10 (?)
More Information
Template Usage:
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (2)bbcode_code_printable
  • (1)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (4)printthreadbit
  • (1)spacer_close
  • (1)spacer_open 

Phrase Groups Available:
  • global
  • postbit
  • showthread
Included Files:
  • ./printthread.php
  • ./global.php
  • ./includes/init.php
  • ./includes/class_core.php
  • ./includes/config.php
  • ./includes/functions.php
  • ./includes/class_hook.php
  • ./includes/modsystem_functions.php
  • ./includes/class_bbcode_alt.php
  • ./includes/class_bbcode.php
  • ./includes/functions_bigthree.php 

Hooks Called:
  • init_startup
  • init_startup_session_setup_start
  • init_startup_session_setup_complete
  • cache_permissions
  • fetch_threadinfo_query
  • fetch_threadinfo
  • fetch_foruminfo
  • style_fetch
  • cache_templates
  • global_start
  • parse_templates
  • global_setup_complete
  • printthread_start
  • bbcode_fetch_tags
  • bbcode_create
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • printthread_post
  • printthread_complete