Jump to content

How we can add a domain search checkbox in six?


ody

Recommended Posts

Thank you Brian for your reply, but this is not what about I ask for?

 

I was mention about domain shearch chekbox, like or any other way

 

<label class="checkbox-inline">

<input type="checkbox" name="tlds[]" id="tlds[]" value=".eu"> <label for="tlds[]">.eu</label>

</label>

<label class="checkbox-inline">

<input type="checkbox" name="tlds[]" id="tlds[]" value=".com"> <label for="tlds[]">.com</label>

Link to comment
Share on other sites

do you mean that you want to do this ?

 

lOc3UU0.png

 

if so, you can't really do it in "Six" without modification to the js code - yes, you can add the checkboxes using a simple foreach loop (as above), but you can't tick just one checkbox (e.g .guru) and have domainchecker check that domain for availability, it will default to checking the first tld, .org.uk

 

the two quickest ways to do this would be a) stick with using the "Five" template, or b) start from scratch using the integration code...

 

i'm sure that i've previously posted integration domainchecker code that used checkboxes instead of a dropdown, but I can't find the thread - but if you were using the integration code on domainchecker (not on other pages), it would be really easy as you could use the foreach loop from the five template (with a slight modification to the div).

 

<form action="http://*path to whmcs*/domainchecker.php" method="post">
<input type="hidden" name="direct" value="true" />
Domain: <input type="text" name="domain" size="20" /><input type="submit" value="Go" /><br>
{foreach from=$tldslist key=num item=listtld}
<div class="col-md-3"><label class="full"><input type="checkbox" name="tlds[]" value="{$listtld}"{if in_array($listtld,$tlds) || !$tlds && $num==1} checked{/if}> {$listtld}</label></div>
{/foreach}
</form>

using this form, when you select a TLD checkbox, it will correctly search for that domain (along with alternatives if your WHMCS is configured to do so). :idea:

Link to comment
Share on other sites

Thank you Brian for you reply, (the only active member in WHMCS forum!!!!!),

we try the above code but it wasn't work,

our six template has under the bulk search orders the,,

<div class="input-group input-group-lg input-group-box">

<input type="text" class="form-control" placeholder="{$LANG.findyourdomain}" value="{$domain}" id="inputDomain" />

<span class="input-group-btn">

<button type="submit" id="btnCheckAvailability" class="btn btn-primary domain-check-availability">{$LANG.search}</button>

where we can put this code so to be functional

 

(as you know there are about 1000 plus TLDs so all WHMCS users needs this kind of a domain search

we have in our mind a domain search like a pre-choosen domains and if user like to search more to have the ability to choose 1 or 2 or .... or with a ready order to choose all,)

 

also is there any way for the output results to give it in a smooth way and not all at once

like when it's finding one to give it out and then the rest one by one or as many it's finding

 

the reason way we look for a new way domain output reasults it's because

a simple search for about 15 to 20 TLDs tooks about 10sec

if you give about 100 tooks 35 to 45sec

if you give more than 150-250 tooks from 50 to 75sec

so a user can't wait so much time to see the output results (all in one output)

but if there is smooth way we believe that a user will wait for all of them

 

Thank you again Brian for your help.

Edited by ody
Link to comment
Share on other sites

Thank you Brian for you reply, (the only active member in WHMCS forum!!!!!),

we try the above code but it wasn't work,

our six template has under the bulk search orders the,,

you never mentioned bulk searching previously... :roll:

 

even in the old "five"/"default" templates, it didn't allow for multiple TLD checkboxes in the bulk search, you just typed multiple domains (upto 20 I think) into the textarea box.

 

the above integration code was just a quick way to search for a domain name by passing it to domainchecker... by default, Six would show whether that domain was available and any alternatives available as specified in your settings.

 

where we can put this code so to be functional

it should be "functional" anywhere on domainchecker.tpl - for testing, I just put it at the end of the existing file... but remember that to do what you want to do, would require some serious modifications - both to the input and outputting of the results.

 

(as you know there are about 1000 plus TLDs so all WHMCS users needs this kind of a domain search

we have in our mind a domain search like a pre-choosen domains and if user like to search more to have the ability to choose 1 or 2 or .... or with a ready order to choose all,)

