Page 1 of 2 12 LastLast
Results 1 to 10 of 11

Thread: Featured Listings First (at the top)

  1. #1
    Join Date
    May 2004
    Posts
    840

    Default Featured Listings First (at the top)

    This is a 2 part request.

    1. How do I get my featured listings to display horizontally (in the same layout as listing_browse)?
    See sample: http://www.joyceyoungrealty.com/


    2. Whenever I do a search or click "browse all" I want the featured listings to appear at the top of the search results and then the generic. Like google does and like buyowner does. The featured listings will have a slightly different color background and maybe a "Featured listing" header to differentiate them from the generic.

    Thanks.
    RealEstate

  2. #2
    Join Date
    May 2004
    Location
    Long Island, NY
    Age
    49
    Posts
    9,796

    Default

    1. You would need to rewrite the renderfeaturedlistingshorizontal function to match the layout of the listing browse page.

    2. Then put renderfeaturedlistingshorizontal(X) (where X = the number of listings you want to show) in the top of the listing browse output. Not at the top of the file, at the top of the section where the html output starts.

  3. #3
    Join Date
    May 2004
    Posts
    840

    Default

    Hey Pb,
    Thanks for the quick reply. You make it sound simple and I'm sure to many programmers it is. I'll give it a go though and see how it goes


    "2. Then put renderfeaturedlistingshorizontal(X) (where X = the number of listings you want to show) in the top of the listing browse output. Not at the top of the file, at the top of the section where the html output starts."

    For #2 it wouldn't really work to accurately. If they do a search for La, California - I want the featured listings for LA to come up first. NOT the featured listings from other states. Only for LA.

    Only the featured listings for that match the search querry should come up.
    See buyowner here http://buyowner.com/propsearch.asp?c...=city&state=IL pick a city and submit.

    You'll notice they have platinum listings at the top, then executive, and then the generic listings.

    Notice also, how they differentiate the platinum and exectuive listings by giving them a "different" border around them.
    RealEstate

  4. #4
    Join Date
    May 2004
    Location
    Long Island, NY
    Age
    49
    Posts
    9,796

    Default

    I see what you want to do. This may be a little easier. You can do it with 2 listing_browse functions in 1 file. First copy the listing browse code and paste it above the existing code. Find this line or similar depending on the listing browse you are using

    $sql .= "(" . $config[table_prefix] . "listingsDB.active = 'yes')";

    and change it to

    $sql .= "(" . $config[table_prefix] . "listingsDB.active = 'yes') AND (" . $config[table_prefix] . "listingsDB.featured = 'yes')";

    Now the top section will look just like the regular section but it will just be for featured listings.

  5. #5
    Join Date
    Oct 2004
    Posts
    73

    Default

    Hi,
    I need to have something like this...i have the featured listing on the left, and now i want a second featured listing on the right, showing just one house...and in admin i will need too a away to select the house for that section... any idea how to do it?
    Thanks in advance!

  6. #6
    Join Date
    May 2004
    Posts
    840

  7. #7
    Join Date
    May 2004
    Posts
    840

    Default

    PB,

    Trying your recommendation my brain turned on and figured that all I had to do was to set the initial sort to sort FEATURED LISTINGS first.

    Then, the visitor can if they wish, sort by price, beds, etc.

    So...how to I add Sort by: "Featured"
    and make it so that Featured is the default sort.
    This is for the listing_browse.php
    RealEstate

  8. #8
    Join Date
    May 2004
    Location
    Long Island, NY
    Age
    49
    Posts
    9,796

    Default

    first you would need to change the query that creates the temp table to pull in the featured value from the listings DB. Then you should be able to change the default sort by to featured.

    First change the following line (around line 42)

    $sql = "CREATE TABLE " . $config[table_prefix] . 'temp_' . $SESSION_ID . " SELECT " . $config[table_prefix] . "listingsDB.ID, " . $config[table_prefix] . "listingsDB.Title, " . $config[table_prefix] . "listingsDB.user_ID, " . $config[table_prefix] . "listingsDBElements.field_name, " . $config[table_prefix] . "listingsDBElements.field_value FROM " . $config[table_prefix] . "listingsDB, " . $config[table_prefix] . "listingsDBElements WHERE (" . $config[table_prefix] . "listingsDBElements.listing_id = " . $config[table_prefix] . "listingsDB.ID) AND ";

    to

    $sql = "CREATE TABLE " . $config[table_prefix] . 'temp_' . $SESSION_ID . " SELECT " . $config[table_prefix] . "listingsDB.ID, ". $config[table_prefix] . "listingsDB.featured, ". $config[table_prefix] . "listingsDB.Title, " . $config[table_prefix] . "listingsDB.user_ID, " . $config[table_prefix] . "listingsDBElements.field_name, " . $config[table_prefix] . "listingsDBElements.field_value FROM " . $config[table_prefix] . "listingsDB, " . $config[table_prefix] . "listingsDBElements WHERE (" . $config[table_prefix] . "listingsDBElements.listing_id = " . $config[table_prefix] . "listingsDB.ID) AND ";

    Then change this line (around line 384)

    $order_text = "ORDER BY ID DESC";

    to

    $order_text = "ORDER BY featured DESC";

    The line numbers are from the standard listing browse. May be different if you're using a modified version.

  9. #9
    Join Date
    Oct 2004
    Posts
    73

    Default

    pbflash, thanks a lor for the links, but i want something differente, because i need to select a house on admin for that "second featured listing" how can i do something like this?
    Thanks a lor one more time!

  10. #10
    Join Date
    May 2004
    Location
    Long Island, NY
    Age
    49
    Posts
    9,796

    Default

    In order to do what you want you will need to add a new field to the listingsdb in order to mark which listing you want to be the second featured listing. Then you need to either add the new field into the edit listings code so it can be changed from there or create a special form to update the listing you want as the featured listing. Then you need a special function to pull the info for the second featured listing and display it. You are not going to find it in the forums as there is nothing like this posted here.

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •