Ir para conteúdo
Banner com Efeitos

Sleet

Membro
  • Registro em

Tudo que Sleet postou

  1. Bom dia pessoal do tibiaking. Estou coçando e perdendo alguns cabelos com esse 'problema'. Eu gostaria de saber como mudar o editor de notícias do meu site disso: Para isso: Eu já tenho o site que tem esse editor especial, ele inclusive aceita imagens! Caso possam me ajudar nesse problema, ficaria muito agradecido.
  2. Não sei como explicar isso da forma mais detalhada mas vamos lá. No meu servidor, se você colocar uma quatia 'x' de dinheiro no banco, você pode comprar infinitas potions com npcs, contanto que eles custem 'x' ou menos de 'x'. Um exemplo disso é quando o cara vai comprar potions, ele tem 200gp, por exemplo, e compra uma potion que cujsta 190gp. Depois disso, o dinheiro dele continua 200gp apesar de no arquivo .xml estar escrito 190gp e no .lua não ter nada Isso só acontece com alguns itens, como as potions e as sudden death runes, os outros estão todos corretos. Alguém saberia como corrigir isso?
  3. Muito obrigado, ajudou bastante.
  4. Olá pessoal, beleza? Gostaria de saber como faz para trocar a cidade de um personagem, que nem no global, o player entra em um teleport e a cidade dele muda.
  5. E aí pessoal, tudo certo? Então, desde quando instalei o gesior no meu site, não consigo utilizar o fórum, tudo que aparece é essa mensagem Aqui está o meu forum.php <?php if(!defined('INITIALIZED')) exit; // CONFIG $level_limit = 30; // minimum 1 character with 30 lvl on account to post $post_interval = 20; // 20 seconds between posts $group_not_blocked = $config['site']['access_admin_painel']; // group id of player that can always post, remove post, remove threads $posts_per_page = 20; $threads_per_page = 20; //Tiny Editor $main_content .= ' <script type="text/javascript" src="'.$layout_name.'/tiny_mce/tiny_mce.js"></script> <script type="text/javascript"> tinyMCE.init({ // General options mode : "textareas", theme : "simple", plugins : "autolink,lists,pagebreak,style,layer,table,save,advhr,advimage,advlink,emotions,iespell,inlinepopups,insertdatetime,preview,media,searchreplace,print,contextmenu,paste,directionality,fullscreen,noneditable,visualchars,nonbreaking,xhtmlxtras,template,wordcount,advlist,autosave,visualblocks", // Theme options theme_advanced_buttons1 : "newdocument,|,bold,italic,underline,strikethrough,|,justifyleft,justifycenter,justifyright,justifyfull,styleselect,formatselect,fontselect,fontsizeselect", theme_advanced_buttons2 : "cut,copy,paste,pastetext,pasteword,|,search,replace,|,bullist,numlist,|,outdent,indent,blockquote,|,link,unlink,anchor,image,cleanup,code,|,insertdate,inserttime,preview,|,forecolor,backcolor", theme_advanced_buttons3 : "tablecontrols,|,hr,removeformat,visualaid,|,sub,sup,|,charmap,emotions,iespell,media,advhr,|,ltr,rtl", theme_advanced_buttons4 : "insertlayer,moveforward,movebackward,absolute,|,styleprops,|,cite,abbr,acronym,del,ins,attribs,|,visualchars,nonbreaking,template,pagebreak,restoredraft,visualblocks", theme_advanced_toolbar_location : "top", theme_advanced_toolbar_align : "left", theme_advanced_statusbar_location : "bottom", theme_advanced_resizing : true, // Example content CSS (should be your site CSS) content_css : "css/content.css", // Drop lists for link/image/media/template dialogs template_external_list_url : "lists/template_list.js", external_link_list_url : "lists/link_list.js", external_image_list_url : "lists/image_list.js", media_external_list_url : "lists/media_list.js", // Style formats style_formats : [ {title : \'Bold text\', inline : \'b\'}, {title : \'Red text\', inline : \'span\', styles : {color : \'#ff0000\'}}, {title : \'Red header\', block : \'h1\', styles : {color : \'#ff0000\'}}, {title : \'Example 1\', inline : \'span\', classes : \'example1\'}, {title : \'Example 2\', inline : \'span\', classes : \'example2\'}, {title : \'Table styles\'}, {title : \'Table row 1\', selector : \'tr\', classes : \'tablerow1\'} ], // Replace values for the template plugin template_replace_values : { username : "Some User", staffid : "991234" } }); </script>'; // SECTION WITH ID 1 IS FOR "NEWS", ONLY ADMINS CAN CREATE NEW THREAD IN IT $sections = array( 1 => 'News', 2 => 'Wars', 3 => 'Quests', 4 => 'Pictures', 5 => 'Bug Report', 6 => 'Events (English Only)', 7 => 'Real Life'); $sections_desc = array( 1 => 'Here are the latest news of the server, and you can comment.', 2 => 'Feel free to tell what you think about your enemy.', 3 => 'Talk with others about quests you made and how to make them.', 4 => 'Show others your best photos from server!', 5 => 'Report bugs on website and in-game here.', 6 => 'This board is all about events. Here you can advertise your events server-wide to find more participants or exchange ideas on how to organise events best.', 7 => 'Everything about your private interests which has nothing to do with Tibia.'); // END function canPost($account) { if($account->isLoaded()) { $SQL = $GLOBALS['SQL']; $level_limit = $GLOBALS['level_limit']; $player = $SQL->query("SELECT " . $SQL->fieldName('level') . " FROM " . $SQL->tableName('players') . " WHERE " . $SQL->fieldName('account_id') . " = ".$SQL->quote($account->getId())." ORDER BY " . $SQL->fieldName('level') . " DESC")->fetch(); if($player['level'] >= $level_limit) return true; } return false; } function replaceSmile($text, $smile) { $smileys = array( ':p' => 1, ':eek:' => 2, ':rolleyes:' => 3, ';)' => 4, ':o' => 5, ':D' => 6, ':(' => 7, ':mad:' => 8, ':)' => 9, ':cool:' => 10 ); if($smile == 1) return $text; else { foreach($smileys as $search => $replace) $text = str_replace($search, '<img src="layouts/tibiarl/images/forum/smile/'.$replace.'.gif" />', $text); return $text; } } function replaceAll($text, $smile) { $rows = 0; while(stripos($text, '[code]') !== false && stripos($text, '[/code]') !== false ) { $code = substr($text, stripos($text, '[code]')+6, stripos($text, '[/code]') - stripos($text, '[code]') - 6); if(!is_int($rows / 2)) { $bgcolor = 'ABED25'; } else { $bgcolor = '23ED25'; } $rows++; $text = str_ireplace('[code]'.$code.'[/code]', '<i>Code:</i><br /><table cellpadding="0" style="background-color: #'.$bgcolor.'; width: 480px; border-style: dotted; border-color: #CCCCCC; border-width: 2px"><tr><td>'.$code.'</td></tr></table>', $text); } $rows = 0; while(stripos($text, '[quote]') !== false && stripos($text, '[/quote]') !== false ) { $quote = substr($text, stripos($text, '[quote]')+7, stripos($text, '[/quote]') - stripos($text, '[quote]') - 7); if(!is_int($rows / 2)) { $bgcolor = 'AAAAAA'; } else { $bgcolor = 'CCCCCC'; } $rows++; $text = str_ireplace('[quote]'.$quote.'[/quote]', '<table cellpadding="0" style="background-color: #'.$bgcolor.'; width: 480px; border-style: dotted; border-color: #007900; border-width: 2px"><tr><td>'.$quote.'</td></tr></table>', $text); } $rows = 0; while(stripos($text, '[url]') !== false && stripos($text, '[/url]') !== false ) { $url = substr($text, stripos($text, '[url]')+5, stripos($text, '[/url]') - stripos($text, '[url]') - 5); $text = str_ireplace('[url]'.$url.'[/url]', '<a href="'.$url.'" target="_blank">'.$url.'</a>', $text); } while(stripos($text, '[player]') !== false && stripos($text, '[/player]') !== false ) { $player = substr($text, stripos($text, '[player]')+8, stripos($text, '[/player]') - stripos($text, '[player]') - 8); $text = str_ireplace('[player]'.$player.'[/player]', '<a href="?subtopic=characters&name='.urlencode($player).'">'.$player.'</a>', $text); } while(stripos($text, '[letter]') !== false && stripos($text, '[/letter]') !== false ) { $letter = substr($text, stripos($text, '[letter]')+8, stripos($text, '[/letter]') - stripos($text, '[letter]') - 8); $text = str_ireplace('[letter]'.$letter.'[/letter]', '<img src="images/letters/letter_martel_'.$letter.'.gif">', $text); } while(stripos($text, '[img=') !== false && stripos($text, ']') !== false ) { $img = substr($text, stripos($text, '[img=')+5, stripos($text, ']') - stripos($text, '[img]') - 5); $text = str_ireplace('[img='.$img.']', '<img src="'.$img.'">', $text); } while(stripos($text, '[b]') !== false && stripos($text, '[/b]') !== false ) { $b = substr($text, stripos($text, '[b]')+3, stripos($text, '[/b]') - stripos($text, '[b]') - 3); $text = str_ireplace('[b]'.$b.'[/b]', '<b>'.$b.'</b>', $text); } while(stripos($text, '[i]') !== false && stripos($text, '[/i]') !== false ) { $i = substr($text, stripos($text, '[i]')+3, stripos($text, '[/i]') - stripos($text, '[i]') - 3); $text = str_ireplace('[i]'.$i.'[/i]', '<i>'.$i.'</i>', $text); } while(stripos($text, '[u]') !== false && stripos($text, '[/u]') !== false ) { $u = substr($text, stripos($text, '[u]')+3, stripos($text, '[/u]') - stripos($text, '[u]') - 3); $text = str_ireplace('[u]'.$u.'[/u]', '<u>'.$u.'</u>', $text); } return replaceSmile($text, $smile); } function removeBBCode($text) { while(stripos($text, '[code]') !== false && stripos($text, '[/code]') !== false ) { $code = substr($text, stripos($text, '[code]')+6, stripos($text, '[/code]') - stripos($text, '[code]') - 6); $text = str_ireplace('[code]'.$code.'[/code]', $code, $text); } while(stripos($text, '[quote]') !== false && stripos($text, '[/quote]') !== false ) { $quote = substr($text, stripos($text, '[quote]')+7, stripos($text, '[/quote]') - stripos($text, '[quote]') - 7); $text = str_ireplace('[quote]'.$quote.'[/quote]', $quote, $text); } while(stripos($text, '[url]') !== false && stripos($text, '[/url]') !== false ) { $url = substr($text, stripos($text, '[url]')+5, stripos($text, '[/url]') - stripos($text, '[url]') - 5); $text = str_ireplace('[url]'.$url.'[/url]', $url, $text); } while(stripos($text, '[player]') !== false && stripos($text, '[/player]') !== false ) { $player = substr($text, stripos($text, '[player]')+8, stripos($text, '[/player]') - stripos($text, '[player]') - 8); $text = str_ireplace('[player]'.$player.'[/player]', $player, $text); } while(stripos($text, '[img=') !== false && stripos($text, ']') !== false ) { $img = substr($text, stripos($text, '[img=')+5, stripos($text, ']') - stripos($text, '[img]') - 5); $text = str_ireplace('[img='.$img.']', $img, $text); } while(stripos($text, '[b]') !== false && stripos($text, '[/b]') !== false ) { $b = substr($text, stripos($text, '[b]')+3, stripos($text, '[/b]') - stripos($text, '[b]') - 3); $text = str_ireplace('[b]'.$b.'[/b]', $b, $text); } while(stripos($text, '[i]') !== false && stripos($text, '[/i]') !== false ) { $i = substr($text, stripos($text, '[i]')+3, stripos($text, '[/i]') - stripos($text, '[i]') - 3); $text = str_ireplace('[i]'.$i.'[/i]', $i, $text); } while(stripos($text, '[u]') !== false && stripos($text, '[/u]') !== false ) { $u = substr($text, stripos($text, '[u]')+3, stripos($text, '[/u]') - stripos($text, '[u]') - 3); $text = str_ireplace('[u]'.$u.'[/u]', $u, $text); } return $text; } function codeLower($text) { return str_ireplace(array('[b]', '[i]', '[u]', '[/u][/i][/b][i][u]', '[/u][/i][u]', '[/u]', '[url]', '[player]', '[img=', '[code]', '[quote]', '[/quote][/code][/url][code][quote]', '[/player]', ']', '[/quote][/code][quote]', '[/quote]'), array('[b]', '[i]', '[u]', '[/u][/i][/b][i][u]', '[/u][/i][u]', '[/u]', '[url]', '[player]', '[img=', '[code]', '[quote]', '[/quote][/code][/url][code][quote]', '[/player]', ']', '[/quote][/code][quote]', '[/quote]'), $text); } function showPost($topic, $text, $smile) { $text = "<br><br>".nl2br($text); $post = ''; if(!empty($topic)) $post .= '<b>'.replaceSmile($topic, $smile).'</b>'; $post .= replaceAll($text, $smile); return $post; } function showPreview($topic, $text, $smile) { $text = nl2br($_POST['text']); $post = ''; if(!empty($topic)) $post .= '<b>'.replaceSmile($topic, $smile).'</b>'; $post .= replaceAll($text, $smile); return $post; } $main_content .= ' <table border=0 cellpadding=2 cellspacing=0 width=100%> <tr>'; if($action == '') { if(!$logged) $main_content .= ' <td class="ff_std" align="left" >You are <b>not</b> logged in. <a href="?subtopic=accountmanagement" >Log in</a> to post on the forum.</td>'; $main_content .= ' <td class="ff_info" align="right" valign="bottom" >&nbsp;<br>Current Time: <i>'.date('G:i').' CEST</i></td> </tr> </table>'; $main_content .= ' <table border=0 cellpadding=3 cellspacing=1 width=100%> <tr> <td bgcolor="#505050" class="ff_white" colspan=1 align="center" width=32 height="16" ><b><img src="'.$layout_name.'/images/general/blank.gif" width=32 height=16 border=0></b></td> <td bgcolor="#505050" class="ff_white" colspan=1 ><b>Board</b></td> <td bgcolor="#505050" class="ff_white" colspan=1 align="center" ><b>Posts</b></td> <td bgcolor="#505050" class="ff_white" colspan=1 align="center" ><b>Threads</b></td> <td bgcolor="#505050" class="ff_white" colspan=1 align="center" ><b>Last Post</b></td> </tr>'; $info = $SQL->query("SELECT " . $SQL->fieldName('section') . ", COUNT(" . $SQL->fieldName('id') . ") AS 'threads', SUM(" . $SQL->fieldName('replies') . ") AS 'replies' FROM " . $SQL->tableName('z_forum') . " WHERE " . $SQL->fieldName('first_post') . " = " . $SQL->fieldName('id') . " GROUP BY " . $SQL->fieldName('section') . "")->fetchAll(); foreach($info as $data) $counters[$data['section']] = array('threads' => $data['threads'], 'posts' => $data['replies'] + $data['threads']); foreach($sections as $id => $section) { $last_post = $SQL->query("SELECT " . $SQL->tableName('players') . "." . $SQL->fieldName('name') . ", " . $SQL->tableName('z_forum') . "." . $SQL->fieldName('post_date') . " FROM " . $SQL->tableName('players') . ", " . $SQL->tableName('z_forum') . " WHERE " . $SQL->tableName('z_forum') . "." . $SQL->fieldName('section') . " = ".(int) $id." AND " . $SQL->tableName('players') . "." . $SQL->fieldName('id') . " = " . $SQL->tableName('z_forum') . "." . $SQL->fieldName('author_guid') . " ORDER BY " . $SQL->fieldName('post_date') . " DESC LIMIT 1")->fetch(); if(!is_int($number_of_rows / 2)) { $bgcolor = $config['site']['darkborder']; } else { $bgcolor = $config['site']['lightborder']; } $number_of_rows++; $main_content .= ' <tr bgcolor="'.$bgcolor.'"> <td bgcolor="#D4C0A1" class="ff_std" >&nbsp;</td> <td bgcolor="#D4C0A1" class="ff_std"><a href="?subtopic=forum&action=show_board&id='.$id.'">'.$section.'</a><br /><small>'.$sections_desc[$id].'</small></td> <td bgcolor="#F1E0C6" class="ff_std" colspan=1 align="center">'.(int) $counters[$id]['posts'].'</td> <td bgcolor="#D4C0A1" class="ff_std" colspan=1 align="center">'.(int) $counters[$id]['threads'].'</td> <td bgcolor="#F1E0C6" class="ff_std" align="left" NOWRAP>'; if(isset($last_post['name'])) $main_content .= '<a href="?subtopic=forum&action=show_board&id='.$id.'"><img src="images/forum/logo_lastpost.gif" border=0 width=10 height=9></a>'.date('d.m.y H:i:s', $last_post['post_date']).'<br> <font class="ff_info">by&nbsp;<a href="?subtopic=characters&name='.urlencode($last_post['name']).'">'.$last_post['name'].'</a></font>'; else $main_content .= 'No posts'; $main_content .= ' </td> </tr> '; } $main_content .= ' <tr> <table border=0 cellpadding=6 cellspacing=0 width=100%> <tr> <td bgcolor="#505050" class="ff_white" colspan=1 align="left" NOWRAP ><b>All times are CEST.</b></td> <td bgcolor="#505050" class="ff_white" colspan=1 align="right" NOWRAP >&nbsp;</td> </tr> </td> </tr> </table>'; } if($action == 'show_board') { $section_id = (int) $_REQUEST['id']; $page = (int) $_REQUEST['page']; $threads_count = $SQL->query("SELECT COUNT(" . $SQL->tableName('z_forum') . "." . $SQL->fieldName('id') . ") AS threads_count FROM " . $SQL->tableName('players') . ", " . $SQL->tableName('z_forum') . " WHERE " . $SQL->tableName('players') . "." . $SQL->fieldName('id') . " = " . $SQL->tableName('z_forum') . "." . $SQL->fieldName('author_guid') . " AND " . $SQL->tableName('z_forum') . "." . $SQL->fieldName('section') . " = ".(int) $section_id." AND " . $SQL->tableName('z_forum') . "." . $SQL->fieldName('first_post') . " = " . $SQL->tableName('z_forum') . "." . $SQL->fieldName('id') . "")->fetch(); for($i = 0; $i < $threads_count['threads_count'] / $threads_per_page; $i++) { if($i != $page) $links_to_pages .= '<a href="?subtopic=forum&action=show_board&id='.$section_id.'&page='.$i.'">'.($i + 1).'</a> '; else $links_to_pages .= '<b>'.($i + 1).' </b>'; } $main_content .= ' <TABLE BORDER=0 CELLPADDING=0 CELLSPACING=0 WIDTH=100%> <TR> <TD><IMG SRC="'.$layout_name.'/images/general/blank.gif" WIDTH=10 HEIGHT=1 BORDER=0></TD> <TD WIDTH=100% ALIGN=right><a href="?subtopic=forum" >Community Boards</a> | <b>'.$sections[$section_id].'</b></TD> <TD><IMG SRC="'.$layout_name.'/images/general/blank.gif" WIDTH=10 HEIGHT=1 BORDER=0></TD> </TR> </TABLE>'; if(!$logged) $main_content .= ' <br>You are <b>not</b> logged in. <a href="?subtopic=accountmanagement" >Log in</a> to post on the forum.<br><br>'; $main_content .= ' <table border=0 cellpadding=2 cellspacing=0 width=100%> <tr> <td class="ff_std" colspan=4 align="left" ></td> </tr> <tr> <td colspan=1 align="left" ><a href="?subtopic=forum&action=new_topic&section_id='.$section_id.'" ><img src="images/forum/topic.gif" name="" width="85" height="20" border="0" ></a> </td> </tr> </table>'; $last_threads = $SQL->query("SELECT " . $SQL->tableName('players') . "." . $SQL->fieldName('name') . ", " . $SQL->tableName('players') . "." . $SQL->fieldName('signature') . ", " . $SQL->tableName('z_forum') . "." . $SQL->fieldName('post_text') . ", " . $SQL->tableName('z_forum') . "." . $SQL->fieldName('post_topic') . ", " . $SQL->tableName('z_forum') . "." . $SQL->fieldName('id') . ", " . $SQL->tableName('z_forum') . "." . $SQL->fieldName('last_post') . ", " . $SQL->tableName('z_forum') . "." . $SQL->fieldName('replies') . ", " . $SQL->tableName('z_forum') . "." . $SQL->fieldName('views') . ", " . $SQL->tableName('z_forum') . "." . $SQL->fieldName('post_date') . ", " . $SQL->tableName('z_forum') . "." . $SQL->fieldName('post_icon_id') . " FROM " . $SQL->tableName('players') . ", " . $SQL->tableName('z_forum') . " WHERE " . $SQL->tableName('players') . "." . $SQL->fieldName('id') . " = " . $SQL->tableName('z_forum') . "." . $SQL->fieldName('author_guid') . " AND " . $SQL->tableName('z_forum') . "." . $SQL->fieldName('section') . " = ".(int) $section_id." AND " . $SQL->tableName('z_forum') . "." . $SQL->fieldName('first_post') . " = " . $SQL->tableName('z_forum') . "." . $SQL->fieldName('id') . " ORDER BY " . $SQL->tableName('z_forum') . "." . $SQL->fieldName('last_post') . " DESC LIMIT ".$threads_per_page." OFFSET ".($page * $threads_per_page))->fetchAll(); if(isset($last_threads[0])) { $main_content .= ' <table border=0 cellpadding=3 cellspacing=1 width=100%> <tr> <td bgcolor="'.$config['site']['vdarkborder'].'" colspan=7 >&nbsp;</td> </tr>'; $main_content .= ' <tr> <td bgcolor="'.$config['site']['vdarkborder'].'" class="ff_white" colspan=1 align="center" width=22 > <b><img src="'.$layout_name.'/images/general/blank.gif" width=16 height=16 border=0></b> </td> <td bgcolor="'.$config['site']['vdarkborder'].'" class="ff_white" colspan=1 align="center" width=22 > <b><img src="'.$layout_name.'/images/general/blank.gif" width=16 height=16 border=0></b> </td> <td bgcolor="'.$config['site']['vdarkborder'].'" class="ff_white" colspan=1 align="center"> <b>Thread</b> </td> <td bgcolor="'.$config['site']['vdarkborder'].'" class="ff_white" colspan=1 align="center"> <b>Thread Starter</b> </td> <td bgcolor="'.$config['site']['vdarkborder'].'" class="ff_white" colspan=1 align="center"> <b>Replies</b> </td> <td bgcolor="'.$config['site']['vdarkborder'].'" class="ff_white" colspan=1 align="center"> <b>Views</b> </td> <td bgcolor="'.$config['site']['vdarkborder'].'" class="ff_white" colspan=1 align="center"> <b>Last Post</b> </td> </tr>'; foreach($last_threads as $thread) { if(!is_int($number_of_rows / 2)) { $bgcolor = $config['site']['lightborder']; } else { $bgcolor = $config['site']['darkborder']; } $number_of_rows++; $main_content .= ' <tr> <td bgcolor="#D4C0A1" class="ff_std" colspan=1 align="center" > <div class="HNCContainer" > <img src="'; if((int)$thread['replies'] >= 2) $main_content .= ' '.$layout_name.'/images/forum/logo_hot.gif" '; else $main_content .= ' '.$layout_name.'/images/general/blank.gif" '; $main_content .= ' width=22 height=22 border=0> </div> </td> <td bgcolor="#F1E0C6" class="ff_std" colspan=1 align="center" >'; if($thread['post_icon_id'] >= 1) $main_content .= ' <img src="'.$layout_name.'/images/forum/icons/'.$thread['post_icon_id'].'.gif" border=0 width=15 height=15 alt="Eek">'; $main_content .= ' </td> <td bgcolor="#D4C0A1" class="ff_std" colspan=1 align="left">'; if($logged && $group_id_of_acc_logged >= $group_not_blocked) $main_content .= ' <a href="?subtopic=forum&action=remove_post&id='.$thread['id'].'" onclick="return confirm(\'Are you sure you want remove thread > '.htmlspecialchars($thread['post_topic']).' <?\')"><font color="red">[REMOVE]</font></a> '; $main_content .= ' <a href="?subtopic=forum&action=show_thread&id='.$thread['id'].'">'.htmlspecialchars($thread['post_topic']).'</a></td> <td bgcolor="#F1E0C6" class="font_std" colspan=1 align="center"><a href="?subtopic=characters&name='.urlencode($thread['name']).'">'.$thread['name'].'</a></td> <td bgcolor="#D4C0A1" class="ff_std" colspan=1 align="center">'.(int) $thread['replies'].'</td> <td bgcolor="#F1E0C6" class="ff_std" colspan=1 align="center">'.(int) $thread['views'].'</td> <td bgcolor="#D4C0A1" class="ff_std" colspan=1 align="left">'; if($thread['last_post'] > 0) { $last_post = $SQL->query("SELECT " . $SQL->tableName('players') . "." . $SQL->fieldName('name') . ", " . $SQL->tableName('z_forum') . "." . $SQL->fieldName('post_date') . " FROM " . $SQL->tableName('players') . ", " . $SQL->tableName('z_forum') . " WHERE " . $SQL->tableName('z_forum') . "." . $SQL->fieldName('first_post') . " = ".(int) $thread['id']." AND " . $SQL->tableName('players') . "." . $SQL->fieldName('id') . " = " . $SQL->tableName('z_forum') . "." . $SQL->fieldName('author_guid') . " ORDER BY " . $SQL->fieldName('post_date') . " DESC LIMIT 1")->fetch(); if(isset($last_post['name'])) $main_content .= date('d.m.y H:i:s', $last_post['post_date']).'<br />by <a href="?subtopic=characters&name='.urlencode($last_post['name']).'">'.$last_post['name'].'</a>'; else $main_content .= 'No posts.'; } else $main_content .= date('d.m.y H:i:s', $thread['post_date']).'<br />by <a href="?subtopic=characters&name='.urlencode($thread['name']).'">'.$thread['name'].'</a>'; $main_content .= ' </td> </tr>'; } $main_content .= ' <table border=0 cellpadding=6 cellspacing=0 width=100%> <tr> <td bgcolor="#505050" class="ff_white" colspan=1 align="left" NOWRAP ><b>All times are CEST.</b></td> <td bgcolor="#505050" class="ff_white" colspan=1 align="right" NOWRAP >&nbsp;</td> </tr> </table> <table border=0 cellpadding=2 cellspacing=0 width=100%> <tr> <td colspan=1 align="left" valign="top" > <a href="?subtopic=forum&action=new_topic&section_id='.$section_id.'" > <img src="'.$layout_name.'/images/forum/button_newtopic_off.gif" name="" width="85" height="20" border="0" > </a> </td> </tr> </table> <td class="ff_info" colspan=1 align="right" valign="top" >Page: '.$links_to_pages.'</td> </tr> <tr> <td class="ff_std" colspan=4 align="left" ><br></td> </tr> </table> <center> <table border=0 cellpadding=3 cellspacing=0> <tr> <td class="ff_info" colspan=1 align="center" valign="middle" NOWRAP ><img src="'.$layout_name.'/images/forum/logo_new.gif" border=0 width=22 height=22></td> <td class="ff_info" colspan=1 align="center" valign="middle" NOWRAP ><b>New Posts</b></td> <td class="ff_info" colspan=1 align="center" valign="middle" NOWRAP ><img src="'.$layout_name.'/images/general/blank.gif" width=12 height=1 border=0></td> <td class="ff_info" colspan=1 align="center" valign="middle" NOWRAP ><img src="/images/forum/logo_hotnew.gif" border=0 width=22 height=22></td> <td class="ff_info" colspan=1 align="center" valign="middle" NOWRAP ><b>More Than 16 Replies</b></td> <td class="ff_info" colspan=1 align="center" valign="middle" NOWRAP ><img src="'.$layout_name.'/images/general/blank.gif" width=12 height=1 border=0></td> <td class="ff_info" colspan=1 align="center" valign="middle" NOWRAP ><img src="'.$layout_name.'/images/forum/logo_closed.gif" border=0 width=22 height=22></td> <td class="ff_info" colspan=1 align="center" valign="middle" NOWRAP ><b>Closed Thread</b></td> <td class="ff_info" colspan=1 align="center" valign="middle" NOWRAP ><img src="'.$layout_name.'/images/forum/logo_sticky.gif" border=0 width=22 height=22></td> <td class="ff_info" colspan=1 align="center" valign="middle" NOWRAP ><b>Sticky Thread</b></td> </tr> </table> </center> <br> <br> <b>Board Rights:<br> </b>View threads.<br> <br> Replace code is ON. Smileys are ON. Images are OFF. Links are OFF. "Thank You!" option is OFF. <br> Account muting option is ON. <br>'; } else $main_content .= '<h3>No threads in this board.</h3>'; } if($action == 'show_thread') { $thread_id = (int) $_REQUEST['id']; $page = (int) $_REQUEST['page']; $thread_name = $SQL->query("SELECT " . $SQL->tableName('players') . "." . $SQL->fieldName('name') . ", " . $SQL->tableName('z_forum') . "." . $SQL->fieldName('post_topic') . " FROM " . $SQL->tableName('players') . ", " . $SQL->tableName('z_forum') . " WHERE " . $SQL->tableName('z_forum') . "." . $SQL->fieldName('first_post') . " = ".(int) $thread_id." AND " . $SQL->tableName('z_forum') . "." . $SQL->fieldName('id') . " = " . $SQL->tableName('z_forum') . "." . $SQL->fieldName('first_post') . " AND " . $SQL->tableName('players') . "." . $SQL->fieldName('id') . " = " . $SQL->tableName('z_forum') . "." . $SQL->fieldName('author_guid') . " LIMIT 1")->fetch(); if(!empty($thread_name['name'])) { $posts_count = $SQL->query("SELECT COUNT(" . $SQL->tableName('z_forum') . "." . $SQL->fieldName('id') . ") AS posts_count FROM " . $SQL->tableName('players') . ", " . $SQL->tableName('z_forum') . " WHERE " . $SQL->tableName('players') . "." . $SQL->fieldName('id') . " = " . $SQL->tableName('z_forum') . "." . $SQL->fieldName('author_guid') . " AND " . $SQL->tableName('z_forum') . "." . $SQL->fieldName('first_post') . " = ".(int) $thread_id)->fetch(); for($i = 0; $i < $posts_count['posts_count'] / $threads_per_page; $i++) { if($i != $page) $links_to_pages .= '<a href="?subtopic=forum&action=show_thread&id='.$thread_id.'&page='.$i.'">'.($i + 1).'</a> '; else $links_to_pages .= '<b>'.($i + 1).' </b>'; } $threads = $SQL->query("SELECT " . $SQL->tableName('players') . "." . $SQL->fieldName('name') . ", " . $SQL->tableName('players') . "." . $SQL->fieldName('group_id') . ", " . $SQL->tableName('players') . "." . $SQL->fieldName('town_id') . ", " . $SQL->tableName('players') . "." . $SQL->fieldName('account_id') . ", " . $SQL->tableName('players') . "." . $SQL->fieldName('rank_id') . ", " . $SQL->tableName('players') . "." . $SQL->fieldName('vocation') . ", " . $SQL->tableName('players') . "." . $SQL->fieldName('level') . ", " . $SQL->tableName('players') . "." . $SQL->fieldName('signature') . ", " . $SQL->tableName('z_forum') . "." . $SQL->fieldName('id') . "," . $SQL->tableName('z_forum') . "." . $SQL->fieldName('first_post') . ", " . $SQL->tableName('z_forum') . "." . $SQL->fieldName('section') . ", " . $SQL->tableName('z_forum') . "." . $SQL->fieldName('post_icon_id') . ", " . $SQL->tableName('z_forum') . "." . $SQL->fieldName('post_text') . ", " . $SQL->tableName('z_forum') . "." . $SQL->fieldName('post_topic') . ", " . $SQL->tableName('z_forum') . "." . $SQL->fieldName('post_date') . ", " . $SQL->tableName('z_forum') . "." . $SQL->fieldName('post_smile') . ", " . $SQL->tableName('z_forum') . "." . $SQL->fieldName('author_aid') . ", " . $SQL->tableName('z_forum') . "." . $SQL->fieldName('author_guid') . ", " . $SQL->tableName('z_forum') . "." . $SQL->fieldName('last_edit_aid') . ", " . $SQL->tableName('z_forum') . "." . $SQL->fieldName('edit_date') . " FROM " . $SQL->tableName('players') . ", " . $SQL->tableName('z_forum') . " WHERE " . $SQL->tableName('players') . "." . $SQL->fieldName('id') . " = " . $SQL->tableName('z_forum') . "." . $SQL->fieldName('author_guid') . " AND " . $SQL->tableName('z_forum') . "." . $SQL->fieldName('first_post') . " = ".(int) $thread_id." ORDER BY " . $SQL->tableName('z_forum') . "." . $SQL->fieldName('post_date') . " LIMIT ".$posts_per_page." OFFSET ".($page * $posts_per_page))->fetchAll(); if(isset($threads[0]['name'])) $SQL->query("UPDATE " . $SQL->tableName('z_forum') . " SET " . $SQL->fieldName('views') . "=" . $SQL->fieldName('views') . "+1 WHERE " . $SQL->fieldName('id') . " = ".(int) $thread_id); $main_content .= ' <TABLE BORDER=0 CELLPADDING=0 CELLSPACING=0 WIDTH=100%> <TR> <TD><IMG SRC="'.$layout_name.'/images/general/blank.gif" WIDTH=10 HEIGHT=1 BORDER=0></TD> <TD WIDTH=100% ALIGN=right> <a href="?subtopic=forum" >Community Boards</a> | <a href="?subtopic=forum&action=show_board&id='.$threads[0]['section'].'">'.$sections[$threads[0]['section']].'</a> | <b>'.htmlspecialchars($thread_name['post_topic']).'</b> </TD> <TD><IMG SRC="'.$layout_name.'/images/general/blank.gif" WIDTH=10 HEIGHT=1 BORDER=0></TD> </TR> </TABLE> <br />'; if(!$logged) $main_content .= ' <br> You are <b>not</b> logged in. <a href="?subtopic=accountmanagement" >Log in</a> to post on the forum.<br> <br>'; $main_content .= ' <table border=0 cellpadding=0 cellspacing=0 width=100%> <tr> <td class="ff_std" colspan=4 align="left" ></td> </tr> <tr> <td bgcolor="#F1E0C6" class="ff_large" colspan=2 align="left" width=800 > <div class="PostReplyLink"> <a href="?subtopic=forum&action=new_post&thread_id='.$thread_id.'"> <img src="images/forum/post.gif" name="" width="92" height="20" border="0" > </a> </div> <div class="Text" ><b>'.$sections[$threads[0]['section']].': '.htmlspecialchars($thread_name['post_topic']).'</b></div></td> </tr> </table>'; $main_content .= ' <table border=0 cellpadding=5 cellspacing=1 width=100%> <tr> <td bgcolor="'.$config['site']['vdarkborder'].'" class="ff_white" colspan=2 align="left" NOWRAP > <div class="ForumPost" style="position:relative;height:26px;left:0px;"> <div style="float:left;width:175;padding: 5 5 0 5;" ><b>Author</b></div> <div style="float:right;width:600px;padding: 5 5 0 5;" > <table border=0 cellpadding=2 cellspacing=0 width=100%> <tr> <td bgcolor="'.$config['site']['vdarkborder'].'" class="ff_white" colspan=1 align="left" NOWRAP ><b>Thread #'.$threads[0]['id'].'</b></td> <td bgcolor="'.$config['site']['vdarkborder'].'" class="ff_white" colspan=1 align="right" NOWRAP ><b>Pages: '.$links_to_pages.'</b> </td> </tr> </table> </div> <div class="PostSeparatorV" ></div> </div> </td> </tr>'; foreach($threads as $thread) { if(!is_int($number_of_rows / 2)) { $bgcolor = $config['site']['darkborder']; } else { $bgcolor = $config['site']['lightborder']; } $number_of_rows++; $main_content .= ' <tr> <td colspan="2" class="CipPost" > <div class="ForumPost" style="background-color:'.$bgcolor.';" >'; if($thread['group_id'] >= 3) $main_content .= ' <div class="CipBorderTop" > <div class="CipBorder" > <div class="CipBorderCornerL" style="background-image: url('.$layout_name.'/images/forum/cip_post_border_lu.jpg)" ></div> <div class="CipBorderH" style="background-image: url('.$layout_name.'/images/forum/cip_post_border_h.jpg)" ></div> <div class="CipBorderCornerR" style="background-image: url('.$layout_name.'/images/forum/cip_post_border_ru.jpg)" ></div> </div> </div> <div class="CipBorderLeft" > <div class="CipBorderV" style="background-image: url('.$layout_name.'/images/forum/cip_post_border_v.jpg)" ></div> </div> <div class="CipBorderRight" > <div class="CipBorderV" style="background-image: url('.$layout_name.'/images/forum/cip_post_border_v.jpg)" ></div> </div>'; $main_content .= ' <div class="PostSeparatorV" ></div> <div class="PostUpper"> <div class="PostCharacterText" > <b><a href="?subtopic=characters&name='.urlencode($thread['name']).'">'.htmlspecialchars($thread['name']).'</a></b><br>'; if($thread['group_id'] >= 3) $main_content .= ' <font class="ff_smallinfo">Community Manager<br/>'; if($thread['group_id'] >= 3) $main_content .= ' <img class="CipPostIcon" src="'.$layout_name.'/images/forum/cip_post_icon.gif" /><br>'; $main_content .= ' </font><br> <font class="ff_infotext">Inhabitant of ' . $config['server']['serverName'] . '<br> Vocation: '.htmlspecialchars(Website::getVocationName($thread['vocation'], $thread['promotion'])).'<br> Level: '.$thread['level'].'<br> <br>'; $rank = new GuildRank($thread['rank_id']); if($rank->isLoaded()) { $guild = $rank->getGuild(); if($guild->isLoaded()) $main_content .= ' <font class="ff_smallinfo">'.htmlspecialchars($rank->getName()).' of the <a href="?subtopic=guilds&action=show&guild='.$guild->getId().'" >'.htmlspecialchars($guild->getName()).'</a> (MegaTibia)</font><br>'; } $posts = $SQL->query("SELECT COUNT(" . $SQL->fieldName('id') . ") AS 'posts' FROM " . $SQL->tableName('z_forum') . " WHERE " . $SQL->fieldName('author_aid') . "=".(int) $thread['account_id'])->fetch(); $main_content .= ' <br />Posts: '.(int) $posts['posts'].'<br /></font></div> <div class="PostText" >'; if($thread['post_icon_id'] != 0) $main_content .= ' <img src="'.$layout_name.'/images/forum/icons/'.$thread['post_icon_id'].'.gif"> '; $main_content .= ' '.showPost(htmlspecialchars($thread['post_topic']), nl2br($thread['post_text']), $thread['post_smile']); if(!empty($thread['signature'])){ $main_content .= ' <br />________________<br />'.$thread['signature']; $main_content .= ' <br /><br /><br /><br /> '; } $main_content .= ' </div> <div class="PostLower" > <div class="PostDetailsHelper" > <div class="PostDetails" ><img src="'.$layout_name.'/images/forum/logo_oldpost.gif" border=0 width=14 height=11>'.date('d.m.y H:i:s', $thread['post_date']); if($thread['edit_date'] > 0) { if($thread['last_edit_aid'] != $thread['author_aid']) $main_content .= '<br />Edited by moderator'; else $main_content .= '<br />Edited by '.htmlspecialchars($thread['name']); $main_content .= '<br />on '.date('d.m.y H:i:s', $thread['edit_date']); } $main_content .= '</div></div>'; $main_content .= ' <div class="PostActions" > <div class="AdditionalBox" >Post #'.$thread['id'].'</div>'; if($logged && $group_id_of_acc_logged >= $group_not_blocked) if($thread['first_post'] != $thread['id']) $main_content .= ' <a href="?subtopic=forum&action=remove_post&id='.$thread['id'].'" onclick="return confirm(\'Are you sure you want remove post of '.htmlspecialchars($thread['name']).'?\')"> <font color="red">REMOVE POST</font> </a>'; else $main_content .= ' <a href="?subtopic=forum&action=remove_post&id='.$thread['id'].'" onclick="return confirm(\'Are you sure you want remove thread > '.htmlspecialchars($thread['post_topic']).' <?\')"> <font color="red">REMOVE THREAD</font> </a>'; if($logged && ($thread['account_id'] == $account_logged->getId() || $group_id_of_acc_logged >= $group_not_blocked)) $main_content .= ' <br/><a href="?subtopic=forum&action=edit_post&id='.$thread['id'].'">Edit Post</a>'; if($logged) $main_content .= ' <br/><a href="?subtopic=forum&action=new_post&thread_id='.$thread_id.'&quote='.$thread['id'].'">Quote</a>'; $main_content .= ' </div>'; if($thread['group_id'] >= 3) $main_content .= ' <div class="CipBorderBottom"> <div class="CipBorder"> <div class="CipBorderCornerL" style="background-image: url('.$layout_name.'/images/forum/cip_post_border_ll.jpg)" ></div> <div class="CipBorderH" style="background-image: url('.$layout_name.'/images/forum/cip_post_border_h.jpg)" ></div> <div class="CipBorderCornerR" style="background-image: url('.$layout_name.'/images/forum/cip_post_border_rl.jpg)" ></div> </div> </div>'; else $main_content .= ' </div>'; $main_content .= ' </td> </tr>'; } $main_content .= ' <table border=0 cellpadding=6 cellspacing=0 width=100%> <tr> <td bgcolor="#505050" class="ff_white" colspan=1 align="left" NOWRAP ><b>All times are CEST.&nbsp;&nbsp;&nbsp;Pages: '.$links_to_pages.'</b></td> </tr> </table> <table border=0 cellpadding=6 cellspacing=0 width=100%> <tr> <td class="ff_pagetext" colspan=1 align="left" ></td> <td class="ff_large" colspan=1 align="right" > <a href="?subtopic=forum&action=new_post&thread_id='.$thread_id.'" > <img src="images/forum/post.gif" name="" width="92" height="20" border="0" > </a> </td> </tr> <tr> <td class="ff_std" colspan=1 align="left" ></td> </tr> <tr> <td class="ff_std" colspan=4 align="left" ></td> </tr> </table> <br> <b>Board Rights:<br> </b>View threads.<br> <br> Replace code is ON. Smileys are ON. Images are OFF. Links are OFF. "Thank You!" option is OFF. <br> Account muting option is ON. <br>'; } else $main_content .= 'Thread with this ID does not exits.'; } if($action == 'remove_post') { if($logged && $group_id_of_acc_logged >= $group_not_blocked) { $id = (int) $_REQUEST['id']; $post = $SQL->query("SELECT " . $SQL->fieldName('id') . ", " . $SQL->fieldName('first_post') . ", " . $SQL->fieldName('section') . " FROM " . $SQL->tableName('z_forum') . " WHERE " . $SQL->fieldName('id') . " = ".$id." LIMIT 1")->fetch(); if($post['id'] == $id) { if($post['id'] == $post['first_post']) { $SQL->query("DELETE FROM " . $SQL->tableName('z_forum') . " WHERE " . $SQL->fieldName('first_post') . " = ".$post['id']); header('Location: ?subtopic=forum&action=show_board&id='.$post['section']); } else { $post_page = $SQL->query("SELECT COUNT(" . $SQL->tableName('z_forum') . "." . $SQL->fieldName('id') . ") AS posts_count FROM " . $SQL->tableName('players') . ", " . $SQL->tableName('z_forum') . " WHERE " . $SQL->tableName('players') . "." . $SQL->fieldName('id') . " = " . $SQL->tableName('z_forum') . "." . $SQL->fieldName('author_guid') . " AND " . $SQL->tableName('z_forum') . "." . $SQL->fieldName('id') . " < ".$id." AND " . $SQL->tableName('z_forum') . "." . $SQL->fieldName('first_post') . " = ".(int) $post['first_post'])->fetch(); $page = (int) ceil($post_page['posts_count'] / $threads_per_page) - 1; $SQL->query("UPDATE " . $SQL->tableName('z_forum') . " SET " . $SQL->fieldName('replies') . " = " . $SQL->fieldName('replies') . " - 1 WHERE " . $SQL->fieldName('id') . " = ".$post['first_post']); $SQL->query("DELETE FROM " . $SQL->tableName('z_forum') . " WHERE " . $SQL->fieldName('id') . " = ".$post['id']); header('Location: ?subtopic=forum&action=show_thread&id='.$post['first_post'].'&page='.(int) $page); } } else $main_content .= 'Post with ID '.$id.' does not exist.'; } else $main_content .= 'You are not logged in or you are not moderator.'; } if($action == 'new_post') { if($logged) { if(canPost($account_logged) || $group_id_of_acc_logged >= $group_not_blocked) { $players_from_account = $SQL->query("SELECT " . $SQL->tableName('players') . "." . $SQL->fieldName('name') . ", " . $SQL->tableName('players') . "." . $SQL->fieldName('id') . " FROM " . $SQL->tableName('players') . " WHERE " . $SQL->tableName('players') . "." . $SQL->fieldName('account_id') . " = ".(int) $account_logged->getId())->fetchAll(); $thread_id = (int) $_REQUEST['thread_id']; $thread = $SQL->query("SELECT " . $SQL->tableName('z_forum') . "." . $SQL->fieldName('post_topic') . ", " . $SQL->tableName('z_forum') . "." . $SQL->fieldName('id') . ", " . $SQL->tableName('z_forum') . "." . $SQL->fieldName('section') . ", " . $SQL->tableName('z_forum') . "." . $SQL->fieldName('post_icon_id') . " FROM " . $SQL->tableName('z_forum') . " WHERE " . $SQL->tableName('z_forum') . "." . $SQL->fieldName('id') . " = ".(int) $thread_id." AND " . $SQL->tableName('z_forum') . "." . $SQL->fieldName('first_post') . " = ".(int) $thread_id." LIMIT 1")->fetch(); $main_content .= ' <TABLE BORDER=0 CELLPADDING=0 CELLSPACING=0 WIDTH=100%> <TR> <TD><IMG SRC="'.$layout_name.'/images/general/blank.gif" WIDTH=10 HEIGHT=1 BORDER=0></TD> <TD WIDTH=100% ALIGN=right> <a href="?subtopic=forum" >Community Boards</a> | <a href="?subtopic=forum&action=show_board&id='.$thread['section'].'">'.$sections[$thread['section']].'</a> | <a href="?subtopic=forum&action=show_thread&id='.$thread_id.'">'.htmlspecialchars($thread['post_topic']).'</a> | <b>Post New Reply</b></TD> <TD><IMG SRC="'.$layout_name.'/images/general/blank.gif" WIDTH=10 HEIGHT=1 BORDER=0></TD> </TR> </TABLE> <br> '; if(isset($_POST['preview_new_post'])){ $main_content .= ' <table border=0 cellpadding=4 cellspacing=1 width=100%> <tr> <td bgcolor="#505050" class="ff_whitelarge" colspan=1 align="left" NOWRAP ><b>Message Preview</b></td> </tr> <tr> <td style="position:relative; height:100%;background-color:#D4C0A1;" align="top" > <div style="position:relative; min-height:18px; width:100%; overflow-x:auto; overflow-y:visible; width:734px; word-wrap:break-word;"> '.showPreview(htmlspecialchars($thread['post_topic']), nl2br($_POST['text']), $thread['post_smile']).' </div> </td> </tr> </table><br><br>'; } if(isset($thread['id'])) { $quote = (int) $_REQUEST['quote']; $text = trim(codeLower($_REQUEST['text'])); $forum_iconid = (int) $_REQUEST['forum_iconid']; $char_id = (int) $_REQUEST['char_id']; $post_topic = trim($_REQUEST['topic']); $smile = (int) $_REQUEST['smile']; $saved = false; if(isset($_REQUEST['quote'])) { $quoted_post = $SQL->query("SELECT " . $SQL->tableName('players') . "." . $SQL->fieldName('name') . ", " . $SQL->tableName('z_forum') . "." . $SQL->fieldName('post_text') . ", " . $SQL->tableName('z_forum') . "." . $SQL->fieldName('post_date') . " FROM " . $SQL->tableName('players') . ", " . $SQL->tableName('z_forum') . " WHERE " . $SQL->tableName('players') . "." . $SQL->fieldName('id') . " = " . $SQL->tableName('z_forum') . "." . $SQL->fieldName('author_guid') . " AND " . $SQL->tableName('z_forum') . "." . $SQL->fieldName('id') . " = ".(int) $quote)->fetchAll(); if(isset($quoted_post[0]['name'])) $text = '[i]Originally posted by '.$quoted_post[0]['name'].' on '.date('d.m.y H:i:s', $quoted_post[0]['post_date']).':[/i][quote]'.$quoted_post[0]['post_text'].'[/quote]'; } elseif(isset($_POST['submit']) && $_POST['submit'] == "save_post") { $lenght = 0; for($i = 0; $i <= strlen($text); $i++) { if(ord($text[$i]) >= 33 && ord($text[$i]) <= 126) $lenght++; } if($lenght < 1 || strlen($text) > 15000) $errors[] = 'Too short or too long post (short: '.$lenght.' long: '.strlen($text).' letters). Minimum 1 letter, maximum 15000 letters.'; if($char_id == 0) $errors[] = 'Please select a character.'; $player_on_account == false; if(count($errors) == 0) { foreach($players_from_account as $player) if($char_id == $player['id']) $player_on_account = true; if(!$player_on_account) $errors[] = 'Player with selected ID '.$char_id.' doesn\'t exist or isn\'t on your account'; } if(count($errors) == 0) { $last_post = $account_logged->getCustomField('last_post'); if($last_post+$post_interval-time() > 0 && $group_id_of_acc_logged < $group_not_blocked) $errors[] = 'You can post one time per '.$post_interval.' seconds. Next post after '.($last_post+$post_interval-time()).' second(s).'; } if(count($errors) == 0) { $saved = true; $account_logged->set('last_post', time()); $account_logged->save(); $SQL->query("INSERT INTO " . $SQL->tableName('z_forum') . " (" . $SQL->fieldName('first_post') . " ," . $SQL->fieldName('last_post') . " ," . $SQL->fieldName('section') . " ," . $SQL->fieldName('replies') . " ," . $SQL->fieldName('views') . " ," . $SQL->fieldName('author_aid') . " ," . $SQL->fieldName('author_guid') . " ," . $SQL->fieldName('post_text') . " ," . $SQL->fieldName('post_topic') . " ," . $SQL->fieldName('post_smile') . " ," . $SQL->fieldName('post_date') . " ," . $SQL->fieldName('last_edit_aid') . " ," . $SQL->fieldName('edit_date') . ", " . $SQL->fieldName('post_ip') . ", " . $SQL->fieldName('post_icon_id') . ") VALUES ('".$thread['id']."', '0', '".$thread['section']."', '0', '0', '".$account_logged->getId()."', '".(int) $char_id."', ".$SQL->quote($text).", ".$SQL->quote($post_topic).", '".(int) $smile."', '".time()."', '0', '0', '".$_SERVER['REMOTE_ADDR']."', '".(int) $forum_iconid."')"); $SQL->query("UPDATE " . $SQL->tableName('z_forum') . " SET " . $SQL->fieldName('replies') . "=" . $SQL->fieldName('replies') . "+1, " . $SQL->fieldName('last_post') . "=".time()." WHERE " . $SQL->fieldName('id') . " = ".(int) $thread_id); $post_page = $SQL->query("SELECT COUNT(" . $SQL->tableName('z_forum') . "." . $SQL->fieldName('id') . ") AS posts_count FROM " . $SQL->tableName('players') . ", " . $SQL->tableName('z_forum') . " WHERE " . $SQL->tableName('players') . "." . $SQL->fieldName('id') . " = " . $SQL->tableName('z_forum') . "." . $SQL->fieldName('author_guid') . " AND " . $SQL->tableName('z_forum') . "." . $SQL->fieldName('post_date') . " <= ".time()." AND " . $SQL->tableName('z_forum') . "." . $SQL->fieldName('first_post') . " = ".(int) $thread['id'])->fetch(); $page = (int) ceil($post_page['posts_count'] / $threads_per_page) - 1; header('Location: ?subtopic=forum&action=show_thread&id='.$thread_id.'&page='.$page); $main_content .= '<br />Thank you for posting.<br /><a href="?subtopic=forum&action=show_thread&id='.$thread_id.'">GO BACK TO LAST THREAD</a>'; } } if(!$saved) { if(count($errors) > 0) { $main_content .= '<font color="red" size="2"><b>Errors occured:</b>'; foreach($errors as $error) $main_content .= '<br />* '.$error; $main_content .= '</font><br />'; } $main_content .= ' <table border=0 cellpadding=4 cellspacing=1 width="97%"> <form action="?" method="POST"> <input type="hidden" name="action" value="new_post" /> <input type="hidden" name="thread_id" value="'.$thread_id.'" /> <input type="hidden" name="subtopic" value="forum" /> <input type="hidden" name="save" value="save" /> <tr> <td bgcolor="#505050" class="ff_whitelarge" colspan=2 align="left" >Post New Reply</td> </tr> <tr> <td bgcolor="#D4C0A1" class="ff_std" colspan=1 align="left" valign="top" ><b>'.$config['server']['serverName'].' Character:</b></td> <td bgcolor="#D4C0A1" class="ff_std" colspan=1 align="left" > <select name="char_id"> <option value="0">(Choose character)</option>'; foreach($players_from_account as $player) { $main_content .= '<option value="'.$player['id'].'"'; if($player['id'] == $char_id) $main_content .= ' selected="selected"'; $main_content .= '>'.$player['name'].'</option>'; } $main_content .= ' </select> </td> </tr> <tr> <td bgcolor="#F1E0C6" class="ff_std" colspan=1 align="left" valign="top" ><b>Post Subject:</b></td> <td bgcolor="#F1E0C6" class="ff_std" colspan=1 align="left" > <input type="text" name="topic" value="'.htmlspecialchars($post_topic).'" size="40" maxlength="60" /> <font class="ff_info"> (Optional)</font> </td> </tr> <tr> <td bgcolor="#D4C0A1" class="ff_std" colspan=1 align="left" valign="top" ><b>Post Icon:</b></td> <td bgcolor="#D4C0A1" class="ff_std" colspan=1 align="left" > <input type=radio name="forum_iconid" value="11"> &nbsp;<img src="'.$layout_name.'/images/forum/icons/11.gif" border=0 width=15 height=15 alt="Stuck Tongue Out">&nbsp;&nbsp;&nbsp; <input type=radio name="forum_iconid" value="12"> &nbsp;<img src="'.$layout_name.'/images/forum/icons/12.gif" border=0 width=15 height=15 alt="Eek">&nbsp;&nbsp;&nbsp; <input type=radio name="forum_iconid" value="13"> &nbsp;<img src="'.$layout_name.'/images/forum/icons/13.gif" border=0 width=15 height=15 alt="Roll Eyes">&nbsp;&nbsp;&nbsp; <input type=radio name="forum_iconid" value="14"> &nbsp;<img src="'.$layout_name.'/images/forum/icons/14.gif" border=0 width=15 height=15 alt="Thumbs up">&nbsp;&nbsp;&nbsp; <input type=radio name="forum_iconid" value="15"> &nbsp;<img src="'.$layout_name.'/images/forum/icons/15.gif" border=0 width=15 height=15 alt="Thumbs down">&nbsp;&nbsp;&nbsp; <input type=radio name="forum_iconid" value="16"> &nbsp;<img src="'.$layout_name.'/images/forum/icons/16.gif" border=0 width=15 height=15 alt="Wink">&nbsp;&nbsp;&nbsp; <input type=radio name="forum_iconid" value="17"> &nbsp;<img src="'.$layout_name.'/images/forum/icons/17.gif" border=0 width=15 height=15 alt="Red face">&nbsp;&nbsp;&nbsp;<br> <input type=radio name="forum_iconid" value="18"> &nbsp;<img src="'.$layout_name.'/images/forum/icons/18.gif" border=0 width=15 height=15 alt="Talking">&nbsp;&nbsp;&nbsp; <input type=radio name="forum_iconid" value="19"> &nbsp;<img src="'.$layout_name.'/images/forum/icons/19.gif" border=0 width=15 height=15 alt="Unhappy">&nbsp;&nbsp;&nbsp; <input type=radio name="forum_iconid" value="20"> &nbsp;<img src="'.$layout_name.'/images/forum/icons/20.gif" border=0 width=15 height=15 alt="Angry">&nbsp;&nbsp;&nbsp; <input type=radio name="forum_iconid" value="21"> &nbsp;<img src="'.$layout_name.'/images/forum/icons/21.gif" border=0 width=15 height=15 alt="Smile">&nbsp;&nbsp;&nbsp; <input type=radio name="forum_iconid" value="22"> &nbsp;<img src="'.$layout_name.'/images/forum/icons/22.gif" border=0 width=15 height=15 alt="Cool">&nbsp;&nbsp;&nbsp; <input type=radio name="forum_iconid" value="23"> &nbsp;<img src="'.$layout_name.'/images/forum/icons/23.gif" border=0 width=15 height=15 alt="Question">&nbsp;&nbsp;&nbsp; <input type=radio name="forum_iconid" value="24"> &nbsp;<img src="'.$layout_name.'/images/forum/icons/24.gif" border=0 width=15 height=15 alt="Exclamation">&nbsp;&nbsp;&nbsp;<br> <input type=radio name="forum_iconid" value="25"> &nbsp;<img src="'.$layout_name.'/images/forum/icons/25.gif" border=0 width=15 height=15 alt="Lightbulb">&nbsp;&nbsp;&nbsp; <input type=radio name="forum_iconid" value="26"> &nbsp;<img src="'.$layout_name.'/images/forum/icons/26.gif" border=0 width=15 height=15 alt="Arrow">&nbsp;&nbsp;&nbsp; <input type=radio name="forum_iconid" value="27"> &nbsp;<img src="'.$layout_name.'/images/forum/icons/27.gif" border=0 width=15 height=15 alt="Post">&nbsp;&nbsp;&nbsp;<br> <input type=radio name="forum_iconid" value="0" checked> &nbsp;No Icon</td> </tr> <tr> <td bgcolor="#F1E0C6" class="ff_std" colspan=1 align="left" valign="top" ><b>Message:</b><br> <br> <font class="ff_info">Replace codes are allowed.<br><br> How to use smileys:<br> <table border=0 cellpadding=2 cellspacing=0 width=100%> <tr> <td colspan=1 align="left" ><img src="'.$layout_name.'/images/forum/smile/1.gif" border=0 width=15 height=15 alt="Stuck Tongue Out"></td> <td colspan=1 align="left" >:p</td> </tr> <tr> <td colspan=1 align="left" ><img src="'.$layout_name.'/images/forum/smile/2.gif" border=0 width=15 height=15 alt="Eek"></td> <td colspan=1 align="left" >:eek:</td> </tr> <tr> <td colspan=1 align="left" ><img src="'.$layout_name.'/images/forum/smile/3.gif" border=0 width=15 height=15 alt="Roll Eyes"></td> <td colspan=1 align="left" >:rolleyes:</td> </tr> <tr> <td colspan=1 align="left" ><img src="'.$layout_name.'/images/forum/smile/4.gif" border=0 width=15 height=15 alt="Wink"></td> <td colspan=1 align="left" >;)</td> </tr> <tr> <td colspan=1 align="left" ><img src="'.$layout_name.'/images/forum/smile/5.gif" border=0 width=15 height=15 alt="Red face"></td> <td colspan=1 align="left" >:o</td> </tr> <tr> <td colspan=1 align="left" ><img src="'.$layout_name.'/images/forum/smile/6.gif" border=0 width=15 height=15 alt="Talking"></td> <td colspan=1 align="left" >:D</td> </tr> <tr> <td colspan=1 align="left" ><img src="'.$layout_name.'/images/forum/smile/7.gif" border=0 width=15 height=15 alt="Unhappy"></td> <td colspan=1 align="left" >:(</td> </tr> <tr> <td colspan=1 align="left" ><img src="'.$layout_name.'/images/forum/smile/8.gif" border=0 width=15 height=15 alt="Angry"></td> <td colspan=1 align="left" >:mad:</td> </tr> <tr> <td colspan=1 align="left" ><img src="'.$layout_name.'/images/forum/smile/9.gif" border=0 width=15 height=15 alt="Smile"></td> <td colspan=1 align="left" >:)</td> </tr> <tr> <td colspan=1 align="left" ><img src="'.$layout_name.'/images/forum/smile/10.gif" border=0 width=15 height=15 alt="Cool"></td> <td colspan=1 align="left" >:cool:</td> </tr> </table> </font> </td> <td bgcolor="#F1E0C6" class="ff_std" colspan=1 align="left" ><textarea rows=20 cols=55 name="text">'.htmlspecialchars($text).'</textarea></td> </tr> <tr> <td bgcolor="#D4C0A1" class="ff_std" colspan=1 align="left" valign="top" ><b>Options:</td> <td bgcolor="#D4C0A1" class="ff_info" colspan=1 align="left" ><input type="checkbox" name="smile" value="1"'; if($smile == 1) $main_content .= ' checked="checked"'; $main_content .= '/>&nbsp;<b>Disable Smileys in This Post </b><br> </td> </tr> <tr> <td class="ff_std" colspan=2 align="center"><br> <input type=submit name="preview_new_post" value="Preview Reply"> &nbsp; <button type="submit" name="submit" value="save_post">Submit Message</button> &nbsp; <input type=reset name="reset" value="Reset Fields"> </td> </FORM> </table>'; $threads = $SQL->query("SELECT " . $SQL->tableName('players') . "." . $SQL->fieldName('name') . ", " . $SQL->tableName('z_forum') . "." . $SQL->fieldName('post_text') . ", " . $SQL->tableName('z_forum') . "." . $SQL->fieldName('post_topic') . ", " . $SQL->tableName('z_forum') . "." . $SQL->fieldName('post_smile') . " FROM " . $SQL->tableName('players') . ", " . $SQL->tableName('z_forum') . " WHERE " . $SQL->tableName('players') . "." . $SQL->fieldName('id') . " = " . $SQL->tableName('z_forum') . "." . $SQL->fieldName('author_guid') . " AND " . $SQL->tableName('z_forum') . "." . $SQL->fieldName('first_post') . " = ".(int) $thread_id." ORDER BY " . $SQL->tableName('z_forum') . "." . $SQL->fieldName('post_date') . " DESC LIMIT 10")->fetchAll(); $main_content .= ' <br><br> <table border=0 cellpadding=5 cellspacing=1 width=100%> <tr> <td bgcolor="#505050" class="ff_whitelarge" colspan=2 align="center" NOWRAP ><b>Thread Review (newest first)</b></td> </tr>'; foreach($threads as $thread) { if(is_int($number_of_rows / 2)) { $bgcolor = $config['site']['darkborder']; } else { $bgcolor = $config['site']['lightborder']; } $number_of_rows++; $main_content .= ' <tr> <td bgcolor="'.$bgcolor.'" class="ff_pagetext" colspan=1 align="left" valign="top" width=175 ><a href="#">'.$thread['name'].'</a></td> <td style="position:relative; height:100%;background-color:'.$bgcolor.';" align="top" > <div style="position:relative; min-height:18px; width:100%; overflow-x:auto; overflow-y:visible; width:538px; word-wrap:break-word;" >'.showPost(htmlspecialchars($thread['post_topic']), nl2br($thread['post_text']), $thread['post_smile']).'</div></td> </tr>'; } } } else $main_content .= 'Thread with ID '.$thread_id.' doesn\'t exist.'; } else $main_content .= 'Your account is banned, deleted or you don\'t have any player with level '.$level_limit.' on your account. You can\'t post.'; } else $main_content .= 'Login first.'; } $main_content .= '</table>'; if($action == 'edit_post') { if($logged) { if(canPost($account_logged) || $group_id_of_acc_logged >= $group_not_blocked) { $post_id = (int) $_REQUEST['id']; $thread = $SQL->query("SELECT " . $SQL->tableName('z_forum') . "." . $SQL->fieldName('author_guid') . ", " . $SQL->tableName('z_forum') . "." . $SQL->fieldName('author_aid') . ", " . $SQL->tableName('z_forum') . "." . $SQL->fieldName('first_post') . ", " . $SQL->tableName('z_forum') . "." . $SQL->fieldName('post_topic') . ", " . $SQL->tableName('z_forum') . "." . $SQL->fieldName('post_date') . ", " . $SQL->tableName('z_forum') . "." . $SQL->fieldName('post_text') . ", " . $SQL->tableName('z_forum') . "." . $SQL->fieldName('post_icon_id') . ", " . $SQL->tableName('z_forum') . "." . $SQL->fieldName('post_smile') . ", " . $SQL->tableName('z_forum') . "." . $SQL->fieldName('id') . ", " . $SQL->tableName('z_forum') . "." . $SQL->fieldName('section') . " FROM " . $SQL->tableName('z_forum') . " WHERE " . $SQL->tableName('z_forum') . "." . $SQL->fieldName('id') . " = ".(int) $post_id." LIMIT 1")->fetch(); if(isset($thread['id'])) { $first_post = $SQL->query("SELECT " . $SQL->tableName('z_forum') . "." . $SQL->fieldName('author_guid') . ", " . $SQL->tableName('z_forum') . "." . $SQL->fieldName('author_aid') . ", " . $SQL->tableName('z_forum') . "." . $SQL->fieldName('first_post') . ", " . $SQL->tableName('z_forum') . "." . $SQL->fieldName('post_topic') . ", " . $SQL->tableName('z_forum') . "." . $SQL->fieldName('post_text') . ", " . $SQL->tableName('z_forum') . "." . $SQL->fieldName('post_smile') . ", " . $SQL->tableName('z_forum') . "." . $SQL->fieldName('id') . ", " . $SQL->tableName('z_forum') . "." . $SQL->fieldName('section') . " FROM " . $SQL->tableName('z_forum') . " WHERE " . $SQL->tableName('z_forum') . "." . $SQL->fieldName('id') . " = ".(int) $thread['first_post']." LIMIT 1")->fetch(); $main_content .= ' <TABLE BORDER=0 CELLPADDING=0 CELLSPACING=0 WIDTH=100%> <TR> <TD><IMG SRC="'.$layout_name.'/images/general/blank.gif" WIDTH=10 HEIGHT=1 BORDER=0></TD> <TD WIDTH=100% ALIGN=right> <a href="?subtopic=forum" >Community Boards</a> | <a href="?subtopic=forum&action=show_board&id='.$thread['section'].'">'.$sections[$thread['section']].'</a> | <a href="?subtopic=forum&action=show_thread&id='.$thread['first_post'].'">'.htmlspecialchars($first_post['post_topic']).'</a> | <b><a href="http://forum.tibia.com/forum/?action=thread&amp;postid=35335511#post35335511" >Post</a></b> | <b>Edit Post</b></TD> <TD><IMG SRC="'.$layout_name.'/images/general/blank.gif" WIDTH=10 HEIGHT=1 BORDER=0></TD> </TR> </TABLE> <br> '; if(isset($_POST['preview_edit_post'])){ $main_content .= ' <table border=0 cellpadding=4 cellspacing=1 width=100%> <tr> <td bgcolor="#505050" class="ff_whitelarge" colspan=1 align="left" NOWRAP ><b>Message Preview</b></td> </tr> <tr> <td style="position:relative; height:100%;background-color:#D4C0A1;" align="top" > <div style="position:relative; min-height:18px; width:100%; overflow-x:auto; overflow-y:visible; width:734px; word-wrap:break-word;"> '.showPreview(htmlspecialchars($thread['post_topic']), nl2br($_POST['text']), $thread['post_smile']).' </div> </td> </tr> </table><br><br>'; } if($account_logged->getId() == $thread['author_aid'] || $group_id_of_acc_logged >= $group_not_blocked) { $players_from_account = $SQL->query("SELECT " . $SQL->tableName('players') . "." . $SQL->fieldName('name') . ", " . $SQL->tableName('players') . "." . $SQL->fieldName('id') . " FROM " . $SQL->tableName('players') . " WHERE " . $SQL->tableName('players') . "." . $SQL->fieldName('account_id') . " = ".(int) $account_logged->getId())->fetchAll(); $saved = false; if(isset($_POST['submit']) && $_POST['submit'] == "edit_post") { $text = trim(codeLower($_REQUEST['text'])); $char_id = (int) $_REQUEST['char_id']; $forum_iconid = (int) $_REQUEST['forum_iconid']; $post_topic = trim($_REQUEST['topic']); $smile = (int) $_REQUEST['smile']; $lenght = 0; for($i = 0; $i <= strlen($post_topic); $i++) { if(ord($post_topic[$i]) >= 33 && ord($post_topic[$i]) <= 126) $lenght++; } if(($lenght < 1 || strlen($post_topic) > 60) && $thread['id'] == $thread['first_post']) $errors[] = 'Too short or too long topic (short: '.$lenght.' long: '.strlen($post_topic).' letters). Minimum 1 letter, maximum 60 letters.'; $lenght = 0; for($i = 0; $i <= strlen($text); $i++) { if(ord($text[$i]) >= 33 && ord($text[$i]) <= 126) $lenght++; } if($lenght < 1 || strlen($text) > 15000) $errors[] = 'Too short or too long post (short: '.$lenght.' long: '.strlen($text).' letters). Minimum 1 letter, maximum 15000 letters.'; if($char_id == 0) $errors[] = 'Please select a character.'; if(empty($post_topic) && $thread['id'] == $thread['first_post']) $errors[] = 'Thread topic can\'t be empty.'; $player_on_account == false; if(count($errors) == 0) { foreach($players_from_account as $player) if($char_id == $player['id']) $player_on_account = true; if(!$player_on_account) $errors[] = 'Player with selected ID '.$char_id.' doesn\'t exist or isn\'t on your account'; } if(count($errors) == 0) { $saved = true; if($account_logged->getId() != $thread['author_aid']) $char_id = $thread['author_guid']; $SQL->query("UPDATE " . $SQL->tableName('z_forum') . " SET " . $SQL->fieldName('author_guid') . " = ".(int) $char_id.", " . $SQL->fieldName('post_text') . " = ".$SQL->quote($text).", " . $SQL->fieldName('post_topic') . " = ".$SQL->quote($post_topic).", " . $SQL->fieldName('post_smile') . " = ".(int) $smile.", " . $SQL->fieldName('last_edit_aid') . " = ".(int) $account_logged->getId()."," . $SQL->fieldName('edit_date') . " = ".time().", " . $SQL->fieldName('post_icon_id')." = " .(int) $forum_iconid. " WHERE " . $SQL->fieldName('id') . " = ".(int) $thread['id']); $post_page = $SQL->query("SELECT COUNT(" . $SQL->tableName('z_forum') . "." . $SQL->fieldName('id') . ") AS posts_count FROM " . $SQL->tableName('players') . ", " . $SQL->tableName('z_forum') . " WHERE " . $SQL->tableName('players') . "." . $SQL->fieldName('id') . " = " . $SQL->tableName('z_forum') . "." . $SQL->fieldName('author_guid') . " AND " . $SQL->tableName('z_forum') . "." . $SQL->fieldName('post_date') . " <= ".$thread['post_date']." AND " . $SQL->tableName('z_forum') . "." . $SQL->fieldName('first_post') . " = ".(int) $thread['first_post'])->fetch(); $page = (int) ceil($post_page['posts_count'] / $threads_per_page) - 1; header('Location: ?subtopic=forum&action=show_thread&id='.$thread['first_post'].'&page='.$page); $main_content .= '<br />Thank you for editing post.<br /><a href="?subtopic=forum&action=show_thread&id='.$thread['first_post'].'">GO BACK TO LAST THREAD</a>'; } } else { $text = $thread['post_text']; $char_id = (int) $thread['author_guid']; $post_topic = $thread['post_topic']; $smile = (int) $thread['post_smile']; } if(!$saved) { if(count($errors) > 0) { $main_content .= '<br /><font color="red" size="2"><b>Errors occured:</b>'; foreach($errors as $error) $main_content .= '<br />* '.$error; $main_content .= '</font>'; } $main_content .= ' <table border=0 cellpadding=4 cellspacing=1> <form action="?" method="POST"> <input type="hidden" name="action" value="edit_post" /> <input type="hidden" name="id" value="'.$post_id.'" /> <input type="hidden" name="subtopic" value="forum" /> <input type="hidden" name="save" value="save" /> <tr> <td bgcolor="#505050" class="ff_whitelarge" colspan=2 align="left" >Edit Post</td> </tr> <tr> <td bgcolor="#D4C0A1" class="ff_std" colspan=1 align="left" valign="top" ><b>'.$config['server']['serverName'].' Character:</b><br> <font class="ff_smallinfo">(This will appear as "Edited by ..." in the post)</font> </td> <td bgcolor="#D4C0A1" class="ff_std" colspan=1 align="left" > <select name="char_id"> <option value="0">(Choose character)</option>'; foreach($players_from_account as $player) { $main_content .= '<option value="'.$player['id'].'"'; if($player['id'] == $char_id) $main_content .= ' selected="selected"'; $main_content .= '>'.$player['name'].'</option>'; } $main_content .= ' </select> </td> </tr> <tr> <td bgcolor="#F1E0C6" class="ff_std" colspan=1 align="left" valign="top" ><b>Post Subject:</b></td> <td bgcolor="#F1E0C6" class="ff_std" colspan=1 align="left" ><input type="text" value="'.htmlspecialchars($post_topic).'" name="topic" size="40" maxlength="60" /><font class="ff_info"> (Optional)</font></td> </tr> <tr> <td bgcolor="#D4C0A1" class="ff_std" colspan=1 align="left" valign="top" ><b>Post Icon:</b></td> <td bgcolor="#D4C0A1" class="ff_std" colspan=1 align="left" > <input type=radio name="forum_iconid" value="11"'; if($thread['post_icon_id'] == "11"){$main_content .= 'checked';} $main_content .= ' > &nbsp;<img src="'.$layout_name.'/images/forum/icons/11.gif" border=0 width=15 height=15 alt="Stuck Tongue Out">&nbsp;&nbsp;&nbsp; <input type=radio name="forum_iconid" value="12"'; if($thread['post_icon_id'] == "12"){$main_content .= 'checked';} $main_content .= '> &nbsp;<img src="'.$layout_name.'/images/forum/icons/12.gif" border=0 width=15 height=15 alt="Eek">&nbsp;&nbsp;&nbsp; <input type=radio name="forum_iconid" value="13"'; if($thread['post_icon_id'] == "13"){$main_content .= 'checked';} $main_content .= '> &nbsp;<img src="'.$layout_name.'/images/forum/icons/13.gif" border=0 width=15 height=15 alt="Roll Eyes">&nbsp;&nbsp;&nbsp; <input type=radio name="forum_iconid" value="14"'; if($thread['post_icon_id'] == "14"){$main_content .= 'checked';} $main_content .= '> &nbsp;<img src="'.$layout_name.'/images/forum/icons/14.gif" border=0 width=15 height=15 alt="Thumbs up">&nbsp;&nbsp;&nbsp; <input type=radio name="forum_iconid" value="15"'; if($thread['post_icon_id'] == "15"){$main_content .= 'checked';} $main_content .= '> &nbsp;<img src="'.$layout_name.'/images/forum/icons/15.gif" border=0 width=15 height=15 alt="Thumbs down">&nbsp;&nbsp;&nbsp; <input type=radio name="forum_iconid" value="16"'; if($thread['post_icon_id'] == "16"){$main_content .= 'checked';} $main_content .= '> &nbsp;<img src="'.$layout_name.'/images/forum/icons/16.gif" border=0 width=15 height=15 alt="Wink">&nbsp;&nbsp;&nbsp; <input type=radio name="forum_iconid" value="17"'; if($thread['post_icon_id'] == "17"){$main_content .= 'checked';} $main_content .= '> &nbsp;<img src="'.$layout_name.'/images/forum/icons/17.gif" border=0 width=15 height=15 alt="Red face">&nbsp;&nbsp;&nbsp;<br> <input type=radio name="forum_iconid" value="18"'; if($thread['post_icon_id'] == "18"){$main_content .= 'checked';} $main_content .= '> &nbsp;<img src="'.$layout_name.'/images/forum/icons/18.gif" border=0 width=15 height=15 alt="Talking">&nbsp;&nbsp;&nbsp; <input type=radio name="forum_iconid" value="19"'; if($thread['post_icon_id'] == "19"){$main_content .= 'checked';} $main_content .= '> &nbsp;<img src="'.$layout_name.'/images/forum/icons/19.gif" border=0 width=15 height=15 alt="Unhappy">&nbsp;&nbsp;&nbsp; <input type=radio name="forum_iconid" value="20"'; if($thread['post_icon_id'] == "20"){$main_content .= 'checked';} $main_content .= '> &nbsp;<img src="'.$layout_name.'/images/forum/icons/20.gif" border=0 width=15 height=15 alt="Angry">&nbsp;&nbsp;&nbsp; <input type=radio name="forum_iconid" value="21"'; if($thread['post_icon_id'] == "21"){$main_content .= 'checked';} $main_content .= '> &nbsp;<img src="'.$layout_name.'/images/forum/icons/21.gif" border=0 width=15 height=15 alt="Smile">&nbsp;&nbsp;&nbsp; <input type=radio name="forum_iconid" value="22"'; if($thread['post_icon_id'] == "22"){$main_content .= 'checked';} $main_content .= '> &nbsp;<img src="'.$layout_name.'/images/forum/icons/22.gif" border=0 width=15 height=15 alt="Cool">&nbsp;&nbsp;&nbsp; <input type=radio name="forum_iconid" value="23"'; if($thread['post_icon_id'] == "23"){$main_content .= 'checked';} $main_content .= '> &nbsp;<img src="'.$layout_name.'/images/forum/icons/23.gif" border=0 width=15 height=15 alt="Question">&nbsp;&nbsp;&nbsp; <input type=radio name="forum_iconid" value="24"'; if($thread['post_icon_id'] == "24"){$main_content .= 'checked';} $main_content .= '> &nbsp;<img src="'.$layout_name.'/images/forum/icons/24.gif" border=0 width=15 height=15 alt="Exclamation">&nbsp;&nbsp;&nbsp;<br> <input type=radio name="forum_iconid" value="25"'; if($thread['post_icon_id'] == "25"){$main_content .= 'checked';} $main_content .= '> &nbsp;<img src="'.$layout_name.'/images/forum/icons/25.gif" border=0 width=15 height=15 alt="Lightbulb">&nbsp;&nbsp;&nbsp; <input type=radio name="forum_iconid" value="26"'; if($thread['post_icon_id'] == "26"){$main_content .= 'checked';} $main_content .= '> &nbsp;<img src="'.$layout_name.'/images/forum/icons/26.gif" border=0 width=15 height=15 alt="Arrow">&nbsp;&nbsp;&nbsp; <input type=radio name="forum_iconid" value="27"'; if($thread['post_icon_id'] == "27"){$main_content .= 'checked';} $main_content .= '> &nbsp;<img src="'.$layout_name.'/images/forum/icons/27.gif" border=0 width=15 height=15 alt="Post">&nbsp;&nbsp;&nbsp;<br> <input type=radio name="forum_iconid" value="0"'; if($thread['post_icon_id'] == "0"){$main_content .= 'checked';} $main_content .= '> &nbsp;No Icon</td> </tr> <tr> <td bgcolor="#F1E0C6" class="ff_std" colspan=1 align="left" valign="top" ><b>Message:</b><br> <br> <font class="ff_info">Replace codes are allowed.<br><br> How to use smileys:<br> <table border=0 cellpadding=2 cellspacing=0 width=100%> <tr> <td colspan=1 align="left" ><img src="'.$layout_name.'/images/forum/smile/1.gif" border=0 width=15 height=15 alt="Stuck Tongue Out"></td> <td colspan=1 align="left" >:p</td> </tr> <tr> <td colspan=1 align="left" ><img src="'.$layout_name.'/images/forum/smile/2.gif" border=0 width=15 height=15 alt="Eek"></td> <td colspan=1 align="left" >:eek:</td> </tr> <tr> <td colspan=1 align="left" ><img src="'.$layout_name.'/images/forum/smile/3.gif" border=0 width=15 height=15 alt="Roll Eyes"></td> <td colspan=1 align="left" >:rolleyes:</td> </tr> <tr> <td colspan=1 align="left" ><img src="'.$layout_name.'/images/forum/smile/4.gif" border=0 width=15 height=15 alt="Wink"></td> <td colspan=1 align="left" >;)</td> </tr> <tr> <td colspan=1 align="left" ><img src="'.$layout_name.'/images/forum/smile/5.gif" border=0 width=15 height=15 alt="Red face"></td> <td colspan=1 align="left" >:o</td> </tr> <tr> <td colspan=1 align="left" ><img src="'.$layout_name.'/images/forum/smile/6.gif" border=0 width=15 height=15 alt="Talking"></td> <td colspan=1 align="left" >:D</td> </tr> <tr> <td colspan=1 align="left" ><img src="'.$layout_name.'/images/forum/smile/7.gif" border=0 width=15 height=15 alt="Unhappy"></td> <td colspan=1 align="left" >:(</td> </tr> <tr> <td colspan=1 align="left" ><img src="'.$layout_name.'/images/forum/smile/8.gif" border=0 width=15 height=15 alt="Angry"></td> <td colspan=1 align="left" >:mad:</td> </tr> <tr> <td colspan=1 align="left" ><img src="'.$layout_name.'/images/forum/smile/9.gif" border=0 width=15 height=15 alt="Smile"></td> <td colspan=1 align="left" >:)</td> </tr> <tr> <td colspan=1 align="left" ><img src="'.$layout_name.'/images/forum/smile/10.gif" border=0 width=15 height=15 alt="Cool"></td> <td colspan=1 align="left" >:cool:</td> </tr> </table> </font> </td> <td bgcolor="#F1E0C6" class="ff_std" colspan=1 align="left" ><textarea rows=20 cols=55 name="text">'.htmlspecialchars($text).'</textarea><div id="forum_pt_lenght">4094 characters left.</div></td> </tr> <tr> <td bgcolor="#D4C0A1" class="ff_std" colspan=1 align="left" valign="top" ><b>Options:</td> <td bgcolor="#D4C0A1" class="ff_info" colspan=1 align="left" ><input type="checkbox" name="smile" value="1"'; if($smile == 1) $main_content .= ' checked="checked"'; $main_content .= '/><strong>Disable Smileys in This Post</strong> </td> </tr> <tr> <td class="ff_std" colspan=2 align="center" ><br> <input type=submit name="preview_edit_post" value="Preview Changes" > &nbsp; <button type="submit" name="submit" value="edit_post">Submit Message</button> &nbsp; <input type=reset name="reset" value="Reset Fields"> </td> </tr> </table> </form>'; } } else $main_content .= '<br />You are not an author of this post.'; } else $main_content .= '<br />Post with ID '.$post_id.' doesn\'t exist.'; } else $main_content .= '<br />Your account is banned, deleted or you don\'t have any player with level '.$level_limit.' on your account. You can\'t post.'; } else $main_content .= '<br />Login first.'; } if($action == 'new_topic') { if($logged) { if(canPost($account_logged) || $group_id_of_acc_logged >= $group_not_blocked) { $players_from_account = $SQL->query("SELECT " . $SQL->tableName('players') . "." . $SQL->fieldName('name') . ", " . $SQL->tableName('players') . "." . $SQL->fieldName('id') . " FROM " . $SQL->tableName('players') . " WHERE " . $SQL->tableName('players') . "." . $SQL->fieldName('account_id') . " = ".(int) $account_logged->getId())->fetchAll(); $section_id = (int) $_REQUEST['section_id']; $main_content .= ' <TABLE BORDER=0 CELLPADDING=0 CELLSPACING=0 WIDTH=100%> <TR> <TD><IMG SRC="'.$layout_name.'/images/general/blank.gif" WIDTH=10 HEIGHT=1 BORDER=0></TD> <TD WIDTH=100% ALIGN=right> <a href="?subtopic=forum" >Community Boards</a> | <a href="?subtopic=forum&action=show_board&id='.$section_id.'">'.$sections[$section_id].'</a> | <b>Post New Thread</b></TD> <TD><IMG SRC="'.$layout_name.'/images/general/blank.gif" WIDTH=10 HEIGHT=1 BORDER=0></TD> </TR> </TABLE> <br> '; if(isset($_POST['preview_new_topic'])){ $main_content .= ' <table border=0 cellpadding=4 cellspacing=1 width=100%> <tr> <td bgcolor="#505050" class="ff_whitelarge" colspan=1 align="left" NOWRAP ><b>Message Preview</b></td> </tr> <tr> <td style="position:relative; height:100%;background-color:#D4C0A1;" align="top" > <div style="position:relative; min-height:18px; width:100%; overflow-x:auto; overflow-y:visible; width:734px; word-wrap:break-word;"> '.showPreview(htmlspecialchars($thread['post_topic']), nl2br($_POST['text']), $thread['post_smile']).' </div> </td> </tr> </table><br><br>'; } if(isset($sections[$section_id])) { if($section_id == 1 && $group_id_of_acc_logged < $group_not_blocked) $errors[] = 'Only moderators and admins can post on news board.'; $quote = (int) $_REQUEST['quote']; $text = trim(codeLower($_REQUEST['text'])); $forum_iconid = (int) $_REQUEST['forum_iconid']; $char_id = (int) $_REQUEST['char_id']; $post_topic = trim($_REQUEST['topic']); $smile = (int) $_REQUEST['smile']; $saved = false; if(isset($_POST['submit']) && $_REQUEST['save']) { $lenght = 0; for($i = 0; $i <= strlen($post_topic); $i++) { if(ord($post_topic[$i]) >= 33 && ord($post_topic[$i]) <= 126) $lenght++; } if($lenght < 1 || strlen($post_topic) > 60) $errors[] = 'Too short or too long topic (short: '.$lenght.' long: '.strlen($post_topic).' letters). Minimum 1 letter, maximum 60 letters.'; $lenght = 0; for($i = 0; $i <= strlen($text); $i++) { if(ord($text[$i]) >= 33 && ord($text[$i]) <= 126) $lenght++; } if($lenght < 1 || strlen($text) > 15000) $errors[] = 'Too short or too long post (short: '.$lenght.' long: '.strlen($text).' letters). Minimum 1 letter, maximum 15000 letters.'; if($char_id == 0) $errors[] = 'Please select a character.'; $player_on_account == false; if(count($errors) == 0) { foreach($players_from_account as $player) if($char_id == $player['id']) $player_on_account = true; if(!$player_on_account) $errors[] = 'Player with selected ID '.$char_id.' doesn\'t exist or isn\'t on your account'; } if(count($errors) == 0) { $last_post = $account_logged->getCustomField('last_post'); if($last_post+$post_interval-time() > 0 && $group_id_of_acc_logged < $group_not_blocked) $errors[] = 'You can post one time per '.$post_interval.' seconds. Next post after '.($last_post+$post_interval-time()).' second(s).'; } if(isset($_POST['submit'])){ if(count($errors) == 0) { $saved = true; $account_logged->set('last_post', time()); $account_logged->save(); $SQL->query("INSERT INTO " . $SQL->tableName('z_forum') . " (" . $SQL->fieldName('first_post') . " ," . $SQL->fieldName('last_post') . " ," . $SQL->fieldName('section') . " ," . $SQL->fieldName('replies') . " ," . $SQL->fieldName('views') . " ," . $SQL->fieldName('author_aid') . " ," . $SQL->fieldName('author_guid') . " ," . $SQL->fieldName('post_text') . " ," . $SQL->fieldName('post_topic') . " ," . $SQL->fieldName('post_smile') . " ," . $SQL->fieldName('post_date') . " ," . $SQL->fieldName('last_edit_aid') . " ," . $SQL->fieldName('edit_date') . ", " . $SQL->fieldName('post_ip') . ", " . $SQL->fieldName('post_icon_id') . ") VALUES ('0', '".time()."', '".(int) $section_id."', '0', '0', '".$account_logged->getId()."', '".(int) $char_id."', ".$SQL->quote($text).", ".$SQL->quote($post_topic).", '".(int) $smile."', '".time()."', '0', '0', '".$_SERVER['REMOTE_ADDR']."', '".(int )$forum_iconid."')"); $thread_id = $SQL->lastInsertId(); $SQL->query("UPDATE " . $SQL->tableName('z_forum') . " SET " . $SQL->fieldName('first_post') . "=".(int) $thread_id." WHERE " . $SQL->fieldName('id') . " = ".(int) $thread_id); header('Location: ?subtopic=forum&action=show_thread&id='.$thread_id); $main_content .= '<br />Thank you for posting.<br /><a href="?subtopic=forum&action=show_thread&id='.$thread_id.'">GO BACK TO LAST THREAD</a>'; } } } if(!$saved) { if(count($errors) > 0) { $main_content .= '<font color="red" size="2"><b>Errors occured:</b>'; foreach($errors as $error) $main_content .= '<br />* '.$error; $main_content .= '</font><br />'; } $main_content .= ' <table border=0 cellpadding=4 cellspacing=1 width="100%"> <form action="/?subtopic=forum" method="POST"> <input type="hidden" name="action" value="new_topic" /> <input type="hidden" name="section_id" value="'.$section_id.'" /> <input type="hidden" name="subtopic" value="forum" /> <input type="hidden" name="save" value="save" /> <tr> <td bgcolor="#505050" class="ff_whitelarge" colspan=2 align="left" >Post New Thread</td> </tr> <tr> <td bgcolor="#D4C0A1" class="ff_std" colspan=1 align="left" valign="top" ><b>'.$config['server']['serverName'].' Character:</b></td> <td bgcolor="#D4C0A1" class="ff_std" colspan=1 align="left" > <select name="char_id"> <option value="0">(Choose character)</option>'; foreach($players_from_account as $player) { $main_content .= '<option value="'.$player['id'].'"'; if($player['id'] == $char_id) $main_content .= ' selected="selected"'; $main_content .= '>'.$player['name'].'</option>'; } $main_content .= ' </select> </td> </tr> <tr> <td bgcolor="#F1E0C6" class="ff_std" colspan=1 align="left" valign="top" ><b>Thread Subject:</b></td> <td bgcolor="#F1E0C6" class="ff_std" colspan=1 align="left" > <input type="text" name="topic" value="'.htmlspecialchars($post_topic).'" size="40" maxlength="60" /> </td> </tr> <tr> <td bgcolor="#D4C0A1" class="ff_std" colspan=1 align="left" valign="top" ><b>Thread Icon:</b></td> <td bgcolor="#D4C0A1" class="ff_std" colspan=1 align="left" ><input type=radio name="forum_iconid" value="11"> &nbsp;<img src="'.$layout_name.'/images/forum/icons/11.gif" border=0 width=15 height=15 alt="Stuck Tongue Out">&nbsp;&nbsp;&nbsp; <input type=radio name="forum_iconid" value="12"> &nbsp;<img src="'.$layout_name.'/images/forum/icons/12.gif" border=0 width=15 height=15 alt="Eek">&nbsp;&nbsp;&nbsp; <input type=radio name="forum_iconid" value="13"> &nbsp;<img src="'.$layout_name.'/images/forum/icons/13.gif" border=0 width=15 height=15 alt="Roll Eyes">&nbsp;&nbsp;&nbsp; <input type=radio name="forum_iconid" value="14"> &nbsp;<img src="'.$layout_name.'/images/forum/icons/14.gif" border=0 width=15 height=15 alt="Thumbs up">&nbsp;&nbsp;&nbsp; <input type=radio name="forum_iconid" value="15"> &nbsp;<img src="'.$layout_name.'/images/forum/icons/15.gif" border=0 width=15 height=15 alt="Thumbs down">&nbsp;&nbsp;&nbsp; <input type=radio name="forum_iconid" value="16"> &nbsp;<img src="'.$layout_name.'/images/forum/icons/16.gif" border=0 width=15 height=15 alt="Wink">&nbsp;&nbsp;&nbsp; <input type=radio name="forum_iconid" value="17"> &nbsp;<img src="'.$layout_name.'/images/forum/icons/17.gif" border=0 width=15 height=15 alt="Red face">&nbsp;&nbsp;&nbsp;<br> <input type=radio name="forum_iconid" value="18"> &nbsp;<img src="'.$layout_name.'/images/forum/icons/18.gif" border=0 width=15 height=15 alt="Talking">&nbsp;&nbsp;&nbsp; <input type=radio name="forum_iconid" value="19"> &nbsp;<img src="'.$layout_name.'/images/forum/icons/19.gif" border=0 width=15 height=15 alt="Unhappy">&nbsp;&nbsp;&nbsp; <input type=radio name="forum_iconid" value="20"> &nbsp;<img src="'.$layout_name.'/images/forum/icons/20.gif" border=0 width=15 height=15 alt="Angry">&nbsp;&nbsp;&nbsp; <input type=radio name="forum_iconid" value="21"> &nbsp;<img src="'.$layout_name.'/images/forum/icons/21.gif" border=0 width=15 height=15 alt="Smile">&nbsp;&nbsp;&nbsp; <input type=radio name="forum_iconid" value="22"> &nbsp;<img src="'.$layout_name.'/images/forum/icons/22.gif" border=0 width=15 height=15 alt="Cool">&nbsp;&nbsp;&nbsp; <input type=radio name="forum_iconid" value="23"> &nbsp;<img src="'.$layout_name.'/images/forum/icons/23.gif" border=0 width=15 height=15 alt="Question">&nbsp;&nbsp;&nbsp; <input type=radio name="forum_iconid" value="24"> &nbsp;<img src="'.$layout_name.'/images/forum/icons/24.gif" border=0 width=15 height=15 alt="Exclamation">&nbsp;&nbsp;&nbsp;<br> <input type=radio name="forum_iconid" value="25"> &nbsp;<img src="'.$layout_name.'/images/forum/icons/25.gif" border=0 width=15 height=15 alt="Lightbulb">&nbsp;&nbsp;&nbsp; <input type=radio name="forum_iconid" value="26"> &nbsp;<img src="'.$layout_name.'/images/forum/icons/26.gif" border=0 width=15 height=15 alt="Arrow">&nbsp;&nbsp;&nbsp; <input type=radio name="forum_iconid" value="27"> &nbsp;<img src="'.$layout_name.'/images/forum/icons/27.gif" border=0 width=15 height=15 alt="Post">&nbsp;&nbsp;&nbsp;<br> <input type=radio name="forum_iconid" value="0" checked> &nbsp;No Icon</td> </tr> <tr> <td bgcolor="#F1E0C6" class="ff_std" colspan=1 align="left" valign="top" ><b>Message:</b><br> <br> <font class="ff_info">Replace codes are allowed.<br><br> How to use smileys:<br> <table border=0 cellpadding=2 cellspacing=0 width=100%> <tr> <td colspan=1 align="left" ><img src="'.$layout_name.'/images/forum/smile/1.gif" border=0 width=15 height=15 alt="Stuck Tongue Out"></td> <td colspan=1 align="left" >:p</td> </tr> <tr> <td colspan=1 align="left" ><img src="'.$layout_name.'/images/forum/smile/2.gif" border=0 width=15 height=15 alt="Eek"></td> <td colspan=1 align="left" >:eek:</td> </tr> <tr> <td colspan=1 align="left" ><img src="'.$layout_name.'/images/forum/smile/3.gif" border=0 width=15 height=15 alt="Roll Eyes"></td> <td colspan=1 align="left" >:rolleyes:</td> </tr> <tr> <td colspan=1 align="left" ><img src="'.$layout_name.'/images/forum/smile/4.gif" border=0 width=15 height=15 alt="Wink"></td> <td colspan=1 align="left" >;)</td> </tr> <tr> <td colspan=1 align="left" ><img src="'.$layout_name.'/images/forum/smile/5.gif" border=0 width=15 height=15 alt="Red face"></td> <td colspan=1 align="left" >:o</td> </tr> <tr> <td colspan=1 align="left" ><img src="'.$layout_name.'/images/forum/smile/6.gif" border=0 width=15 height=15 alt="Talking"></td> <td colspan=1 align="left" >:D</td> </tr> <tr> <td colspan=1 align="left" ><img src="'.$layout_name.'/images/forum/smile/7.gif" border=0 width=15 height=15 alt="Unhappy"></td> <td colspan=1 align="left" >:(</td> </tr> <tr> <td colspan=1 align="left" ><img src="'.$layout_name.'/images/forum/smile/8.gif" border=0 width=15 height=15 alt="Angry"></td> <td colspan=1 align="left" >:mad:</td> </tr> <tr> <td colspan=1 align="left" ><img src="'.$layout_name.'/images/forum/smile/9.gif" border=0 width=15 height=15 alt="Smile"></td> <td colspan=1 align="left" >:)</td> </tr> <tr> <td colspan=1 align="left" ><img src="'.$layout_name.'/images/forum/smile/10.gif" border=0 width=15 height=15 alt="Cool"></td> <td colspan=1 align="left" >:cool:</td> </tr> </table> </font> </td> <td bgcolor="#F1E0C6" class="ff_std" colspan=1 align="left" ><textarea rows=20 cols=55 name="text">'.htmlspecialchars($text).'</textarea><br /></td> </tr> <tr> <td bgcolor="#D4C0A1" class="ff_std" colspan=1 align="left" valign="top" ><b>Options:</td> <td bgcolor="#D4C0A1" class="ff_info" colspan=1 align="left" ><input type="checkbox" name="smile" value="1"'; if($smile == 1) $main_content .= ' checked="checked"'; $main_content .= '/>&nbsp;<b>Disable Smileys in This Post </b><br> </td> </tr> <tr> <td class="ff_std" colspan=2 align="center"><br> <input type=submit name="preview_new_topic" value="Preview Message"> &nbsp; <button type="submit" name="submit" value="save_topic">Submit Message</button> &nbsp; <input type=reset name="reset" value="Reset Fields"> </td> </tr> </FORM> </table>'; } } else $main_content .= 'Board with ID '.$board_id.' doesn\'t exist.'; } else $main_content .= 'Your account is banned, deleted or you don\'t have any player with level '.$level_limit.' on your account. You can\'t post.'; } else $main_content .= 'Login first.'; } Caso alguém consiga me ajudar, eu ficarei muito grato. Rep+ para quem conseguir uma solução massa.
  6. Por algum motivo, não consigo criar personagens no meu server, aparece apenas isso no chat: Your character couldn't be created, please try again. E isso no server log: mysql_real_query(): INSERT INTO `players` (`id`, `name`, `world_id`, `group_id`, `account_id`, `level`, `vocation`, `health`, `healthmax`, `experience`, `lookbody`, `lookfeet`, `lookhead`, `looklegs`, `looktype`, `lookaddons`, `maglevel`, `mana`, `manamax`, `manaspent`, `soul`, `town_id`, `posx`, `posy`, `posz`, `conditions`, `cap`, `sex`, `lastlogin`, `lastip`, `skull`, `skulltime`, `save`, `rank_id`, `guildnick`, `lastlogout`, `blessings`, `online`) VALUES (NULL, 'Eorie', 0, 1, 14, 10, 4, 215, 215, 9300, 68, 76, 78, 39, 128, 0, 1, 45, 45, 0, 100, 1, 160, 50, 8, 0, 485, 1, 0, 0, 0, 0, 1, 0, '', 0, 0, 0) - MYSQL ERROR: Duplicate entry '32-0' for key 'player_id_2' (1062)
  7. Olá pessoal, deparei-me com um problema: coloquei um npc de troca, só que ele só pode trocar dois itens por vez, tem como fazê-lo trocar mais itens? Aqui vai o código: local keywordHandler = KeywordHandler:new() local npcHandler = NpcHandler:new(keywordHandler) NpcSystem.parseParameters(npcHandler) local talkState = {} function onCreatureAppear(cid) npcHandler:onCreatureAppear(cid) end function onCreatureDisappear(cid) npcHandler:onCreatureDisappear(cid) end function onCreatureSay(cid, type, msg) npcHandler:onCreatureSay(cid, type, msg) end function onThink() npcHandler:onThink() end local items = { item1 = {2159, 2145}, -- item1 item que será pedido e que será dado na primeira troca item2 = {2159, 2146} -- item2 item que será pedido e que será dado na segunda troca } local counts = { count1 = {10, 1}, count2 = {10, 1} } function creatureSayCallback(cid, type, msg) if(not npcHandler:isFocused(cid)) then return false end local talkUser = NPCHANDLER_CONVBEHAVIOR == CONVERSATION_DEFAULT and 0 or cid if msgcontains(msg, 'removedor de frags') then if getPlayerItemCount(cid, items.item1[1]) >= counts.count1[1] then doPlayerRemoveItem(cid, items.item1[1], counts.count1[1]) doPlayerAddItem(cid, items.item1[2], counts.count1[2]) selfSay('Você trocou '.. counts.count1[1] ..' '.. getItemNameById(items.item1[1]) ..' por '.. counts.count1[2] ..'x '.. getItemNameById(items.item1[2]) ..'.', cid) else selfSay('Você precisa de '.. counts.count1[1] ..' '.. getItemNameById(items.item1[1]) ..'.', cid) end elseif msgcontains(msg, 'power exp ring') then if getPlayerItemCount(cid, items.item2[1]) >= counts.count2[1] then doPlayerRemoveItem(cid, items.item2[1], counts.count2[1]) doPlayerAddItem(cid, items.item2[2], counts.count2[2]) selfSay('Você trocou '.. counts.count2[1] ..' '.. getItemNameById(items.item2[1]) ..' por '.. counts.count2[2] ..' '.. getItemNameById(items.item2[2]) ..'.', cid) else selfSay('Você precisa de '.. counts.count2[1] ..' '.. getItemNameById(items.item2[1]) ..'.', cid) end end return TRUE end npcHandler:setCallback(CALLBACK_MESSAGE_DEFAULT, creatureSayCallback) npcHandler:addModule(FocusModule:new())
  8. Caso ajude, consegui achar o script da porta, mas está sem o reset ainda. function onUse(cid, item, frompos, item2, topos) pos = getPlayerPosition(cid) if pos.x == topos.x then if pos.y < topos.y then pos.y = topos.y + 1 else pos.y = topos.y - 1 end elseif pos.y == topos.y then if pos.x < topos.x then pos.x = topos.x + 1 else pos.x = topos.x - 1 end else doPlayerSendTextMessage(cid,22,'Fique na frente da porta.') return 1 end reqlevel = item.actionid - 1000 if item.actionid > 0 and getPlayerLevel(cid) >= item.actionid - 1000 then doTeleportThing(cid,pos) doSendMagicEffect(topos,12) else doPlayerSendTextMessage(cid,22,'Voce precisa de level ' .. reqlevel .. ' ou maior para passar nesta porta.') end return 1 end
  9. Não deu certo não cara.
  10. Opa, o reset é por storage, é um NPC que vende resets: local config = { minlevel = 1000, price = 1000000, newlevel = 10, priceByReset = 1000000, percent = 100, maxresets = 15, levelbyreset = 1000 } function getResets(uid) resets = getPlayerStorageValue(uid, 378378) if resets < 0 then resets = 0 end return resets end local keywordHandler = KeywordHandler:new() local npcHandler = NpcHandler:new(keywordHandler) NpcSystem.parseParameters(npcHandler) local talkState = {} function onCreatureAppear(cid) npcHandler:onCreatureAppear(cid) end function onCreatureDisappear(cid) npcHandler:onCreatureDisappear(cid) end function onCreatureSay(cid, type, msg) npcHandler:onCreatureSay(cid, type, msg) end function onThink() npcHandler:onThink() end function creatureSayCallback(cid, type, msg) if(not npcHandler:isFocused(cid)) then return false end local talkUser = NPCHANDLER_CONVBEHAVIOR == CONVERSATION_DEFAULT and 0 or cid function addReset(cid) if(npcHandler:isFocused(cid)) then npcHandler:releaseFocus(cid) end talkState[talkUser] = 0 resets = getResets(cid) setPlayerStorageValue(cid, 378378, resets+1) doTeleportThing(cid, getTownTemplePosition(getPlayerTown(cid))) local hp = getCreatureMaxHealth(cid) local resethp = hp*(config.percent/100) setCreatureMaxHealth(cid, resethp) local differencehp = (hp - resethp) doCreatureAddHealth(cid, -differencehp) local mana = getCreatureMaxMana(cid) local resetmana = mana*(config.percent/100) setCreatureMaxMana(cid, resetmana) local differencemana = (mana - resetmana) doCreatureAddMana(cid, -differencemana) doRemoveCreature(cid) local description = resets+1 db.query("UPDATE `players` SET `description` = ' [Reset: "..description.."]' WHERE `players`.`id`= ".. playerid .."") db.query("UPDATE `players` SET `level`="..config.newlevel..",`experience`= 0 WHERE `players`.`id`= ".. playerid .."") return true end local newPrice = config.price + (getResets(cid) * config.priceByReset) local newminlevel = config.minlevel + (getResets(cid) * config.levelbyreset) if msgcontains(msg, 'reset') then if getResets(cid) < config.maxresets then selfSay('You want to reset your character? It will cost '..newPrice..' gp\'s!', cid) talkState[talkUser] = 1 else selfSay('You already reached the maximum reset level!', cid) end elseif(msgcontains(msg, 'yes') and talkState[talkUser] == 1) then if getPlayerMoney(cid) < newPrice then selfSay('Its necessary to have at least '..newPrice..' gp\'s for reseting!', cid) elseif getPlayerLevel(cid) < newminlevel then selfSay('The minimum level for reseting is '..newminlevel..'!', cid) else doPlayerRemoveMoney(cid,newPrice) playerid = getPlayerGUID(cid) addEvent(function() if isPlayer(cid) then addReset(cid) end end, 3000) local number = getResets(cid)+1 local msg ="---[Reset: "..number.."]-- You have reseted! You'll be disconnected in 3 seconds." doPlayerPopupFYI(cid, msg) talkState[talkUser] = 0 npcHandler:releaseFocus(cid) end talkState[talkUser] = 0 elseif(msgcontains(msg, 'no')) and isInArray({1}, talkState[talkUser]) == TRUE then talkState[talkUser] = 0 npcHandler:releaseFocus(cid) selfSay('Ok.', cid) elseif msgcontains(msg, 'quantity') then selfSay('You have a total of '..getResets(cid)..' reset(s).', cid) talkState[talkUser] = 0 end return true end npcHandler:setCallback(CALLBACK_MESSAGE_DEFAULT, creatureSayCallback) npcHandler:addModule(FocusModule:new())
  11. Andei pesquisando nos fóruns e não achei nada que me agradasse. Gostaria de um sistema onde o player só pode passar em determinada porta quando ele tiver uma quantidade x de resets. Também gostaria que a porta teleportasse o player para um tile à frente da porta. Caso consigam algo do tipo, agradeço.
  12. Pô cara, aparece esse erro na dntpagseguro.php Fatal error: Uncaught exception 'Exception' with message 'PagSeguroLibrary: cURL library is required.' in C:\xampp\htdocs\custom_scripts\PagSeguroLibrary\utils\PagSeguroHttpConnection.class.php:33 Stack trace: #0 C:\xampp\htdocs\custom_scripts\PagSeguroLibrary\service\PagSeguroPaymentService.class.php(73): PagSeguroHttpConnection->__construct() #1 C:\xampp\htdocs\custom_scripts\PagSeguroLibrary\domain\PagSeguroPaymentRequest.class.php(627): PagSeguroPaymentService::createCheckoutRequest(Object(PagSeguroAccountCredentials), Object(PagSeguroPaymentRequest), false) #2 C:\xampp\htdocs\dntpagseguro.php(21): PagSeguroPaymentRequest->register(Object(PagSeguroAccountCredentials)) #3 {main} thrown in C:\xampp\htdocs\custom_scripts\PagSeguroLibrary\utils\PagSeguroHttpConnection.class.php on line 33
  13. Então pessoal, acabei descobrindo um problema no meu servidor: os players não atacam quando healam. Isso fica mais evidente no paladin, quando ele está à distancia. Quando ele heala, ele para de atacar, mas volta normalmente depois. Como arrumar isso?
  14. Olá pessoal. Estou terminando de incrementar alguns sistemas no meu otserver e acabei de perceber uma coisa: os guardas não aparecem na WoE. Procurei por todo o fórum, mas não encontrei nada, então vim aqui na esperança de alguma solução. Pelo que eu já lí, eu já tenho o guarda no monsters.xml e o próprio .xml do guarda, então o problema não parece estar aí. Postarei o meu woe.lua caso alguém precise. woe.lua dofile("./_woe.lua") local delays = 60 local guards_price = 1000000 --1kk function onUse(cid, item, fromPosition, itemEx, toPosition) Woe.getInfo() if item.actionid == Castle.banderas then if Woe.isTime() then if Woe.isStarted() then if infoLua[2] == getPlayerGuildId(cid) then doTeleportThing(cid, Castle.guildEntry, false) else doPlayerSendCancel(cid, "You are not member of ".. Woe.guildName() ..".") end end else if infoLua[2] == getPlayerGuildId(cid) then doTeleportThing(cid, Castle.guildEntry, false) else doPlayerSendCancel(cid, "You are not member of ".. Woe.guildName() ..".") end end elseif (item.uid == 3134) then if not Woe.isStarted() or (infoLua[2] ~= getPlayerGuildId(cid)) or (getPlayerGuildLevel(cid) ~= GUILDLEVEL_LEADER) then return true end if (getPlayerMoney(cid) < guards_price) then return doPlayerSendCancel(cid, "Not enough money.") end local varDelay = getGlobalStorageValue(24503) if (varDelay < 0) or ((os.time() - varDelay) >= delays) then if Woe.check() then Woe.summon() doPlayerRemoveMoney(cid, guards_price) else doPlayerSendCancel(cid, "There are still guards alive.") end else doPlayerSendCancel(cid, "Delay no listo.") end end return true end Além disso, aqui está o problema que aparece quando tento invocar/sumonar um guarda:
  15. Putz, na verdade eu consegui resolver meu problema. Aqui vai a solução: Lá em local arena_entrada_pos = {x = 167, y = 49, z = 7, stackpos = 2} eu troquei stackpos = 2 por stackpos = 1 Valeu aí pela ajuda
  16. Estou terminando de concluir o zombie event do meu servidor. Porém a única coisa que falta para ficar completo é remover o item de um tile quando o evento começa. Aqui segue o script: -- Inicio das configurações local arena_entrada_pos = {x = 167, y = 49, z = 7, stackpos = 2} local arenaa_entrada_pos = {x = 164, y = 49, z = 7, stackpos = 2} local cor = 22 -- Defina a cor da mensagem (22 = branco) local mensagens ={ [[O Zombie Event começou! Tenham um ótimo evento!. Lembrando que o teleport Fechará em 5 minutos. ]] } -- Fim de Configurações function onTime() doBroadcastMessage(mensagens[math.random(1,table.maxn(mensagens))], cor) doRemoveItem(getThingfromPos(arena_entrada_pos).uid,1) --doRemoveItem(getThingfromPos(arenaa_entrada_pos).uid,1) doSetStorage(12365,1) return TRUE end Como é possível ver, eu marquei como comentário a linha --doRemoveItem(getThingfromPos(arenaa_entrada_pos).uid,1) Mas foi proposital, já que preciso apenas de UM objeto removido. Porém, quando o evento começa, o objeto não é removido, fazendo com que o teleporte fique em cima do item (já tentei com vários objetos e inclusive desmarquei como comentário aquela linha). Então, a única conclusão que consegui chegar depois das minhas inúmeras tentativas é a de que há um erro no código que eu não percebi. Qualquer ajuda será bem-vinda, obrigado.
  17. Olá. Acabei de implantar o sistema do evento Dota no meu servidor a partir deste tutorial: Porém, quando o evento inicia, não há nenhum teleporte no templo para levar o jogador à sala de times. Talvez alguma configuração deva ter passada despercebida ou então esse sistema realmente não tem essa função. Alguém poderia me ajudar? Outro sistema de Dota também seria bem-vindo.
  18. Sleet postou uma resposta no tópico em Suporte Tibia OTServer
    Putz, esse script aí não funcionou não...
  19. Então, se eu colocar essas skulls aí, quando o player é atacado, ele tem que tirar do modo seguro para se defender...
  20. Desculpe-me, mas descobri um outro bug... Quando o jogador está com alguma skull (white, red ou black), ele ataca os outros, mesmo estando no modo seguro.
  21. Muito obrigado, está funcionando perfeitamente. Parabéns.
  22. Sleet postou uma resposta no tópico em Suporte Tibia OTServer
    Sim.
  23. Sleet postou uma resposta no tópico em Suporte Tibia OTServer
    Pessoal, tem um filho da puta nuker no meu servidor. O desgraçado até colocou o nome dele de "nuker". Eu tentei baní-lo por ip, mas ainda não deu certo. Consegui isso aqui até agora:
  24. Putz, um belíssimo script, mas agora voltou à estaca zero... Os jogadores atacam outros mesmo estando no modo seguro.
  25. O que eu coloco no arquivo creaturescripts.xml? Eu tentei isso, mas não deu certo: <event type="combat" name="areaspell" event="script" value="areaspell.lua"/> Edit: Eu consegui implantar esse sistema, mas quando alguém entra em pvp e está com o modo seguro, ele não ataca com magia de área (ele deveria atacar).

Informação Importante

Confirmação de Termo