Jump to content

brunonyyu

Campones
  • Content Count

    38
  • Joined

  • Last visited

  • xPoints

    0 [ Donate ]

1 Follower

About brunonyyu

Perfil

  • Gênero
    Masculino

Informações

  • Forma que conheci o xTibia
    Sites de Busca
  • Sou
    OT-Admin

Recent Profile Visitors

135 profile views
  1. Obrigado irmao, vou olhar uma outra api para usar e testar
  2. Olá, ao adicionar um video na pagina videos.php pelo painel do adm ele me volta o seguinte erro: Linha com erro $info = new SimpleXMLElement(file_get_contents("http://gdata.youtube.com/feeds/api/videos/$link")); Codigo da pagina <?php # Variaveis globais. $action = $_GET["action"]; $act = $_GET["act"]; $db = $SQL; $accessLevel = ($logged && $account_logged->getPageAccess() > 0) ? TRUE : FALSE; # Checa se as tabelas existem. $res = $db->query("SHOW TABLES"); if($res){ foreach($res as $tabela){ if($tabela[0] == "videos"){ $videos = TRUE; } if($tabela[0] == "videos_categorias"){ $videos_categorias = TRUE; } if($tabela[0] == "videos_comentarios"){ $videos_comentarios = TRUE; } } if(!$videos){ try{ $db->exec(" CREATE TABLE `videos` ( `id` int(11) NOT NULL AUTO_INCREMENT, `titulo` varchar(255) NOT NULL, `descricao` text NOT NULL, `categoria` int(11) NOT NULL, `link` varchar(11) NOT NULL, `ativo` int(1) NOT NULL DEFAULT '1', PRIMARY KEY (`id`) ) ENGINE=MyISAM DEFAULT CHARSET=latin1 "); } catch (PDOException $e){ $main_content = "Erro:<br />".$e->getMessage(); } } if(!$videos_categorias){ try{ $db->exec(" CREATE TABLE `videos_categorias` ( `id` int(11) NOT NULL AUTO_INCREMENT, `nome` varchar(255) NOT NULL, PRIMARY KEY (`id`) ) ENGINE=MyISAM DEFAULT CHARSET=latin1 "); } catch (PDOException $e){ $main_content = "Erro:<br />".$e->getMessage(); } } if(!$videos_comentarios){ try{ $db->exec(" CREATE TABLE `videos_comentarios` ( `id` int(11) NOT NULL AUTO_INCREMENT, `mensagem` text NOT NULL, `character` varchar(255) NOT NULL, `ip` varchar(15) NOT NULL, `topico` int(11) NOT NULL, `data` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP, `ativo` int(1) NOT NULL DEFAULT '1', PRIMARY KEY (`id`) ) ENGINE=MyISAM DEFAULT CHARSET=latin1 "); } catch (PDOException $e){ $main_content = "Erro:<br />".$e->getMessage(); } } }else{ $main_content = "Erro ao adicionar tabelas ao banco de dados!"; } # Se as tabelas existirem. if($videos && $videos_categorias && $videos_comentarios){ # Se nao existir nenhuma acao. if(empty($action) && !isset($action)){ $catFilter = (isset($_GET["cat"]) && !empty($_GET["cat"]) && is_numeric($_GET["cat"])) ? " AND `categoria` = ".$_GET["cat"]."" : ""; $resul = $db->query("SELECT `id`,`titulo`,`link` FROM `videos` WHERE `ativo` = 1".$catFilter.";"); $main_content = "<div class=\"conteudo\" style=\"background-image:url(layouts/tibiacom/images/content/scroll.gif);\">"; $main_content .= "<center><a href=\"?subtopic=videos\"><img src=\"images/youtube.png\"></a></center>"; $main_content .= ($accessLevel) ? "<center><a href=\"?subtopic=videos&action=adminpanel\">Painel de Administra&ccedil;&atilde;o</a></center>" : ""; if($resul->rowCount() <= 0){ $mc = "<br /><center><table cellpadding=\"5\" cellspacing=\"1\"><tr><td width=\"560px\" bgcolor=\"#F1E0C6\"><center>Nenhum v&iacute;deo cadastrado!<br /></center></td></tr>"; $div2 = "</div>"; } $categorias = $db->query("SELECT `id`, `nome` FROM `videos_categorias` ORDER BY nome ASC;"); if($categorias->rowCount() <= 0){ $mcs = "Nenhuma categoria cadastrada!"; } $tudos = ""; $t = ""; $i = 0; foreach($categorias as $categoria){ $barra = ($i != 0) ? "|" : ""; $space = ($i = count($categorias)-1) ? "" : " "; $adm = ($accessLevel) ? "<a href=\"?subtopic=videos&action=adminpanel&act=editcat&id=".$categoria["id"]."\"><img src=\"images/edit.png\" height=\"15\" weight=\"15\" /></a><a href=\"?subtopic=videos&action=adminpanel&act=delcat&id=".$categoria["id"]."\"><img src=\"images/del.png\" height=\"15\" weight=\"15\" /></a>" : ""; $tudos .= "$barra $adm<a href=\"?subtopic=videos&cat=".$categoria["id"]."\">".html_entity_decode($categoria["nome"])."</a>$space"; $t .= "$barra ".html_entity_decode($categoria["nome"])."$space"; $i++; } $tx = (strlen($t) > 0) ? "<a href=\"?subtopic=videos\">Todas</a> |" : ""; $tam = (strlen($t)*8 < 560) ? "560" : strlen($t)*8; $add = ($accessLevel) ? "<a href=\"?subtopic=videos&action=adminpanel&act=addcat\"><img src=\"images/add.png\" weight=\"15\" height=\"15\" /></a>" : ""; $main_content .= "<center><table cellpadding=\"5\" cellspacing=\"1\"><tr><td width=\"".$tam ."px\" colspan=\"3\" bgcolor=\"#555555\"><font color=\"white\" size=\"3\"><b><center>Categorias</center></b></font></td></tr>"; $main_content .= "<tr><td width=\"".$tam ."px\" bgcolor=\"#F1E0C6\"><b><center>$mcs$tx$tudos$add</center></b></td></tr>"; # Loop para os resultados que vem da database com os videos. foreach($resul as $res){ $id = (int)$res["id"]; $titulo = html_entity_decode($res["titulo"]); if($accessLevel){ $editar = "<a href=\"?subtopic=videos&action=adminpanel&act=edit&id=$id\">Editar V&iacute;deo</a> &hArr;"; $deletar = '<a href="?subtopic=videos&action=adminpanel&act=del&id='.$id.'"> Deletar V&iacute;deo</a>'; } $embed = '<iframe width="560" height="349" src="http://www.youtube.com/embed/'.$res["link"].'" frameborder="0" allowfullscreen></iframe>'; $main_content .= "<br /><center><table cellpadding=\"5\" cellspacing=\"1\"><tr><td width=\"550px\" bgcolor=\"#D4C0A1\"><center><b><a href=\"?subtopic=videos&id=$id\">$titulo</a></b></center></td></tr>"; $main_content .= "<br /><tr><td width=\"550px\" bgcolor=\"#F1E0C6\"><center>$embed $editar $deletar<br /></center></td></tr>"; $div = "</div>"; } $main_content .= "$mc</div>$div</table>".$div2."$div</center>"; if(isset($_GET["id"])){ $id = (int)$_GET['id']; $res = $db->query("SELECT `titulo`,`link`, `descricao` FROM `videos` WHERE `ativo` = 1 AND `id` = $id LIMIT 1;")->fetch(); if(!$res){ $main_content = "V&iacute;deo inexistente!<br /><a href=\"?subtopic=videos\">&lArr; Voltar</a>"; }else{ $resul = $db->query("SELECT `id`, `mensagem`, `character`, `data`, `ativo` FROM `videos_comentarios` WHERE `topico` = $id"); $resuls = $db->query("SELECT `id` FROM `videos_comentarios` WHERE `topico` = $id AND `ativo` = 1")->fetchAll(); $numM = $db->query("SELECT COUNT(`id`) FROM `videos_comentarios` WHERE `topico` = $id AND `ativo` = 1")->fetch(); $numM = ($numM[0] > 0) ? $numM[0]." " : ""; $s = ($numM > 1 || $numM == 0) ? "s" : ""; $main_content = "<div class=\"conteudo\" style=\"background-image:url(layouts/tibiacom/images/content/scroll.gif);\">"; $main_content .= "<center><table cellpadding=\"5\" cellspacing=\"1\"><tr><td width=\"200px\" colspan=\"3\" bgcolor=\"#505050\"><font color=\"white\" size=\"2\"><center><b>".$res["titulo"]."</b></center></font></td></tr>"; $main_content .= "<tr><td width=\"500px\" bgcolor=\"#F1E0C6\"><center><iframe width=\"560\" height=\"349\" src=\"http://www.youtube.com/embed/".$res['link']."\" frameborder=\"0\" allowfullscreen></center></iframe></td></tr>"; if($res["descricao"]){ $main_content .= "<tr><td width=\"200px\" colspan=\"3\" bgcolor=\"#505050\"><font color=\"white\" size=\"2\"><center><b>Descri&ccedil;&atilde;o</b></font></td></tr>"; $main_content .= "<tr><td width=\"200px\" colspan=\"3\" bgcolor=\"#F1E0C6\"><center>".html_entity_decode($res["descricao"])."</center></td></tr>"; } $main_content .= "<tr><td width=\"500px\" bgcolor=\"#505050\"><center><span style=\"color:white; font-weight:bold;\">".$numM."Coment&aacute;rio$s</span></center></td></tr>"; foreach($resul as $resz){ preg_match_all("/(\d{4})-(\d{2})-(\d{2})\ (\d{2}):(\d{2}):(\d{2})/", $resz["data"], $matches); $ifAccess = ($accessLevel && $resz["ativo"]) ? " <a href=\"?subtopic=videos&action=adminpanel&act=delcom&id=".$resz["id"]."\"><img src=\"images/del.png\" height=\"15\" weight=\"15\" /></a>" : ""; $msg = preg_replace("/(.{100})/i", "$1<br />", html_entity_decode($resz["mensagem"])); if($resz["ativo"]){ $main_content .= "<tr><td width=\"200px\" colspan=\"3\" bgcolor=\"#D4C0A5\"><center><b>[".$matches[3][0]."/".$matches[2][0]."] [<a href=\"?subtopic=characters&name=".urlencode($resz["character"])."\">".$resz["character"]."</a>] [".$matches[4][0].":".$matches[5][0]."]</b></center></td></tr>"; $main_content .= "<tr><td width=\"200px\" colspan=\"3\" bgcolor=\"#F1E0C6\"><font color=\"black\" size=\"2\"></span><center>".$msg."$ifAccess</center></font></td></tr>"; }elseif(!$resz["ativo"] && $accessLevel){ $existe = TRUE; $main_content .= "<tr><td width=\"200px\" colspan=\"3\" bgcolor=\"#D4C0A5\"><center><b>[".$matches[3][0]."/".$matches[2][0]."] [<a href=\"?subtopic=characters&name=".urlencode($resz["character"])."\">".$resz["character"]."</a>] [".$matches[4][0].":".$matches[5][0]."]</b></center></td></tr>"; $main_content .= "<tr><td width=\"200px\" colspan=\"3\" bgcolor=\"#F1E0C6\"><font color=\"black\" size=\"2\"></span><center><strike>".$msg."</strike> <a href=\"?subtopic=videos&action=adminpanel&act=ativarcom&id=".$resz["id"]."\"><img src=\"images/ativar.png\" height=\"15\" weight=\"15\" /></a></center></font></td></tr>"; } } if(!count($resuls)){ if($accessLevel && $existe){ }else{ $main_content .= "<tr><td width=\"500px\" bgcolor=\"#D4C0A5\"><center>Nenhum coment&aacute;rio foi feito!</center></td></tr>"; } } $todosChars = ""; if($account_logged){ $accountPlayers = $account_logged->getPlayersList(); $accountPlayers->orderBy('name'); foreach($accountPlayers as $char){ $todosChars .= "<option value=\"".$char->getName()."\">".$char->getName()."</option>"; } $temChar = (!$accountPlayers) ? TRUE : FALSE; } $ifLogged = " <tr><td width=\"500px\" bgcolor=\"#505050\"><span style=\"color:white; font-weight:bold;\"> <form action=\"?subtopic=videos&id=$id\" method=\"post\"> <fieldset> <legend>Deixe um coment&aacute;rio</legend><br /> <select style=\"border-radius:3px;-webkit-border-radius:3px;-moz-border-radius:3px;-o-border-radius:3px;-khtml-border-radius:3px;padding: 4px 2px; border: 1px solid #b2babe; background: #fff;\" name=\"character\"> $todosChars </select> Character *<br /> <input type=\"hidden\" name=\"topico\" value=\"$id\" /> <textarea style=\"border-radius:3px;-webkit-border-radius:3px;-moz-border-radius:3px;-o-border-radius:3px;-khtml-border-radius:3px;padding: 4px 2px; border: 1px solid #b2babe; background: #fff;\" cols=\"70\" rows=\"13\" name=\"mensagem\"></textarea> <input type=\"submit\" style=\"border-radius:3px;-webkit-border-radius:3px;-moz-border-radius:3px;-o-border-radius:3px;-khtml-border-radius:3px;padding: 4px 2px; border: 1px solid #b2babe; background: #fff;\" name=\"comment\" id=\"comment\" value=\"Comentar\" /> </fieldset> </form> </span></td></tr> "; $main_content .= ($logged && !$temChar) ? $ifLogged : "<tr><td width=\"500px\" bgcolor=\"#505050\"><center><span style=\"color:white; font-weight:bold;\">Voc&ecirc; deve estar logado e ter um character para comentar!</span></center></td></tr>"; $main_content .= "</div></div></table></div></center>"; if(isset($_POST["comment"]) && !empty($_POST["comment"])){ $accountPlayers = $account_logged->getPlayersList(); foreach($accountPlayers as $char){ if($char->getName() == $_POST["character"]){ $character = TRUE; } } if(strlen($_POST["mensagem"]) < 1){ $main_content = "Voc&ecirc; deve escrever uma mensagem para comentar!<br /><a href='?subtopic=videos&id=".$_POST["topico"]."'>&lArr; Voltar</a>"; }else{ if(!$character){ $main_content = "Voc&ecirc; deve escolher um character para comentar!<br /><a href='?subtopic=videos&id=".$_POST["topico"]."'>&lArr; Voltar</a>"; }else{ try{ $reszs = $db->exec("INSERT INTO `videos_comentarios` (`mensagem`, `character`, `ip`, `topico`) VALUES (".$db->quote(htmlentities(strip_tags($_POST["mensagem"]))).", ".$db->quote(htmlentities($_POST["character"])).", ".$db->quote($_SERVER["REMOTE_ADDR"]).",".(int)$_POST["topico"].")"); } catch (PDOException $e){ $main_content = "Erro:<br />".$e->getMessage(); } if($reszs){ $main_content = "Coment&aacute;rio adicionado com sucesso!<br /><a href='?subtopic=videos&id=".$_POST["topico"]."'>&lArr; Voltar</a>"; } } } } } } } if(isset($action) && !empty($action) && $action == "adminpanel" && $accessLevel){ $main_content = "<br /><div class=\"conteudo\" style=\"background-image:url(layouts/tibiacom/images/content/scroll.gif);\">"; $main_content .= "<center><table cellpadding=\"5\" cellspacing=\"1\"><tr><td width=\"500px\" colspan=\"3\" bgcolor=\"#555555\"><font color=\"white\" size=\"3\"><b>Painel de Controle</b></font></td></tr><tr><td width=\"250px\" bgcolor=\"#F1E0C6\"><b>Op&ccedil;&otilde;es</b></td></tr>"; $main_content .= "<tr><td width=\"250px\" bgcolor=\"#D4C0A1\"><a href=\"?subtopic=videos&action=adminpanel&act=addcat\">Adicionar Categoria</a></td></tr>"; $main_content .= "<tr><td width=\"250px\" bgcolor=\"#D4C0A1\"><a href=\"?subtopic=videos&action=adminpanel&act=add\">Adicionar V&iacute;deo</a></td></tr>"; $main_content .= "<tr><td width=\"250px\" bgcolor=\"#D4C0A1\"><a href=\"?subtopic=videos\">Editar V&iacute;deos</a></td></tr>"; $main_content .= "<tr><td width=\"250px\" bgcolor=\"#D4C0A1\"><a href=\"?subtopic=videos\">Deletar V&iacute;deos</a></td></tr>"; $main_content .= "</div></div></table></div></center>"; }elseif(isset($action) && !empty($action) && $action == "adminpanel" && !$accessLevel){ $main_content = "Voc&ecirc; n&atilde;o pode acessar esta &aacute;rea!"; } if(isset($action) && !empty($action) && $action == "adminpanel" && $accessLevel && $act == "add"){ $main_content = "<fieldset>"; $main_content .= "<legend>Adicionar V&iacute;deo</legend>"; $main_content .= "<form id=\"add\" name=\"add\" method=\"post\" action=\"?subtopic=videos&action=adminpanel&act=add\">"; $main_content .= "<p style=\"font-size: 1.8em;\">"; $main_content .= "<label for=\"link\">Link do V&iacute;deo</label>"; $main_content .= "<br /><input name=\"link\" type='text' id=\"link\" style=\"border-radius:3px;-webkit-border-radius:3px;-moz-border-radius:3px;-o-border-radius:3px;-khtml-border-radius:3px;padding: 4px 2px; border: 1px solid #b2babe; background: #fff;\" />"; $main_content .= "</p>"; $main_content .= "<p>"; $main_content .= "<input type=\"submit\" style=\"border-radius:3px;-webkit-border-radius:3px;-moz-border-radius:3px;-o-border-radius:3px;-khtml-border-radius:3px;padding: 4px 2px; border: 1px solid #b2babe; background: #fff;\" name=\"button\" id=\"button\" value=\"Adicionar\" />"; $main_content .= "</p>"; $main_content .= "</form></fieldset>"; if(isset($_POST["button"]) && !empty($_POST["button"]) && $accessLevel){ $link = $_POST["link"]; $res = $db->query("SELECT `id`,`nome` FROM `videos_categorias`;"); $tudo = ""; foreach($res as $cat_info){ $cat_tudo .= "<option name='".$cat_info["id"]."' value='".$cat_info["id"]."'>".html_entity_decode($cat_info["nome"])."</option>"; } if(strlen($link) != 11){ preg_match_all("/([[:alnum:]|\_|\-]{11}?)/", $link, $matches); if(count($matches[0]) > 1){ $link = "Alexx Pirado lol"; }else{ $link = $matches[0][0]; } } if(strlen($link) != 11){ $erro = "O link do v&iacute;deo est&aacute; errado ou incompleto.<br />Por favor, coloque a parte do link como o exemplo abaixo:<br />http://www.youtube.com/watch?v=<b><i>5abamRO41fE</i></b><br /><a href='?subtopic=videos&action=adminpanel&act=add'>&lArr; Voltar</a>"; } if(empty($erro) && !isset($erro)){ $info = new SimpleXMLElement(file_get_contents("http://gdata.youtube.com/feeds/api/videos/$link")); $titulo = $info->title; $main_content = "<br /><div class=\"conteudo\" style=\"background-image:url(layouts/tibiacom/images/content/scroll.gif);\">"; $main_content .= "<form action='?subtopic=videos&action=adminpanel&act=add' method='post'><input type='hidden' name='link' value='$link'>"; $main_content .= "<center><table cellpadding=\"5\" cellspacing=\"1\"><tr><td width=\"800px\" colspan=\"3\" bgcolor=\"#555555\"><font color=\"white\" size=\"3\"><b>Informa&ccedil;&otilde;es do V&iacute;deo</b></font></td></tr><tr><td width=\"250px\" bgcolor=\"#F1E0C6\"><b>Informa&ccedil;&atilde;o</b></td><td width=\"250px\" bgcolor=\"#F1E0C6\"><b>Valor</b></td></tr>"; $main_content .= "<tr><td width=\"300px\" bgcolor=\"#D4C0A1\"><b>Link</b><span style='color:red;'>*</span></td><td width=\"300px\" bgcolor=\"#D4C0A1\"><a href='http://www.youtube.com/watch?v=$link'>http://www.youtube.com/watch?v=$link</a></td></tr>"; $main_content .= "<tr><td width=\"250px\" bgcolor=\"#D4C0A1\"><b>T&iacute;tulo</b><span style='color:red;'>*</span></td><td width=\"250px\" bgcolor=\"#D4C0A1\"><input type='text' name='titulo' value='$titulo' size='".strlen($titulo)."'></td></tr>"; $main_content .= "<tr><td width=\"250px\" bgcolor=\"#D4C0A1\"><b>Descri&ccedil;&atilde;o</b></td><td width=\"250px\" bgcolor=\"#D4C0A1\"><textarea id=\"descricao\" name=\"descricao\" cols=\"40\" rows=\"10\" onfocus=\"if(this.innerHTML == 'Coloque uma descrição no vídeo!') this.innerHTML = '';\" onblur=\"if(this.innerHTML == '') this.innerHTML = 'Coloque uma descrição no vídeo!';\">Coloque uma descri&ccedil;&atilde;o no v&iacute;deo!</textarea></td></tr>"; $main_content .= "<tr><td width=\"250px\" bgcolor=\"#D4C0A1\"><b>Categoria</b><span style='color:red;'>*</span></td><td width=\"250px\" bgcolor=\"#D4C0A1\"><select name='categoria'><option value=\"0\">Nenhuma</option>$cat_tudo</select></td></tr>"; $main_content .= "</div></div></table>Os campos com <span style='color:red;margin:left;'>*</span> s&atilde;o obrigat&oacute;rios!<br /><input type='submit' style=\"border-radius:3px;-webkit-border-radius:3px;-moz-border-radius:3px;-o-border-radius:3px;-khtml-border-radius:3px;padding: 4px 2px; border: 1px solid #b2babe; background: #fff;\" name='avancar' value='Avan&ccedil;ar'></center></div>"; }else{ $main_content = $erro; } } if(isset($_POST["avancar"]) && !empty($_POST["avancar"]) && $accessLevel){ $link = $_POST["link"]; $titulo = $_POST["titulo"]; $categoria = htmlentities($_POST["categoria"]); $descricao = ($_POST["descricao"] != "Coloque uma descrição no vídeo!" && $_POST["descricao"] != "Coloque uma descri&ccedil;&atilde;o no v&iacute;deo!") ? nl2br($_POST["descricao"]) : NULL; if(!empty($link) && isset($link) & $link != 11){ if(!empty($titulo) && isset($titulo)){ try { $res = $db->query("INSERT INTO `videos` (`titulo`, `descricao`, `categoria`, `link`) VALUES (".$db->quote(htmlentities($titulo)).", ".$db->quote(htmlentities($descricao)).", $categoria, ".$db->quote($link).")"); } catch (PDOException $e){ $main_content = "Erro ao adicionar o v&iacute;deo!<br />".$e->getMessage()."<br /><a href='?subtopic=videos&action=adminpanel&act=add'>&lArr; Voltar</a>"; } if($res){ $main_content = "V&iacute;deo adicionado com sucesso!<br /><a href='?subtopic=videos'>&lArr; Voltar</a>"; } }else{ $main_content = "O t&iacute;tulo n&atilde;o pode ficar em branco!<br /><a href='?subtopic=videos&action=adminpanel&act=add'>&lArr; Voltar</a>"; } }else{ $main_content = "Voc&ecirc; deve fornecer um link para adicionar um v&iacute;deo!<br /><a href='?subtopic=videos&action=adminpanel&act=add'>&lArr; Voltar</a>"; } } } if(isset($action) && !empty($action) && $action == "adminpanel" && isset($act) && !empty($act) && $act == "del" && $accessLevel){ $id = (int)$_GET["id"]; $main_content = "Voc&ecirc; realmente deseja excluir o v&iacute;deo #$id?<br /> <form action=\"?subtopic=videos&action=adminpanel&act=del\" method=\"post\"> <input type=\"hidden\" name=\"id\" value=\"$id\"> <input type=\"submit\" name=\"botao\" value=\"Concluir\" style=\"border-radius:3px;-webkit-border-radius:3px;-moz-border-radius:3px;-o-border-radius:3px;-khtml-border-radius:3px;padding: 4px 2px; border: 1px solid #b2babe; background: #fff;\"> </form> "; if(isset($_POST["botao"]) && !empty($_POST["botao"])){ $id = (int)$_POST["id"]; if(!empty($id) && isset($id) && is_numeric($id)){ $id = (int)$id; try { $res = $db->exec("DELETE FROM `videos` WHERE `id` = $id"); } catch (PDOException $e){ $main_content = "Houve um erro ao deletar o v&iacute;deo n&uacute;mero $id.<br />".$e->getMessage()."<br /><a href='?subtopic=videos'>&lArr; Voltar</a>"; } if($res){ $main_content = "V&iacute;deo #$id deletado com sucesso!<br /><a href='?subtopic=videos'>&lArr; Voltar</a>"; } }else{ $main_content = "V&iacute;deo n&atilde;o encontrado!<br /><a href='?subtopic=videos'>&lArr; Voltar</a>"; } } } if(isset($action) && !empty($action) && $action == "adminpanel" && isset($act) && !empty($act) && $act == "edit" && $accessLevel){ $res = $db->query("SELECT `id`,`titulo`,`link`,`descricao` FROM `videos` WHERE `ativo` = 1 AND `id` = ".$_GET["id"]." LIMIT 1;")->fetch(); $resul = $db->query("SELECT `id`,`nome` FROM `videos_categorias`;"); $resz = $db->query("SELECT `categoria` as `id` FROM `videos` WHERE `id` = ".$_GET["id"]." LIMIT 1;")->fetch(); $cat_tudo = ""; foreach($resul as $cat_info){ if($cat_info["id"] == $resz["id"]){ $c = " selected=\"selected\""; } $cat_tudo .= "<option name='".$cat_info["id"]."' $c value='".$cat_info["id"]."'>".html_entity_decode($cat_info["nome"])."</option>"; } $main_content = "<fieldset>"; $main_content .= "<legend>Editar V&iacute;deo</legend>"; $main_content .= " <center> <span style=\"font-size:1.8em; font-color:black;\"><strong>".html_entity_decode($res['titulo'])."</span></strong><hr> <iframe width=\"560\" height=\"349\" src=\"http://www.youtube.com/embed/".$res["link"]."\" frameborder=\"0\" allowfullscreen></iframe><hr /> <br /><br /> </center> "; $main_content .= "<form id=\"add\" name=\"add\" method=\"POST\" action=\"\">"; $main_content .= "<p style=\"font-size: 1.8em;\">"; $main_content .= "<label for=\"titulo\">T&iacute;tulo do V&iacute;deo</label>"; $main_content .= "<br /><input name=\"titulo\" type=\"text\" id=\"titulo\" size=\"".strlen($res["link"])*3 ."\" style=\"border-radius:3px;-webkit-border-radius:3px;-moz-border-radius:3px;-o-border-radius:3px;-khtml-border-radius:3px;padding: 4px 2px; border: 1px solid #b2babe; background: #fff;\" value=\"".$res['titulo']."\"/>"; $main_content .= "</p>"; $main_content .= "<p style=\"font-size: 1.8em;\">"; $main_content .= "<label for=\"link\">Link do V&iacute;deo</label>"; $main_content .= "<br /><input name=\"link\" type='text' id=\"link\" size=\"25\" maxlength=\"11\" style=\"border-radius:3px;-webkit-border-radius:3px;-moz-border-radius:3px;-o-border-radius:3px;-khtml-border-radius:3px;padding: 4px 2px; border: 1px solid #b2babe; background: #fff;\" value=\"".$res['link']."\"/>"; $main_content .= "<br /><br /><label for=\"descricao\">Descri&ccedil;&atilde;o do V&iacute;deo</label>"; $main_content .= "<br /><textarea id=\"descricao\" name=\"descricao\" cols=\"40\" rows=\"10\" style=\"border-radius:3px;-webkit-border-radius:3px;-moz-border-radius:3px;-o-border-radius:3px;-khtml-border-radius:3px;padding: 4px 2px; border: 1px solid #b2babe; background: #fff;\">".html_entity_decode($res["descricao"])."</textarea>"; $main_content .= "</p>"; $main_content .= "<p style=\"font-size: 1.8em;\">"; $main_content .= "Categoria<br /><select name='categoria'><option value=\"0\">Nenhuma</option>$cat_tudo</select>"; $main_content .= "</p>"; $main_content .= "<p>"; $main_content .= "<input type=\"hidden\" name=\"id\" value=\"".$res["id"]."\"><input type=\"submit\" style=\"border-radius:3px;-webkit-border-radius:3px;-moz-border-radius:3px;-o-border-radius:3px;-khtml-border-radius:3px;padding: 4px 2px; border: 1px solid #b2babe; background: #fff;\" name=\"button\" id=\"button\" value=\"Editar\" />"; $main_content .= "</p>"; $main_content .= "</form></div></fieldset>"; if(isset($_POST['button']) && !empty($_POST["button"])){ if(($_POST["link"] != $res["link"]) || ($_POST["titulo"] != $res["titulo"]) || ($_POST["descricao"] != $res["descricao"]) || ($_POST["categoria"] != $resz["id"])){ try { $res = $db->exec("UPDATE `videos` SET `link` = '".$_POST["link"]."', `titulo` = ".$db->quote(htmlentities($_POST["titulo"])).", `descricao` = ".$db->quote(htmlentities($_POST["descricao"])).", `categoria` = ".(int)$_POST["categoria"]." WHERE `id` = ".$_POST["id"].";"); } catch (PDOException $e){ $main_content = "Houve um erro ao tentar editar o v&iacute;deo #".$_POST["id"]."!<br />".$e->getMessage(); } if($res){ $main_content = "V&iacute;deo #".$_POST["id"]." editado com sucesso!<br /><a href='?subtopic=videos'>&lArr; Voltar</a>"; } }else{ $main_content = "V&iacute;deo #".$_POST["id"]." editado com sucesso!<br /><a href='?subtopic=videos'>&lArr; Voltar</a>"; } } } if(isset($action) && !empty($action) && $action == "adminpanel" && isset($act) && !empty($act) && $act == "addcat" && $accessLevel){ $main_content = " <form action=\"?subtopic=videos&action=adminpanel&act=addcat\" method=\"post\"> <fieldset> <legend>Adicionar Categoria</legend><br /> <label for=\"catNome\" style=\"margin-left:3px;\">Nome da Categoria</label><br /> <input type=\"text\" name=\"catNome\" style=\"border-radius:3px;-webkit-border-radius:3px;-moz-border-radius:3px;-o-border-radius:3px;-khtml-border-radius:3px;padding: 4px 2px; border: 1px solid #b2babe; background: #fff;\" /><br /> <input type=\"submit\" name=\"botao\" value=\"Adicionar\" style=\"border-radius:3px;-webkit-border-radius:3px;-moz-border-radius:3px;-o-border-radius:3px;-khtml-border-radius:3px;padding: 4px 2px; border: 1px solid #b2babe; background: #fff;\" /> </fieldset> </form> "; if(isset($_POST["botao"]) && !empty($_POST["botao"]) && $accessLevel){ if(isset($_POST["catNome"]) && !empty($_POST["catNome"]) && strlen($_POST["catNome"]) > 0){ try { $res = $db->exec("INSERT INTO `videos_categorias` (`nome`) VALUES (".$db->quote(htmlentities($_POST["catNome"])).");"); } catch (PDOException $e){ $main_content = "Houve um erro ao adicionar a categoria!<br />".$e->getMessage()."<br /><a href='?subtopic=videos'>&lArr; Voltar</a>"; } if($res) $main_content = "Categoria adicionada com sucesso!<br /><a href='?subtopic=videos'>&lArr; Voltar</a>"; }else{ $main_content = "O campo <b>Nome da Categoria</b> &eacute; obrigat&oacute;rio!<br /><a href='?subtopic=videos&action=adminpanel&act=addcat'>&lArr; Voltar</a>"; } } } if(isset($action) && !empty($action) && $action == "adminpanel" && isset($act) && !empty($act) && $act == "delcat" && $accessLevel){ if(!isset($_GET["id"]) && empty($_GET["id"]) & $accessLevel){ $main_content = "Voc&ecirc; deve definir uma categoria para deletar!"; }else{ $res = $db->query("SELECT `id`, `nome` FROM `videos_categorias` WHERE `id` = ".$_GET["id"]." LIMIT 1;")->fetch(); $main_content = " <form action=\"?subtopic=videos&action=adminpanel&act=delcat&id=".$res["id"]."\" method=\"post\"> <fieldset> <legend>Deletar Categoria</legend><br /> <span style=\"margin-left:3px;\">Voc&ecirc; realmente deseja deletar a categoria <b>".$res["nome"]."</b>?</span><br /> <input type=\"hidden\" name=\"catId\" value=\"".$res["id"]."\" /> <input type=\"hidden\" name=\"catNome\" value=\"".$res["nome"]."\" /> <input type=\"submit\" name=\"botao\" value=\"Deletar Categoria\" style=\"border-radius:3px;-webkit-border-radius:3px;-moz-border-radius:3px;-o-border-radius:3px;-khtml-border-radius:3px;padding: 4px 2px; border: 1px solid #b2babe; background: #fff;\" /> <input type=\"submit\" name=\"botao2\" value=\"Deletar categoria e v&iacute;deos desta categoria\" style=\"border-radius:3px;-webkit-border-radius:3px;-moz-border-radius:3px;-o-border-radius:3px;-khtml-border-radius:3px;padding: 4px 2px; border: 1px solid #b2babe; background: #fff;\" /> </fieldset> </form> "; if(isset($_POST["botao"]) && !empty($_POST["botao"]) && $accessLevel){ try { $res = $db->exec("DELETE FROM `videos_categorias` WHERE `id` = ".$_POST["catId"].";"); $res = $db->exec("UPDATE `videos` SET `categoria` = 0 WHERE `categoria` = ".$_POST["catId"].";"); } catch (PDOException $e) { $main_content = "Houve um erro ao deletar a categoria ".$_POST["catNome"]."!<br />".$e->getMessage(); } if($res){ $main_content = "Categoria deletada com sucesso!<br /><a href='?subtopic=videos'>&lArr; Voltar</a>"; } } if(isset($_POST["botao2"]) && !empty($_POST["botao2"]) && $accessLevel){ try { $res = $db->exec("DELETE FROM `videos_categorias` WHERE `id` = ".$_POST["catId"].";"); $resul = $db->exec("DELETE FROM `videos` WHERE `categoria` = ".$_POST["catId"].";"); } catch (PDOException $e) { $main_content = "Houve um erro ao deletar a categoria ".$_POST["catNome"]."!<br />".$e->getMessage(); } if($res && $resul){ $main_content = "Categoria deletada com sucesso!<br /><a href='?subtopic=videos'>&lArr; Voltar</a>"; } } } } if(isset($action) && !empty($action) && $action == "adminpanel" && isset($act) && !empty($act) && $act == "editcat" && $accessLevel){ if(!isset($_GET["id"]) && empty($_GET["id"]) & $accessLevel){ $main_content = "Voc&ecirc; deve definir uma categoria para deletar!"; }else{ $res = $db->query("SELECT `id`, `nome` FROM `videos_categorias` WHERE `id` = ".$_GET["id"]." LIMIT 1;")->fetch(); $main_content = " <form action=\"?subtopic=videos&action=adminpanel&act=editcat&id=".$res["id"]."\" method=\"post\"> <fieldset> <legend>Editar Categoria</legend><br /> <p style=\"font-size: 1.8em;\"> <label for=\"catNome\" style=\"margin-left:3px;\">Nome da Categoria</label><br /></p> <input type=\"hidden\" name=\"nome\" value=\"".$res["nome"]."\" /> <input type=\"hidden\" name=\"id\" value=\"".$res["id"]."\" /> <input type=\"text\" name=\"catNome\" style=\"border-radius:3px;-webkit-border-radius:3px;-moz-border-radius:3px;-o-border-radius:3px;-khtml-border-radius:3px;padding: 4px 2px; border: 1px solid #b2babe; background: #fff;\" value=\"".$res["nome"]."\" /><br /> <br /><input type=\"submit\" name=\"botao\" value=\"Editar Categoria\" style=\"border-radius:3px;-webkit-border-radius:3px;-moz-border-radius:3px;-o-border-radius:3px;-khtml-border-radius:3px;padding: 4px 2px; border: 1px solid #b2babe; background: #fff;\" /> </fieldset> </form> "; if(isset($_POST["botao"]) && !empty($_POST["botao"]) && $accessLevel){ try { $res = $db->exec("UPDATE `videos_categorias` SET `nome` = ".$db->quote(htmlentities($_POST["catNome"]))." WHERE `id` = ".$_POST["id"].";"); } catch (PDOException $e) { $main_content = "Houve um erro ao editar a categoria ".$_POST["nome"]."!<br />".$e->getMessage(); } if($res){ $main_content = "Categoria editada com sucesso!<br /><a href='?subtopic=videos'>&lArr; Voltar</a>"; } } } } if(isset($action) && !empty($action) && $action == "adminpanel" && isset($act) && !empty($act) && $act == "delcom" && $accessLevel){ if(!isset($_GET["id"]) && empty($_GET["id"]) & $accessLevel){ $main_content = "Voc&ecirc; deve escolher um coment&aacute;rio para deletar!"; }else{ $res = $db->query("SELECT `id`, `mensagem`, `topico` FROM `videos_comentarios` WHERE `id` = ".(int)$_GET["id"]." LIMIT 1;")->fetch(); $main_content = " <form action=\"?subtopic=videos&action=adminpanel&act=delcom&id=".$res["id"]."\" method=\"post\"> <fieldset> <legend>Deletar Coment&aacute;rio</legend><br /> <span style=\"margin-left:3px;\">Voc&ecirc; realmente deseja deletar o coment&aacute;rio <b>".html_entity_decode($res["mensagem"])."</b>?</span><br /> <input type=\"hidden\" name=\"comId\" value=\"".$res["id"]."\" /> <input type=\"hidden\" name=\"comTopico\" value=\"".$res["topico"]."\" /> <input type=\"hidden\" name=\"comCom\" value=\"".html_entity_decode($res["mensagem"])."\" /> <input type=\"submit\" name=\"botao\" value=\"Deletar Coment&aacute;rio\" style=\"border-radius:3px;-webkit-border-radius:3px;-moz-border-radius:3px;-o-border-radius:3px;-khtml-border-radius:3px;padding: 4px 2px; border: 1px solid #b2babe; background: #fff;\" /> </fieldset> </form> "; if(isset($_POST["botao"]) && !empty($_POST["botao"]) && $accessLevel){ try { $res = $db->exec("UPDATE `videos_comentarios` SET `ativo` = 0 WHERE `id` = ".(int)$_POST["comId"]." AND `ativo` = 1;"); } catch (PDOException $e) { $main_content = "Houve um erro ao deletar o coment&aacute;rio ".$_POST["comCom"]."!<br />".$e->getMessage(); } if($res){ $main_content = "Coment&aacute;rio deletado com sucesso!<br /><a href='?subtopic=videos&id=".(int)$_POST["comTopico"]."'>&lArr; Voltar</a>"; } } } } if(isset($action) && !empty($action) && $action == "adminpanel" && isset($act) && !empty($act) && $act == "ativarcom" && $accessLevel){ if(!isset($_GET["id"]) && empty($_GET["id"]) & $accessLevel){ $main_content = "Voc&ecirc; deve escolher um coment&aacute;rio para restaurar!"; }else{ $res = $db->query("SELECT `id`, `mensagem`, `topico` FROM `videos_comentarios` WHERE `id` = ".(int)$_GET["id"]." LIMIT 1;")->fetch(); $main_content = " <form action=\"?subtopic=videos&action=adminpanel&act=ativarcom&id=".$res["id"]."\" method=\"post\"> <fieldset> <legend>Restaurar Coment&aacute;rio</legend><br /> <span style=\"margin-left:3px;\">Voc&ecirc; realmente deseja restaurar o coment&aacute;rio <b>".html_entity_decode($res["mensagem"])."</b>?</span><br /> <input type=\"hidden\" name=\"comId\" value=\"".$res["id"]."\" /> <input type=\"hidden\" name=\"comTopico\" value=\"".$res["topico"]."\" /> <input type=\"hidden\" name=\"comCom\" value=\"".html_entity_decode($res["mensagem"])."\" /> <input type=\"submit\" name=\"botao\" value=\"Restaurar Coment&aacute;rio\" style=\"border-radius:3px;-webkit-border-radius:3px;-moz-border-radius:3px;-o-border-radius:3px;-khtml-border-radius:3px;padding: 4px 2px; border: 1px solid #b2babe; background: #fff;\" /> </fieldset> </form> "; if(isset($_POST["botao"]) && !empty($_POST["botao"]) && $accessLevel){ try { $res = $db->exec("UPDATE `videos_comentarios` SET `ativo` = 1 WHERE `id` = ".(int)$_POST["comId"]." AND `ativo` = 0;"); } catch (PDOException $e) { $main_content = "Houve um erro ao restaurar o coment&aacute;rio ".$_POST["comCom"]."!<br />".$e->getMessage(); } if($res){ $main_content = "Coment&aacute;rio restaurado com sucesso!<br /><a href='?subtopic=videos&id=".(int)$_POST["comTopico"]."'>&lArr; Voltar</a>"; } } } } } ?>
  3. npcsystem.lua npchandler.lua Olá, estou tendo a seguinte situação: quando eu fecho a tela de chat do npc, ele ainda fica esperando que eu fale algo, porem isso me traz um problema pois caso eu realmente queira algo ele nao me responde, eu tenho que sair de perto do npc e isso ocorre com todos os npcs gostaria de ao apertar no X o chat fosse fechado, e o npc ficasse disponivel para uma nova conversa, e quando ele finalizar a conversa nao abrisse novamente a tela de conversa, pois fica o "Bye" dele tanto no chat privado quando no chat aberto.
  4. São os Npcs da Pitis Of Inferno do trone de pumin
  5. Boa Noite, pessoal estou precisando das script dos npc A dead Bureucrat, alguem teria para disponibilizar? tibia 8.6, tfs 0.4.
  6. Olá estou com um pequino erro no distro quando jogo vial de sague em cima do Gravestone da Poi. Erros - Action Interface data/action/scripts/Liquids/containers.lua:onUse Description: <luaDoDecayItem> Item not found Action GraveStone Action Containers
  7. Ola pessoal, estou com uma scritp que era para rodar da seguinte maneira, quando personagem pisa em um sqm com uniqueid, troca sqm de lava por uma ponte, quando sai do sqm ele troca a ponte por lava, porem a script nao esta rodando conforme o esperado, quando vc pisa ele cria a ponte, mas quando sai do sqm ele nao remove o sqm. poi_ponte.lua
  8. Olá Bom dia, pessoal estou com um probleminha no servidor, ao iniciar a quest Pits of Inferno, jogando o sangue em cima do gravestone, ele teletransporta meu personagem corretamente, mas gera um erro na distro: Error- Action Interface Data/actions/scripts/Liquids/containers.lua:onUse Description: <luaDoDecayItem> Item not found Movements.xml <movement type="AddItem" tileitem="1" uniqueid="50010" event="script" value="PitsOfInferno/gravestone.lua" /> Script Gravestone Containers
  9. Olá pessoal, estou fazendo uma adaptação dos npcs do meu servidor, estava acrescentando um por um conforme precisava, porem notei que alguns npc adicionados no mapa nao apareciam no game, resolvi trocar a pasta completa de npc junto com as lib pois vi que eram tambem diferentes, como o meu servidor os npc eram basicos, vi que o do outro era o que eu precisava resolvi trocar pasta inteira, porem venho enfrentando erro na distro. isto é o que ele fala da linha 373, eu teria que puxar mais algum arquivo, ou editar alguma coisa?
  10. Ola galera, estou tentando abrir meu gesior porem estou com o seguinte problema. Parse error: syntax error, unexpected '[' in C:\xampp\htdocs\pages\latestnews.php on line 9 como posso resolver isso? vurus total scan: https://www.virustotal.com/gui/file/9eee824c551b2d7056b49e3d8389990a76053c744dfe08907502803e8af647c6/detection latestnews.rar
  11. obrigado vou testar @Yan Liima Novamente Obrigado cara, deu certo.
  12. Boa noite, ou bom dia kk, Pessoal, eu tive que fazer alteração de mapa no meu OT, e apos isso apresentou algumas falhas no distro de e identifiquei que era nas houses das cidades vips que eu tirei, teria como eu fazer uma atualização no meu banco de dados automaticamente sem que eu precise fazer isso na mao um por um?
  • Recently Browsing   0 members

    No registered users viewing this page.

×
×
  • Create New...