$titulo = str_replace("</title>", "", $titulo); $titulo = str_replace("<TITLE>", "", $titulo); $titulo = str_replace("</TITLE>", "", $titulo); $titulo = html_entity_decode($titulo); if (mb_detect_encoding($titulo, "UTF-8,ISO-8859-1") != "ISO-8859-1") { $titulo = utf8_decode($titulo); } //Coloca o conte�do da tag DESCRIPTION em uma vari�vel. Se n�o possuir, atribui o t�tulo $descricao = $tag['description'] == "" ? $titulo : $tag['description']; //Coloca o conte�do da tag KEYWORDS em uma vari�vel. Se n�o possuir, atribui o t�tulo $keyw = $tag['keywords'] == "" ? $pega : $tag['keywords']; //Insere o conte�do do site em banco de dados que ser� usado nas consultas no site $via->setAcao("insert"); $via->setTabela("tbl_site"); $via->setCampos("sit_titulo, sit_url, sit_metakey, sit_metades, sit_idioma"); $via->setValores("'{$titulo}','" . $sit['acr_url'] . "','{$keyw}','{$descricao}','" . $_SERVER['HTTP_ACCEPT_LANGUAGE'] . "'"); $via->executa(); //Atualiza a tabela ACRE para mostrar que os sites j� foram indexados $via->setAcao("update"); $via->setTabela("tbl_acre"); $via->setValores("acr_indexado = 's'"); $via->setCdg("acr_codigo = " . $sit['acr_codigo'] . ""); $via->executa(); } else { //Se o site der header diferente de 200, � exclu�do da base de dados $via->setAcao("delete"); $via->setTabela("tbl_acre"); $via->setCdg("acr_codigo = " . $sit['acr_codigo'] . ""); $via->executa(); } } else {
$link = $tag->getAttribute('href'); if ($link != "") { echo $link . "<br>"; } $ver = substr_count($link, "http://"); $ver += substr_count($link, "https://"); if ($ver >= 1) { $head = get_headers($link); $header = substr_count($head[0], "200"); if ($header >= 1) { $check = $via->totalRegistros("SELECT * FROM tbl_acre WHERE acr_url = '{$href}'"); if ($check <= 0 && $link != "") { $via->setAcao("insert"); $via->setTabela("tbl_acre"); $via->setCampos("acr_url"); $via->setValores("'{$link}'"); $via->executa(); } else { $via->setAcao("delete"); $via->setTabela("tbl_acre"); $via->setCdg("acr_codigo = '{$sit['acr_codigo']}'"); $via->executa(); } } else { $via->setAcao("delete"); $via->setTabela("tbl_acre"); $via->setCdg("acr_codigo = '{$sit['acr_codigo']}'"); $via->executa(); } } }
digita diretamente no site. Sistema desenvolvido por Noedir C. Filho http://www.constantweb.com.br - 2010 **************************************************/ session_start(); include_once "classes/conecta.class.php"; $via = new mysqlConn(); if ($_POST['manda'] == "sim") { $sql = "SELECT * FROM tbl_site WHERE sit_url = '{$_POST['url']}'"; $nbus = $via->totalRegistros($sql); if ($nbus < 1) { $via->setAcao("insert"); $via->setTabela("tbl_acre"); $via->setCampos("acr_url"); $via->setValores("'" . $_POST['url'] . "'"); $via->executa(); echo '<script type="text/javascript"> alert("Dados cadastrados com sucesso.\\r\\n\\r\\nSerão indexados em até 24 horas."); location.href="index.php"; </script>'; } else { echo '<script type="text/javascript"> alert("Esse site já está cadastrado no sistema.\\r\\n\\r\\nExperimente inserir um diretório."); location.href="acrescenta.php"; </script>'; } } ?> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml">
</form></td> </tr> </table> <? if($_GET['bus'] == "sim" and $_GET['qy'] != ""){?> <? if($nbus >= 1){ ?> <table width="100%" border="0" cellspacing="0" cellpadding="4"> <tr> <td bgcolor="#DDEBFF" class="mn_resultado">Encontrado <strong><?php echo $nbus; ?></strong> ocorrências para <strong><?php echo $_GET['qy']; ?></strong></td> </tr> <tr> <td> </td> </tr> <?php while($res = $qr->fetch(PDO::FETCH_ASSOC)){ $via->setAcao("update"); $via->setTabela("tbl_site"); $via->setValores("sit_relevancia = sit_relevancia + 1"); $via->setCdg("sit_codigo = '".$res['sit_codigo']."'"); $via->executa(); ?> <tr> <td><a href="<?php echo $res['sit_url']; ?>" class="tit_link"><?php echo utf8_encode($res['sit_titulo']); ?></a></td> </tr> <tr> <td><?php echo utf8_encode($res['sit_metades']); ?></td> </tr> <tr> <td><strong class="res_link"><?php echo $res['sit_url']; ?></strong></td> </tr> <tr> <td> </td>