<form action="" name="sortlinks_frm" method="post">
Sort By :
<select name="sort_by">
    <option value="" <%if !$sort_by%>selected="selected"<%/if%>></option>
    <option value="title" <%if $sort_by == 'title'%>selected="selected"<%/if%>>Title</option>
    <option value="url" <%if $sort_by == 'url'%>selected="selected"<%/if%>>URL</option>
    <option value="date" <%if $sort_by == 'date'%>selected="selected"<%/if%>>Date Added</option>
    <option value="last_updated" <%if $sort_by == 'last_updated'%>selected="selected"<%/if%>>Last Updated</option>
    <option value="hits" <%if $sort_by == 'hits'%>selected="selected"<%/if%>>Hits</option>
    <option value="votes" <%if $sort_by == 'votes'%>selected="selected"<%/if%>>Votes</option>
    <option value="rating" <%if $sort_by == 'rating'%>selected="selected"<%/if%>>Rating</option>
    <%if $use_pagerank == 'yes'%>
    <option value="rank" <%if $sort_by == 'rank'%>selected="selected"<%/if%>>Google PR</option>
    <%/if%>
    <%if $use_custom_field == 'yes'%>
      <%section name=i loop=$custom_fields%>
        <%if strpos($exclude_custom_field, $custom_fields[i].field_name) === FALSE%>
        <option value="<%$custom_fields[i].field_name%>" <%if $sort_by == $custom_fields[i].field_name%>selected="selected"<%/if%>>
          <%$custom_fields[i].field_text%>
        </option>
        <%/if%>
      <%/section%>
    <%/if%>
</select>
<select name="sort_order">
    <option value="" <%if !$sort_order%>selected="selected"<%/if%>></option>
    <option value="asc" <%if $sort_order == 'asc'%>selected="selected"<%/if%>>Ascending</option>
    <option value="desc" <%if $sort_order == 'desc'%>selected="selected"<%/if%>>Descending</option>
</select>
<input type="submit" value="Go" />
</form>