private function getSeo() { $ReadSeo = new WsPosts(); switch ($this->File) { case 'artigo': $Admin = isset($_SESSION['userlogin']['user_level']) && $_SESSION['userlogin']['user_level'] == 3 ? true : false; $Check = $Admin ? '' : 'post_status = 1 AND '; $ReadSeo->setPost_name($this->Link); $ReadSeo->Query("WHERE {$Check} #post_name#"); if (!$ReadSeo->getResult()) { $this->seoData = null; $this->seoTags = null; } else { extract((array) $ReadSeo->getResult()[0]); $this->seoData = (array) $ReadSeo->getResult()[0]; $this->Data = [$post_title . ' - ' . SITENAME, $post_content, HOME . "/artigo/{$post_name}", HOME . "/uploads/{$post_cover}"]; //post:: post_views $ReadSeo->setPost_id($post_id); $ReadSeo->setPost_views($post_views + 1); $ReadSeo->setPost_last_views(date('Y-m-d H:i:s')); $ReadSeo->update(); } break; case 'index': $this->Data = [SITENAME . ' - Seu Guia de empresas, eventos e baladas!', SITEDESC, HOME, INCLUDE_PATH . '/images/site.png']; break; default: $this->Data = ['404 Oppss, Nada encontrado!', SITEDESC, HOME . '/404', INCLUDE_PATH . '/images/site.png']; break; } if ($this->Data) { $this->setTags(); } }
</ul> </header> <h2>Sub categorias de vídeo aulas:</h2> <?php $ReadSes->setCategory_parent($category_id); $ReadSes->Query("WHERE #category_parent#"); if (!$ReadSes->getResult()) { } else { $a = 0; foreach ($ReadSes->getResult() as $sub) { $a++; $ReadCatPosts = new WsPosts(); $ReadCatPosts->setPost_category($sub->category_id); $ReadCatPosts->Query("WHERE #post_category#"); ?> <article<?php if ($a % 3 == 0) { echo ' class="right"'; } ?> > <h1><a target="_blank" href="../categoria/<?php echo $sub->category_name; ?> " title="Ver Categoria"><?php echo $sub->category_title; ?> </a> ( <?php echo $ReadCatPosts->getRowCount();
private function checkPosts() { $readPosts = new WsPosts(); $readPosts->setPost_category($this->CatId); $readPosts->Query("WHERE #post_category#"); if (isset($readPosts->getResult()[0])) { return false; } else { return true; } }
private function setName() { $Where = isset($this->Post) ? "post_id != {$this->Post} AND " : ""; $WsPosts = new WsPosts(); $WsPosts->setPost_title($this->Data['post_title']); $WsPosts->Query("WHERE {$Where} #post_title#"); if ($WsPosts->getResult()) { $this->Data['post_name'] = $this->Data['post_name'] . '-' . $WsPosts->getRowCount(); } }