<?PHP
/*
=====================================================
 DataLife Engine v9.3 - by DLE Farsi Group 
-----------------------------------------------------
 http://datalifeengine.ir/
-----------------------------------------------------
 Copyright (c) 2006,2011 DLE Farsi Group
=====================================================
*/

@error_reporting(7);
@ini_set('display_errors', true);
@ini_set('html_errors', false);

define('DATALIFEENGINE', true);
define('ROOT_DIR', '../..');
define('ENGINE_DIR', '..');

include ENGINE_DIR.'/data/config.php';

require_once ROOT_DIR.'/language/'.$config['langs'].'/adminpanel.lng';

$config['charset'] = ($lang['charset'] != '') ? $lang['charset'] : $config['charset'];

require_once ENGINE_DIR.'/inc/include/functions.inc.php';


@header("HTTP/1.0 200 OK");
@header("HTTP/1.1 200 OK");
@header("Cache-Control: no-cache, must-revalidate, max-age=0");
@header("Expires: 0");
@header("Pragma: no-cache");
@header("Content-type: text/css; charset=".$config['charset']);

$idsea = $_REQUEST['idsea'];

function getCI($idsea) {
$ci_url = "http://bar-navig.yandex.ru/u?ver=2&show=32&url=http://{$idsea}/";
        $ci_data = @implode("", file("$ci_url"));
        preg_match("/value=\"(.\d*)\"/", $ci_data, $ci);
if ($ci[1] == "")
        return "no"; 
        else
        return $ci[1];
    }
function getPR($idsea) {
    	
        $pr_url = "http://bar-navig.yandex.ru/u?ver=2&show=32&url=http://{$idsea}/";
        $pr_data = @implode("", file("$pr_url"));
        preg_match("/rang=\"(.\d*)\"/", $pr_data, $pr);

        if ($pr[1] == "")
        return "no"; 
        else
        return $pr[1];
    }
    
$seo_tyc   = getCI($idsea);
$seo_pr   = getPR($idsea);
if ($seo_pr && $seo_tyc == "no")
echo "شما به اينترنت متصل نيستيد."; else
echo <<<HTML
Google Page Rank: <b>{$seo_pr}</b><br>Yandex: <b>{$seo_tyc}</b>
HTML;
?>
