Search Users module in the Search navbar drop down

Discussion in 'Support & Feedback' started by Dekker, Jan 4, 2006.

  1. #1
    it's pretty simple to do

    <!-- header quick search form -->
      	<div class="vbmenu_popup" id="navbar_search_menu" style="display:none">
      		<table cellpadding="4" cellspacing="1" border="0">
      		<tr>
     			<td class="thead">$vbphrase[search_forums]</td>
      		</tr>
      		<tr>
      			<td class="vbmenu_option" title="nohilite">
     			<form action="$vboptions[bburl]/search.php" method="post">
     		 	<input type="hidden" name="do" value="process" />
     		 	<input type="hidden" name="showposts" value="0" />
     		 	<input type="text" class="bginput" name="query" size="20" />$gobutton<br />
      			</form>
      			</td>
      		</tr>
      		<tr>
     			<td class="vbmenu_option"><a href="$vboptions[bburl]/search.php?$session[sessionurl]">$vbphrase[advanced_search]</a></td>
      		</tr>
      		<tr>
     			<td class="thead">Find a Member</td>
      		</tr>
      		<tr>
      			<td class="vbmenu_option" title="nohilite">
     			<form action="$vboptions[bburl]/memberlist.php" method="post">
     		 	<input type="hidden" name="s" value="$session[sessionhash]" />
     		 	<input type="hidden" name="do" value="getall" />
     		 	<input type="text" class="bginput" name="ausername" size="20" value="$ltr" title="$vbphrase[username]" />$gobutton
      			</form>
      			</td>
      		</tr>
      		<tr>
     			<td class="vbmenu_option"><a href="$vboptions[bburl]/memberlist.php?$session[sessionurl]do=search">$vbphrase[advanced_search]</a></td>
      		</tr>
      		</table>
      	</div>
      	<!-- / header quick search form -->
    PHP:
    it's the bottom portion, i basically just copy and pasted it from the memberlist.php, it's really quick and simple to use. but if you've removed it for the server load aspect, then i guess it's not a good idea :p

    but it just adds a Search Member and Advanced Options box under the search forums ones
     
    Dekker, Jan 4, 2006 IP
  2. digitalpoint

    digitalpoint Overlord of no one Staff

    Messages:
    38,334
    Likes Received:
    2,613
    Best Answers:
    462
    Trophy Points:
    710
    Digital Goods:
    29
    #2
    I've thought about it... but to be honest, it would just encourage people to search for users (which I don't really see the point to it). If people *really* want to find a user, they can use the normal member search under the memberlist.php
     
    digitalpoint, Jan 4, 2006 IP
  3. Dekker

    Dekker Peon

    Messages:
    4,185
    Likes Received:
    287
    Best Answers:
    0
    Trophy Points:
    0
    #3
    but you have to type out forums.digitalpoint.com/memberlist.php because it's not in the navbar (at least not to me :p)

    i usually just find them through my PM box :p
     
    Dekker, Jan 4, 2006 IP
  4. digitalpoint

    digitalpoint Overlord of no one Staff

    Messages:
    38,334
    Likes Received:
    2,613
    Best Answers:
    462
    Trophy Points:
    710
    Digital Goods:
    29
    #4
    It's under "Quick Links". :)
     
    digitalpoint, Jan 4, 2006 IP
  5. Dekker

    Dekker Peon

    Messages:
    4,185
    Likes Received:
    287
    Best Answers:
    0
    Trophy Points:
    0
    #5
    oooh.

    i do know some people recommend to turn it off to ease the server load..does it really have that much of an impact?

    i do have most of my mysql tabled indexed, dunno if that makes a difference
     
    Dekker, Jan 4, 2006 IP
  6. digitalpoint

    digitalpoint Overlord of no one Staff

    Messages:
    38,334
    Likes Received:
    2,613
    Best Answers:
    462
    Trophy Points:
    710
    Digital Goods:
    29
    #6
    Yeah... I hate the memberlist queries. There isn't a way to make them "good" queries (trust me, I've spent hours trying to figure out a way so I could give the query to the vB developers).

    It's probably going to make it worse to be honest. vBulletin is pretty well tuned for SQL query efficiency.
     
    digitalpoint, Jan 4, 2006 IP
  7. Dekker

    Dekker Peon

    Messages:
    4,185
    Likes Received:
    287
    Best Answers:
    0
    Trophy Points:
    0
    #7
    oy vay...hmmmmmmmm i guess i'll deindex them and compare
     
    Dekker, Jan 4, 2006 IP
  8. digitalpoint

    digitalpoint Overlord of no one Staff

    Messages:
    38,334
    Likes Received:
    2,613
    Best Answers:
    462
    Trophy Points:
    710
    Digital Goods:
    29
    #8
    If you really want to dig into it run your queries through the EXPLAIN function in MySQL. You can see what indexes the query is able to use, etc.
     
    digitalpoint, Jan 4, 2006 IP
  9. Dekker

    Dekker Peon

    Messages:
    4,185
    Likes Received:
    287
    Best Answers:
    0
    Trophy Points:
    0
    #9
    hmmm i had this queries done

    ALTER TABLE `post` ADD INDEX `datelineuserid` ( `userid` , `dateline` );
    Code (markup):
    ALTER TABLE `thread` ADD INDEX ( `lastposter` );
    
    ALTER TABLE `thread` ADD INDEX ( `lastpost` );
    Code (markup):
    alter table forum add index (displayorder);
    
    alter table forumpermission add index (forumid);
    alter table forumpermission add index (usergroupid);
    alter table forumpermission add index (canadminedit);
    
    alter table post add index (threadid);
    alter table post add index (username);
    alter table post add index (userid);
    alter table post add index (dateline);
    
    alter table session add index (userid);
    alter table session add index (location);
    
    alter table thread add index (lastpost);
    alter table thread add index (forumid);
    alter table thread add index (lastpost); 
    alter table user add index (usergroupid); 
    alter table user add index (username); 
    Code (markup):
     
    Dekker, Jan 4, 2006 IP
  10. digitalpoint

    digitalpoint Overlord of no one Staff

    Messages:
    38,334
    Likes Received:
    2,613
    Best Answers:
    462
    Trophy Points:
    710
    Digital Goods:
    29
    #10
    I dunno... maybe you needed the indexes for custom stuff/queries, so don't take them out on my account. But adding an index for a *default* vBulletin query is going to be counter productive (at least for any query I've seen).
     
    digitalpoint, Jan 4, 2006 IP
  11. Dekker

    Dekker Peon

    Messages:
    4,185
    Likes Received:
    287
    Best Answers:
    0
    Trophy Points:
    0
    #11
    do you know if any of those have an index by default? how do you check if it has an index or not?

    alter table <table> drop index (<index>); 
    Code (markup):
    to remove them right?

    they said it's for bigger boards with more posts, etc. it might actually impede performance on smaller boards, but i think my board counts as a bigger one.

    hmmm....bleh i'll ask the vbulletin people :p
     
    Dekker, Jan 4, 2006 IP
  12. digitalpoint

    digitalpoint Overlord of no one Staff

    Messages:
    38,334
    Likes Received:
    2,613
    Best Answers:
    462
    Trophy Points:
    710
    Digital Goods:
    29
    #12
    How big is your forum? This one is medium sized and I haven't needed to alter any of the default vB structure (indexes or otherwise).
     
    digitalpoint, Jan 4, 2006 IP
  13. Dekker

    Dekker Peon

    Messages:
    4,185
    Likes Received:
    287
    Best Answers:
    0
    Trophy Points:
    0
    #13
    well i guess it'd be small-medium if you consider this one medium :p

    i don't believe there are any special queries that need those indexes...hmmm...well I made a post on the vbulletin boards so I'll see what they say.
     
    Dekker, Jan 4, 2006 IP
  14. digitalpoint

    digitalpoint Overlord of no one Staff

    Messages:
    38,334
    Likes Received:
    2,613
    Best Answers:
    462
    Trophy Points:
    710
    Digital Goods:
    29
    #14
    I would consider 1M+ posts a "big" forum.

    BTW, if you don't mind it being wrapped in PHP, you can find the vBulletin DB schema in:

    /install/mysql-schema.php

    (open the file in a text editor)
     
    digitalpoint, Jan 4, 2006 IP
  15. Dekker

    Dekker Peon

    Messages:
    4,185
    Likes Received:
    287
    Best Answers:
    0
    Trophy Points:
    0
    #15
    thanks!

    i'll take a look at that.

    i'm trying to learn PHP so i might as well umm...yeah :p
     
    Dekker, Jan 4, 2006 IP
  16. Dekker

    Dekker Peon

    Messages:
    4,185
    Likes Received:
    287
    Best Answers:
    0
    Trophy Points:
    0
    #16
    hmmm...

    if they were to install an index by default would they have "ADD INDEX" within the code?

    or this
    CREATE [UNIQUE|FULLTEXT|SPATIAL] INDEX index_name
        [USING index_type]
        ON tbl_name (index_col_name,...
    Code (markup):
    
    $schema['CREATE']['query']['forumpermission'] = "
    CREATE TABLE " . TABLE_PREFIX . "forumpermission (
    	forumpermissionid SMALLINT UNSIGNED NOT NULL AUTO_INCREMENT,
    	forumid SMALLINT UNSIGNED NOT NULL DEFAULT '0',
    	usergroupid SMALLINT UNSIGNED NOT NULL DEFAULT '0',
    	forumpermissions INT UNSIGNED NOT NULL DEFAULT '0',
    	PRIMARY KEY (forumpermissionid),
    	UNIQUE KEY ugid_fid (usergroupid, forumid)
    
    Code (markup):
    i believe that's the setup for the forumpermission table, but I don't believe I see anything about indexes

    hmm

    $schema['CREATE']['query']['subscribeforum'] = "
    CREATE TABLE " . TABLE_PREFIX . "subscribeforum (
    	subscribeforumid INT UNSIGNED NOT NULL AUTO_INCREMENT,
    	userid INT UNSIGNED NOT NULL DEFAULT '0',
    	forumid SMALLINT UNSIGNED NOT NULL DEFAULT '0',
    	emailupdate SMALLINT UNSIGNED NOT NULL DEFAULT '0',
    	PRIMARY KEY (subscribeforumid),
    	[b]UNIQUE KEY subindex (userid, forumid),[/b]
    	KEY forumid (forumid)
    )
    Code (markup):
    a sub index?
     
    Dekker, Jan 4, 2006 IP
  17. digitalpoint

    digitalpoint Overlord of no one Staff

    Messages:
    38,334
    Likes Received:
    2,613
    Best Answers:
    462
    Trophy Points:
    710
    Digital Goods:
    29
    #17
    No... the following code are for the two default indexes in that table:

    PRIMARY KEY (forumpermissionid),
    UNIQUE KEY ugid_fid (usergroupid, forumid)
    Code (sql):
     
    digitalpoint, Jan 4, 2006 IP
  18. Dekker

    Dekker Peon

    Messages:
    4,185
    Likes Received:
    287
    Best Answers:
    0
    Trophy Points:
    0
    #18
    hmmm this is going to take some time then :p

    are those the only two notifier that it's an index or are there more?
     
    Dekker, Jan 4, 2006 IP
  19. digitalpoint

    digitalpoint Overlord of no one Staff

    Messages:
    38,334
    Likes Received:
    2,613
    Best Answers:
    462
    Trophy Points:
    710
    Digital Goods:
    29
    #19
    Just look for the word "KEY". And they are always in the last lines of the SQL query in the vB schema. For example the user table has 5 indexes (one primary and 4 "normal").
     
    digitalpoint, Jan 4, 2006 IP
  20. Dekker

    Dekker Peon

    Messages:
    4,185
    Likes Received:
    287
    Best Answers:
    0
    Trophy Points:
    0
    #20
    cool, thanks :)
     
    Dekker, Jan 4, 2006 IP