
Benjamin
Staff

Dec 12, 2002, 4:47 PM
Post #5 of 15
(17639 views)
Shortcut
|
Hi, Roger - All done! Let me give you a run-over of what I've done, what are its limitations, and how you can implement it on your own site. I've attached a couple of files for you to look at and use; I'll explain what they are and how they work in a bit. I've arranged the following under headings for clarity (and to help me organize my thoughts!) What it does: ------------- In broad terms, I've written a little script that allows you to have a separate 'Open House' page on your website. This page retrieves all listings that have open houses from the current day onwards, and displays them chronologically. (Note: if you're interested in only having, say, the next months open houses listed - post me back and I'll explain how to do it). Limitations / Concerns: ---------------------- - First off, since it's written in javascript, a few things need to be taken into consideration. - First, it relies on the site visitor having a javascript-enabled browser. The vast majority of browsers out there are javascript-enabled, but you never want to create pages that are inaccessible to people no matter how small a group they may be. So, in the code, I've left a space where you can show something else for the minority who aren't running javascript.
- Second, it assumes that the timeclock on the person's computer is accurate. If, say, it's a week behind, it'll retrieve those open houses that have already come and gone.
But all considered, these concerns aren't that big a deal - I just felt obliged to mention them. - In your specs, Roger, you suggested it would be nice for the results page to group the open houses by day, so that each day would have a heading with the date. This isn't possible, unfortunately. In the attached _open_house.html template file, I've rigged it so that every result has a banner with the date. But you can't have banners for the date groups of Open Houses. (Actually, there is an SSI solution - but it's inefficient and tricky to implement, so I won't go into it here.) - In order to have your Open House page uniquely customized, you'll need the latest version of Realty Manager. This enables you to specify a template to retrieve results with. If you're not running the latest version, it will still function perfectly - but the look and feel of the page will be the same as any search results page. So if you want a distinct page with "OPEN HOUSE" in bold, red, flashing letters across the top, I'd recommend upgrading. How to implement it: -------------------- (1) First, you'll need to add two fields to your Listings Database. (Technically, you can get by with only doing ONE, but there are a couple of good reasons to do two. I'll spare you the explanation here). Call these fields something like: "1. Open House - yyyymmdd" and "2. Open House - mm/dd/yy". Make sure they're both set to "textfield" and both enabled. As you can probably surmise, the first field is used to store the date of the open house in yyyymmdd format, and the second stores it in the standard mm/dd/yy format. For Each listing you create that you want to have an open house day, you'll have to fill in the date for both fields, in separate formats. (2) Second, you'll want to put a "View Upcoming Open Houses!" link somewhere on your site. The attached file, demo_code.html contains the javascript code you'll need to use. Just copy everything between <script> and </noscript> into your document. You'll need to replace /enter/the/link/to/exec/directory/here/ to fit your directory setup. This has to point to your search.cgi script. Also, as noted previously, you may want to put some HTML between the <noscript> tags for those poor websurfers who don't have a javascript-enabled browser... A few other things: - you'll need to replace the number 30 in "lfield30_min" to refer to the listing field number which contains your yyyymmdd-formatted Open House date, and also the number 30 in "sort_order=30,123,forward". Likewise. - If you're running an older version of Realty Manager - (see if "upgrade available" is written in red at the bottom of your Setup Options page to be sure) - you may also want to remove the line + "&template=_open_house.html" which specifies a particular template file to draw the results. This functionality is only available the latest version. (3) Lastly, upload the _open_house.html file into your /templates/ directory. And hey presto! I hope the above is relatively clear, but if you need clarification on anything just post! Ben interactivetools.com
(This post was edited by Benjamin on Dec 13, 2002, 10:12 AM)
|