1

Topic: search results sort by joindate possible?

Hello,

I am using quicksearch buttons, such as :

<form name="quicksearch" method="post" action="index.php?m=search">
<input type="hidden" name="gender2" value="Man" />
<input type="hidden" name="pictures_only" value="1" />
<input class="showSubmit" type="submit" name="submit" value=" all men with photo"/>
<input type="hidden" name="issearch" value="1" />
</form>

And I am wondering how I could have the search results in desc order by joindate.

Purpose is to have the most recently joined member on top of the list.

In cp.search.php near line 235 (and after) I see things that possibly influence the sort order, however, I am not sure how to use these in the above quicksearch.

What I did is to mod near line 347

    $result = $DB->query("SELECT m.member_id, m.username, m.screenname, m.joindate,
                                (m.totalactivepictures + m.totalinactivepictures) AS totalpictures,
                                (m.totalimessages + m.totalsmessages) as totalmessages,
                                m.picture
                          FROM " . DB_PREFIX . "members AS m, " . DB_PREFIX . "members_groups AS g
                          WHERE m.group_id=g.group_id AND $sqlquery
                          ORDER BY $sort $order
                          LIMIT " . (($page - 1) * $results) . ", " . $results);

And change $sort $order into joindate desc, to 'hardcode' the sort, but is has no effect. Just trying to change the sort filters for the quicksearch.

dOJO dATE
Free Martial Arts Dating www.dojodate.net/kimono/

2

Re: search results sort by joindate possible?

Actually you should be editing "includes/lib/lib.search.php" ("cp" files are for the control panel, and "lib" are for the front end). On line 499 replace "m.lastvisit" with "m.joindate".

Developer

3

Re: search results sort by joindate possible?

Yes, of course. I had already a hunch this direction.

Thank you for your help.

Best regards,

dOJO dATE
Free Martial Arts Dating www.dojodate.net/kimono/

4

Re: search results sort by joindate possible?

Hi there vlad,

How would I sort the search results, with priority in this order:

1) Gold members first (group_id = "21")
2) Members with vip package ( package_name is "VIP Membership $12/Month")
3) Last login of every other member

Thanks for your help in advance