Main
Index
Search
Posts
Who's
Online
Log
In

Home: Discontinued/Classic Products: Instant Website: Realty/Listings/Auto:
search form with OR statements

 

 


dwn11
User

Jul 27, 2009, 2:09 AM

Post #1 of 7 (3367 views)
Shortcut
search form with OR statements Can't Post

Hello

I have a few questions regarding the new Instant Realty Website.

1. I would like to give the chance to my customers to select more than one property type.

For example, two drop down menus and select flat in one of them and maisonette in the other one.

2. Is it possible to add formatting tools to the summary and description fields?



Thanks

Andy


dwn11
User

Jul 27, 2009, 2:31 AM

Post #2 of 7 (3363 views)
Shortcut
Re: [dwn11] search form with OR statements [In reply to] Can't Post

further to my questions above, i wouldl ike to know how to have: Search Results. The number of listings found are 23 of 456


Dave
Staff / Moderator


Jul 27, 2009, 12:53 PM

Post #3 of 7 (3338 views)
Shortcut
Re: [dwn11] search form with OR statements [In reply to] Can't Post

Hi there,

1) You can create custom search engines, the docs for that are here:
http://www.interactivetools.com/docs/cmsbuilder/viewer_search.html

2) In what way do you want to format the data?

3) You can display total records found like this: <?php echo $listingDetails['totalRecords'] ?> but I don't think we have a way to display the total number of records. You'd have to add another getRecords() code block that just got the count. If you want the code for that attach your viewer page to this thread and I'll take a look.

Hope that helps!

Dave Edis - Senior Developer
interactivetools.com
 


dwn11
User

Jul 27, 2009, 1:36 PM

Post #4 of 7 (3333 views)
Shortcut
Re: [Dave] search form with OR statements [In reply to] Can't Post

Hi and thanks for the reply.

1) I am not very comfortable with sql etc. I have a hidden field <input name="property_type" type="hidden" id="property_type" value="plot"> . I would like to say something .. value = plot OR land

2) I would like to format the font color, type etc of the summary and description. I mean Bold Underline font color etc.Like this text box here!:) I do not know if these should appear anyway, but they do not!

3. Viewer page is attached. I have managed to get the nunber of the search results but not the total number of properties in the database.
Attachments: listings.php (12.0 KB)


texascoffee
User

Jul 27, 2009, 1:41 PM

Post #5 of 7 (3333 views)
Shortcut
Re: [Dave] search form with OR statements [In reply to] Can't Post

I believe that you can use this idea:

<select name="home,condo,land, etc"> with checkboxes to search multiple database fields. You just need to make sure to configure the form to allow multiple boxes checked.


dwn11
User

Jul 27, 2009, 10:39 PM

Post #6 of 7 (3301 views)
Shortcut
Re: [dwn11] search form with OR statements [In reply to] Can't Post

Dave?


Dave
Staff / Moderator


Jul 28, 2009, 10:26 AM

Post #7 of 7 (3251 views)
Shortcut
Re: [dwn11] search form with OR statements [In reply to] Can't Post

Hi dwn11,

>I would like to format the font color, type etc of the summary and
>description. I mean Bold Underline font color etc.Like this text box
>here!:) I do not know if these should appear anyway, but they do not!

There are two ways to do this. You can either change the summary and description to by wysiwyg fields in the field editor, which will allow the CMS users to edit the colors, etc. -OR- you can hard code those values in the HTML of the page displaying the content, and in that case you can only apply changes the all the content. Eg: making the summary all one color, etc.

>I have managed to get the nunber of the search results but not the
>total number of properties in the database.

Try adding this code in red:


Code
 
// get total records count
list($listingRecords, $listingDetails) = getRecords(array(
'tableName' => 'listings',
'allowSearch' => false,
'limit' => '0',
));
$totalRecords = $listingDetails['totalRecords'];

//
list($listingRecords, $listingDetails) = getRecords(array(
'tableName' => 'listings',
'joinTable' => 'homepages',
'perPage' => '10',
));


This will make available a variable $totalRecords with the total count of listings (that aren't hidden). You can display it like this:

There are <?php echo $totalRecords ?> in the database.

hope that helps!

Dave Edis - Senior Developer
interactivetools.com