Home | Products | Consulting | Forums | Support | Order | 1-800-752-0455
  Main
Index
Search
Posts
Who's
Online
Log
In

Home: Products: Listings Manager (Realty Manager & Auto Manager):
Only show current listings (hide old ones)

 

 


Alastair
User

Mar 31, 2006, 6:39 AM

Post #1 of 2 (2483 views)
Shortcut
Only show current listings (hide old ones) Can't Post

Is there a neat way of hiding old listings ?

I'm using LM for a simple entertainments listing (www.dorchesterarts.org.uk). The view is sorted by date so you see the oldest first, but obviously there's no point in lisitng events which have already taken place. Currently we go in and hide or delete them, but it would be much more useful if it only showed current and future events, automatically hiding them when their date has passed. Any thoughts ?

Alastair Smile


Donna
Staff / Moderator


Mar 31, 2006, 1:30 PM

Post #2 of 2 (2470 views)
Shortcut
Re: [Alastair] Only show current listings (hide old ones) [In reply to] Can't Post

Hey Alastair,

Thanks for your post. :)

I came up with an interesting way to force a search results link to only show listings from today forward. It involves using an SSI to output a date format, which would be saved in a specific format in your listing.

The first thing you need to do is make sure that "echo" commands in Server Side Include pages work. For this, make a test page on your server (remember to give it a .shtml extension) with the following in it:


Code
<!--#config timefmt="%Y%m%d" --> 
<!--#echo var="date_local" -->


This should output the date in a format that looks like this: 20060331

Once you've confirmed that this works, enter a new field into Listing Manager for the date. I wouldn't recommend using the existing date field, because this one needs to be formatted exactly in YYYYMMDD format in order to sort correctly. In my example, I'll assume this is in lfield1.

Once you've got the date entered in that format, create a link to it like this:


Code
<!--#config timefmt="%Y%m%d" --> 
<a href="/path/to/exec/search.cgi?search=1&lfield1_min=<!--#echo var="date_local" -->&lfield1_max=20200101>search link</a>


The "config" part can go anywhere, but the "echo" variable must stay where it is. What this does is creates a custom link to the search results that will update based on the date. The max, I set to a date well into the future. (If your site still exists in 2020... you may want to update this.) ;)

Alternately, on a standard search form page, you could enter the following:


Code
<input type="hidden" name="lfield1_min" value="<!--#echo var="date_local" -->"> 
<input type="hidden" name="lfield1_max" value="20200101">


This way, once you hit "Submit", it will pass these hidden values through, but fill in the date into the "minimum" part of the range.

Let me know if this works for you, or if you have any problems with it!

Donna


Hire me!
Save time by getting our experts to help with your project. Template changes, advanced features, full integration, whatever you need. Whether you need one hour or fifty, get it done fast with Priority Consulting.


(This post was edited by Donna on Apr 11, 2006, 5:25 PM)

 
 
 


Search for (options)
Products
CMS Builder
Article Manager
Realty Manager
Listings Manager
Order Now
Services
Priority Consulting
Support
Online Documentation
Support Forums
Support Homepage
Company Info
12 reasons to choose us!
Meet the team
Monthly newsletter
Contact Us
Toll Free: 1-800-752-0455
Phone: (604) 689-3347
Sales | Support
Conditions of Use | Privacy Policy | Copyright © interactivetools.com 2008
#201 - 2730 Commercial Drive, Vancouver BC Canada V5N 5P4