/** * Test setting meta title and description */ public function testMetaSetGet() { SEO::init(); $title = 'Meta Title'; SEO::setTitle($title); $this->assertEquals($title, SEO::getTitle()); $description = 'Meta Description'; SEO::setDescription($description); $this->assertEquals($description, SEO::getDescription()); }
<?php include '../../config.php'; include ROOT . 'model/Noticia.php'; include ROOT . 'model/SEO.php'; $filtro_noticia = isset($_POST['filtro_busca']) ? $_POST['filtro_busca'] : ''; $Noticia = new Noticia(); $noticias = $Noticia->lista_noticias($filtro_noticia, ' LIMIT 5'); $SEO = new SEO(); $SEO->setTitle('Notícias de Mogi das Cruzes e região - SP - Diretório Mogi '); $SEO->setDescription('As melhores e mais importantes notícias sobre Mogi das Cruzes e região, fique por dentro dos Esportes, Eventos, Baladas, Restaurantes, teatro e muito mais.'); $total_pages = 10; include ROOT . 'view/noticia/noticias.php';
if (is_numeric($noticia_cdg) || $noticia_url != '-1') { //carregar classes $Noticia = new Noticia($noticia_cdg, $noticia_url); //echo $Noticia->noticia_cdg; $Curtida = new Curtida(-1, $Noticia->noticia_cdg, 1); $Comentario = new Comentario($Noticia->noticia_cdg); $SEO = new SEO(); $Ranking = new Ranking(); //carregar colecoes $Noticia->adicionar_view(); $comentarios = $Comentario->lista_comentarios_noticia($Noticia->noticia_cdg); $ranking = $Ranking->lista_ranking_usuarios(); $noticias_relacionadas = $Noticia->lista_noticias_relacionadas($Noticia->tags, 5); //carregar textos para SEO $SEO->setTitle($Noticia->titulo . ' - Notícias Diretório Mogi '); $SEO->setDescription($Noticia->resumo); // ta indo 200 letras $SEO->setUrl('http://' . $_SERVER['SERVER_NAME'] . $_SERVER['REQUEST_URI']); if (trim($Noticia->imagem) != '') { $SEO->setImage($Noticia->imagem); } //css botoes sociais $posicao_botoes = 'centro'; $identificador = 'noticia'; //imagem principal da noticia $imagem_caminho_completo = $Noticia->montar_link_imagem(); } //se nao teve parametros, ou nao conseguiu carregar a noticia $erro = $noticia_cdg == '-1' && $noticia_url == '-1' || !isset($Noticia); if ($erro) { $SEO = new SEO();
//filtro de bairro $filtro_bairro = isset($_GET['b']) ? $_GET['b'] : -1; //filtro de paavra chave $filtro_busca = isset($_POST['filtro_busca']) ? trim($_POST['filtro_busca']) : ''; if ($filtro_busca == '-1') { $filtro_busca = ''; } //no index usar parametros padroes de SEO $SEO = new SEO(); if ($filtro_categoria != -1 || $filtro_categoria_url != '-1') { if ($filtro_categoria_url != '-1') { $categoria_nome = $Cat->getCategoriaNome($Cat->getCategoriaCDG($filtro_categoria_url)); } else { $categoria_nome = $Cat->getCategoriaNome($filtro_categoria); } $SEO->setDescription(' Encontre ' . $categoria_nome . ' em Mogi das Cruzes, veja endereços, contatos, telefones, dicas e avaliações.'); } include ROOT . 'view/head.php'; ?> <script type="text/javascript" src="<?php echo ROOT_URL; ?> view/js/infobox.js" defer></script> <script src="https://apis.google.com/js/platform.js" async="defer"></script> <title><?php echo $SEO->getTitle(); ?> </title>
$item_url = isset($_GET['url']) ? $_GET['url'] : '-1'; $item_url = $item_url == '' ? '-1' : $item_url; if (is_numeric($item_cdg) || $item_url != '-1') { //carregar classes $Comentario = new Comentario(); $Item = new Item($item_cdg, $item_url); //criar item antes da curtida para ter o item_Cdg atualizado $Curtida = new Curtida($Item->item_cdg, -1, 1); $SEO = new SEO(); //carregar colecoes $comentarios = $Comentario->lista_comentarios_item($Item->item_cdg); $total_comentarios = $Comentario->total_atual; $Item->adicionar_contador(); //carregar textos para SEO $SEO->setTitle($Item->nome . ' em Mogi das Cruzes - Diretório Mogi '); $SEO->setDescription('Saiba como chegar em ' . $Item->nome . ' em Mogi das Cruzes, veja o contato, endereço e rotas. Encontre tudo sobre ' . $Item->categoria_nome . '.'); if (trim($Item->imagem) != '') { $SEO->setImage($Item->imagem); } $posicao_botoes = ''; //css botoes sociais $identificador = 'item'; } //se nao teve parametros, ou nao conseguiu carregar o Item $erro = $item_cdg == '-1' && $item_url == '-1' || !isset($Item); if ($Item->carregado && !$erro) { require ROOT . 'view/item/item.php'; } else { $SEO = new SEO(); require ROOT . 'view/item/item-nao-encontrado.php'; }
Route::any('/xml', function () { \Excel::create('Laravel Excel', function ($excel) { $excel->sheet('Excel sheet', function ($sheet) { $sheet->setOrientation('landscape'); }); })->export('xls'); return 'sdf'; }); Route::get('/', ['as' => 'home', function () { SEO::setTitle(config('page.home.title')); SEO::setDescription(config('page.home.description')); return view('page.home'); }]); Route::get('/contact', ['as' => 'contact', function () { SEO::setTitle(config('page.contact.title')); SEO::setDescription(config('page.contact.description')); return view('page.contact'); }]); /* |--------------------------------- | Form |--------------------------------- */ Route::controller('form/message', '\\App\\Http\\Controllers\\Form\\MessageController', ['getIndex' => 'form.message']); /* |--------------------------------- | LaraBox Route |--------------------------------- */ LaraBox::route('blog'); LaraBox::route('market');
<?php SEO::setTitle('Home'); SEO::setDescription('Home page description'); ?> @extends('layouts.master') @section('content') <h1>Page heading</h1> <p>Some content goes here</p> @endsection
<?php include '../../config.php'; include ROOT . 'model/SEO.php'; $SEO = new SEO(); $SEO->setTitle('Horários do trem Expresso Leste Mogi das Cruzes - Luz'); $SEO->setDescription('Confira os horários do Expresso Leste Mogi das Cruzes - Luz. Veja o funcionamento e status online do metro e trem e formas de contatos'); include ROOT . 'view/pagina/horarios-trem-expresso-leste.php';