Файл: modules/analiz/controllers/analiz.php
Строк: 92
<?defined('SYSPATH') or die('<b>403<br />Запрет доступа</b>');
class Analiz extends Controller
{
public function action_index()
{
$site = htmlspecialchars(strtolower($_GET['url']));
$site = str_replace("http://","",$site);
$site = str_replace("www.","",$site);
if(empty($site))Errors::__echo("Адрес не введён!");
if(preg_match('#^(.*)$#',$site))
{
$a = $this->DB->num_rows("`sites`","`url`='$site'");
if($a == 0)
{
$yandex = new SimpleXMLElement('http://bar-navig.yandex.ru/u?ver=2&show=32&url=http://'.$site, NULL, TRUE);
$alexa = new SimpleXMLElement('http://data.alexa.com/data?cli=10&dat=snbamz&url='.$site, NULL, TRUE);
if(isset($alexa->SD[1]->POPULARITY['TEXT']))
{
$alexaa = $alexa->SD[1]->POPULARITY['TEXT'];
}
else
{
$alexaa = 'no';
}
$seo = new Seo();
$res['url'] = $site;
$res['google_pr'] = pr($site);
$res['yandex_cy'] = $yandex->tcy['value'];
$res['yandex_rank'] = $yandex->tcy['rang'];
$res['alexa'] = $alexaa;
$res['google_index'] = $seo->google_index($site);
$res['yandex_index'] = $seo->Yandex_Index($site);
$res['bing_index'] = getBing($site);
$res['yahoo_index'] = getYahoo($site);
$res['google_link'] = $seo->google_links($site);
$res['yandex_link'] = $seo->Yandex_Links($site);
$res['bing_link'] = getBingLink($site);
$res['yahoo_link'] = getYahooLink($site);
$res['rambler_link'] = getBackRambler($site);
$res['google_blog'] = $seo->google_blogs($site);
$res['yandex_cat'] = yaca($site);
$res['dmoz'] = getDmoz($site);
$res['time'] = time();
$res['number'] = 1;
$sites = getSite($site);
$res['keywords'] = $sites[0];
$res['description'] = $sites[1];
$this->DB->insert("`sites`","`url`,`keywords`,`description`,`google_pr`,`yandex_cy`,`yandex_rank`,`alexa`,`google_index`,`yandex_index`,`bing_index`,`yahoo_index`,`google_link`,`yandex_link`,`bing_link`,`yahoo_link`,`rambler_link`,`google_blog`,`yandex_cat`,`dmoz`,`number`,`time`","'$site','$res[keywords]','$res[description]',$res[google_pr],'$res[yandex_cy]','$res[yandex_rank]','$res[alexa]','$res[google_index]','$res[yandex_index]','$res[bing_index]','$res[yahoo_index]','$res[google_link]','$res[yandex_link]','$res[bing_link]','$res[yahoo_link]','$res[rambler_link]','$res[google_blog]','$res[yandex_cat]','$res[dmoz]','$res[number]','$res[time]'");
}
else
{
$res = $this->DB->assoc("`sites`","`url`='$site'");
}
$this->view->display("Анализ сайта ".$site,$res,'analiz');
}
else
{
Errors::__echo("Адрес введён не верно!");
}
}
}