 |

kingtarzan
User
Mar 26, 2003, 6:52 PM
Post #1 of 2
(1587 views)
Shortcut
|
|
RM-AM Feature Suggestion
|
Can't Post
|
|
Right now in order to have search results display from newest to oldest or vice versa you need to set a field to be a listing number and enter it manually which is not ideal since the program is setup to automatically assign listing numbers in the first place. a sort by date feature should be added to article manager and realty manager so that listings can be displayed based on the date they were created. I am a realty manager user so I'm not sure if Article manager already has this feature, but seeing how the two programs are very similar, I am assuming it does not. Thanks, Matt
|
|
|  |
 |

Benjamin
Staff

Mar 26, 2003, 8:19 PM
Post #2 of 2
(1585 views)
Shortcut
|
|
Re: [kingtarzan] RM-AM Feature Suggestion
[In reply to]
|
Can't Post
|
|
Hi Matt, Here's a little hack solution for you. Realty Manager and Auto Manager store the date created and date modified internally within the listings' data file. These dates are created using UNIX dates (# of seconds since Jan 1st 1970 - Unix 'epoch time'). So the format of them really isn't that useful without a converter - but that's okay, since you don't have direct access to them anyway; you can't reference them on your published pages like your user-defined listings fields. But okay, okay, I'm getting to the neat bit: the search.cgi script, when receiving a sort_order query string, can be fooled into searching by internal fields. Here's how it works: inside your listings.dat.cgi file, there are (I think) 13 internal fields, used by the program to store, well, stuff. Following that, are all the user defined fields which you can see when you click "Setup Listings Fields" in your Setup Options. So, when you do a search query with something like search.cgi?search=1&sort_order=1,abc,forward it's actually sorting by the 14th field, not the 1st as you'd think. Okay, now I'm finally getting to the good bit ;-) To search by the internal fields, you can pass in a negative value into the sort_order query string, specifically -10. This will pinpoint the internal date created field. Since it's in Unix date format, it'll be a really big number, and most importantly consistent. So the search script will order them correctly. That was probably a little more detail than you needed, but there you go. Enjoy :-) Ben interactivetools.com
(This post was edited by Benjamin on Mar 26, 2003, 8:21 PM)
|
|
|  |
 | |  |
|