Gossamer Forum
Home : Products : Gossamer Links : Development, Plugins and Globals :

Search results sorting options

Quote Reply
Search results sorting options

I would like to offer some sorting options on search results.
Basically, user has an option to select links and to
display them on the search results.

The problem is ID=8&ID=10&ID=11&ID=9 part ...

I don't know how to pass this back to the search script
or clean "sb" and "so" stuff.


<form action="" method="GET">
<select name="sb">
<option value="Title">Title</option>
<option value="Rating">Rating</option>
<option value="Votes">Votes</option>
<select name="so">
<option value="ASC">ASC</option>
<option value="DESC">DESC</option>
<input type="submit" value="Submit">





Any ideas?

Thank you!
Quote Reply
Re: [Payooo] Search results sorting options In reply to
Figured out a way of tidying up the sort asc, desc today...

I see by default the search.cgi script sorts on asc (or perhaps MySQL deos?) anyways 9 time out of 10 Rating needs to be sorted by desc so to avoid having to enter another option for the end user you can add the variable to the query string automatically like this using Javascript:

<form action="<%db_cgi_url%>/search.cgi" method="GET" onSubmit="if (this.sb.value=='Rating') {this.so.value='desc'}else{this.so.value=''};">
<input type="text" size="12" name="query">
<select name="sb">
<option value="">Sort by:</option>
<option value="">Rank</option>
<option value="Title">Title</option>
<option value="Rating">Rating</option>
<input type="hidden" name="so">
<input class="search-button" type=submit value="Go" name="submit">

Comedy Quotes - Glinks 3.3.0, PageBuilder, StaticURLtr, CAPTCHA, User_Edit_Profile