Hello there! Welcome to Youjoomla Support Forums

We are Web Development Company specializing in Joomla Templates , Joomla Extensions and WordPress Themes development . You are not able to see some forum threads due to your memberhip level. To unlock all forums and special customer support please take few moments to signup . If you are just searching for free joomla templates , or free joomla extension support simply head to our Free Joomla Support forums and open a new thread. Our moderators will help you as soon as possible. To spead up the response time please take few seconds and go over forum rules

Have fun!

[ACTUALLY SOLVED] .au or watever you like :)

02-24-2010, 08:56 PM
# 1 (permalink)
itsimple
ok, so change the serverList array so each one looks like this:

PHP Code:

$this->serverList[0]['top']      = 'com.au'//this is the front end name
    
$this->serverList[0]['first']     = 'com';  //this is the first part of the TLD

$this->serverList[0]['second']     = 'au'//this is the second part of the TLD

$this->serverList[0]['server']   = 'whois.ausregistry.net.au';

$this->serverList[0]['response'] = 'No Data Found';

$this->serverList[0]['check']    = true
The extra fields are:

PHP Code:

$this->serverList[0]['first']     = 'com';  //this is the first part of the TLD

$this->serverList[0]['second']     = 'au'//this is the second part of the TLD 
if it is just a .com name you still need to add these, but you can leave 'second' empty

PHP Code:

$this->serverList[0]['first']     = 'com';  //this is the first part of the TLD

$this->serverList[0]['second']     = ''//this is the second part of the TLD 
no i can't remember exactly what lines i changed and where i added stuff so just replace the rest of the code under the serverList array (after "function showHeader(){" but before the close php tag "?>" with the following:

PHP Code:

function getCurrentURL_whois(){

$cururl_whois = JRequest::getURI();

if(($pos = strpos($cururl_whois, "index.php"))!== false){

$cururl_whois = substr($cururl_whois,$pos);

}

$cururl_whois = JRoute::_($cururl_whois);

return $cururl_whois;

}

       

       

       ?>

<!--[if IE 6]>

<style type="text/css">

.option{

padding-right:2px;

}

</style>

<![endif]-->

<!--[if IE 7]>

<style type="text/css">

.option{

padding-right:6px;

}

</style>

<![endif]-->



<?php

}



function 
showWhoisForm($params){

            
$defaultMessage=$params->get('defaultMessage');

            
$document JFactory::getDocument();

            
$document->addStyleSheet(JURI::base() . 'modules/mod_yj_whois/stylesheet.css');

            
$document->addScript(JURI::base() . 'modules/mod_yj_whois/js/checkboxes.js');

            
$document->addScriptDeclaration("window.addEvent('domready', function(){

                new AjaxWhois({

                    formId: 'yj_whois',

                    domain: 'domain',

                    defaultMessage: '
$defaultMessage',

                    labels: '.option',

                    checkboxes: '.check',

                    errors: 'responses'

                });

            })"
);            

?>

            

            <form action="<?php echo getCurrentURL_whois(); ?>" method="post" id="yj_whois">

                <div id="domain_check"><input name="domain" type="text" id="domain" /></div> 

                <div id="checkboxes">

                    <?php

                        $i 
0;

                        foreach (
$this->serverList as $value) {

                            if(!
$params->get($value['top'],1)) continue;
                            if(!
$params->get($value['first'],1)) continue;
                            if(!
$params->get($value['second'],1)) continue;
                            
                            if (
$value['check'] == true$checked='checked="checked"';

                            else 
$checked '';

                            

                            if(
strlen($value['second'])<1){
                                
$domainstring $value['first'];
                            }else{
                                
$domainstring $value['first'].".".$value['second'];
                            }
                            
                            

                            echo 
'<div class="option check">';

                            echo 
'<div class="check"><input type="checkbox" name="top_'.$domainstring.'" '.$checked.'/></div>.'.$value['top'].'';

                            echo 
'</div>';

                            
$i++;                    

                            

                            if (
$i 6) {

                                
$i 0;

                            }

                        }

                        

                    
?>

                </div>    

                <div id="responses"></div>

                <input type="hidden" name="submitBtn" value="1" />            

            </form>

            

<?php

}



