19-10-2010, 12:28 AM
How to move "search" to the top of the members list
By default, the search function is at the bottom of the members list. This tutorial is going to show you how to move it to the top.
You can find your members list at: http://yoursite.com/memberlist.php
Steps
Go to:
- Admin CP
- Templates (Left)
- *your theme*
- Member List Templates
- memberlist
Look for " <br style="clear: both;" /> ". Once you've found it, highlight from there to " </form> " like below.
Code:
<br style="clear: both;" />
<br />
<form method="post" action="memberlist.php">
<table border="0" cellspacing="{$theme['borderwidth']}" cellpadding="{$theme['tablespace']}" class="tborder">
<tr>
<td class="thead" colspan="3">
<div class="float_right">
<strong><a href="memberlist.php?action=search">{$lang->advanced_search}</a></strong>
</div>
<div><strong>{$lang->search_members}</strong></div>
</td>
</tr>
<tr>
<td class="tcat"><strong><label for="username">{$lang->username}</label></strong></td>
<td class="tcat"><strong><label for="website">{$lang->website}</label></strong></td>
<td class="tcat"><strong><label for="sort">{$lang->sort_by}</label></strong></td>
</tr>
<tr>
<td class="trow1" width="33%" style="vertical-align: top;">
{$lang->contains}<br />
<input type="text" class="textbox" name="username" id="username" style="width: 99%; margin-top: 4px;" value="{$search_username}" />
</td>
<td class="trow1" width="33%" style="vertical-align: top;">
{$lang->contains}<br />
<input type="text" class="textbox" name="website" id="website" style="width: 99%; margin-top: 4px;" value="{$search_website}" />
</td>
<td class="trow1" width="33%">
<select name="sort" id="sort" style="width: 99%;">
<option value="username"{$sort_selected['username']}>{$lang->sort_by_username}</option>
<option value="regdate"{$sort_selected['regdate']}>{$lang->sort_by_regdate}</option>
<option value="lastvisit"{$sort_selected['lastvisit']}>{$lang->sort_by_lastvisit}</option>
<option value="postnum"{$sort_selected['postnum']}>{$lang->sort_by_posts}</option>
<option value="referrals"{$sort_selected['referrals']}>{$lang->sort_by_referrals}</options>
</select><br />
<span class="smalltext">
<input type="radio" class="radio" name="order" id="order_asc" value="ascending"{$order_check['ascending']} /> <label for="order_asc">{$lang->order_asc}</label><br />
<input type="radio" class="radio" name="order" id="order_desc" value="descending"{$order_check['descending']} /> <label for="order_desc">{$lang->order_desc}</label>
</span>
</td>
</tr>
</table>
<div align="center"><br /><input type="submit" class="button" name="submit" value="{$lang->search}" /></div>
</form>
Cut it, scroll back up and paste it directly under " {header} ".
Your end result should be this:
Code:
<html>
<head>
<title>{$mybb->settings['bbname']} - {$lang->member_list}</title>
{$headerinclude}
</head>
<body>
{$header}
<br style="clear: both;" />
<br />
<form method="post" action="memberlist.php">
<table border="0" cellspacing="{$theme['borderwidth']}" cellpadding="{$theme['tablespace']}" class="tborder">
<tr>
<td class="thead" colspan="3">
<div class="float_right">
<strong><a href="memberlist.php?action=search">{$lang->advanced_search}</a></strong>
</div>
<div><strong>{$lang->search_members}</strong></div>
</td>
</tr>
<tr>
<td class="tcat"><strong><label for="username">{$lang->username}</label></strong></td>
<td class="tcat"><strong><label for="website">{$lang->website}</label></strong></td>
<td class="tcat"><strong><label for="sort">{$lang->sort_by}</label></strong></td>
</tr>
<tr>
<td class="trow1" width="33%" style="vertical-align: top;">
{$lang->contains}<br />
<input type="text" class="textbox" name="username" id="username" style="width: 99%; margin-top: 4px;" value="{$search_username}" />
</td>
<td class="trow1" width="33%" style="vertical-align: top;">
{$lang->contains}<br />
<input type="text" class="textbox" name="website" id="website" style="width: 99%; margin-top: 4px;" value="{$search_website}" />
</td>
<td class="trow1" width="33%">
<select name="sort" id="sort" style="width: 99%;">
<option value="username"{$sort_selected['username']}>{$lang->sort_by_username}</option>
<option value="regdate"{$sort_selected['regdate']}>{$lang->sort_by_regdate}</option>
<option value="lastvisit"{$sort_selected['lastvisit']}>{$lang->sort_by_lastvisit}</option>
<option value="postnum"{$sort_selected['postnum']}>{$lang->sort_by_posts}</option>
<option value="referrals"{$sort_selected['referrals']}>{$lang->sort_by_referrals}</options>
</select><br />
<span class="smalltext">
<input type="radio" class="radio" name="order" id="order_asc" value="ascending"{$order_check['ascending']} /> <label for="order_asc">{$lang->order_asc}</label><br />
<input type="radio" class="radio" name="order" id="order_desc" value="descending"{$order_check['descending']} /> <label for="order_desc">{$lang->order_desc}</label>
</span>
</td>
</tr>
</table>
<div align="center"><br /><input type="submit" class="button" name="submit" value="{$lang->search}" /></div>
</form>
<br />
{$multipage}
<table border="0" cellspacing="{$theme['borderwidth']}" cellpadding="{$theme['tablespace']}" class="tborder">
<tr>
<td class="thead" colspan="6">
<div class="float_right">
<a href="memberlist.php?username_match=begins&username={$lang->a}" style="padding: 5px;">{$lang->a}</a>
<a href="memberlist.php?username_match=begins&username={$lang->b}" style="padding: 5px;">{$lang->b}</a>
<a href="memberlist.php?username_match=begins&username={$lang->c}" style="padding: 5px;">{$lang->c}</a>
<a href="memberlist.php?username_match=begins&username={$lang->d}" style="padding: 5px;">{$lang->d}</a>
<a href="memberlist.php?username_match=begins&username={$lang->e}" style="padding: 5px;">{$lang->e}</a>
<a href="memberlist.php?username_match=begins&username={$lang->f}" style="padding: 5px;">{$lang->f}</a>
<a href="memberlist.php?username_match=begins&username={$lang->g}" style="padding: 5px;">{$lang->g}</a>
<a href="memberlist.php?username_match=begins&username={$lang->h}" style="padding: 5px;">{$lang->h}</a>
<a href="memberlist.php?username_match=begins&username={$lang->i}" style="padding: 5px;">{$lang->i}</a>
<a href="memberlist.php?username_match=begins&username={$lang->j}" style="padding: 5px;">{$lang->j}</a>
<a href="memberlist.php?username_match=begins&username={$lang->k}" style="padding: 5px;">{$lang->k}</a>
<a href="memberlist.php?username_match=begins&username={$lang->l}" style="padding: 5px;">{$lang->l}</a>
<a href="memberlist.php?username_match=begins&username={$lang->m}" style="padding: 5px;">{$lang->m}</a>
<a href="memberlist.php?username_match=begins&username={$lang->n}" style="padding: 5px;">{$lang->n}</a>
<a href="memberlist.php?username_match=begins&username={$lang->o}" style="padding: 5px;">{$lang->o}</a>
<a href="memberlist.php?username_match=begins&username={$lang->p}" style="padding: 5px;">{$lang->p}</a>
<a href="memberlist.php?username_match=begins&username={$lang->q}" style="padding: 5px;">{$lang->q}</a>
<a href="memberlist.php?username_match=begins&username={$lang->r}" style="padding: 5px;">{$lang->r}</a>
<a href="memberlist.php?username_match=begins&username={$lang->s}" style="padding: 5px;">{$lang->s}</a>
<a href="memberlist.php?username_match=begins&username={$lang->t}" style="padding: 5px;">{$lang->t}</a>
<a href="memberlist.php?username_match=begins&username={$lang->u}" style="padding: 5px;">{$lang->u}</a>
<a href="memberlist.php?username_match=begins&username={$lang->v}" style="padding: 5px;">{$lang->v}</a>
<a href="memberlist.php?username_match=begins&username={$lang->w}" style="padding: 5px;">{$lang->w}</a>
<a href="memberlist.php?username_match=begins&username={$lang->x}" style="padding: 5px;">{$lang->x}</a>
<a href="memberlist.php?username_match=begins&username={$lang->y}" style="padding: 5px;">{$lang->y}</a>
<a href="memberlist.php?username_match=begins&username={$lang->z}" style="padding: 5px;">{$lang->z}</a>
</div>
<div><strong>{$lang->member_list}</strong></td></div>
</tr>
<tr>
<td class="tcat" width="1%"><span class="smalltext"><strong>{$lang->avatar}</strong></span></td>
<td class="tcat"><span class="smalltext"><strong>{$lang->username}</strong></span></td>
<td class="tcat" width="15%" align="center"><span class="smalltext"><strong>{$lang->joined}</strong></span></td>
<td class="tcat" width="15%" align="center"><span class="smalltext"><strong>{$lang->lastvisit}</strong></span></td>
<td class="tcat" width="10%" align="center"><span class="smalltext"><strong>{$lang->posts}</strong></span></td>
{$referral_header}
</tr>
{$users}
</table>
<div class="float_right" style="padding-top: 4px;">
<a href="showteam.php"><strong>{$lang->forumteam}</strong></a>
</div>
{$multipage}
{$footer}
<script type="text/javascript" src="jscripts/autocomplete.js?ver=1400"></script>
<script type="text/javascript">
<!--
if(use_xmlhttprequest == "1")
{
new autoComplete("username", "xmlhttp.php?action=get_users", {valueSpan: "username"});
}
// -->
</script>
</body>
</html>
Example:
[spoiler]
[/spoiler]