Jump to content

New Enom Name Spinner


Recommended Posts

@Eric - The action hook mod you mention makes its own Mysql connection instead of using the existing one that WHMCS already has open?

 

I personally would want to reuse the existing connection if possible, but just waned to know in case this is something that should be updated in the master namespinner.tpl or just added as a footnote for special cases.

Link to comment
Share on other sites

  • Replies 174
  • Created
  • Last Reply

Top Posters In This Topic

Top Posters In This Topic

Posted Images

I found the issue with my problem and a solution. For anyone having the same issues, what I saw was that a hook that I had setup was using mysql calls. This overrides any connections that this mod makes. In order to to fix my problem, I had to specify the database connection in the namespinner.tpl file. This is what I used...

 

Just before the first mysql_query call, add these two lines:

 

 

Just after the last mysql call, add this:

 

 

Hopefully this helps someone else.

 

-Eric

 

I am very bad at PHP. will you please paste whole new updated namespinner.tpl with addition to your "mysql_query call".

Thanks in advance.

Link to comment
Share on other sites

  • 1 month later...

It has nothing to do with MySQL on our installation. The script assumes a the Smarty modifier 'lower' is available, which WHMCS does not include on a default installation.

 

To solve this, create a file in "includes/smarty/plugins/" called "modifier.lower.php". Put the following content in:

 

<?php
/**
* Smarty plugin
* @package Smarty
* @subpackage plugins
*/


/**
* Smarty lower modifier plugin
*
* Type:     modifier<br>
* Name:     lower<br>
* Purpose:  convert string to lowercase
* @link http://smarty.php.net/manual/en/language.modifier.lower.php
*          lower (Smarty online manual)
* @param string
* @return string
*/
function smarty_modifier_lower($string)
{
   return strtolower($string);
}

?>

 

And you're done. If this does not solve your issue, add $display_errors=true; to your configuration file. Would have spared us some discussions over here.

Link to comment
Share on other sites

It has nothing to do with MySQL on our installation. The script assumes a the Smarty modifier 'lower' is available, which WHMCS does not include on a default installation.

 

To solve this, create a file in "includes/smarty/plugins/" called "modifier.lower.php". Put the following content in:

 

And you're done. If this does not solve your issue, add $display_errors=true; to your configuration file. Would have spared us some discussions over here.

 

Interesting, I had assumed everyone had the full Smarty library. Good find getup.

 

You could also replace all occurrences of |lower with |strtolower in the .tpl itself.

 

I sent a support request into WHMCS to find out why the entire Smarty library isn't included with the distribution.

Link to comment
Share on other sites

Updated to version 1.6

 

--------------------

Change Log

--------------------

1.6

-Updated distributed zip file to have the neccessary files already in the correct location - *thanks getup*

-Changed |lower modifier to use php function |strtolower since WHMCS does not include all plugins from the official Smarty library

