Go Back   vb.org Archive > vBulletin 3 Discussion > vB3 General Discussions
  #1  
Old 01-04-2007, 12:50 PM
John Diver John Diver is offline
 
Join Date: Nov 2003
Posts: 329
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default Getting member search to work in a sidebar on all pages

Hey,

I am trying to get the member search function to work in a side bar on all pages to let my users search for other members by custom profile fields.

This is the member search code

Code:
<form action="memberlist.php?do=getall" method="post">
<input type="hidden" name="s" value="$session[sessionhash]" />
<input type="hidden" name="do" value="getall" />

<table class="tborder" cellpadding="$stylevar[cellpadding]" cellspacing="$stylevar[cellspacing]" border="0" width="100%" align="center">
<tr>
	<td class="tcat">$vbphrase[members_list] - $vbphrase[advanced_search]</td>
</tr>
<tr>
	<td class="panelsurround" align="center">
	<div class="panel">
		<div style="width:$stylevar[formwidth]" align="$stylevar[left]">
		
			<div style="margin-bottom:$stylevar[formspacer]px">
				$vbphrase[fields_on_form_optional]
			</div>
			
			<div class="fieldset">
				$vbphrase[username]
				<div id="userfield"><input type="text" class="bginput" id="userfield_txt" size="50" name="ausername" value="" /></div>
				<if condition="$show['popups']">
					<div id="userfield_menu" class="vbmenu_popup" style="display:none"></div>
					<script type="text/javascript" src="clientscript/vbulletin_ajax_namesugg.js?v=$vboptions[simpleversion]"></script>
					<script type="text/javascript">
					<!--
					vbmenu_register('userfield', true);
					snc = new vB_AJAX_NameSuggest('snc', 'userfield_txt', 'userfield');
					//-->
					</script>
				</if>
			</div>
			
			<div class="fieldset">
				$vbphrase[home_page]<br />
				<input type="text" class="bginput" size="50" name="homepage" value="" />
			</div>
		
			$customfields
			
			<fieldset class="fieldset">
				<legend>$vbphrase[instant_messaging]</legend>
				<table cellpadding="0" cellspacing="$stylevar[formspacer]" border="0">
				<tr>
					<td>
						$vbphrase[icq_number]<br />
						<img src="$stylevar[imgdir_misc]/im_icq.gif" alt="" />
						<input type="text" class="bginput" size="25" name="icq" value="" dir="ltr" />
					</td>
					<td>
						$vbphrase[aim_screen_name]<br />
						<img src="$stylevar[imgdir_misc]/im_aim.gif" alt="" />
						<input type="text" class="bginput" size="25" name="aim" value="" dir="ltr" />
					</td>
				</tr>
				<tr>
					<td>
						$vbphrase[msn_messenger_handle]<br />
						<img src="$stylevar[imgdir_misc]/im_msn.gif" alt="" />
						<input type="text" class="bginput" size="25" name="msn" value="" dir="ltr" />
					</td>
					<td>
						$vbphrase[yahoo_messenger_handle]<br />
						<img src="$stylevar[imgdir_misc]/im_yahoo.gif" alt="" />
						<input type="text" class="bginput" size="25" name="yahoo" value="" dir="ltr" />
					</td>
				</tr>
				<tr>
					<td>
						$vbphrase[skype_name]<br />
						<img src="$stylevar[imgdir_misc]/im_skype.gif" alt="" />
						<input type="text" class="bginput" size="25" name="skype" value="" dir="ltr" />
					</td>
					<td>&nbsp;</td>
				</tr>
				</table>
			</fieldset>
			
			<fieldset class="fieldset">
				<legend>$vbphrase[post_count]</legend>
				<table cellpadding="0" cellspacing="$stylevar[formspacer]" border="0">
				<tr>
					<td>
						$vbphrase[is_greater_than_or_equal_to]<br />
						<input type="text" class="bginput" size="25" name="postslower" value="" />
					</td>
					<td>
						$vbphrase[is_less_than]<br />
						<input type="text" class="bginput" size="25" name="postsupper" value="" />
					</td>
				</tr>
				</table>
			</fieldset>
			
			<fieldset class="fieldset">
				<legend>$vbphrase[join_date]</legend>
				<table cellpadding="0" cellspacing="$stylevar[formspacer]" border="0">
				<tr>
					<td>
						$vbphrase[is_after]<br />
						<input type="text" class="bginput" size="25" name="joindateafter" value="" />
					</td>
					<td>
						$vbphrase[is_before]<br />
						<input type="text" class="bginput" size="25" name="joindatebefore" value="" />
					</td>
				</tr>
				<tr>
					<td colspan="2">$vbphrase[please_use_format]</td>
				</tr>
				</table>
			</fieldset>
			
			<fieldset class="fieldset">
				<legend>$vbphrase[last_post]</legend>
				<table cellpadding="0" cellspacing="$stylevar[formspacer]" border="0">
				<tr>
					<td>
						$vbphrase[is_after]<br />
						<input type="text" class="bginput" size="25" name="lastpostafter" value="" />
					</td>
					<td>
						$vbphrase[is_before]<br />
						<input type="text" class="bginput" size="25" name="lastpostbefore" value="" />
					</td>
				</tr>
				<tr>
					<td colspan="2">$vbphrase[please_use_format_yyyymmdd_hhmmss]</td>
				</tr>
				</table>
			</fieldset>
			
		</div>
	</div>
	
	<div class="thead" style="padding:$stylevar[cellpadding]px">$vbphrase[options]</div>
	
	<div class="panel" align="center">
		<div style="width:$stylevar[formwidth]" align="$stylevar[left]">
			
			<fieldset class="fieldset">
				<legend>$vbphrase[options]</legend>
				<table cellpadding="0" cellspacing="$stylevar[formspacer]" border="0">
				<tr>
					<td>
						$vbphrase[order_results_by]<br />
						<select name="sort">
							<option value="username" selected="selected">$vbphrase[username]</option>
							<option value="joindate">$vbphrase[join_date]</option>
							<option value="posts">$vbphrase[post_count]</option>
							<option value="lastvisit">$vbphrase[last_visit]</option>
							<if condition="$vboptions['reputationenable']">
							<option value="reputation">$vbphrase[reputation]</option>
							</if>
						</select>
						<select name="order">
							<option value="">$vbphrase[in_ascending_order]</option>
							<option value="DESC">$vbphrase[in_descending_order]</option>
						</select>
					</td>
				</tr>
				<tr>
					<td>
						$vbphrase[number_of_users_perpage]<br />
						<input type="text" class="bginput" size="25" name="pp" value="$vboptions[memberlistperpage]" />
					</td>
				</tr>
				</table>
			</fieldset>
			
		</div>
	</div>
	
	<div style="margin-top:$stylevar[cellpadding]px">
		<input type="submit" class="button" value="$vbphrase[search_now]" accesskey="s" />
		<input type="reset" class="button" value="$vbphrase[reset_fields]" />
	</div>
	</td>
