Вход Регистрация
Файл: wapxl.ru/addssites.php
Строк: 127
<?php
require 'shaxty.php';


$align 'left';
$title 'Каталог мобильных сайтов, белый каталог | Добавление сайта в каталог';
include_once (
'shaxty/head.php');
if(
core::$user['level']<9)func::errors('<b>Доступ закрыт</b>');

echo 
'<div class="content">';
if(!isset(
$_POST['site'])){





echo 
'<form method="post" action="?">';


echo 
'<b>Список сайтов к добалению:</b> <br /><textarea cols="50" rows="5" name="site"></textarea><dl></dl>';


    echo 
'<b>Версия сайта</b>:</b><br/>
    <div class="xl"> <input type="radio" name="web" value="0" checked/>Для мобильных (WAP)</div>
    <div class="xl"> <input type="radio" name="web" value="1"/>Для ПК (WEB)</div><dl></dl>'
;

echo  
'<b>Выберите категории, к которым относится ваш сайт:</b>' . (isset($_SESSION['cat_err']) ? '<br /><span style="color:#DD0000">'.$_SESSION['cat_err'].'</span>' '') . '';

$k_post core:: $db -> querySingle("SELECT count(*) FROM `categorii`;");

if (
$k_post==0)echo 'Категорий нет<br />';


$r core:: $db -> query("SELECT * FROM `categorii`;");

$i=0;
echo 
'<div class="scr">';
while (
$raz$r -> fetch()) {

if ( !
preg_match("/[^0-9]/s", ($i/6)) )echo '<div  style="display: table-cell;padding: 10px;">';
$i++;                                            //checked
echo '<input style="padding: 2px;" type="checkbox"   value="'.$raz['id'].'" name="cat[]"/>'.$raz['name'].' <br />';

if ( !
preg_match("/[^0-9]/s", ($i/6)) )echo "</div>";

}
echo 
"</div>";


echo 
'    <input type="submit" value="Добавить сайты" />';
echo 
'</form>';
echo 
'</div>';
}else{

$cats .= '|';
// формируем список категорий сайтов
foreach ($_POST['cat'] as $v) {
$cats .= func::checkin(intval($v)).'|';
}


//for($is=0; $is<1; $is++){    //
//$file = file($_POST['site']);

$err '';
$ok 0;
$sitemap '';

//$total=count($file);

set_time_limit(0); // разграничиваем время работы скрипта

$record=split("rn"$_POST['site']);
$num=count($record);
for (
$i=0;$i<$num;$i++){


//preg_match('#<a  href="/go/([.]*|[^>]*).xhtml">([.]*|[^>]*)</a>#i',$file[$i0],$wapxl);

if($record[$i]!=''){

$url $record[$i];

$url str_replace("https://","",$url);
$url str_replace("http://","",$url);
$url str_replace("www.","",$url);





if (empty(
$url)){
$err[$i] = 'нет адреса';
}

if (!
preg_match('|^[0-9a-zA-Zа-яА-Я-.]+$|i'$url)){
$err[$i] = 'неверный адрес';
}



$mcore::$db -> queryFetch("SELECT * FROM `sites` WHERE `url`=?;", array($url));
if (
$m != 0) {
$err[$i] = 'сайт уже есть в каталоге';
}


if (
$err[$i] == '') {



$name getTitle($url);

if (
$name=='нет')$name $url;


    
$yandex = new SimpleXMLElement('http://bar-navig.yandex.ru/u?ver=2&show=32&url=http://'.$urlNULLTRUE);
        
$alexa = new SimpleXMLElement('http://data.alexa.com/data?cli=10&dat=snbamz&url='.$urlNULLTRUE);
        if(isset(
$alexa->SD[1]->POPULARITY['TEXT']))
        {
            
$alexaa $alexa->SD[1]->POPULARITY['TEXT'];
        }
        else
        {
            
$alexaa 'no';
        }
        
$seo = new Seo();

        
$res['url']             = $url;

        
$res['google_pr']         = pr($url);
        
$res['yandex_cy']         = $yandex->tcy['value'];
        
$res['yandex_rank']     = $yandex->tcy['rang'];
        
$res['alexa']             = $alexaa;
        
$res['google_index']     = $seo->google_index($url);
        
$res['yandex_index']     = $seo->Yandex_Index($url);
        
$res['bing_index']         = getBing($url);
        
$res['yahoo_index']     = getYahoo($url);
        
$res['google_link']     = $seo->google_links($url);
        
$res['yandex_link']     = $seo->Yandex_Links($url);
        
$res['bing_link']         = getBingLink($url);
        
$res['yahoo_link']         = getYahooLink($url);
        
$res['rambler_link']     = getBackRambler($url);
        
$res['google_blog']     = $seo->google_blogs($url);
        
$res['yandex_cat']         = yaca($url);
        
$res['dmoz']             = getDmoz($url);
        
$res['time']             = time();
        
$res['number']             = 1;
        
$sites                    getSite($url);
        
$res['keywords']         = $sites[0];
        
$res['description']     = $sites[1];

$key $sites[0];
$abaut $sites[1];

$web func::checkin($_POST['web']);






 
$dbi core::$db -> prepare("INSERT INTO `sites` SET `web`=?, `url`=?, `name`=?, `title`=?, `abaut`=?, `key`=?, `description`=?, `keywords`=?, `time_add`=?,`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`=?,`cat`=?,`user_id`=?");

$dbi -> execute($web,$url,$name,getTitle($url),$abaut,$key,$sites[1],$sites[0],core::$realtime,$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'],core::$realtime,$cats,0);

$timesp=date("Y-m-j"core::$realtime);
$timesp2=date("H:i:s"core::$realtime);
    
//<lastmod>'.$timesp.'T'.$timesp2.'+01:00</lastmod>
$sitemap .= '<url>
    <loc>http://wapxl.ru/cat/'
.$url.'</loc>
    <changefreq>weekly</changefreq>
    <priority>1.0</priority>
</url>'
;



$ok++;

$wer .= $ok.' -<b> '.$url.'</b> - OK<br />';



}else{
$ok++; $wer .= $ok.' - <b>'.$url.'</b> - '.$err[$i].'<br />';
}







}

//sleep(1);
}

if(
$sitemap!=''){
// открываем карту
$file H.'sitemap.xml';
$fil file($file);

$timesp=date("Y-m-j"$time);
$timesp2=date("H:i:s"$time);


$fil file($file);
$fp=fopen($file,"a+");
$total=count($fil);
if (!
$total){ $total=''; }
for (
$i=0$i<$total$i++){
if((
$total-2)==$i){
flock ($fp,LOCK_EX);
ftruncate($fp,0);
for(
$i=0$i<sizeof($fil); $i++){
if ((
$total-2)!=$i){

fputs($fp,$fil[$i]);
}else{

$bizname=$fil[$i]; fputs($fp,$bizname.$sitemap."rn");
}}
fflush ($fp); flock($fp,LOCK_UN);
fclose($fp);
}
}
}

echo 
$wer;


}


echo 
'</div>';
include_once (
'shaxty/foot.php');

?>
Онлайн: 0
Реклама