-Added new variable $createnewdbconn which when set to true will create a new database connection (only neccessary if some other script had closed WHMCS's db connection, and recommended to be left as false unless needed)

 

 

Download at http://ideamesh.com/file/16/WHMCS-ENOM-NameSpinner-v16.html

Link to comment
Share on other sites

  • 1 month later...

I have installed it all right as per instructions but i get the following error when i set debug to true

 

User not permitted from this IP address - 4

 

<?xml version="1.0"?>

<interface-response>

<Command>NAMESPINNER</Command>

<Language>eng</Language>

<ErrCount>1</ErrCount>

<errors>

<Err1>User not permitted from this IP address - 4</Err1>

</errors>

<ResponseCount>1</ResponseCount>

<responses>

<response>

<ResponseNumber>713254</ResponseNumber>

<ResponseString>Policy error; unauthorized; user(s)</ResponseString>

</response>

</responses>

<MinPeriod>0</MinPeriod>

<MaxPeriod>0</MaxPeriod>

<Server>sjl01wresell08</Server>

<Site>eNom</Site>

<IsLockable>False</IsLockable>

<IsRealTimeTLD>False</IsRealTimeTLD>

<TimeDifference>+0.00</TimeDifference>

<ExecTime>0.031</ExecTime>

<Done>true</Done>

<debug></debug>

<TrackingKey>0ec58cdd-ee37-4813-b980-47bf3eff5a81</TrackingKey>

</interface-response>

 

 

Enom confirms my ip is authorized by them why is this happening any idea ?

Link to comment
Share on other sites

Are you using reseller hosting with your own purchased dedicated IP address? If so the outgoing IP address will be the primary address of the server, not your dedicated address.

 

Also Test mode uses the test server on Enom, not their live environment. You can edit which IP addresses are authorized for the test environment through the Enom web interface.

Link to comment
Share on other sites

  • 4 weeks later...
  • 2 months later...

I have the problem that i can only get the namespinner to work in firefox (3.6), i have tried IE 8, chrome, and safari but it doesnt show up, with or without the debug.

 

I have only so far used the test mode.

 

I have tried it logged in and not logged in. but still no namespinner.

 

any ideas.

 

Thanks

Link to comment
Share on other sites

I have the problem that i can only get the namespinner to work in firefox (3.6), i have tried IE 8, chrome, and safari but it doesnt show up, with or without the debug.

 

I have only so far used the test mode.

 

I have tried it logged in and not logged in. but still no namespinner.

 

any ideas.

 

Thanks

 

The namespinner doesn't have any CSS or JS that would prevent it from working in one browser or another. It uses nearly identical code to the table that displays "Choose Domains" above it.

Link to comment
Share on other sites

  • 1 month later...
  • 2 weeks later...

This is a great mod, but this thread is sooooo long now it's taking me ages to work out if this works in bulk domain search?

 

In the download, it has instructions and I've followed them to the tee. It doesn't mention anything about the bulk search, so... I guess it doesn't? No problem if it doesn't :) I'm just curious if I'm missing something!

 

Once again, great mod! :)

Link to comment
Share on other sites

  • 2 weeks later...
This is not working for me using ajax order link and v4.4.2

 

I dont think it was ever part of the order form, was it? I thought it was mainly justed used in the domain checker area. I could be wrong, I havent messed with it in probably 2 years.

Link to comment
Share on other sites

This is not working for me at all. I edited addondomain.tpl in web20cart folder.

 

Starting with line 75, 76, 77

 

<p align="center">

<input type="submit" value="{$LANG.addtocart}" class="buttongo" />

</p>

I inserted the code (and modified variables) before the </form>

 

The recommended domain area does not show up at all. Yes, I checked and tested via the cart.php method, not ajax order form.

Edited by Chad
Link to comment
Share on other sites

I had the domain's IP authorized with ENOM.

 

However:

 

In debugging, I get this output:

 

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

Link to comment
Share on other sites

I dont think it was ever part of the order form, was it? I thought it was mainly justed used in the domain checker area. I could be wrong, I havent messed with it in probably 2 years.

 

This is not working for me using ajax order link and v4.4.2

 

No it is not compatible with the Ajax order form. Possibly in the future this might be added.

Link to comment
Share on other sites

I just found the latest v1.6 on the OP's site. I used that method now, and it doesn't work?

 

Debugged says "bad username or passord -3"?

 

My login is certainly correct.

 

Are you able to order Enom products normally through WHMCS? The namespinner uses the same credentials that you use for setting up Enom as a registrar in your system.

 

In your Enom setup there is a checkbox for test mode. Namespinner will use this flag to determine whether namespinner requests get sent to the live Enom reseller server or to the reseller test server.

 

I can also now confirm that this is working for WHMCS 4.4.2 in case anyone was wondering.

 

If you are still having problems setting things up I do offer a one time setup service for this addon. Please see the section "Installation Service" at http://ideamesh.com/file/16/WHMCS-ENOM-NameSpinner-v16.html

Link to comment
Share on other sites

  • 1 month later...
New features:

  • Ability to sort multiple ways
  • Added debug mode variable

 

Recommended Install Steps

  1. Create a new .tpl file in your orderforms template called namespinner.tpl
  2. In adddomain.tpl add the line : {include file="orderforms/cart/namespinner.tpl"} directly before before the last </form> tag
  3. In configureproductdomain.tpl add the line : {include file="orderforms/cart/namespinner.tpl"} directly before before the last </form> tag
  4. Block tpl access from the web

 

{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 these to your actual enom username and password
	$enomid = "enomusername";
	$enompw = "enompassword";

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

	//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 = true;
	$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}

 

I've just followed what appears to be simple steps but it failed to work, I've adjusted the username and password, created the file, added the line of code on each of the 2 files above the last </form> but doesn't show anything when trying to search. Any ideas?

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