Проверки занятости домена

Статус
В этой теме нельзя размещать новые ответы.

webscorp

Писатель
Регистрация
5 Июн 2009
Сообщения
6
Реакции
5
Друзья! Очень нужен модуль для joomla 1.5 для проверки занятости домена под зоны .ru .su
Пробовал редактировать такие модули как yj_whois и tp_whois, но безрезультатно!

Вот изменил немного модуль yj_whois под зоны .ru .su, но почему то пишет что любой домен занят вне зависимости свободен он или нет
<?php
/*======================================================================*\
|| #################################################################### ||
|| # Youjoomla LLC - YJ- Licence Number 1145CU597
|| # Licensed to - John Landry
|| # ---------------------------------------------------------------- # ||
|| Max's Whois Joomla Integration ||
|| # Copyright ©2006-2009 Youjoomla LLC. All Rights Reserved. ||
|| # This file may not be redistributed in whole or significant part. # ||
|| # ---------------- THIS IS NOT FREE SOFTWARE ---------------- # ||
|| # Для просмотра ссылки Войди или Зарегистрируйся | Для просмотра ссылки Войди или Зарегистрируйся # ||
|| #################################################################### ||
\*======================================================================*/

defined( '_JEXEC' ) or die( 'Direct Access to this location is not allowed.');


JHTML::_('behavior.modal');

class maxWhois{

var $serverList;
var $tr = 0;

function maxWhois(){
$this->serverList[0]['top'] = 'ru';
$this->serverList[0]['server'] = 'WHOIS.RIPN.NET';
$this->serverList[0]['response'] = 'NOT FOUND';
$this->serverList[0]['check'] = false;

$this->serverList[2]['top'] = 'su';
$this->serverList[2]['server'] = 'WHOIS.RIPN.NET';
$this->serverList[2]['response'] = 'NOT FOUND';
$this->serverList[2]['check'] = false;

$this->serverList[1]['top'] = 'net';
$this->serverList[1]['server'] = 'whois.crsnic.net';
$this->serverList[1]['response'] = 'No match for';
$this->serverList[1]['check'] = false;


$this->serverList[3]['top'] = 'info';
$this->serverList[3]['server'] = 'whois.afilias.net';
$this->serverList[3]['response'] = 'NOT FOUND';
$this->serverList[3]['check'] = false;

$this->serverList[4]['top'] = 'name';
$this->serverList[4]['server'] = 'whois.nic.name';
$this->serverList[4]['response'] = 'No match';
$this->serverList[4]['check'] = false;

$this->serverList[5]['top'] = 'us';
$this->serverList[5]['server'] = 'whois.nic.us';
$this->serverList[5]['response'] = 'Not found:';
$this->serverList[5]['check'] = false;

$this->serverList[6]['top'] = 'biz';
$this->serverList[6]['server'] = 'whois.nic.biz';
$this->serverList[6]['response'] = 'Not found';
$this->serverList[6]['check'] = false;

$this->serverList[7]['top'] = 'ca';
$this->serverList[7]['server'] = 'whois.cira.ca';
$this->serverList[7]['response'] = 'AVAIL';
$this->serverList[7]['check'] = false;

$this->serverList[8]['top'] = 'tv';
$this->serverList[8]['server'] = 'whois.internic.net';
$this->serverList[8]['response'] = 'No match for';
$this->serverList[8]['check'] = false;
}

function showHeader(){
?>




<?php
// -- figure out what URL to use for prefix
// -- Loop through existing prefix to get all of the variables

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 id="checkboxes"><?php
$i = 0;
foreach ($this->serverList as $value) {
if(!$params->get($value['top'],1)) continue;
if ($value['check'] == true) $checked='checked="checked"';
else $checked = '';

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

if ($i > 4) {
$i = 0;
}
}

?>
</div>
</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'])) ? $_POST['domain'] : '';

for ($i = 0; $i < sizeof($this->serverList); $i++) {
$actTop = "top_".$this->serverList[$i]['top'];
$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']){
$this->showDomainResult($params,$domainName.".".$this->serverList[$i]['top'],
$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; СВОБОДЕН:<a class='yjwh_available' title='Register http://www.$domain' href ='http://www.$your_link'>Click here to Register</a></div>";
}
else echo "<div class='dom_result_ta'>Извините, но данный домен $domain &nbsp;ЗАНЯТ:<a class='yjwh_taken' title='Visit http://www.$domain' href ='http://www.$domain'>Посетить</a></div>";
}




function checkDomain($domain,$server,$findText){
$con = fsockopen($server, 43);
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);
?>
 
для .ru достаточно добавить


PHP:
	$this->serverList[9]['top']      = 'ru';
	$this->serverList[9]['server']   = 'whois.ripn.net';
	$this->serverList[9]['response'] = 'No entries found for the selected source';
	$this->serverList[9]['check']    = false;

и будет все работать
 
Есть компонент:

Модуль от компонента mod_jhost_domainsearch проверяет занятость доменов...
 
Статус
В этой теме нельзя размещать новые ответы.
Назад
Сверху