function 
showFooter(){

?>

        



<?php



}



function 
processWhois($params){



//$site_logo=$params->get('site_logo');

//$popbox_bg=$params->get('popbox_bg');

    
$this->showHeader();



    if (!isset(
$_POST['submitBtn'])){

        
$this->showWhoisForm($params);

    } else {



         
$domainName = (isset($_POST['domain'])) ? htmlspecialchars(strip_tags($_POST['domain'])) : '';
        

           for (
$i 0$i sizeof($this->serverList); $i++) {
        
                            if(
strlen($this->serverList[$i]['second'])<1){
                                
$dot='';
                            }else{
                                
$dot='_';
                            }


               
$actTop "top_".$this->serverList[$i]['first'].$dot.$this->serverList[$i]['second'];

               
$this->serverList[$i]['check'] = isset($_POST[$actTop]) ? true false;

           }



        
// Check domains only if the base name is big enough

        
if (strlen($domainName)>2){

            

            echo 
'<div class="dtable">';

            echo 
'<div class="dtable_in">';

         

        

               for (
$i 0$i sizeof($this->serverList); $i++) {

                   if (
$this->serverList[$i]['check']){
                
                            if(
strlen($this->serverList[$i]['second'])<1){
                     
$this->showDomainResult($params,$domainName.".".$this->serverList[$i]['first'],
                                             
$this->serverList[$i]['server'],

                                             
$this->serverList[$i]['response']);
                            }else{
                     
$this->showDomainResult($params,$domainName.".".$this->serverList[$i]['first'].".".$this->serverList[$i]['second'],
                                             
$this->serverList[$i]['server'],

                                             
$this->serverList[$i]['response']);
                            }



                }

            }


            echo 
'</div>';

            echo 
'</div>';

            

            if( 
$_GET['ajax_submit'] ) exit();

        }

        
$this->showWhoisForm($params);

        

    }

    
$this->showFooter();



}



function 
showDomainResult($params,$domain,$server,$findText){

    
$your_link=$params->get('your_link','lunarpages.com/id/youjoomla');

    

    

    if (
$this->tr == 0){

        
$this->tr 1;

        
$class " class='tr2'";

    

    } else {

        
$this->tr 0;

        
$class "";

    

    }

    if (
$this->checkDomain($domain,$server,$findText))

    {    

        
//$register = 'voxdomains.com';

        
echo "<div class='dom_result_av'>$domain &nbsp; IS AVAILABLE:<a class='yjwh_available' title='Register http://www.$domain' href ='http://www.$your_link' target='_blank'>Click here to Register</a></div>";

    }

        else echo  
"<div class='dom_result_ta'>Sorry but $domain &nbsp; IS TAKEN:<a class='yjwh_taken' title='Visit http://www.$domain' href ='http://www.$domain' target='_blank'>Visit</a></div>";
        
        

}









function 
checkDomain($domain,$server,$findText){

    
$con fsockopen($server43);

    if (!
$con) return false;

        

    
// Send the requested doman name

    
fputs($con$domain."\r\n");

        

    
// Read and store the server response

    
$response ' :';

    while(!
feof($con)) {

        
$response .= fgets($con,128); 

    }

        

    
// Close the connection

    
fclose($con);

        

    
// Check the response stream whether the domain is available

    
if (strpos($response$findText)){

        return 
true;

    }

    else {

        return 
false;   

    }

}



}

?>

<?php

    $whois 
= new maxWhois();

    
$whois->processWhois($params);

?>
I hope it works for you as it has for me.

If YouJoomla want to use this in an update of the module, can you please include this in your commented out section at the top:

PHP Code:

|| #################################################################### ||

|| # Edited by Chris Asher to enable country specific domain names #    ||

|| # Chris would like to give a shout out to www.itsimple.com.au #      ||

|| #################################################################### || 

Thanks Guys, let me know how it goes for ya as testing has only been done on .com.au and .net.au domains.

oh, and you can find your domain server listed here:
Whois Server list

just make a query for a taken domain to see what the response text is.
Thread Tools
Display Modes

Powered by vBulletin®
Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.

Members Login

Username
Password