Jump to content

small fix: registration and description of IDN domains


wsd

Recommended Posts

This is certainly not optimal, but it's a small step

 

http://forum.whmcs.com/showthread.php?t=9944

 

In the file /templates/orderforms/default/adddomain.tpl

Search for this

www. <input type="text" name="sld" size="40" value="{$sld}" /> <select name="tld">

Replace it with

<!—you name BOF: //-->
{include_php file='/usr/home/domains/public_html/whmcs/idn.php'}
<!—you name EOF: //-->
www. <input type="text" name="sld" size="40" value="{$sld}" /> <select name="tld">

 

 

In the file /templates/orderforms/default/configureproductdomain.tpl

Search for this

www. <input type="text" name="sld[0]" size="40" value="{$sld}" /> <select name="tld[0]">

Replace it with

<!—you name BOF: //-->
{include_php file='/usr/home/domains/public_html/whmcs/idn.php'}
<!—you name EOF: //-->
www. <input type="text" name="sld[0]" size="40" value="{$sld}" /> <select name="tld[0]">

 

And Search for this

www. <input type="text" name="sld[1]" size="40" value="{$sld}" /> <select name="tld[1]">

Replace it with

<!—you name BOF: //-->
{include_php file='/usr/home/domains/public_html/whmcs/idn.php'}
<!—you name EOF: //-->
www. <input type="text" name="sld[1]" size="40" value="{$sld}" /> <select name="tld[1]">

 

In the file /templates/default/domainchecker.tpl

Search for this

</form>
{/if}
<p>{$LANG.domainintrotext}</p>
<form method="post" action="domainchecker.php">

Replace it with

</form>
{/if}
<!—you name BOF: //-->
{include_php file='/usr/home/domains/public_html/whmcs/idn.php'}
<!—you name EOF: //-->
<p>{$LANG.domainintrotext}</p>
<form method="post" action="domainchecker.php">

 

/usr/home/domains/public_html/whmcs/idn.php

<?php
$encoded = '';
$decoded = '';
$add = '';
require_once('idna_convert.class.php');
$IDN = new idna_convert();
if (isset($_REQUEST['encode'])) {
   $decoded = isset($_REQUEST['decoded']) ? stripslashes($_REQUEST['decoded']) : '';
   $encoded = $IDN->encode($decoded);
}
?>
<table width="85%" align="center" border="0" cellpadding="0" cellspacing="0">
  <tr>
   <td width="40%" align="left">Domæne navn med æøå</td>
<td width="10%"> </td>
   <td width="40%" align="right">Det er så det her du skal søge efter</td>
  </tr>

  <tr>
   <td width="40%" align="left">
    <form action="<?php echo $_SERVER['PHP_SELF']; ?>" method="post">
     <input type="text" name="decoded" value="<?php echo htmlentities($decoded, null, 'UTF-8'); ?>" size="20" maxlength="255" /></td>
   <td width="10%" align="center">
     <input type="submit" name="encode" value="Encode" /><?php echo $add; ?></td>
   <td width="40%" align="right">
     <input type="text" name="encoded" value="<?php echo htmlentities($encoded, null, 'UTF-8'); ?>" size="20" maxlength="255" /></td>
    </form>
  </tr>
</table>

 

Download idna_convert.class.php from

http://phlymail.com/download/Goodies/idna_convert_064.zip

 

Regards,

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