Ads Module show ads from selected metro

I have added a new dropdown field at the top of main ads home. 

I have already created a new select field in post ads page, so when members adds new ad then metro name will also be added in database table. 

Now , I want to filter ads in ads home page according to metro city they select.

e.g. Logic should be , SQL statement SELECT * FROM bx_ads_main where Metro='$value'

$value= $_POST['metro'];   /* where value will be posted from select input field as shown in screenshot.

 

So, What changes should i do in bxAdsModule.php to achieve this.

 

Thankyou

ads main.png · 21K · 159 views
Quote · 12 Oct 2013

on the page you took a screen shot of - you dont have to do much other than creating the field in a form and using the post method upon clicking select - like so:

<form action="metro_search_page.php" method="post">
  <label for="select">Metro City:</label>
  <select name="select" id="select">
    <option value="City A">City A</option>
    <option value="City B">City B</option>
  </select>
  <input type="button" name="button" id="button" value="Select">
</form>

 

Your select field will be different as you have already got that set up - this is just a brief example. From here, you would create a page that would actual display just the results that you want. In my example i called it metro_search_page.php That page is tricky if you are wanting to keep the same formatting as the original Ads Home page. You would need to really look  at the coding and see how everything is done, and then edit it to fit your needs. There may be a javascript function already in Dolphin that can send you back to the same page with the desired results, but again, you really got dive into the code and figure out whats going on.

caredesign.net
Quote · 12 Oct 2013

click on one of the sub categories - such as Auto Parts - on this page it has a filter for country - you may be able to edit this and use your Metro field instead. I know it is not on the Ads home page, but may be a lot easier.

caredesign.net
Quote · 12 Oct 2013

Then I think it would be better to fetch data from mysql query and show it in own designed new php file.

Can you tell me the code for header and footer so that i could create new 

-header.php

-footer.php

 

and can include in my new php file using

-inlcude('header.php'); or include('footer.php');

Quote · 12 Oct 2013

check out inc/classes/BxDolPageView.php - it has an explanation of how to create a php page so that you can use it in the page builders. Even if you dnt want to use it in the page builders, it is still a great starting point.

caredesign.net
Quote · 12 Oct 2013

OKay! Thank you :)

Quote · 12 Oct 2013
 
 
Below is the legacy version of the Boonex site, maintained for Dolphin.Pro 7.x support.
The new Dolphin solution is powered by UNA Community Management System.