Go Back   vb.org Archive > vBulletin 4 Discussion > vB4 Programming Discussions
FAQ Community Calendar Today's Posts Search

Reply
 
Thread Tools Display Modes
  #1  
Old 07-20-2011, 09:22 PM
EquinoxWorld EquinoxWorld is offline
 
Join Date: Nov 2009
Location: Naples
Posts: 354
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default Need Help utilizing vb username suggestion pop-up into another script

Hello everyone, I am currently trying to utilize vb built in username suggestion pop-up. So far what I can gather is that it would be need to have included this script:

Code:
<script type="text/javascript" src="clientscript/vbulletin_ajax_suggest.js?v={vb:raw vboptions.simpleversion}"></script>
The form would need to have the same id and/or class as required and enclosed between these divs.

HTML Code:
<div mrecipid="ps" class="popupmenu nomouseover noclick nohovermenu">
					<textarea class="primary full textbox popupctrl" id="pmrecips_ctrl" name="recipients" rows="{vb:if is_browser('mozilla'), 1, 2}" cols="50"  tabindex="1">{vb:raw pm.recipients}</textarea>
				</div>
And finally this script code below the above divs:

Code:
<script type="text/javascript">
				<!--
					recip_sugg = new vB_AJAX_NameSuggest('recip_sugg', 'pmrecips_ctrl', 'pmrecips');
					<vb:if condition="$show['sendmultiple']">recip_sugg.allow_multiple = true;</vb:if>
				//-->
				</script>
So what I can understand so far is that all that I would have to do is copy the <scripts> and place them accordingly with my custom form, next wrap the form in the divs mentioned above as well. Here is where I get confused, I am not sure if I need to have the id and/or the class as the above example the same on my custom form.

Before I start meddling with this I was wondering if anyone had any additional information I can use to help me through understanding how this works. Any info at all would be very very helpful, so please don't be shy .

PS.. I know I may be wayyyyy off so please bare with the noobness.

P.S.: Am I going to have to register those variables in my custom php page as well or they globally registered by including global.php?

Here is my form template btw:

HTML Code:
{vb:stylevar htmldoctype}
<html xmlns="http://www.w3.org/1999/xhtml" dir="{vb:stylevar textdirection}" lang="{vb:stylevar languagecode}" id="vbulletin_html">
<head>
<title>{vb:raw vboptions.bbtitle} - {vb:raw pagetitle}</title>
   {vb:raw headinclude}
   {vb:raw headinclude_bottom}
</head>
<body>
    
    {vb:raw header}
    
    {vb:raw navbar}

    
<div id="pagetitle">
   <h1>{vb:raw pagetitle}</h1>
</div>

<div id="usercp_content">

{vb:raw oftw_sidemenu}

<div class="cp_content" style="width: 80%; float: right;">
<h2 class="blockhead">Contests Of The Week - Signature Of The Week # {vb:raw oftw_get_contests_number} - Starting Date:&nbsp;{vb:raw oftw_contest_date_start}</h2>
<div class="blocksubhead">
<center><form action="nominate.php" method="post">
Enter Image URL to Nominate: <input type="text" name="imgurl">&nbsp;&nbsp;Artist: <input type="text" name="author"><input type="submit" name="submit">
<p><font size="1"><font color="#417394"><b>Max allowed size for images is 500px x 200px. </b></font>Both image URL and Artist must be entered to validate nomination. If you are the artist of your nomination please use "Self".</font></P>
</form>
</center>
</div>
        {vb:raw print_nominations}
</div>


</div>				
    {vb:raw footer}

  </body>
</html>
--------------- Added [DATE]1311203918[/DATE] at [TIME]1311203918[/TIME] ---------------

OK GOT IT...I apologize if the thread was uncalled for...never the less here is what I did to get it to work for me...Maybe someone else might find this useful.

This is my form template:

HTML Code:
<div id="pmrecips" class="popupmenu nomouseover noclick nohovermenu">
<div class="blocksubhead">

<script type="text/javascript" src="clientscript/vbulletin_ajax_suggest.js?v=414"></script>

<center><form action="nominate.php" method="post">
Enter Image URL to Nominate: <input type="text" name="imgurl">&nbsp;&nbsp;Artist: <input type="text" class="primary full textbox popupctrl" id="pmrecips_ctrl" name="author"  rows="{vb:if is_browser('mozilla'), 1, 2}" cols="50"  tabindex="1"><input type="submit" name="submit">
<p><font size="1"><font color="#417394"><b>Max allowed size for images is 500px x 200px. </b></font>Both <font color="#417394"><b>Image URL</b></font> and Artist <font color="#417394"><b>User Name</b></font> must be entered to validate nomination.</font></P>
</div>

</form>
<script type="text/javascript">
				<!--
					recip_sugg = new vB_AJAX_NameSuggest('recip_sugg', 'pmrecips_ctrl', 'pmrecips');
					<vb:if condition="$show['sendmultiple']">recip_sugg.allow_multiple = true;</vb:if>
				//-->
				</script>
</center>
</div>
And here's a screen to proove it!

Reply With Quote
Reply


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT. The time now is 12:43 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.03258 seconds
  • Memory Usage 2,177KB
  • Queries Executed 11 (?)
More Information
Template Usage:
  • (1)SHOWTHREAD
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (1)ad_showthread_beforeqr
  • (1)ad_showthread_firstpost
  • (1)ad_showthread_firstpost_sig
  • (1)ad_showthread_firstpost_start
  • (2)bbcode_code
  • (3)bbcode_html
  • (1)footer
  • (1)forumjump
  • (1)forumrules
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (1)navbar
  • (3)navbar_link
  • (120)option
  • (1)post_thanks_box
  • (1)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (1)post_thanks_postbit_info
  • (1)postbit
  • (1)postbit_onlinestatus
  • (1)postbit_wrapper
  • (1)spacer_close
  • (1)spacer_open
  • (1)tagbit_wrapper 

Phrase Groups Available:
  • global
  • inlinemod
  • postbit
  • posting
  • reputationlevel
  • showthread
Included Files:
  • ./showthread.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/functions_bigthree.php
  • ./includes/class_postbit.php
  • ./includes/class_bbcode.php
  • ./includes/functions_reputation.php
  • ./includes/functions_post_thanks.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
  • showthread_start
  • showthread_getinfo
  • forumjump
  • showthread_post_start
  • showthread_query_postids
  • showthread_query
  • bbcode_fetch_tags
  • bbcode_create
  • showthread_postbit_create
  • postbit_factory
  • postbit_display_start
  • post_thanks_function_post_thanks_off_start
  • post_thanks_function_post_thanks_off_end
  • post_thanks_function_fetch_thanks_start
  • post_thanks_function_fetch_thanks_end
  • post_thanks_function_thanked_already_start
  • post_thanks_function_thanked_already_end
  • fetch_musername
  • postbit_imicons
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • postbit_display_complete
  • post_thanks_function_can_thank_this_post_start
  • tag_fetchbit_complete
  • forumrules
  • navbits
  • navbits_complete
  • showthread_complete