Search domain name on main website

Discussion in 'Tutorial Requests' started by abeck007, Feb 16, 2014.

  1. abeck007

    abeck007 New Member

    Joined:
    Feb 6, 2014
    Messages:
    7
    Likes Received:
    1
    How to create code for search domain name widget on main website, I just found the widget only HelpDesk on side bar don't have a widget for search domain name with copy paste to another page,

    Kind Regards,
     
    #1
  2. shahidi

    shahidi Active Member

    Joined:
    Aug 29, 2011
    Messages:
    562
    Likes Received:
    41
    This something clientexec should describe clear in a post or document.
     
    #2
  3. abeck007

    abeck007 New Member

    Joined:
    Feb 6, 2014
    Messages:
    7
    Likes Received:
    1
    I agree with you Mr, Shahidi, this is for clients member, and i hope clientexec can be better then for the next version include domain name widget or anythings.
     
    #3
    shahidi likes this.
  4. smis2014

    smis2014 New Member

    Joined:
    Aug 5, 2014
    Messages:
    6
    Likes Received:
    1
    there is no website widgets on CE?

    is there going to be a mobile version?
     
    #4
  5. Reid

    Reid New Member

    Joined:
    Aug 7, 2012
    Messages:
    11
    Likes Received:
    3
    #5
  6. CE-Alberto

    CE-Alberto Administrator Staff Member

    Joined:
    Aug 26, 2011
    Messages:
    959
    Likes Received:
    173
    Hi @smis2014

    Website widget has been planned. Mobile version is also something we are planning now that we are in the 5.x framework.
     
    #6
  7. Mark Downing

    Mark Downing New Member

    Joined:
    Aug 7, 2014
    Messages:
    13
    Likes Received:
    3
    I tried this, but it did not function properly
     
    #7
  8. Reid

    Reid New Member

    Joined:
    Aug 7, 2012
    Messages:
    11
    Likes Received:
    3
    I would like to look into this. Can you kindly submit a ticket with the subject: "ATTN: Reid" and attach your code from the article.
     
    #8
  9. Mark Downing

    Mark Downing New Member

    Joined:
    Aug 7, 2014
    Messages:
    13
    Likes Received:
    3
    I removed the code snippet from the page. I think the real issue at heart is that I have no active registrar configured. I don't know how to do this with Just host as the provider of these services.
     
    #9
  10. CE-Lincoln

    CE-Lincoln Moderator Staff Member

    Joined:
    Aug 27, 2011
    Messages:
    438
    Likes Received:
    125
  11. Steve

    Steve New Member

    Joined:
    Oct 5, 2014
    Messages:
    1
    Likes Received:
    0
    Hello,

    I've been reading through the documentation and am wondering if this has been addressed somewhere I haven't found yet. I have a domain registrar account linked in with my CE but I'm looking for ways to customize it further.

    Thanks,
     
    #11
  12. CE-Lincoln

    CE-Lincoln Moderator Staff Member

    Joined:
    Aug 27, 2011
    Messages:
    438
    Likes Received:
    125
    Hi @Steve - What exactly are you looking to do? Just want to make sure I fully understand first.
     
    #12
  13. Waqass

    Waqass New Member

    Joined:
    Jun 7, 2015
    Messages:
    9
    Likes Received:
    5
    #13
  14. shahidi

    shahidi Active Member

    Joined:
    Aug 29, 2011
    Messages:
    562
    Likes Received:
    41
    #14
  15. CE-Matt

    CE-Matt Administrator Staff Member

    Joined:
    Aug 27, 2011
    Messages:
    1,571
    Likes Received:
    274
    It looks like something isn't displaying properly.

    I'll get the proper code later today or tomorrow for you guys and make sure it works :)
     
    #15
    shahidi likes this.
  16. hostmaster

    hostmaster Member

    Joined:
    Jan 14, 2013
    Messages:
    33
    Likes Received:
    8
    How about something like this (taken directly from my own site so I know it works):

    Code:
    <div id="result"><h2>Enter a domain (example: something.com) to see if it is available:</h2></div>
    <?php if (isset($_GET['domainname'])){
    echo '<form action="" method="get">';
    }
    ?>
    <input id="domainname" type="text" name="domainname" value="enter domain to search (e.g. newdomain.com)" onfocus="if(this.value == 'enter domain to search (e.g. newdomain.com)') { this.value = ''; } " onblur="if(this.value == '') { this.value = 'enter domain to search (e.g. newdomain.com)'; }" maxlength="68" />
    <input id="submit-button" type="submit" class="button" value="" />
    <?php if (isset($_GET['domainname'])){
    echo '</form>';
    }
    ?>
    <script type="text/javascript">
    var ceURL = 'http://- - - - your clientexec installation - - - -';
    var groupId = ' - - - group id - - - ';
    <?php if (isset($_GET['domainname'])){ ?>
    $( document ).ready(function(){
    <?php }else{ ?>
    $('#submit-button').click(function(e) {
    e.preventDefault();
    <?php } ?>
    
    $('#result').html('<h2><img src="'+ceURL+'templates/common/css/spinner.gif" width="24" height="24" alt="Searching..." /> Searching domain availability ...</h2>');
    <?php if (isset($_GET['domainname'])){ ?>
    var fullname = '<?php echo htmlspecialchars($_GET['domainname']);?>';
    <?php }else{ ?>
    var fullname = $('#domainname').val();
    <?php } ?>
    if ( fullname.indexOf(".") == -1 ) {
    $('#domainname').addClass('domain_fail');
    $('#domainname').val(fullname+' - not a valid domain name');
    } else {
    var name_array = fullname.split('.');
    $.post(ceURL + 'index.php?fuse=clients&action=checkdomain',
    {
    name: name_array[0],
    tld: name_array[1],
    group: groupId
    }, function(response) {
    console.log(response);
    if ( response.error ) {
    $('#result').html('<h1 id="nope"><img src="/client/images/alert_sorry.gif" width="81" height="72" alt="Sorry, unavailable" /> There was an error, please try your search again.</h1>');
    } else {
    var domainStatus = response.search_results.status;
    if ( domainStatus == '0' ) {
    $('#result').html('<h1><img src="/client/images/alert_success.gif" width="81" height="72" alt="Yes, available" /> Congratulations</h1><h2>The domain '+fullname+' is available!<br /><a class="noline" href="/client/order.php?step=0&productGroup=15&domainName='+name_array[0]+'&tld='+name_array[1]+'" title="Register '+fullname+' Now!"><img src="/images/register-now.png" width="393" height="130" alt="Register '+fullname+' Now!" /></a></h2>');
    } else if ( domainStatus == '1' ) {
    $('#result').html('<h1 id="nope"><img src="/client/images/alert_sorry.gif" width="81" height="72" alt="Sorry, unavailable" /> Sorry!<h1><h2>The domain '+fullname+' is not available. Try another search.</h2>');
    } else {
    $('#result').html('<h1 id="nope"><img src="/client/images/alert_sorry.gif" width="81" height="72" alt="Sorry, unavailable" /> Sorry!<h1><h2>Something did not work right, please try again.</h2>');
    }
    }
    }, 'json');
    }
    return false;
    });
    </script>
    
    You will need to input your domain and path to CE install on line 14.
    var ceURL = 'http://yourdomain.com/path-to-your-install/';

    Lastly, you will need to enter the domain product group in line 15.
    var groupId = 2;
     
    #16

Share This Page