Ejemplo n.º 1
0
 /**
  * Check all the tld domain extensions
  * 
  * @param string $name
  * @param array $exluded (exclude a tld extension)
  */
 private function chktlds($name, $exluded = "")
 {
     $result = array();
     $currency = Shineisp_Registry::getInstance()->Zend_Currency;
     $translator = Shineisp_Registry::getInstance()->Zend_Translate;
     $tlds = DomainsTlds::getAll();
     foreach ($tlds as $tld) {
         if (!in_array($tld['tld_id'], $exluded)) {
             $available = Domains::check_availability($name, $tld['tld_id']);
             // Create the domain name
             $domain = $name . "." . $tld['DomainsTldsData'][0]['name'];
             // Domain Price
             $price = $available ? $tld['registration_price'] : $tld['transfer_price'];
             $taxpercent = $tld['Taxes']['percentage'];
             // Format the price number
             $strprice = $currency->toCurrency($price * ($taxpercent + 100) / 100, array('currency' => Settings::findbyParam('currency')));
             // Create the message
             $mex = $available ? $translator->translate('The domain is available for registration') : $translator->translate("The domain is unavailable for registration, but if you are the domain owner, you can transfer it!");
             $result[] = array('available' => $available, 'name' => $name, 'tld' => $tld['tld_id'], 'price' => $strprice, 'domain' => $domain, 'mex' => $mex);
         }
     }
     return $result;
 }