MRWhois"; // DO NOT CHANGE $backgcol = '#9AC0CD'; // general background color $fontacolor = 'green'; // color of an available domain $fontucolor = 'red'; // color when not available $infolinks = 'black'; // color of additional links $sepcolor = '#cccccc'; // separator color $stdcolor = 'black'; // header and footer font color $errcolor = 'red'; // color of error messages # End of variables, you do not need to change anything below this line. # Register / Order Link Configuration $_link = $_CCFG['WHOIS_LINK']; switch($_link) { case 0: # Do NOT add an [Order] or [Register] link $regurl = ''; $regtext = ''; break; case 1: /* Go to "orders" page, passing in domain name and setting "New Domain" to "Yes" If you want the customer to be able to click on an [Order] button for available domains. May need to edit $regurl. */ $regurl = 'mod.php?mod=orders&ord_referred_by=' . $_GPV[ord_referred_by]; $regtext = $_LANG['_WHOIS']['Link_Order']; break; case 2: /* Go to your affiliiate link to register the domain. This option will open a new browser window to the registrar, and the original browser window will remain on this page. May need to edit $regurl. */ $regurl = $_CCFG['WHOIS_AFFILIATE_LINK']; $regtext = $_LANG['_WHOIS']['Link_Register']; break; default: # Do NOT add an [Order] or [Register] link $regurl = ''; $regtext = ''; break; } # Do Database lookup of registrars $result= ""; $numrows = 0; # Set Query for select. $query = "SELECT * FROM ".$_DBCFG['whois']." WHERE whois_include=1 ORDER BY whois_display ASC"; # Do select and return check $result = db_query_execute($query); $numrows = db_query_numrows($result); # Process query results $xx=0; while(list($whois_id, $whois_server, $whois_nomatch, $whois_value, $whois_display, $whois_include, $whois_prod_id, $whois_notes) = db_fetch_row($result)) { $Lookup_Domain['server'][$xx] = $whois_server; // server to lookup for domain name $Lookup_Domain['nomatch'][$xx] = $whois_nomatch; // string returned by server if the domain is not found $Lookup_Domain['value'][$xx] = $whois_value; // string value for this domain extension (do not change) $Lookup_Domain['display'][$xx] = $whois_display; // string value for this domain to display on form $Lookup_Domain['include'][$xx] = $whois_include; // include this domain in lookup $Lookup_Domain['prod_id'][$xx] = $whois_prod_id; // over-ride product ordered with this id $xx++; // Increment counter } $Lookups = $xx; # This function displays an available domain ($what), adding [Order] or [Register] links if configured. function dispav($what, $prodid) { global $fontacolor, $infolinks, $regurl, $regtext, $_nl; $where = str_replace('%DOMAIN_NAME%', $what, $regurl); $_out .= ''.$_nl; $_out .= ''.$_nl; IF ($regurl <> '') { # Check if regurl is linked to phpCOIN orders page (if no, open new window) $theURL = strpos($regurl, 'mod.php'); # Set link IF ( $theURL === false ) { # Open a new browser window to the registrar. $_out .= ''; } ELSE { # Send current browser window to order form, passing in domain name. $_out .= ''; } $_out .= ''.$regtext.''.$_nl; } ELSE { $_out .= ' '; } $_out .= ''.$_nl; $_out .= ''.$what.''.$_nl; $_out .= ' '.$_nl; $_out .= ''.$_nl; return $_out; } # Function to display an unavailable domain ($what) via server ($where), with [details] and [goto] links function dispun($what, $where) { global $fontucolor, $infolinks, $_nl, $_LANG, $_CCFG; $where = str_replace('%DOMAIN_NAME%', $what, $where); $_out .= ' '.$_nl; $_out .= ''.$_nl; $_out .= ''.$what.''.$_nl; $_out .= ''.$_nl; IF (!$_CCFG['WHOIS_DETAILS_NEW']) { # Set to open details in current window $_out .= ''.$_LANG['_WHOIS']['Link_Details'].''.$_nl; } ELSE { # Set to open details in new window $_out .= ''; $_out .= ' '.$_LANG['_WHOIS']['Link_Details'].''.$_nl; } $_out .= ''.$_nl; $_out .= ''.$_LANG['_WHOIS']['Link_Goto'].''.$_nl; $_out .= ''.$_nl; return $_out; } # Function to display an error function disperror($text) { global $errcolor, $_nl; $_out .= '
'.$_nl; $_out .= ''.$text.''.$_nl; $_out .= '
'.$_nl; return $_out; } # Function to display main lookup form function main() { global $sepcolor, $stdcolor, $poweredby, $_nl, $_sp, $_LANG, $_CCFG, $_GPV; global $Lookups, $Lookup_Domain; IF ($_GPV[type]=='') {$_GPV[type]='com';} $_out .= '
'.$_nl; $_out .= '
'.$_nl; $_out .= ''.$_nl; $_out .= ''.$_nl; $_out .= ''.$_nl; $_out .= ''.$_nl; $_out .= ''.$_nl.''.$_nl.''.$_nl; $_out .= ''.$_nl.''.$_nl; $_out .= ''.$_nl; $_out .= ''.$_nl; $_out .= ''.$_nl; $_out .= ''.$_nl; $_out .= ''.$_nl.''.$_nl.''.$_nl; $_out .= ''.$_nl; $_out .= ''.$_nl.''.$_nl.''.$_nl; $_out .= '
'.$_nl; IF ($_CCFG['WHOIS_INSTRUCTIONS_SHORT']) { $_out .= $_LANG['_WHOIS']['Text_Instructions_Short'].$_nl; } ELSE { $_out .= $_LANG['_WHOIS']['Text_Instructions_Long'].$_nl; } $_out .= '
'.$_sp.'
'.$_LANG['_WHOIS']['Title_Domain'].$_sp.''.$_sp.$_LANG['_WHOIS']['Title_Extension'].'
'.$_nl; $_out .= ''.$_nl; $_out .= ''.$_nl; $_out .= ''.$_nl; $_out .= ' '.$_nl; $_out .= ''.$_nl; IF ($_CCFG['WHOIS_EXT_LIST']) { # Build extensions as select list $_out .= $_sp.$_sp.''.$_nl; } ELSE { # Build extensions as radio buttons list $_out .= '

