The ZipCodeSearch plugin allows visitors to find links within a certain radius of their Zip Code or Postal Code. Functions as a Dealer Locator or a Dating Site search form that finds service centers or other members within a certain distance.
Includes 43k+ US Zip Codes.
Supports international postal codes.
Searches the entire directory or specific categories.
Logs search queries to the standard search logs.
Options for units of measure (Miles, Kilometers, Nautical).
Customizable search form automatically searches additional input fields.
Optional Country drop down menu for use on Add Link and Modify Link pages.
The ZipCodeSearch Form
Form Template = zipcode_search.html
Form Action = <%config.db_cgi_url%>/zipcode_search.cgi
Results Template = zipcode_search_results.html
Add the code below to include_header.html to create a link to the ZCS Form.
CODE: SELECT ALL
<a href="<%config.db_cgi_url%>/zipcode_search.cgi">ZipCode Search</a>
Clicking the link generated by the code above will display the following page. You can turn off the Category dropdown menu in ZipCodeSearch Setup.
Image
The form action would be called as:
CODE: SELECT ALL
zipcode_search.cgi?t=luna&d=1&catid=0&query=53140&dist=50&mh=25
You can create similar links to directly display search results, bypassing the form. See the "Links Near" screen grab below.
Search Results
The search results are ordered by distance and optionally limited by category. The City, State, Country, Zip Code and Distance are all generated by the ZipCodeSearch plugin.
Image
Links Near
You can add a "Find Links Near" form to your detailed pages using the following code:
Add this code to the top of detailed.html:
CODE: SELECT ALL
<%Plugins::ZipCodeSearch::GetLocationTags($ID)%>
<%Links::Plugins::get_plugin_user_cfg('ZipCodeSearch')%>
Then add this code to detailed.html where you want the form to appear:
CODE: SELECT ALL
<div class="searchbar">
<form action="<%config.db_cgi_url%>/zipcode_search.cgi">
<input type="hidden" name="d" value="1" />
<input type="hidden" id="query" name="query" value="<%ZCS_ZipCode%>"/>
<strong>Find other places</strong> within
<select id="dist" name="dist">
<option selected="selected">5</option>
<option>10</option>
<option>15</option>
<option>20</option>
<option>25</option>
</select> <%units%>s
<input type="submit" value="Search" class="submit" />
</form>
</div>
Image
Additional Info
For more advanced features see our GoogleMaps Plugin which adds a visual interface to the ZipCodeSearch plugin.