Jump to content

New Enom Name Spinner


Recommended Posts

  • 5 months later...
  • Replies 174
  • Created
  • Last Reply

Top Posters In This Topic

Top Posters In This Topic

Posted Images

Has anyone gotten this error when using the domain spinner?

 

Invalid TLD/Registration Period Supplied for Domain Registration

 

The domain spinner works fine when adding domains through the "Domain Registration" link in the shopping cart, but when doing it from /domainchecker.php I get the error above.

 

Edit: I'm on 4.5.2 using a copy of the default theme, all stock except for the changes in the instructions.

Link to comment
Share on other sites

  • 1 month later...
  • 5 weeks later...
  • 1 month later...
  • 2 weeks later...
Don't forget that the code might need to be put back into the templates that are being used. I have this working on 5.x.

 

I've followed the instructions in this post and can't get it to work in version 5.0.3. Is there anything specific I need to do to get this working in 5.0.3 ?

Link to comment
Share on other sites

  • 4 weeks later...
If you are testing on a development box you need to make sure that you have authorized it's IP address at enom for API access.ht3.jpgjh.jpgbh.jpg

 

Already done (otherwise enom registrations wouldn't be working - which they are... )

 

Is this addon supported or is there a commercial version planned, etc.?

Link to comment
Share on other sites

If you are testing on a development box you need to make sure that you have authorized it's IP address at enom for API access.ht3.jpgjh.jpgbh.jpg

 

Already done (otherwise enom registrations wouldn't be working - which they are... )

 

Is this addon supported or is there a commercial version planned, etc.?

Link to comment
Share on other sites

  • 2 weeks later...
  • 3 months later...

wow this doesnt even work? i added {include file="namespinner.tpl"} to all of the files that it said to add it too but it did not work at all. using version 5.1.1 about to upgrade to 5.1.2 but my question is this. do i add it to ever one of the adddomain.tpl files in every folder that it is in?

Link to comment
Share on other sites

  • 1 month later...
  • 2 months later...

i am getting same error how to fix this. kindly help

I had the domain's IP authorized with ENOM.

 

However:

 

In debugging, I get this output:

 

<?xml version="1.0"?>
<interface-response>
<Command><=!=[=C=D=A=T=A=[NAMESPINNER]=]=></Command>
<Language><=!=[=C=D=A=T=A=[eng]=]=></Language>
<ErrCount><=!=[=C=D=A=T=A=[1]=]=></ErrCount>
<errors>
<Err1><=!=[=C=D=A=T=A=[user not permitted from this IP address - 4]=]=></Err1>
</errors>
<ResponseCount><=!=[=C=D=A=T=A=[1]=]=></ResponseCount>
<responses>
<response>
<ResponseNumber><=!=[=C=D=A=T=A=[]=]=></ResponseNumber>
<ResponseString><=!=[=C=D=A=T=A=[Policy error; unauthorized; user(s)]=]=></ResponseString>

Link to comment
Share on other sites

  • 5 months later...

Hi WebWorker

 

I install on my website and working good... the only problem is the result look messy

I'm not using whmcs default template I have a wordpress theme so I try to figure how make the result look good the colon are not ok ... and I really want use your module but not if look like that

 

can you help me please ?

 

you can see an example on the picture ...

Thank you very much

example.jpg

Edited by Sylvie
Link to comment
Share on other sites

  • 2 months later...
  • 1 month later...
  • 4 months later...
  • 3 weeks later...
  • 4 months later...
  • 10 months later...

Thanks Ideamesh, I did it. I also replaced the login credentials with external php file... just formats off and some of the fields not showing yet like price of suggested domain. :(

 

https://hotrockhosting.com/whmcs/add/1.html

 

 

 

Based on WHMCS Register New Domain under the Default Template and Web20cart Cart

You will have to create files: namespinner.tpl and enom.php and just edit adddomain.tpl

 

 

namespinner.tpl

{if $domain neq "transfer"}
{php}

	/**
	 * @version 1.1
	 * @since WHMCS 3.8
	 * @copyright 2009 http://ideamesh.com This script is owned and licensed by Ideamesh, Inc.
	 * You may use this script in commercial applications, however you may not resell
	 * this script without permission of Ideamesh, Inc.<br>
	 * Please contact (sales [at] ideamesh [dot] com) for more information
	 */

	//Set to true to get debug messages
	$debug = false;

	//Edit enom.php to your actual enom username
       include ("templates/orderforms/web20cart/enom.php");




	//Max number of spins to generate
	$maxspins = 50;

	//Choose which options to show in the spin results
	//Enom only will return .com, .net, .cc and .tv results that's why these were chosen
	$showdotcom = true;
	$showdotnet = false;
	$showdotcc = false;
	$showdottv = false;

	//Can be one of these values ("tld"|"sld"|"score")
	$sort1 = "score";
	$sort2 = "sld";
	//Can be one of these values (SORT_ASC|SORT_DESC)
	$sort1order = SORT_DESC;
	$sort2order = SORT_ASC;

	//Set this to "True" for blocking sensitive content or "False" to allow sensitive content
	$sensitivecontent = "True";

	// Extract Smarty variables
	extract($this->_tpl_vars);

	//Do not edit this. We're setting up the URL to retrieve the spins
	$namespinnerurl = "https://reseller.enom.com/interface.asp?command=namespinner&uid=".$enomid."&pw=".$enompw."&SLD=".$sld."&TLD=".$tld."&SensitiveContent=".$sensitivecontent."&MaxResults=".$maxspins."&ResponseType=XML";

	// Use cURL to get the XML response
	$ch = curl_init($namespinnerurl);
	curl_setopt($ch, CURLOPT_HEADER, false);
	curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
	$xml = curl_exec($ch);
	curl_close($ch);

	if ($xml) {
		$spinnerresults = new SimpleXmlElement($xml, LIBXML_NOCDATA);

		if ($spinnerresults->ErrCount == 0) {
			for ($i=0; $i< $maxspins; $i++) {
				if ($showdotcom && (string)$spinnerresults->namespin->domains->domain[$i]['com'] == "y")
					$spinner[] = array(
						'domain' => (string)$spinnerresults->namespin->domains->domain[$i]['name'].".com",
						'netscore' => (int)$spinnerresults->namespin->domains->domain[$i]['comscore'],
						'tld' => '.com');
				if ($showdotnet && (string)$spinnerresults->namespin->domains->domain[$i]['net'] == "y")
					$spinner[] = array(
						'domain' => (string)$spinnerresults->namespin->domains->domain[$i]['name'].".net",
						'netscore' => (int)$spinnerresults->namespin->domains->domain[$i]['netscore'],
						'tld' => '.net');
				if ($showdotcc && (string)$spinnerresults->namespin->domains->domain[$i]['cc'] == "y")
					$spinner[] = array(
						'domain' => (string)$spinnerresults->namespin->domains->domain[$i]['name'].".cc",
						'netscore' => (int)$spinnerresults->namespin->domains->domain[$i]['ccscore'],
						'tld' => '.cc');
				if ($showdottv && (string)$spinnerresults->namespin->domains->domain[$i]['tv'] == "y")
					$spinner[] = array(
						'domain' => (string)$spinnerresults->namespin->domains->domain[$i]['name'].".tv",
						'netscore' => (int)$spinnerresults->namespin->domains->domain[$i]['tvscore'],
						'tld' => '.tv');
			}
			$gotnamespinner = true;
		} else {
			$gotnamespinner = false;
		}
	} else {
		if ($debug) echo "Cannot retrieve XML file. Please check your firewall settings";
		$gotnamespinner = false;
	}

	if ($debug) {
		echo "<pre>";
		echo htmlentities($xml);
		echo "</pre>";
	}

	//Get domain pricing for .com, .net, .cc and .tv
	if ($gotnamespinner) {
		$sql = "SELECT extension, register, registrationperiod FROM tbldomainpricing WHERE extension in ('.com', '.net', '.cc', '.tv');";
		$query = mysql_query ($sql);
		while ($row = @mysql_fetch_array ($query, MYSQL_ASSOC)) {
			$domainprices[$row['extension']][$row['registrationperiod']] = $row['register'];
		}
	}

	// Setup for the sorting
	foreach ($spinner as $key => $row) {
		$spin['sld'][$key]  = $row['domain'];
		$spin['score'][$key] = $row['netscore'];
		$spin['tld'][$key] = $row['tld'];
	}

	array_multisort($spin[$sort1], $sort1order, $spin[$sort2], $sort2order, $spinner);

	//Send some variables back to the template
	$this->assign('spinner', $spinner);
	$this->assign('gotnamespinner', $gotnamespinner);
	$this->assign('domainprices', $domainprices);
{/php}

{if $gotnamespinner}
	<p class="cartsubheading">We also recommend</p>

	<table class="clientareatable" style="width:90%;" align="center" cellspacing="1">
	<tr class="clientareatableheading"><td>{$LANG.domainname}</td><td>{$LANG.domainstatus}</td><td>{$LANG.domainmoreinfo}</td></tr>
	{foreach key=num item=result from=$spinner}
		<tr class="clientareatableactive">
			<td width="33%">{$result.domain}</td>
			<td width="33%" class="domaincheckeravailable"><input type="checkbox" name="domains[]" value="{$result.domain|lower}"{if $result.domain|lower|in_array:$domains} checked{/if} /> {$LANG.domainavailable}</td>
			<td width="33%"><select name="domainsregperiod[{$result.domain|lower}]">
				{assign var=thistld value=$result.tld}
				{foreach key=years item=regoption from=$domainprices.$thistld}
					<option value="{$years}">{$years} {$LANG.orderyears} @ {$currencysymbol}{$regoption} {$currency}</option>
				{/foreach}</select>
			</td>
		</tr>
	{/foreach}
	</table>

	<p align="center"><input type="submit" value="{$LANG.addtocart}" /></p>
{/if}
{/if}

 

 

enom.php

<?php
       $enomid = "enomid";
       $enompw = "enompw";
?>

 

adddomain.tpl add code before last form tag as instructed.

{include file="orderforms/web20cart/namespinner.tpl"}

 

still working on domainchecker :)

Link to comment
Share on other sites

comes auto with whmcs 6.0

https://hotrockhosting.com/whmcs/domainchecker.php

use template 6 and activate the service under whmcs>settings>>domains in the top right box

 

Here is template code to use Enom's Namespinner on your adddomain.tpl

 

Features:

  • Only displays when ordering a new domain name
  • Uses live pricing from your database
  • Formatted to match WHMCS's bulk domain checker layout
  • Uses SSL connection to enom for better securrity
  • Does not suggest unavailable domain names

 

Limitations:

  • Requires PHP5, cUrl and SimpleXML
  • Will not output anything if there was an error communicating with Enom
  • Because of the complexity of pulling encrypted passwords from WHMCS's database, you still need to put your Enom username and password into the appropriate variables.

 

Installing:

Insert this code between the line:

<p align="center"><input type="submit" value="{$LANG.addtocart}" /></p>

and

</form>

 

The code to insert:

{if $domain neq "transfer"}
{php}
	/**
	 * @version 1.0
	 * @since WHMCS 3.8
	 * @copyright 2009 http://ideamesh.com This script is owned and licensed by Ideamesh, Inc.
	 * You may use this script in commercial applications, however you may not resell
	 * this script without permission of Ideamesh, Inc.<br>
	 * Please contact (sales [at] ideamesh [dot] com) for more information
	 */

	// Extract Smarty variables
	extract($this->_tpl_vars);

	//Edit these to your actual enom username and password
	$enomid = "enomuser";
	$enompw = "enompass";

	//Max number of spins to generate
	$maxspins = 20;

	//Choose which options to show in the spin results
	$showdotcom = true;
	$showdotnet = true;
	$showdotcc = false;
	$showdottv = false;

	//Set this to "True" for blocking sensitive content or "False" to allow sensitive content
	$sensitivecontent = "True";

	//Setup the namespinner url
	$namespinnerurl = "https://reseller.enom.com/interface.asp?command=namespinner&uid=".$enomid."&pw=".$enompw."&SLD=".$sld."&TLD=".$tld."&SensitiveContent=".$sensitivecontent."&MaxResults=".$maxspins."&ResponseType=XML";

	// Use cURL to get the XML response
	$ch = curl_init($namespinnerurl);
	curl_setopt($ch, CURLOPT_HEADER, false);
	curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
	$xml = curl_exec($ch);
	curl_close($ch);

	if ($xml) {
		$spinnerresults = new SimpleXmlElement($xml, LIBXML_NOCDATA);

		if ($spinnerresults->ErrCount == 0) {
			for($i=0; $i<$maxspins; $i++){
				if ($showdotcom && (string)$spinnerresults->namespin->domains->domain[$i]['com'] == "y")
					$spinner[] = array(
						'domain' => (string)$spinnerresults->namespin->domains->domain[$i]['name'].".com",
						'sld' => (string)$spinnerresults->namespin->domains->domain[$i]['name'],
						'tld' => '.com');
				if ($showdotnet && (string)$spinnerresults->namespin->domains->domain[$i]['net'] == "y")
					$spinner[] = array(
						'domain' => (string)$spinnerresults->namespin->domains->domain[$i]['name'].".net",
						'sld' => (string)$spinnerresults->namespin->domains->domain[$i]['name'],
						'tld' => '.net');
				if ($showdotcc && (string)$spinnerresults->namespin->domains->domain[$i]['cc'] == "y")
					$spinner[] = array(
						'domain' => (string)$spinnerresults->namespin->domains->domain[$i]['name'].".cc",
						'sld' => (string)$spinnerresults->namespin->domains->domain[$i]['name'],
						'tld' => '.cc');
				if ($showdottv && (string)$spinnerresults->namespin->domains->domain[$i]['tv'] == "y")
					$spinner[] = array(
						'domain' => (string)$spinnerresults->namespin->domains->domain[$i]['name'].".tv",
						'sld' => (string)$spinnerresults->namespin->domains->domain[$i]['name'],
						'tld' => '.tv');
			}
			$gotnamespinner = true;
		} else {
			$gotnamespinner = false;
		}
	} else {
		$gotnamespinner = false;
	}

	//Get domain pricing for .com, .net, .cc and .tv
	$sql = "SELECT extension, register, registrationperiod FROM tbldomainpricing WHERE extension in ('.com', '.net', '.cc', '.tv');";
	$query = mysql_query ($sql);
	while ($row = @mysql_fetch_array ($query, MYSQL_ASSOC)) {
		$domainprices[$row['extension']][$row['registrationperiod']] = $row['register'];
	}

	//Send some variables back to the template
	$this->assign('spinner', $spinner);
	$this->assign('gotnamespinner', $gotnamespinner);
	$this->assign('domainprices', $domainprices);
{/php}

{if $gotnamespinner}
	<p class="cartsubheading">We also recommend</p>

	<table class="clientareatable" style="width:90%;" align="center" cellspacing="1">
	<tr class="clientareatableheading"><td>{$LANG.domainname}</td><td>{$LANG.domainstatus}</td><td>{$LANG.domainmoreinfo}</td></tr>
	{foreach key=num item=result from=$spinner}
		<tr class="clientareatableactive">
			<td width="33%">{$result.domain}</td>
			<td width="33%" class="domaincheckeravailable"><input type="checkbox" name="domains[]" value="{$result.domain|lower}"{if $result.domain|lower|in_array:$domains} checked{/if} /> {$LANG.domainavailable}</td>
			<td width="33%"><select name="domainsregperiod[{$result.domain|lower}]">
				{assign var=thistld value=$result.tld}
				{foreach key=years item=regoption from=$domainprices.$thistld}
					<option value="{$years}">{$years} {$LANG.orderyears} @ {$currencysymbol}{$regoption} {$currency}</option>
				{/foreach}</select>
			</td>
		</tr>
	{/foreach}
	</table>

	<p align="center"><input type="submit" value="{$LANG.addtocart}" /></p>
{/if}
{/if}

 

Final steps:

  • Edit the variables $enomid and $enompw
  • Change $maxspins variable to adjust number of suggested names
  • Change $showdotcom, $showdotnet, $showdotcc, $showdottv to your liking

 

Try it out here: https://ideamesh.com/cart.php?a=add&domain=register

 

Hope you enjoy it! Please see my note on securing your .tpl files using .htaccess at : http://forum.whmcs.com/showthread.php?p=96394

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.

  • Recently Browsing   0 members

    • No registered users viewing this page.

×
×
  • 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