'.$_nl; # Loop through for domains list FOR ($i=0; $i <= $Lookups; $i++) { IF ($Lookup_Domain['include'][$i] == true) { $_cnt++; $_out .= ''; $_out .= ' '.$Lookup_Domain['display'][$i].'
'.$_nl; } } IF ($_cnt > 0) { $_cnt = 0; $_out .= ' '.$_LANG['_WHOIS']['Option_All_Domains'].'
'; } $_out .= '

'.$_nl; } // showlist $_out .= '
'.$_sp.'
'.$_sp.'
'.$_nl; $_out .= '
'.$_nl; $_out .= '
'.$_nl; return $_out; } function dispdi($what) { global $fontucolor, $infolinks, $_nl, $sp, $_LANG, $_CCFG; $_out .= ' '.$_nl; $_out .= ''.$_nl; $_out .= ''.$what.''.$_nl; $_out .= ''.'Unable to check: allow_url_fopen is disabled'.''.$_nl; $_out .= ''.$_nl; return $_out; } ############################# ##### End Functions ##### ############################# # Output main form except for details IF ($_GPV[action] != 'details') {$_out .= main();} # Continue if displaying results IF ($_GPV[action] == 'details' && !$_CCFG['WHOIS_DETAILS_NEW']) { IF (strpos('whois.co.za', $_GPV['server']) === TRUE) { $whois = str_replace('%DOMAIN_NAME%', $domname, $_GPV['server']); $lines = file('http://'.$whois); // $lines = file('http://'.$_GPV['server']); foreach ($lines as $line_num => $line) {$_out .= $line;} } ELSE { $_out .= '
'.$_nl; $_out .= '
'.$_nl; $_out .= '

'.$_nl; $fp = fsockopen($_GPV['server'],43); fputs($fp, "$_GPV[ord_domain]\r\n"); while(!feof($fp)) {$_out .= fgets($fp,128).'
'.$_nl;} fclose($fp); $_out .= '