</tr>
</table>

</form>
I have the normal search on the sidebar but not sure how the member search will work.

Thanks a lot
John
Reply With Quote
  #2  
Old 01-04-2007, 01:10 PM
paul41598's Avatar
paul41598 paul41598 is offline
 
Join Date: Jun 2004
Location: MI
Posts: 732
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

You could mabe set it up somewhat similar to your other search. Have 1 text box, that searches just the username, and when someone clicks advanced, they get all the advanced options.
Reply With Quote
  #3  
Old 01-04-2007, 05:52 PM
John Diver John Diver is offline
 
Join Date: Nov 2003
Posts: 329
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Thanks Paul.

Would you be willing to share your code? I'm looking to do this but I'm looking to add a few fields to the search.

I don't know how to add custom fields to the search. Seems to be a lot of people interested in this but I haven't been able to see code for it anywhere.
Reply With Quote
  #4  
Old 01-04-2007, 06:48 PM
paul41598's Avatar
paul41598 paul41598 is offline
 
Join Date: Jun 2004
Location: MI
Posts: 732
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Well I can just come up with the template code to add the member search in ur sidebar... with an advanced link to the actual advanced member search page. As far as adding custom fields.. I'm not sure if you need to do that? Mine show up fine in my advanced page...maybe edit the custom field and make sure it says "Field Searchable on Members List"
Reply With Quote
  #5  
Old 01-04-2007, 06:57 PM
John Diver John Diver is offline
 
Join Date: Nov 2003
Posts: 329
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Hey Paul,

Thanks for the help

I am using it on a poker forum to let members search for other users that are in their country, its for a forum just for the UK and Ireland so having the custom fields for region, gender and age would really help and be used a lot.

Is your site private Paul or could I take a look at it?

Thanks again
Reply With Quote
Reply

Thread Tools
Display Modes

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 05:47 AM.


Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2024, vBulletin Solutions Inc.
X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.04334 seconds
  • Memory Usage 2,204KB
  • 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
  • (1)bbcode_code
  • (1)footer
  • (1)forumjump
  • (1)forumrules
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (1)navbar
  • (3)navbar_link
  • (120)option
  • (5)post_thanks_box
  • (5)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (5)post_thanks_postbit_info
  • (5)postbit
  • (5)postbit_onlinestatus
  • (5)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