also is there any way for the output results to give it in a smooth way and not all at once

like when it's finding one to give it out and then the rest one by one or as many it's finding

the only commercial option that springs to mind is the Hexonet High Performance DomainChecker Module - take a look at the public demo from their site...

 

https://wiki.hexonet.net/wiki/WHMCS_Modules

 

I think you'd need an account with Hexonet to use it on a live site though...

 

the reason way we look for a new way domain output results it's because

a simple search for about 15 to 20 TLDs tooks about 10sec

if you give about 100 tooks 35 to 45sec

if you give more than 150-250 tooks from 50 to 75sec

so a user can't wait so much time to see the output results (all in one output)

but if there is smooth way we believe that a user will wait for all of them.

if you're going to do something like this, then you'll likely need an API solution (such as hexonet's or perhaps the resellerclubmod free addon) - if you use the standard whois method, then it will be slower and will run the risk of breaking whois lookup limits.

 

if you know ajax and WHMCS then it is possible to write your own, but it's a huge topic to get into and much too big for a forum post!... if you don't know how to use ajax, then a ready-made solution would be much better suited to your needs.

Link to comment
Share on other sites

Thanks to Brian (to whom we own to many till now) we find out a good solution with his code!!!!

DomainChecker1.jpg

DomainChecker2.jpg

Bellow is the code-guide for this solution and this is our 1st version and it's multilang.

it works with six template (original one) but taking functions from five checked with 6.2.2

(we haven't till now upgrade to 6.3.1 as we wait to WHMCS to fix bugs etc. so to be sure for their stable one version)

Be carefull with our pricelist code because we use www.resellerclub-mods.com free tool which is a very usefull-great and too professional addon and if you work with Reseller Club we propose to add it, if not, use the original pricelist code of WHMCS.

We hope that WHMCS will give us into future more easy solutions and options about how we want to give our output results more easy options for navbars etc.

Now the code REMEMBER TO CREATE BEFORE AN ORIGINAL COPY OF YOUR domainchecker.tpl

<div class="pull-right btn-group">

<button type="button" class="btn btn-default dropdown-toggle" data-toggle="dropdown" aria-expanded="false">

Bulk Domain Search <span class="caret"></span>

</button>

<ul class="dropdown-menu" role="menu">

<li><a href="domainchecker.php">Simple Domain Search</a></li>

<li><a href="domainchecker.php?search=bulkregister">Bulk Domain Search</a></li>

<li><a href="domainchecker.php?search=bulktransfer">Bulk Domain Transfer</a></li>

</ul>

</div>

</br></br> ***1. Watch out here we took the original bulk search and we add it into the beging of search page If you don't use it you can remove it.

 

{include file="$template/includes/alert.tpl" type="danger" msg="{$LANG.searchtermrequired}" textcenter=true idname="searchTermRequired" additionalClasses="domain-checker-error" hide=true}

 

{include file="$template/includes/alert.tpl" type="danger" msg="{$LANG.invalidchars}" textcenter=true idname="invalidChars" additionalClasses="domain-checker-error" hide=true}

 

{if $errorMsg}

{include file="$template/includes/alert.tpl" type="danger" msg=$errorMsg textcenter=true idname="invalidDomainError" additionalClasses="domain-checker-error"}

{else}

{include file="$template/includes/alert.tpl" type="danger" msg="{$LANG.unabletolookup}" textcenter=true idname="invalidDomainError" additionalClasses="domain-checker-error" hide=true}

{/if}

 

 

<div class="domain-step-options hidden" id="stepBulkOptions">

<textarea class="form-control" rows="10" cols="60" id="inputBulkDomains"></textarea>

</div>

<div class="domain-step-options{if !$performingLookup} hidden{/if}" id="stepResults">

{include file="$template/domainchecker-results.tpl"}

</div>

***2. Watch out here we took the original code of output results from the end and bring it up so when a client gets into results page first he will see them and if the domain exist and secondly he can make a new one search.

If you don't like it you can move it back it's in original code WHMCS place.

<div class="well text-center">

<div class="domain-checker-bg">

<form action="https or http://your-domain-WHMCS-directory.???/domainchecker.php" method="post">

 

<input type="hidden" name="direct" value="true" />

<div class="input-group input-group-lg input-group-box">

<div class="col-md-0">Domain: <input type="text" name="domain" size="70" /> <button type="submit" id="btnCheckAvailability" class="btn btn-primary domain-check-availability">{$LANG.search}</button></br>

{foreach from=$tldslist key=num item=listtld}

<label class="full"><input type="checkbox" name="tlds[]" value="{$listtld}"{if in_array($listtld,$tlds) || !$tlds && $num==1} checked{/if}> {$listtld}</label>

{/foreach}

</div>

</div>

</form>

</div>

</div>

</br>

 

{if !$loggedin && $currencies && !$performingLookup}

<div class="currencychooser pull-right clearfix margin-bottom">

<div class="btn-group" role="group">

{foreach from=$currencies item=curr}

<a href="domainchecker.php?currency={$curr.id}" class="btn btn-default{if $currency.id eq $curr.id} active{/if}">

<img src="{$BASE_PATH_IMG}/flags/{if $curr.code eq "AUD"}au{elseif $curr.code eq "CAD"}ca{elseif $curr.code eq "EUR"}eu{elseif $curr.code eq "GBP"}gb{elseif $curr.code eq "INR"}in{elseif $curr.code eq "JPY"}jp{elseif $curr.code eq "USD"}us{elseif $curr.code eq "ZAR"}za{else}na{/if}.png" border="0" alt="" />

{$curr.code}

</a>

{/foreach}

</div>

</div>

<div class="clearfix"></div>

{/if}

 

<div id="pricingTable"{if $performingLookup} class="hidden"{/if}>

 

<div class="panel-group" id="accordion" role="tablist" aria-multiselectable="true">

<div class="panel panel-default">

<div class="panel-heading" role="tab" id="heading{$tldCategory->id}">

<h4 class="panel-title">

<a data-toggle="collapse" data-parent="#accordion" href="#collapseAll" aria-expanded="false" aria-controls="collapseAll" class="domain-tld-pricing-category">

{$LANG.alltldpricing}

</a>

</h4>

</div>

<div id="collapseAll" class="panel-collapse collapse in" role="tabpanel" aria-labelledby="headingAll">

<div class="panel-body">

<div class="row">

<div class="col-md-10 col-md-offset-1 col-lg-8 col-lg-offset-2 table-responsive domain-tld-pricing-table-responsive">

<script language="javascript" src = "widgets/domainpricelist.php?currency={$smarty.post.currency}"></script>

</div>

</div>

</div>

</div>

</div>

</div>

 

</div>

***3. Watch out here is the code of Resellerclub Mods If you don't use it USE THE ORIGINAL WHMCS CODE.

 

{if !$loggedin && $currencies && !$performingLookup}

<div class="currencychooser pull-right clearfix margin-bottom">

<div class="btn-group" role="group">

{foreach from=$currencies item=curr}

<a href="domainchecker.php?currency={$curr.id}" class="btn btn-default{if $currency.id eq $curr.id} active{/if}">

<img src="{$BASE_PATH_IMG}/flags/{if $curr.code eq "AUD"}au{elseif $curr.code eq "CAD"}ca{elseif $curr.code eq "EUR"}eu{elseif $curr.code eq "GBP"}gb{elseif $curr.code eq "INR"}in{elseif $curr.code eq "JPY"}jp{elseif $curr.code eq "USD"}us{elseif $curr.code eq "ZAR"}za{else}na{/if}.png" border="0" alt="" />

{$curr.code}

</a>

{/foreach}

</div>

</div>

<div class="clearfix"></div>

{/if}

 

<script>

var langSearch = '{$LANG.search}';

var langAdding = '{$LANG.domaincheckeradding}';

var langAdded = '{$LANG.domaincheckeradded}';

var langUnavailable = '{$LANG.domainunavailable}';

var langBulkPlaceholder = '{$LANG.domaincheckerbulkplaceholder|escape:'quotes'|replace:"\n":'\n'}';

</script>

<script src="templates/{$template}/js/domainchecker.js"></script>

 

{include file="$template/includes/modal.tpl" name="CheckUnavailable" title="{$LANG.domainchecker.suggestiontakentitle}" content="{$LANG.domainchecker.suggestiontakenmsg}" closeLabel="{$LANG.domainchecker.suggestiontakenchooseanother}"}

 

{include file="$template/includes/modal.tpl" name="AlreadyInCart" title="{$LANG.domainchecker.alreadyincarttitle}" content="{$LANG.domainchecker.alreadyincartmsg}" submitAction="window.location='cart.php?a=checkout'" submitLabel="{$LANG.domainchecker.alreadyincartcheckoutnow}"}

 

{include file="$template/includes/modal.tpl" name="AddToCartError" title="{$LANG.genericerror.title}" content="{$LANG.genericerror.msg}"}

Edited by ody
Link to comment
Share on other sites

Rest which need to be done?

Any one can help us.!!!

1. When you enter in domain search invalid characters like #!&..... system check giving fault results for 1st TLD but giving positive output for the rest TLDs ??? so we need to fix it.?

2. This Search Page works outside six - it's re-directing page with reults not inside as six normaly works with a delay .gif image

we try to add an order like this

onclick="$('#modalpleasewait').modal();"

but till now we haven't find the way, if somebody find it please place it here.

Edited by ody
Link to comment
Share on other sites

try to remember not to use QUOTE when pasting code as it will likely add an occasional space that will prevent the code from working - as it has above...

 

here's the same code with the incorrect spacing removed... :idea:

 

<div class="pull-right btn-group">
<button type="button" class="btn btn-default dropdown-toggle" data-toggle="dropdown" aria-expanded="false">
Bulk Domain Search <span class="caret"></span>
</button>
<ul class="dropdown-menu" role="menu">
<li><a href="domainchecker.php">Simple Domain Search</a></li>
<li><a href="domainchecker.php?search=bulkregister">Bulk Domain Search</a></li>
<li><a href="domainchecker.php?search=bulktransfer">Bulk Domain Transfer</a></li>
</ul>
</div>
</br></br> 

{include file="$template/includes/alert.tpl" type="danger" msg="{$LANG.searchtermrequired}" textcenter=true idname="searchTermRequired" additionalClasses="domain-checker-error" hide=true}

{include file="$template/includes/alert.tpl" type="danger" msg="{$LANG.invalidchars}" textcenter=true idname="invalidChars" additionalClasses="domain-checker-error" hide=true}

{if $errorMsg}
{include file="$template/includes/alert.tpl" type="danger" msg=$errorMsg textcenter=true idname="invalidDomainError" additionalClasses="domain-checker-error"}
{else}
{include file="$template/includes/alert.tpl" type="danger" msg="{$LANG.unabletolookup}" textcenter=true idname="invalidDomainError" additionalClasses="domain-checker-error" hide=true}
{/if}


<div class="domain-step-options hidden" id="stepBulkOptions">
<textarea class="form-control" rows="10" cols="60" id="inputBulkDomains"></textarea>
</div>
<div class="domain-step-options{if !$performingLookup} hidden{/if}" id="stepResults">
{include file="$template/domainchecker-results.tpl"}
</div>

<div class="well text-center">
<div class="domain-checker-bg">
<form action="domainchecker.php" method="post">

<input type="hidden" name="direct" value="true" />
<div class="input-group input-group-lg input-group-box">
<div class="col-md-0">Domain: <input type="text" name="domain" size="70" /> <button type="submit" id="btnCheckAvailability" class="btn btn-primary domain-check-availability">{$LANG.search}</button></br>
{foreach from=$tldslist key=num item=listtld}
<label class="full"><input type="checkbox" name="tlds[]" value="{$listtld}"{if in_array($listtld,$tlds) || !$tlds && $num==1} checked{/if}> {$listtld}</label>
{/foreach}
</div>
</div>
</form>
</div>
</div>
</br>

{if !$loggedin && $currencies && !$performingLookup}
<div class="currencychooser pull-right clearfix margin-bottom">
<div class="btn-group" role="group">
{foreach from=$currencies item=curr}
<a href="domainchecker.php?currency={$curr.id}" class="btn btn-default{if $currency.id eq $curr.id} active{/if}">
<img src="{$BASE_PATH_IMG}/flags/{if $curr.code eq "AUD"}au{elseif $curr.code eq "CAD"}ca{elseif $curr.code eq "EUR"}eu{elseif $curr.code eq "GBP"}gb{elseif $curr.code eq "INR"}in{elseif $curr.code eq "JPY"}jp{elseif $curr.code eq "USD"}us{elseif $curr.code eq "ZAR"}za{else}na{/if}.png" border="0" alt="" />
{$curr.code}
</a>
{/foreach}
</div>
</div>
<div class="clearfix"></div>
{/if}

<div id="pricingTable"{if $performingLookup} class="hidden"{/if}>

<div class="panel-group" id="accordion" role="tablist" aria-multiselectable="true">
<div class="panel panel-default">
<div class="panel-heading" role="tab" id="heading{$tldCategory->id}">
<h4 class="panel-title">
<a data-toggle="collapse" data-parent="#accordion" href="#collapseAll" aria-expanded="false" aria-controls="collapseAll" class="domain-tld-pricing-category">
{$LANG.alltldpricing}
</a>
</h4>
</div>
<div id="collapseAll" class="panel-collapse collapse in" role="tabpanel" aria-labelledby="headingAll">
<div class="panel-body">
<div class="row">
<div class="col-md-10 col-md-offset-1 col-lg-8 col-lg-offset-2 table-responsive domain-tld-pricing-table-responsive">
<script language="javascript" src = "widgets/domainpricelist.php?currency={$smarty.post.currency}"></script>
</div>
</div>
</div>
</div>
</div>
</div>

</div>

{if !$loggedin && $currencies && !$performingLookup}
<div class="currencychooser pull-right clearfix margin-bottom">
<div class="btn-group" role="group">
{foreach from=$currencies item=curr}
<a href="domainchecker.php?currency={$curr.id}" class="btn btn-default{if $currency.id eq $curr.id} active{/if}">
<img src="{$BASE_PATH_IMG}/flags/{if $curr.code eq "AUD"}au{elseif $curr.code eq "CAD"}ca{elseif $curr.code eq "EUR"}eu{elseif $curr.code eq "GBP"}gb{elseif $curr.code eq "INR"}in{elseif $curr.code eq "JPY"}jp{elseif $curr.code eq "USD"}us{elseif $curr.code eq "ZAR"}za{else}na{/if}.png" border="0" alt="" />
{$curr.code}
</a>
{/foreach}
</div>
</div>
<div class="clearfix"></div>
{/if}

<script>
var langSearch = '{$LANG.search}';
var langAdding = '{$LANG.domaincheckeradding}';
var langAdded = '{$LANG.domaincheckeradded}';
var langUnavailable = '{$LANG.domainunavailable}';
var langBulkPlaceholder = '{$LANG.domaincheckerbulkplaceholder|escape:'quote s'|replace:"\n":'\n'}';
</script>
<script src="templates/{$template}/js/domainchecker.js"></script>

{include file="$template/includes/modal.tpl" name="CheckUnavailable" title="{$LANG.domainchecker.suggestiontakentitle}" content="{$LANG.domainchecker.suggestiontakenmsg}" closeLabel="{$LANG.domainchecker.suggestiontakenchooseanother}"}

{include file="$template/includes/modal.tpl" name="AlreadyInCart" title="{$LANG.domainchecker.alreadyincarttitle}" content="{$LANG.domainchecker.alreadyincartmsg}" submitAction="window.location='cart.php?a=checkout '" submitLabel="{$LANG.domainchecker.alreadyincartcheckoutnow}"}

{include file="$template/includes/modal.tpl" name="AddToCartError" title="{$LANG.genericerror.title}" content="{$LANG.genericerror.msg}"}

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use & Guidelines and understand your posts will initially be pre-moderated