Search widget code

This topic contains 15 replies, has 3 voices, and was last updated by  Paolo 9 years, 6 months ago.

We have moved to a support ticketing system and our forums are now closed.

Open Support Ticket
  • Author
    Posts
  • #19099

    mykidsdayout
    Free User
    Post count: 36

    Hi guys,

    Can somebody tell me where the search widget code sits? I am currently customising my search bar with a static version and need to grab some of the functionality from the actual widget before it is rendered?

    Many thanks,
    Wes

    #19111

    Stiofan O’Connor
    Site Admin
    Post count: 22956

    it is located in geodirectory_widgets.php starting around line 691

    Stiofan

    #19115

    mykidsdayout
    Free User
    Post count: 36

    Thanks Stiofan, I can’t see the woods for the trees, I am looking for the dynamic code that I need to add to the code for the user’s input values in “XXXX” below when moving from search to search …

    e.g. <input class=”search_text” name=”s” value=”XXXX” type=”text” onblur=”if (this.value == ”) {this.value = ‘Solicitor Name’;}” onfocus=”if (this.value == ‘Solicitor Name’) {this.value = ”;}” onkeydown=”javascript: if(event.keyCode == 13) geodir_click_search(this);”>

    <input name=”snear” class=”snear” type=”text” value=”XXXX” onblur=”if (this.value == ”) {this.value = ‘Town / Postcode’;}” onfocus=”if (this.value == ‘Town / Postcode’) {this.value = ”;}” onkeydown=”javascript: if(event.keyCode == 13) geodir_click_search(this);” />

    Cheers,
    Wes

    #19117

    Stiofan O’Connor
    Site Admin
    Post count: 22956

    If you explain what you are trying to achieve it might help?

    Stiofan

    #19119

    mykidsdayout
    Free User
    Post count: 36

    Sorry Stiofan,

    I have a search page that has the GD Search Widget, and a hard-coded version that I am trying to build directly below it (see http://bit.ly/1ou9wLt) and use in it’s place so that I can get rid of the advanced search and implement the category drop down alongside keyword and location.

    I have managed to do this, apart from that when I run a search with values, it fails to retain what I had entered previously – I need the code that keeps the values?

    Cheers,
    Wes

    #19197

    Stiofan O’Connor
    Site Admin
    Post count: 22956

    it should just grab them from the url, please paste your code here and i will look.

    Stiofan

    #19202

    mykidsdayout
    Free User
    Post count: 36

    Hi,

    This is the code I am using for my custom search (you will notice I have default values in the input tags that need replacing with the dynamic code? – Cheers…
    ———————————————————–
    <section id=”geodir_advance_search-3″ class=”widget geodir-widget geodir_advance_search_widget”>

    <form class=”geodir-listing-search” name=”geodir-listing-search” action=”http://www.legaladvicegroup.co.uk” method=”get” >
    <input type=”hidden” name=”geodir_search” value=”1″ />

    <div class=”geodir-loc-bar”>

    <div class=”clearfix geodir-loc-bar-in”>

    <div class=”geodir-search”>
    <input type=”hidden” name=”stype” value=”gd_place” />
    <input class=”search_text” name=”s” value=”Solicitor Name” type=”text” onblur=”if (this.value == ”) {this.value = ‘Solicitor Name’;}” onfocus=”if (this.value == ‘Solicitor Name’) {this.value = ”;}” onkeydown=”javascript: if(event.keyCode == 13) geodir_click_search(this);”>

    <input name=”snear” class=”snear” type=”text” value=”Town / Postcode” onblur=”if (this.value == ”) {this.value = ‘Town / Postcode’;}” onfocus=”if (this.value == ‘Town / Postcode’) {this.value = ”;}” onkeydown=”javascript: if(event.keyCode == 13) geodir_click_search(this);” />

    <select name=”sgd_placecategory[]” class=”cat_select”>
    <option value=”” >Areas of Law</option>
    <option value=”93″ >Children</option>
    <option value=”96″ >Commercial Property</option>
    <option value=”100″ >Conveyancing Residential</option>
    <option value=”111″ >Employment</option>
    <option value=”97″ >Company Commercial</option>
    <option value=”87″ >Advocacy</option>
    <option value=”140″ >Professional Negligence</option>
    <option value=”128″ >Litigation General</option>
    <option value=”102″ >Crime Fraud</option>
    <option value=”98″ >Construction</option>
    <option value=”139″ >Private Client Wills and Probate</option>
    <option value=”136″ >Personal Injury</option>
    <option value=”122″ >Insolvency and Restructuring Business</option>
    <option value=”99″ >Consumer</option>
    <option value=”95″ >Commercial Litigation</option>
    <option value=”106″ >Debt Recovery</option>
    <option value=”88″ >Agriculture</option>
    <option value=”89″ >Aviation</option>
    <option value=”110″ >Education</option>
    <option value=”138″ >Private Client Trusts</option>
    <option value=”134″ >Neighbour Disputes</option>
    <option value=”130″ >Media Entertainment and Sport</option>
    <option value=”126″ >Landlord and Tenant Residential</option>
    <option value=”124″ >Intellectual Property</option>
    <option value=”123″ >Insurance</option>
    <option value=”113″ >Environment</option>
    <option value=”112″ >Energy and Natural Resources</option>
    <option value=”105″ >Debt and Bankruptcy Personal</option>
    <option value=”94″ >Clinical Negligence</option>
    <option value=”90″ >Banking</option>
    <option value=”92″ >Charities</option>
    <option value=”143″ >Tax</option>
    <option value=”127″ >Licensing Gaming and Betting</option>
    <option value=”119″ >Immigration General</option>
    <option value=”107″ >Defamation</option>
    <option value=”144″ >Travel and Tourism</option>
    <option value=”137″ >Planning</option>
    <option value=”132″ >Mergers and Acquisitions</option>
    <option value=”129″ >Maritime and Shipping</option>
    <option value=”125″ >International</option>
    <option value=”117″ >Financial Services</option>
    <option value=”115″ >Family</option>
    <option value=”114″ >European Community Law</option>
    </select>

    <input style=”float:right” type=”button” value=”Find Solicitor” class=”geodir_submit_search”>

    </div>

    </div>

    </div>
    <input name=”sgeo_lat” class=”sgeo_lat” type=”hidden” value=”” />
    <input name=”sgeo_lon” class=”sgeo_lon” type=”hidden” value=”” />
    </form>
    </section>

    #19203

    mykidsdayout
    Free User
    Post count: 36

    Hi,

    Here is the code I am using for my custom search (you will notice I have default values in the input tags that need replacing with the dynamic code that grabs the text from the URL: Cheers for your help!

    ———————–

    <section id=”geodir_advance_search-3″ class=”widget geodir-widget geodir_advance_search_widget”>

    <form class=”geodir-listing-search” name=”geodir-listing-search” action=”http://www.legaladvicegroup.co.uk” method=”get” >
    <input type=”hidden” name=”geodir_search” value=”1″ />

    <div class=”geodir-loc-bar”>
    <div class=”clearfix geodir-loc-bar-in”>

    <div class=”geodir-search”>

    <input type=”hidden” name=”stype” value=”gd_place” />
    <input class=”search_text” name=”s” value=”Solicitor Name” type=”text” onblur=”if (this.value == ”) {this.value = ‘Solicitor Name’;}” onfocus=”if (this.value == ‘Solicitor Name’) {this.value = ”;}” onkeydown=”javascript: if(event.keyCode == 13) geodir_click_search(this);”>

    <input name=”snear” class=”snear” type=”text” value=”Town / Postcode” onblur=”if (this.value == ”) {this.value = ‘Town / Postcode’;}” onfocus=”if (this.value == ‘Town / Postcode’) {this.value = ”;}” onkeydown=”javascript: if(event.keyCode == 13) geodir_click_search(this);” />

    <select name=”sgd_placecategory[]” class=”cat_select”>
    <option value=”” >Areas of Law</option>
    <option value=”93″ >Children</option>
    <option value=”96″ >Commercial Property</option>
    <option value=”100″ >Conveyancing Residential</option>
    <option value=”111″ >Employment</option>
    <option value=”97″ >Company Commercial</option>
    <option value=”87″ >Advocacy</option>
    <option value=”140″ >Professional Negligence</option>
    <option value=”128″ >Litigation General</option>
    <option value=”102″ >Crime Fraud</option>
    <option value=”98″ >Construction</option>
    <option value=”139″ >Private Client Wills and Probate</option>
    <option value=”136″ >Personal Injury</option>
    <option value=”122″ >Insolvency and Restructuring Business</option>
    <option value=”99″ >Consumer</option>
    <option value=”95″ >Commercial Litigation</option>
    <option value=”106″ >Debt Recovery</option>
    <option value=”88″ >Agriculture</option>
    <option value=”89″ >Aviation</option>
    <option value=”110″ >Education</option>
    <option value=”138″ >Private Client Trusts</option>
    <option value=”134″ >Neighbour Disputes</option>
    <option value=”130″ >Media Entertainment and Sport</option>
    <option value=”126″ >Landlord and Tenant Residential</option>
    <option value=”124″ >Intellectual Property</option>
    <option value=”123″ >Insurance</option>
    <option value=”113″ >Environment</option>
    <option value=”112″ >Energy and Natural Resources</option>
    <option value=”105″ >Debt and Bankruptcy Personal</option>
    <option value=”94″ >Clinical Negligence</option>
    <option value=”90″ >Banking</option>
    <option value=”92″ >Charities</option>
    <option value=”143″ >Tax</option>
    <option value=”127″ >Licensing Gaming and Betting</option>
    <option value=”119″ >Immigration General</option>
    <option value=”107″ >Defamation</option>
    <option value=”144″ >Travel and Tourism</option>
    <option value=”137″ >Planning</option>
    <option value=”132″ >Mergers and Acquisitions</option>
    <option value=”129″ >Maritime and Shipping</option>
    <option value=”125″ >International</option>
    <option value=”117″ >Financial Services</option>
    <option value=”115″ >Family</option>
    <option value=”114″ >European Community Law</option>
    </select>

    <input style=”float:right” type=”button” value=”Find Solicitor” class=”geodir_submit_search”>

    </div>

    </div>

    </div>
    <input name=”sgeo_lat” class=”sgeo_lat” type=”hidden” value=”” />
    <input name=”sgeo_lon” class=”sgeo_lon” type=”hidden” value=”” />
    </form>
    </section>

    #19204

    mykidsdayout
    Free User
    Post count: 36

    Hi,

    Here is the code I am using for my custom search (you will notice I have default values in the input tags that need replacing with the dynamic code that grabs the text from the URL: Cheers for your help!

    ———————–

    <section id=”geodir_advance_search-3″ class=”widget geodir-widget geodir_advance_search_widget”>

    <form class=”geodir-listing-search” name=”geodir-listing-search” action=”http://www.legaladvicegroup.co.uk” method=”get” >
    <input type=”hidden” name=”geodir_search” value=”1″ />
    <div class=”geodir-loc-bar”>
    <div class=”clearfix geodir-loc-bar-in”>

    <div class=”geodir-search”>

    <input type=”hidden” name=”stype” value=”gd_place” />
    <input class=”search_text” name=”s” value=”Solicitor Name” type=”text” onblur=”if (this.value == ”) {this.value = ‘Solicitor Name’;}” onfocus=”if (this.value == ‘Solicitor Name’) {this.value = ”;}” onkeydown=”javascript: if(event.keyCode == 13) geodir_click_search(this);”>

    <input name=”snear” class=”snear” type=”text” value=”Town / Postcode” onblur=”if (this.value == ”) {this.value = ‘Town / Postcode’;}” onfocus=”if (this.value == ‘Town / Postcode’) {this.value = ”;}” onkeydown=”javascript: if(event.keyCode == 13) geodir_click_search(this);” />

    <select name=”sgd_placecategory[]” class=”cat_select”>
    <option value=”” >Areas of Law</option>
    <option value=”93″ >Children</option>
    <option value=”96″ >Commercial Property</option>
    <option value=”100″ >Conveyancing Residential</option>
    <option value=”111″ >Employment</option>
    <option value=”97″ >Company Commercial</option>
    <option value=”87″ >Advocacy</option>
    <option value=”140″ >Professional Negligence</option>
    <option value=”128″ >Litigation General</option>
    <option value=”102″ >Crime Fraud</option>
    <option value=”98″ >Construction</option>
    <option value=”139″ >Private Client Wills and Probate</option>
    <option value=”136″ >Personal Injury</option>
    <option value=”122″ >Insolvency and Restructuring Business</option>
    <option value=”99″ >Consumer</option>
    <option value=”95″ >Commercial Litigation</option>
    <option value=”106″ >Debt Recovery</option>
    <option value=”88″ >Agriculture</option>
    <option value=”89″ >Aviation</option>
    <option value=”110″ >Education</option>
    <option value=”138″ >Private Client Trusts</option>
    <option value=”134″ >Neighbour Disputes</option>
    <option value=”130″ >Media Entertainment and Sport</option>
    <option value=”126″ >Landlord and Tenant Residential</option>
    <option value=”124″ >Intellectual Property</option>
    <option value=”123″ >Insurance</option>
    <option value=”113″ >Environment</option>
    <option value=”112″ >Energy and Natural Resources</option>
    <option value=”105″ >Debt and Bankruptcy Personal</option>
    <option value=”94″ >Clinical Negligence</option>
    <option value=”90″ >Banking</option>
    <option value=”92″ >Charities</option>
    <option value=”143″ >Tax</option>
    <option value=”127″ >Licensing Gaming and Betting</option>
    <option value=”119″ >Immigration General</option>
    <option value=”107″ >Defamation</option>
    <option value=”144″ >Travel and Tourism</option>
    <option value=”137″ >Planning</option>
    <option value=”132″ >Mergers and Acquisitions</option>
    <option value=”129″ >Maritime and Shipping</option>
    <option value=”125″ >International</option>
    <option value=”117″ >Financial Services</option>
    <option value=”115″ >Family</option>
    <option value=”114″ >European Community Law</option>
    </select>

    <input style=”float:right” type=”button” value=”Find Solicitor” class=”geodir_submit_search”>

    </div>
    </div>

    </div>
    <input name=”sgeo_lat” class=”sgeo_lat” type=”hidden” value=”” />
    <input name=”sgeo_lon” class=”sgeo_lon” type=”hidden” value=”” />
    </form>
    </section>

    #19206

    mykidsdayout
    Free User
    Post count: 36

    Hi,

    Here is the code I am using for my custom search (you will notice I have default values in the input tags that need replacing with the dynamic code that grabs the text from the URL: Cheers for your help!

    ———————–

    <section id=”geodir_advance_search-3″ class=”widget geodir-widget geodir_advance_search_widget”>

    <form class=”geodir-listing-search” name=”geodir-listing-search” action=”http://www.legaladvicegroup.co.uk” method=”get” >
    <input type=”hidden” name=”geodir_search” value=”1″ />
    <div class=”geodir-loc-bar”>
    <div class=”clearfix geodir-loc-bar-in”>

    <div class=”geodir-search”>

    <input type=”hidden” name=”stype” value=”gd_place” />
    <input class=”search_text” name=”s” value=”Solicitor Name” type=”text” onblur=”if (this.value == ”) {this.value = ‘Solicitor Name’;}” onfocus=”if (this.value == ‘Solicitor Name’) {this.value = ”;}” onkeydown=”javascript: if(event.keyCode == 13) geodir_click_search(this);”>

    <input name=”snear” class=”snear” type=”text” value=”Town / Postcode” onblur=”if (this.value == ”) {this.value = ‘Town / Postcode’;}” onfocus=”if (this.value == ‘Town / Postcode’) {this.value = ”;}” onkeydown=”javascript: if(event.keyCode == 13) geodir_click_search(this);” />

    <select name=”sgd_placecategory[]” class=”cat_select”>
    <option value=”” >Areas of Law</option>
    <option value=”93″ >Children</option>
    <option value=”96″ >Commercial Property</option>
    <option value=”100″ >Conveyancing Residential</option>
    <option value=”111″ >Employment</option>
    <option value=”97″ >Company Commercial</option>
    <option value=”87″ >Advocacy</option>
    <option value=”140″ >Professional Negligence</option>
    </select>

    <input style=”float:right” type=”button” value=”Find Solicitor” class=”geodir_submit_search”>

    </div>
    </div>

    </div>
    <input name=”sgeo_lat” class=”sgeo_lat” type=”hidden” value=”” />
    <input name=”sgeo_lon” class=”sgeo_lon” type=”hidden” value=”” />
    </form>
    </section>

    #19212

    Stiofan O’Connor
    Site Admin
    Post count: 22956

    Looks like you have no PHP to actually set them, please look at the original widget code to help you see how to set these.

    Stiofan

    #19213

    mykidsdayout
    Free User
    Post count: 36

    Unfortunately I couldn’t find the piece of code in the widget, if you could supply that would be great!

    Thanks,
    Wes

    #19218

    Stiofan O’Connor
    Site Admin
    Post count: 22956

    look in geodirectory-templateslisting-filter-form.php

    Stiofan

    #19264

    mykidsdayout
    Free User
    Post count: 36

    Hi, thanks for the direction – I was hoping I could just grab the php code for the values and it would work, sadly it’s just spitting this out as text in the input field…any ideas?

    Cheers

    #19268

    mykidsdayout
    Free User
    Post count: 36

    Actually, now that I have the whereabouts of the widget php code, I am able to alter this instead of trying to use a static version – all sorted 😉

Viewing 15 posts - 1 through 15 (of 16 total)

We have moved to a support ticketing system and our forums are now closed.

Open Support Ticket