0) { $CategoriaAtual = mysql_fetch_array($QueryCategoriaAtual); $WhereSQL = "AND b.id_blog_categoria = $CategoriaAtual[id_blog_categoria]"; $OndeEstou = 'Blog '.$Categoria; $Config['title'] = $CategoriaAtual['descricao']; } if ($var2 == 'post'){ $idPost = explode('-',$var3); $QueryPostAtual = mysql_query("SELECT b.*, bc.descricao AS categoria, (SELECT COUNT(*) FROM blog_comentario bcc WHERE bcc.id_blog = b.id_blog AND bcc.status = 1) AS qtd_comentario FROM blog b JOIN blog_categoria bc ON (bc.id_blog_categoria = b.id_blog_categoria) WHERE b.status = 1 AND id_blog = $idPost[0] LIMIT 1") or die(mysql_error()); $PostAtual = mysql_fetch_array($QueryPostAtual); $Config['description'] = $PostAtual['descricao']; $Config['keywords'] = $PostAtual['keywords']; $Config['title'] = $PostAtual['titulo']; $OndeEstou = 'Blog '.$PostAtual['categoria'].' '.substr($PostAtual['titulo'],0,10).'...'; } else { if (preg_match('^[0-9]^', $var2)) $PagAtual = $var2; if (preg_match('^[0-9]^', $var1)) $PagAtual = $var1; if (!(isset($PagAtual))) $PagAtual = 1; $ItemPorPag = 3; //Configurar Quantidade de Itens por Pagina; $LimitInicial = ($PagAtual-1)*$ItemPorPag; $LimitSQL = ($PagAtual > 0) ? "LIMIT $LimitInicial,$ItemPorPag" : "LIMIT $ItemPorPag"; $QueryBlog = mysql_query("SELECT b.*, bc.descricao AS categoria, (SELECT COUNT(*) FROM blog_comentario bcc WHERE bcc.id_blog = b.id_blog AND bcc.status = 1) AS qtd_comentario FROM blog b JOIN blog_categoria bc ON (bc.id_blog_categoria = b.id_blog_categoria) WHERE b.status = 1 $WhereSQL $LimitSQL") or die(mysql_error()); $QueryCount = mysql_query("SELECT COUNT(*) FROM blog b WHERE b.status = 1 $WhereSQL") or die (mysql_error()); $ContPag = mysql_fetch_array($QueryCount); $ContPag = $ContPag[0]; } ?>

Blog

Categorias

Post Populares