//Tags $tags = array(); if (count($_POST["tags"]) > 0) { $tags = explode(",", $_POST["tags"]); } $newTags = array(); if (count($_POST["newTags"]) > 0 && !empty($_POST["newTags"])) { $newTags = explode(",", $_POST["newTags"]); } if (!empty($newTags) && count($newTags) > 0) { foreach ($newTags as $newTag) { $arr = array("nome" => $newTag, "seo" => ""); $tags[] = TagController::insert($arr); } } $tagsPost = PostController::getAllPostTag($_POST['id'], "", ""); if (count($tagsPost) > 0) { foreach ($tagsPost as $tag) { $tagsPostList[] = $tag->IdTag; } $array = array(); foreach ($tags as $tag) { error_log($tag); if (!in_array($tag, $tagsPostList)) { $arr = array("idTag" => $tag, "idPost" => $_POST['id']); PostController::insertPostTag($arr); } } foreach ($tagsPostList as $tag) { error_log($tag); if (!in_array($tag, $tags)) {
<?php if (!AutenticaController::logado()) { header("Location: login"); exit; } include "helper/cabecalho.php"; $postCategorias = PostController::getAllPostCategoria($_GET['id'], "", ""); $arrayCategorias = array(); if (count($postCategorias) > 0) { foreach ($postCategorias as $postCategoria) { $arrayCategorias[] = $postCategoria->IdCategoria; } } $postTags = PostController::getAllPostTag($_GET['id'], "", ""); $arrayTags = array(); if (count($postTags) > 0) { foreach ($postTags as $postTag) { $arrayTags[] = $postTag->IdTag; } } ?> <div id="wrapper"> <?php include "helper/menu.php"; ?> <div id="page-wrapper">