'.$_nl; $_out .= '
'.$_nl; } } # Continue if checking domain IF ($_GPV[action] == 'checkdom') { // Check the name for bad characters IF (strlen($_GPV[ord_domain]) < 3) { $err = 1; $msg = $_LANG['_WHOIS']['Error_Too_Short']; $_out .= disperror($msg); } IF (strlen($_GPV[ord_domain]) > 63) { $err = 1; $msg = $_LANG['_WHOIS']['Error_Too_Long']; $_out .= disperror($msg); } IF (ereg("^-|-$",$_GPV[ord_domain])) { $err = 1; $msg = $_LANG['_WHOIS']['Error_Hyphens']; $_out .= disperror($msg); } IF (!$err) { IF (!ereg("([a-z]|[A-Z]|[0-9]|-){".strlen($_GPV[ord_domain])."}",$_GPV[ord_domain])) { $err = 1; $msg = $_LANG['_WHOIS']['Error_AlphaNum']; $_out .= disperror($msg); } } IF ($err) {$_out = '
'.$_out.$_nl;} IF (!$err) { # $_out .= '
'.$_nl; $_out .= '
'.$_nl; $_out .= ''.$_nl; $_out .= ''.$_nl; $_out .= ''.$_nl; $_out .= ''.$_nl; $_out .= ''.$_nl; $_out .= ''.$_nl; $_out .= ''.$_nl; $_out .= ''.$_nl; FOR ( $x=0; $x < $Lookups; $x++ ) { IF ((($_GPV[type] == "all") || ($_GPV[type] == $Lookup_Domain['value'][$x])) && $Lookup_Domain['include'][$x]) { # Custom to get multiple lookups from one item IF ($Lookup_Domain['value'][$x] == 'com' && $Lookup_Domain['display'][$x] == '.com .net') { $dom_array = array($_GPV[ord_domain].'.com', $_GPV[ord_domain].'.net'); } ELSEIF ($Lookup_Domain['value'][$x] == 'uk' && $Lookup_Domain['display'][$x] == '.co.uk .org.uk .me.uk') { $dom_array = array($_GPV[ord_domain].'.co.uk', $_GPV[ord_domain].'.org.uk', $_GPV[ord_domain].'.me.uk'); } ELSEIF ($Lookup_Domain['value'][$x] == 'pl' && $Lookup_Domain['display'][$x] == '.pl .com.pl') { $dom_array = array($_GPV[ord_domain].'.pl', $_GPV[ord_domain].'.com.pl'); } ELSE { $dom_array = array($_GPV[ord_domain].'.'.$Lookup_Domain['value'][$x]); } $dom_count = count($dom_array); $i=0; FOR ($i=0; $i < $dom_count; $i++) { $domname = $dom_array[$i]; $result = ''; # Some Registrars now insert domain name into return $Lookup_Domain['nomatch'][$x] = str_replace('%ORD_DOMAIN%', $domname, $Lookup_Domain['nomatch'][$x]); $Lookup_Domain['server'][$x] = str_replace('%ORD_DOMAIN%', $domname, $Lookup_Domain['server'][$x]); # Support .co.za IF ($Lookup_Domain['value'][$x] == 'co.za') { IF (!ini_get('allow_url_fopen')) { $result = 'disabled'; } ELSE { $lines = file('http://'.$Lookup_Domain['server'][$x]); foreach ($lines as $line_num => $line) {$result .= $line;} } # Support .mt } ELSEIF ($Lookup_Domain['value'][$x] == 'com.mt' || $Lookup_Domain['value'][$x] == 'net.mt' || $Lookup_Domain['value'][$x] == 'org.mt' ) { IF (!ini_get('allow_url_fopen')) { $result = 'disabled'; } ELSE { $lines = file('https://'.$Lookup_Domain['server'][$x]); foreach ($lines as $line_num => $line) {$result .= $line;} } # Normal WHOIS lookup } ELSE { $ns = fsockopen($Lookup_Domain['server'][$x], 43, $errno, $errstr, 10); fputs($ns,"$domname\r\n"); while(!feof($ns)) {$result .= fgets($ns,128);} fclose($ns); } $result = trim($result); # Some registrars now insert extra spaces and carriage returns into results $result = str_replace(' ', '', $result); $result = str_replace("\n", '', $result); $result = str_replace("\r", '', $result); $NoMatch = str_replace(' ', '', $Lookup_Domain['nomatch'][$x]); IF (eregi($NoMatch, $result) !== FALSE) { // Over-ride product_id ordered, if set in array above, // otherwise pass back ord_prod_id originally ordered. IF ($Lookup_Domain['prod_id'][$i]) { $prodid = $Lookup_Domain['prod_id'][$i]; } ELSE { $prodid = $_REQUEST[ord_prod_id]; } $_out .= dispav($domname,$prodid); } ELSEIF ($result == 'disabled') { $_out .= dispdi($domname); } ELSE { $_out .= dispun($domname,$Lookup_Domain['server'][$x]); } } $_out .= ''.$_nl; } } $_out .= '
'.$_nl; $_out .= ''.$_sp.''.$_nl; $_out .= ''.$_nl; $_out .= ''.$_LANG['_WHOIS']['Title_Available'].''.$_nl; $_out .= ''.$_nl; $_out .= ''.$_LANG['_WHOIS']['Title_Taken'].''.$_nl; $_out .= ''.$_nl; $_out .= ''.$_sp.''.$_nl; $_out .= ''.$_nl; $_out .= ''.$_sp.''.$_nl; $_out .= '
 
'.$_nl; $_out .= '
'.$_nl; } // error check # Hide ls layer if implemented. IF ($_WAIT) { $_js .= ''.$_nl; echo $_js; } } // action checkdomain # Call block it function $_tstr .= $_LANG['_WHOIS']['Text_Title']; $_cstr .= '
'.$_out.'

'.$_nl; $_cstr .= '
'.$poweredby.'

'.$_nl; $_mstr = do_nav_link(getenv("HTTP_REFERER"), $_TCFG['_IMG_RETURN_M'],$_TCFG['_IMG_RETURN_M_MO'],'',''); $_ret .= do_mod_block_it ($_tstr, $_cstr, '1', $_mstr, '1'); $_ret .= '
'.$_nl; echo $_ret; ?>