PDA

View Full Version : MOD: Sort links by Description


mikerock
09-01-2005, 01:01 AM
I recently added the ability to sort links by description on my site. If anyone else needs this ability, here are the code changes below.

Open index.php

Find line:
Content visible to registered users only.

Change to:
Content visible to registered users only.

Open main.tpl

Find:
Content visible to registered users only.

Insert After:
Content visible to registered users only.

Ap0s7le
09-01-2005, 02:03 AM
Righto Mike

Thanks

-Casey

mikerock
09-01-2005, 09:29 PM
A couple more options:

1. I needed to default it to sorting on description. I edited the database to change PLD_CONFIG --> DEFAULT_SORT and changed the value to D. You can also hard code it by changing $sort = DEFAULT_SORT; to $sort = 'D'

Although it automatically defaults to Ascending, I also added Description to the $sort_ord line. You can change this to DESC for descending depending on preference.

Content visible to registered users only.

2. Sort Description and Title at same time.

One more thing I noticed is when I have alot of sites with the same description it looks odd with the title not getting sorted at the same time. Depending on the way you use description you may want to sort description and title at the same time.

Therefore changing the $sort_cols line as follows accomplishes that.

Content visible to registered users only.