Ir para conteúdo
  • Cadastre-se

Posts Recomendados

Erro ao Criar conta no Gesior acc \/
 
ERRO : 
Warning: mysql_pconnect() [function.mysql-pconnect]: Access denied for user 'Global-Rush'@'localhost' (using password: NO) in C:\xampp\htdocs\createaccount.php on line 58
MySQL connection error.

 
 CREATE ACCOUNT.PHP

  1. <b>
  2. <?php
  3. $location = array(
  4. 'GER' =>'Europe',
  5. // 'USA' =>'North America'
  6. );
  7. $default = 'all';
  8.  
  9. $worlds = array();
  10. $worlds[0] = array('GER', 'open');
  11. /*
  12. $worlds[1] = array('GER', 'optional');
  13. $worlds[2] = array('GER', 'hardcore');
  14. $worlds[3] = array('USA', 'open');
  15. $worlds[4] = array('USA', 'optional');
  16. $worlds[5] = array('USA', 'hardcore');
  17. */
  18.  
  19. $voc = array(); // if empty, Rook Sample will be used
  20. $voc[1] = 'Sorcerer';
  21. $voc[2] = 'Druid';
  22. $voc[3] = 'Paladin';
  23. $voc[4] = 'Knight';
  24.  
  25. $suggestname = NULL; // not available
  26. $version = '860'; // for download link
  27.  
  28. foreach($worlds as $k =>$v) // remove invalid worlds
  29. if(!isset($location[$v[0]]) || !isset($config['site']['worlds'][$k]))
  30. unset($worlds[$k]);
  31.  
  32. $tmp = array();
  33. foreach($location as $k =>$v) // remove invalid/unused locations
  34. foreach($worlds as $i =>$j)
  35. if($j[0] == $k) {
  36. $tmp[$k] = $v;
  37. break;
  38. }
  39. $location = $tmp; unset($tmp);
  40.  
  41. if(isset($_POST['step']) && $_POST['step'] == 'docreate') {
  42. $e = array();
  43. $s = isset($_POST['accountname']) ? $_POST['accountname'] : '';
  44. if($s == '')
  45. $e['acc'] = 'Please enter an account name!';
  46. elseif(strlen($s) < 6)
  47. $e['acc'] = 'This account name is too short!';
  48. elseif(strlen($s) > 30)
  49. $e['acc'] = 'This account name is too long!';
  50. else {
  51. $s = strtoupper($s);
  52.  
  53. if(!ctype_alnum($s))
  54. $e['acc'] = 'This account name has an invalid format. Your account name may only consist of numbers 0-9 and letters A-Z!';
  55. elseif(!preg_match('/[A-Z]/', $s))
  56. $e['acc'] = 'Your account name must include at least one letter A-Z!';
  57. else {
  58. $con = mysql_pconnect($config['server']['sqlHost'], $config['server']['sqlUser'], $config['server']['sqlPass']) or die('MySQL connection error.');
  59. mysql_select_db($config['server']['sqlDatabase']);
  60.  
  61. if(mysql_num_rows(mysql_query('SELECT id FROM accounts WHERE name=\''.mysql_escape_string($s).'\' LIMIT 1')) != 0)
  62. $e['acc'] = 'This account name is already used. Please select another one!';
  63. }
  64. }
  65.  
  66. $s = isset($_POST['name']) ? trim($_POST['name']) : '';
  67.  
  68. if(empty($s))
  69. $e['name'] = 'Please enter a name for your character!';
  70. elseif(strlen($s) < 2 || strlen($s) > 29)
  71. $e['name'] = 'A name must have at least 2 but no more than 29 letters!';
  72. elseif(preg_match('/[^a-zA-Z ]/', $s))
  73. $e['name'] = 'This name contains invalid letters. Please use only A-Z, a-z and space!';
  74. elseif(!ctype_upper($s[0]))
  75. $e['name'] = 'The first letter of a name has to be a capital letter!';
  76. elseif(strpos($s, '  ') !== false)
  77. $e['name'] = 'This name contains more than one space between words. Please use only one space between words!';
  78. else {
  79. foreach(explode(' ', $s) as $k =>$v) {
  80. $words[$k] = str_split($v);
  81. $len = strlen($v);
  82. if($len == 1) {
  83. $e['name'] = 'This name contains a word with only one letter. Please use more than one letter for each word!';
  84. break;
  85. }
  86. elseif($len > 14) {
  87. $e['name'] = 'This name contains a word that is too long. Please use no more than 14 letters for each word!';
  88. break;
  89. }
  90. }
  91. if(!isset($e['name'])) {
  92. $total=0;
  93. foreach($words as $k =>$p) {
  94. if(isset($e['name']))
  95. break;
  96. $total++;
  97. if($total > 3) {
  98. $e['name'] = 'This name contains more than 3 words. Please choose another name!';
  99. break;
  100. }
  101. $len=0;
  102. foreach($p as $i =>$j) {
  103. $len++;
  104. if($i != 0 && ctype_upper($j)) {
  105. $e['name'] = 'In names capital letters are only allowed at the beginning of a word!';
  106. break;
  107. }
  108. elseif($i == $len-1) {
  109. $ff=null;
  110. for($h=0;$h<strlen($v); $h++) {
  111. if(in_array(strtolower($v[$h]), array('a','e','i','o','u')) !== false) {
  112. $ff=true;
  113. break;
  114. }
  115. }
  116. if(!$ff) {
  117. $e['name'] = 'This name contains a word without vowels. Please choose another name!';
  118. break;
  119. }
  120. }
  121. }
  122. }
  123. if(!isset($e['name'])) {
  124. $s = strtolower($s);
  125. for($i = 0; $i < strlen($s); $i++)
  126. if($s[$i] == $s[($i+1)] && $s[$i] == $s[($i+2)]) {
  127. $e['name'] = 'This character name is already used. Please select another one!';
  128. break;
  129. }
  130. if(!isset($e['name'])) {
  131. foreach(array('aa ', 'ee', 'ii', 'oo', 'uu', 'gm','cm', 'aff ', 'god ', 'abc', 'tutor', 'game', 'admin', 'the ') as $v)
  132. if($v == substr($s, 0, strlen($v))) {
  133. $e['name'] = 'This character name is already used. Please select another one!';
  134. break;
  135. }
  136. if(!isset($e['name'])) {
  137. foreach(array('game', 'customer', 'support', 'fuck', 'haha', 'sux', ' abc', 'suck', 'noob', 'tutor', 'admin', 'account', 'gay', 'password', 'manager') as $v)
  138. if(strpos($s, $v) !== false) {
  139. $e['name'] = 'This character name is already used. Please select another one!';
  140. break;
  141. }
  142. if(!isset($e['name'])) {
  143. if(!isset($con)) {
  144. $con = mysql_pconnect($config['server']['sqlHost'], $config['server']['sqlUser'], $config['server']['sqlPass']) or die('MySQL connection error.');
  145. mysql_select_db($config['server']['sqlDatabase']);
  146. }
  147. if(mysql_num_rows(mysql_query('SELECT id FROM players WHERE name=\''.mysql_escape_string($s).'\' LIMIT 1')) != 0)
  148. $e['name'] = 'This character name is already used. Please select another one!';
  149. }
  150. }
  151. }
  152. }
  153. }
  154. }
  155.  
  156. if(!isset($_POST['world']) || empty($_POST['world']))
  157. $e['world'] = 'Please select a game world for your character!';
  158.  
  159. if(!isset($_POST['sex']) || ($_POST['sex'] != 'male' && $_POST['sex'] != 'female'))
  160. $e['sex'] = 'Please select the sex for your character!';
  161.  
  162. if(count($voc) != 0 && (!isset($_POST['vocation']) || !is_numeric($_POST['vocation']) || !isset($voc[$_POST['vocation']])))
  163. $e['vocation'] = 'Please select the vocation for your character!';
  164.  
  165. $s = isset($_POST['email']) ? $_POST['email'] : '';
  166.  
  167. if($s == '')
  168. $e['email'] = 'Please enter your email address!';
  169. elseif(strlen($s) > 49)
  170. $e['email'] = 'Your email address is too long!';
  171. elseif(!filter_var($s, FILTER_VALIDATE_EMAIL))
  172. $e['email'] = 'This email address has an invalid format. Please enter a correct email address!';
  173. else {
  174. if(!isset($con)) {
  175. $con = mysql_pconnect($config['server']['sqlHost'], $config['server']['sqlUser'], $config['server']['sqlPass']) or die('MySQL connection error.');
  176. mysql_select_db($config['server']['sqlDatabase']);
  177. }
  178. if(mysql_num_rows(mysql_query('SELECT id FROM accounts WHERE email=\''.mysql_escape_string($s).'\' LIMIT 1')) != 0)
  179. $e['email'] = 'This email address is already used. Please enter another email address!';
  180. }
  181.  
  182. $s1 = isset($_POST['password1']) ? $_POST['password1'] : '';
  183. $s2 = isset($_POST['password2']) ? $_POST['password2'] : '';
  184.  
  185. if(empty($s2))
  186. $e['pass'] = 'Please enter the password again!';
  187. elseif($s1 != $s2)
  188. $e['pass'] = 'The two passwords do not match!';
  189. else {
  190. $err = array();
  191. if(strlen($s1) < 8 || strlen($s1) > 29)
  192. $err[] = 'The password must have at least 8 and less than 30 letters!';
  193. if(!ctype_alnum($s1))
  194. $err[] = 'The password contains invalid letters!';
  195. if(!preg_match('/[a-zA-Z]/', $s1))
  196. $err[] = 'The password must contain at least one letter A-Z or a-z!';
  197. elseif(!preg_match('/[0-9]/', $s1))
  198. $err[] = 'The password must contain at least one letter other than A-Z or a-z!';
  199.  
  200. if(count($err) != 0) {
  201. $e['pass'] = '';
  202. for($i=0; $i < count($err); $i++)
  203. $e['pass'] .= ($i == 0 ? '' : '<br/>').$err[$i];
  204. }
  205. }
  206.  
  207. if(!isset($_POST['agreeagreement']) || empty($_POST['agreeagreement']))
  208. $e['agreement'] = 'You have to agree to the Tibia Service Agreement in order to create an account!';
  209. if(!isset($_POST['agreerules']) || empty($_POST['agreerules']))
  210. $e['rules'] = 'You have to agree to the Tibia Rules in order to create an account!';
  211. if(!isset($_POST['agreeprivacy']) || empty($_POST['agreeprivacy']))
  212. $e['privacy'] = 'You have to agree to the Tibia Privacy Policy in order to create an account!';
  213.  
  214. if(count($e) == 0) {
  215. $worldid = NULL;
  216. foreach($config['site']['worlds'] as $id =>$name)
  217. if($worlds[$id] && $name == $_POST['world']) {
  218. $worldid = $id;
  219. break;
  220. }
  221. if($worldid === FALSE)
  222. $e['world'] = 'Please select a valid game world.';
  223. }
  224.  
  225. if(count($e) != 0) {
  226. $main_content = '<div class="SmallBox"><div class="MessageContainer"><div class="BoxFrameHorizontal" style="background-image:url('.$layout_name.'/images/content/box-frame-horizontal.gif)"/></div><div class="BoxFrameEdgeLeftTop" style="background-image:url('.$layout_name.'/images/content/box-frame-edge.gif)"/></div><div class="BoxFrameEdgeRightTop" style="background-image:url('.$layout_name.'/images/content/box-frame-edge.gif)"/></div><div class="ErrorMessage"><div class="BoxFrameVerticalLeft" style="background-image:url('.$layout_name.'/images/content/box-frame-vertical.gif)"/></div><div class="BoxFrameVerticalRight" style="background-image:url('.$layout_name.'/images/content/box-frame-vertical.gif)"/></div><div class="AttentionSign" style="background-image:url('.$layout_name.'/images/content/attentionsign.gif)"/></div><b>The Following Errors Have Occurred:</b><br/>';
  227. foreach($e as $error) $main_content .= $error.'<br/>';
  228. $main_content .= '</div><div class="BoxFrameHorizontal" style="background-image:url('.$layout_name.'/images/content/box-frame-horizontal.gif)"/></div><div class="BoxFrameEdgeRightBottom" style="background-image:url('.$layout_name.'/images/content/box-frame-edge.gif)"/></div><div class="BoxFrameEdgeLeftBottom" style="background-image:url('.$layout_name.'/images/content/box-frame-edge.gif)"/></div></div></div><br/>';
  229. }
  230. else {
  231. $random = rand(1, 9999999);
  232. $n = $random;
  233. $cur = array();
  234.  
  235. $q = mysql_query('SELECT id FROM accounts');
  236. while ($r = mysql_fetch_array($q, MYSQL_NUM))
  237. $cur[] = $r[0];
  238.  
  239. while(true)
  240. {
  241. if(!in_array($n, $cur))
  242. break;
  243.  
  244. $n++;
  245.  
  246. if($n > 9999999)
  247. $n = 1;
  248.  
  249. if($n == $random)
  250. die('Failed to create account.');
  251. }
  252.  
  253. if(mysql_query("INSERT INTO accounts (id,name,password,email,created) VALUES($n,'".$_POST['accountname']."','".($config['server']['encryptionType'] == 'plain' ? $_POST['password1'] : hash($config['server']['encryptionType'], $_POST['password1']))."','".$_POST['email']."',".time().")") === true) {
  254. $sample = (count($voc) == 0 ? 'Rook' : $voc[$_POST['vocation']]).' Sample';
  255. $q = mysql_query("SELECT id,vocation,town_id,experience,level,maglevel,health,healthmax,mana,manamax,soul,lookbody,lookfeet,lookhead,looklegs,lookaddons,cap,save,posx,posy,posz FROM players WHERE name='$sample' LIMIT 1");
  256. if(mysql_num_rows($q) != 1)
  257. die('Missing sample character ('.$sample.')');
  258.  
  259. $q = mysql_fetch_array($q);
  260. mysql_query('INSERT INTO players (name,world_id,account_id,level,vocation,health,healthmax,experience,lookbody,lookfeet,lookhead,looklegs,looktype,lookaddons,maglevel,mana,manamax,soul,town_id,posx,posy,posz,cap,sex,created) VALUES(\''.$_POST['name'].'\','.$worldid.','.$n.','.$q['level'].','.$q['vocation'].','.$q['health'].','.$q['healthmax'].','.$q['experience'].','.$q['lookbody'].','.$q['lookfeet'].','.$q['lookhead'].','.$q['looklegs'].','.($_POST['sex'] == 'female' ? 136 : 128).','.$q['lookaddons'].','.$q['maglevel'].','.$q['mana'].','.$q['manamax'].','.$q['soul'].','.$q['town_id'].','.$q['posx'].','.$q['posy'].','.$q['posz'].','.$q['cap'].','.($_POST['sex'] == 'female' ? 0 : 1).','.time().')');
  261. }
  262. else die('Failed to create account.');
  263. $main_content = '<div class="SmallBox"><div class="MessageContainer"><div class="BoxFrameHorizontal" style="background-image:url('.$layout_name.'/images/content/box-frame-horizontal.gif)"/></div><div class="BoxFrameEdgeLeftTop" style="background-image:url('.$layout_name.'/images/content/box-frame-edge.gif)"/></div><div class="BoxFrameEdgeRightTop" style="background-image:url('.$layout_name.'/images/content/box-frame-edge.gif)"/></div><div class="Message"><div class="BoxFrameVerticalLeft" style="background-image:url('.$layout_name.'/images/content/box-frame-vertical.gif)"/></div><div class="BoxFrameVerticalRight" style="background-image:url('.$layout_name.'/images/content/box-frame-vertical.gif)"/></div><table><tr><td class="LabelV">Note:</td><td style="width:100%"><p>Your account and character have been created successfully.</p></td></tr></table></div><div class="BoxFrameHorizontal" style="background-image:url('.$layout_name.'/images/content/box-frame-horizontal.gif)"/></div><div class="BoxFrameEdgeRightBottom" style="background-image:url('.$layout_name.'/images/content/box-frame-edge.gif)"/></div><div class="BoxFrameEdgeLeftBottom" style="background-image:url('.$layout_name.'/images/content/box-frame-edge.gif)"/></div></div></div><div class="BoxFrameHorizontal" style="background-image:url('.$layout_name.'/images/content/box-frame-horizontal.gif)"></div><div class="BoxFrameEdgeRightBottom" style="background-image:url('.$layout_name.'/images/content/box-frame-edge.gif)"></div><div class="BoxFrameEdgeLeftBottom" style="background-image:url('.$layout_name.'/images/content/box-frame-edge.gif)"></div><br/><div class="TableContainer"><table class="Table4" cellpadding="0" cellspacing="0"><div class="CaptionContainer"><div class="CaptionInnerContainer"><span class="CaptionEdgeLeftTop" style="background-image:url('.$layout_name.'/images/content/box-frame-edge.gif)"/></span><span class="CaptionEdgeRightTop" style="background-image:url('.$layout_name.'/images/content/box-frame-edge.gif)"/></span><span class="CaptionBorderTop" style="background-image:url('.$layout_name.'/images/content/table-headline-border.gif)"></span><span class="CaptionVerticalLeft" style="background-image:url('.$layout_name.'/images/content/box-frame-vertical.gif)"/></span><div class="Text">Download Client</div><span class="CaptionVerticalRight" style="background-image:url('.$layout_name.'/images/content/box-frame-vertical.gif)"/></span><span class="CaptionBorderBottom" style="background-image:url('.$layout_name.'/images/content/table-headline-border.gif)"></span><span class="CaptionEdgeLeftBottom" style="background-image:url('.$layout_name.'/images/content/box-frame-edge.gif)"/></span><span class="CaptionEdgeRightBottom" style="background-image:url('.$layout_name.'/images/content/box-frame-edge.gif)"/></span></div></div><tr><td><div class="InnerTableContainer"><table style="width:100%"><tr><td><table width="100%" cellpadding=0 cellspacing=0><tr><td style="vertical-align:top"><div class="TableShadowContainerRightTop"><div class="TableShadowRightTop" style="background-image:url('.$layout_name.'/images/content/table-shadow-rt.gif)"></div></div><div class="TableContentAndRightShadow" style="background-image:url('.$layout_name.'/images/content/table-shadow-rm.gif)"><div class="TableContentContainer"><table class="TableContent" width="100%"><tr><td><table style="width:100%;text-align:center"><tr><td><a href="http://tibiaclient.com/files/tibia'.$version.'.exe" type="application/octet-stream" target="_top"><img style="width:180px;height:180px;border:0px" src="account/download_windows.png"/></a></td><td><a href="http://tibiaclient.com/files/tibia'.$version.'.tar" type="application/octet-stream" target="_top"><img style="width:180px;height:180px;border:0px" src="account/download_linux.png"/><br/></a></td></tr><tr><td valign="top"><a href="http://tibiaclient.com/files/tibia'.$version.'.exe" type="application/octet-stream" target="_top">Windows Tibia Client '.(sprintf('%01.2f', $version / 100)).'</a></td><td valign="top"><a href="http://tibiaclient.com/files/tibia'.$version.'.tar" type="application/octet-stream" target="_top">Linux Tibia Client '.(sprintf('%01.2f', $version / 100)).'</a></td></tr><tr><td colspan="2">[<span class="HelpLink" onClick="window.open(\'http://www.tibia.com/support/content/help.php?subtopic=requirementes\' \'Help\', \'width=380px, height=310px, scrollbars=yes\')"><a>system requirements</a></span>]</td></tr></table></td></tr></table></div></div><div class="TableShadowContainer"><div class="TableBottomShadow" style="background-image:url('.$layout_name.'/images/content/table-shadow-bm.gif)"><div class="TableBottomLeftShadow" style="background-image:url('.$layout_name.'/images/content/table-shadow-bl.gif)"></div><div class="TableBottomRightShadow" style="background-image:url('.$layout_name.'/images/content/table-shadow-br.gif)"></div></div></div></td><td style="vertical-align:top"><div class="TableShadowContainerRightTop"><div class="TableShadowRightTop" style="background-image:url('.$layout_name.'/images/content/table-shadow-rt.gif)"></div></div><div class="TableContentAndRightShadow" style="background-image:url('.$layout_name.'/images/content/table-shadow-rm.gif)"><div class="TableContentContainer"><table class="TableContent" width="100%"><tr><td style="text-align:center"><img style="width:254px;height:218px;margin:7px" src="account/successful_download.jpg"/></td></tr></table></div></div><div class="TableShadowContainer"><div class="TableBottomShadow" style="background-image:url('.$layout_name.'/images/content/table-shadow-bm.gif)"><div class="TableBottomLeftShadow" style="background-image:url('.$layout_name.'/images/content/table-shadow-bl.gif)"></div><div class="TableBottomRightShadow" style="background-image:url('.$layout_name.'/images/content/table-shadow-br.gif)"></div></div></div></td></tr></table><tr><td><div class="TableShadowContainerRightTop"><div class="TableShadowRightTop" style="background-image:url('.$layout_name.'/images/content/table-shadow-rt.gif)"></div></div><div class="TableContentAndRightShadow" style="background-image:url('.$layout_name.'/images/content/table-shadow-rm.gif)"><div class="TableContentContainer"><table class="TableContent" width="100%"><tr><td class="LabelV">Disclaimer</td></tr><tr><td>The software and any related documentation is provided "as is" without warranty of any kind. The entire risk arising out of use of the software remains with you. In no event shall CipSoft GmbH be liable for any damages to your computer or loss of data.</td></tr></table></div></div><div class="TableShadowContainer"><div class="TableBottomShadow" style="background-image:url('.$layout_name.'/images/content/table-shadow-bm.gif)"><div class="TableBottomLeftShadow" style="background-image:url('.$layout_name.'/images/content/table-shadow-bl.gif)"></div><div class="TableBottomRightShadow" style="background-image:url('.$layout_name.'/images/content/table-shadow-br.gif)"></div></div></div></td></tr></table></div></table></div></td></tr>';
  264. return;
  265. }
  266. } else $_POST['step'] = '';
  267.  
  268. $main_content .= '<script type="text/javascript" src="account/jquery.js"></script>
  269. <script type="text/javascript" src="account/create_character.js"></script>
  270. <script type="text/javascript">var PreselectServerLocation="'.$default.'";var g_FormName="CreateAccountAndCharacter";var g_FieldName="accountname";document.getElementById("ActiveSubmenuItemIcon_createaccount").style.visibility = "visible";';
  271. foreach($worlds as $k =>$v) // create dynamic server list
  272. $main_content .= 'ServerList.push(new Array(\''.$config['site']['worlds'][$k].'\', \''.$v[0].'\', \''.$v[1].'\'));';
  273. $main_content .= '</script><div style="position:relative;top:0px;left:0px"><form action="/index.php?subtopic=createaccount" method=post name="CreateAccountAndCharacter"><div class="TableContainer"><table class="Table5" cellpadding="0" cellspacing="0"><div class="CaptionContainer"><div class="CaptionInnerContainer"><span class="CaptionEdgeLeftTop" style="background-image:url('.$layout_name.'/images/content/box-frame-edge.gif)"></span><span class="CaptionEdgeRightTop" style="background-image:url('.$layout_name.'/images/content/box-frame-edge.gif)"></span><span class="CaptionBorderTop" style="background-image:url('.$layout_name.'/images/content/table-headline-border.gif)"></span><span class="CaptionVerticalLeft" style="background-image:url('.$layout_name.'/images/content/box-frame-vertical.gif)"></span><div class="Text">Create New Account</div><span class="CaptionVerticalRight" style="background-image:url('.$layout_name.'/images/content/box-frame-vertical.gif)"></span><span class="CaptionBorderBottom" style="background-image:url('.$layout_name.'/images/content/table-headline-border.gif)"></span><span class="CaptionEdgeLeftBottom" style="background-image:url('.$layout_name.'/images/content/box-frame-edge.gif)"></span><span class="CaptionEdgeRightBottom" style="background-image:url('.$layout_name.'/images/content/box-frame-edge.gif)"></span></div></div><tr><td><div class="InnerTableContainer"><table style="width:100%"><tr><td><div class="TableShadowContainerRightTop"><div class="TableShadowRightTop" style="background-image:url('.$layout_name.'/images/content/table-shadow-rt.gif)"></div></div><div class="TableContentAndRightShadow" style="background-image:url('.$layout_name.'/images/content/table-shadow-rm.gif)"><div class="TableContentContainer"><table class="TableContent" width="100%"><tr><td class="LabelV150"><span id="accountname_label"'.(isset($e['acc']) ? ' class=red"' : '').'>Account Name:</span></td><td><input id="accountname" name="accountname" class="CipAjaxInput" style="width:206px;float:left" value="'.(isset($_POST['accountname]) ? htmlspecialchars(substr($_POST['accountname'], 0, 30)) : '').'" size=30" maxlength="30" onBlur="SendAjaxCip({DataType: \'Container\'}, {Href: \'account/ajax_accountname.php\',PostData: \'a_AccountName=\'+this.value,Method: \'POST\'})"/><div id="accountname_indicator" class="InputIndicator" style="background-image:url(account/'.($_POST['step] != 'docreate' || isset($e['acc']) ? 'n' : '').'ok.gif)"></div></td></tr><tr><td></td><td><span id=accountname_errormessage" class="FormFieldError">'.(isset($e['acc]) ? $e['acc'] : '').'</span></td></tr><tr><td class=LabelV150"><span id="email_label"'.(isset($e['email]) ? ' class="red"' : '').'>Email Address:</span></td><td><input id="email" name="email" class="CipAjaxInput" style="width:206px;float:left" value="'.(isset($_POST['email']) ? htmlspecialchars(substr($_POST['email'], 0, 50)) : '').'" autocomplete=off" size="30" maxlength="50" onBlur="SendAjaxCip({DataType: \'Container\'}, {Href: \'account/ajax_email.php\',PostData: \'a_EMail=\'+this.value,Method: \'POST\'})"/><div id="email_indicator" class="InputIndicator" style="background-image:url(account/'.($_POST['step] != 'docreate' || isset($e['email']) ? 'n' : '').'ok.gif)"></div></td></tr><tr><td></td><td><span id=email_errormessage" class="FormFieldError">'.(isset($e['email]) ? $e['email'] : '').'</span></td></tr><tr><td class=LabelV150"><span id="password1_label"'.(isset($e['pass]) ? ' class="red"' : '').'>Password:</span></td><td><input id="password1" type="password" autocomplete="off" name="password1" style="width:206px;float:left" value="'.(isset($_POST['password1']) ? htmlspecialchars(substr($_POST['password1'], 0, 30)) : '').'" size=30" maxlength="30" onBlur="SendAjaxCip({DataType: \'Container\'}, {Href: \'account/ajax_password.php\',PostData: \'a_Password1=\'+getElementById(\'password1\').value+\'&a_Password2=\'+getElementById(\'password2\').value,Method: \'POST\'})"/><div id="password1_indicator" class="InputIndicator" style="background-image:url(account/'.($_POST['step] != 'docreate' || isset($e['pass']) ? 'n' : '').'ok.gif)"></div></td></tr><tr><td class=LabelV150"><span id="password2_label"'.(isset($e['pass]) ? ' class="red"' : '').'>Password Again:</span></td><td><input id="password2" type="password" name="password2" style="width:206px;float:left" value="'.(isset($_POST['password2']) ? htmlspecialchars(substr($_POST['password2'], 0, 30)) : '').'" size=30" maxlength="30" onBlur="SendAjaxCip({DataType: \'Container\'}, {Href: \'account/ajax_password.php\',PostData: \'a_Password1=\'+getElementById(\'password1\').value+\'&a_Password2=\'+getElementById(\'password2\').value,Method: \'POST\'})"/><div id="password2_indicator" class="InputIndicator" style="background-image:url(account/'.($_POST['step] != 'docreate' || isset($e['pass']) ? 'n' : '').'ok.gif)"></div></td></tr><tr><td></td><td><span id=password_errormessage" class="FormFieldError">'.(isset($e['pass]) ? $e['pass'] : '').'</span></td></tr></table></div></div><div class=TableShadowContainer"><div class="TableBottomShadow" style="background-image:url('.$layout_name.'/images/content/table-shadow-bm.gif)"><div class="TableBottomLeftShadow" style="background-image:url('.$layout_name.'/images/content/table-shadow-bl.gif)"></div><div class="TableBottomRightShadow" style="background-image:url('.$layout_name.'/images/content/table-shadow-br.gif)"></div></div></div></td></tr><tr><td><div class="TableShadowContainerRightTop"><div class="TableShadowRightTop" style="background-image:url('.$layout_name.'/images/content/table-shadow-rt.gif)"></div></div><div class="TableContentAndRightShadow" style="background-image:url('.$layout_name.'/images/content/table-shadow-rm.gif)"><div class="TableContentContainer"><table class="TableContent" width="100%"><tr><td class="LabelV150"><span id="charactername_label"'.(isset($e['name]) ? ' class="red"' : '').'>Character Name:</span></td><td><input id="charactername" name="name" class="CipAjaxInput" style="width:206px;float:left;position:relative" style="float:left" value="'.(isset($_POST['name']) ? htmlspecialchars(str_replace('+', ' ', substr(trim($_POST['name']), 0, 30))) : '').'" size=30" maxlength="30" onBlur="SendAjaxCip({DataType: \'Container\'}, {Href: \'account/ajax_charactername.php\',PostData: \'a_CharacterName=\'+this.value,Method: \'POST\'})"/><div id="charactername_indicator" class="InputIndicator" style="background-image:url(account/'.($_POST['step] != 'docreate' || isset($e['name']) ? 'n' : '').'ok.gif)"></div>';
  274. if($suggestname)
  275. $main_content .= '<br/><small>[<a class="CipAjaxLink" href="https://secure.tibia.com/account/content/ajax_suggestname.php" ajaxcip="true" ajaxcip_datatype="Container">suggest name</a>]</small>';
  276. $main_content .= '</td></tr><tr><td></td><td><span id="charactername_errormessage" class="FormFieldError">'.(isset($e['name']) ? $e['name'] : '').'</span></td></tr><tr><td class=LabelV150"><span'.(isset($e['sex]) ? ' class="red"' : '').'>Sex:</span></td><td><table width="100%"><tr><td><span style="margin-right:75px" class="OptionContainer"><label for="sex_male"><span class="OptionContainer"><input id="sex_male" type="radio" name="sex" value="male"'.(($_POST['sex'] == 'male' || $_POST['step'] != 'docreate') ? ' checked=checked"' : '').'/><label for="sex_male">male</label></span></label></span><span class="OptionContainer"><label for="sex_female"><span class="OptionContainer"><input id="sex_female" type="radio" name="sex" value="female"'.($_POST['sex] == 'female' ? ' checked="checked"' : '').'/><label for="sex_female">female</label></span></label></span></td><td></td></tr></table></td></tr>'.(isset($e['sex']) ? '<tr><td></td><td><span class=FormFieldError">'.$e['sex].'</span></td></tr>' : '');
  277. if(count($voc) != 0) {
  278. $main_content .= '<tr><td class="LabelV150"><span'.(isset($e['vocation']) ? ' class="red"' : '').'>Vocation:</span></td><td><table width="100%"><tr><td>';
  279. foreach($voc as $k => $v)
  280. $main_content .= '<span style="margin-right:15px" class="OptionContainer"><label for="vocation_'.$k.'">
  281. <span class="OptionContainer"><input id="vocation_'.$k.'" type="radio" name="vocation" value="'.$k.'"'.($_POST['vocation'] == $k ? ' checked="checked"' : '').'/><label for="vocation_'.$k.'">'.$v.'</label></span></label></span>';
  282. $main_content .= '</td><td></td></tr></table></td></tr>'.(isset($e['vocation']) ? '<tr><td></td><td><span class=FormFieldError">'.$e['vocation].'</span></td></tr>' : '');
  283. }
  284. $main_content .= '</table></div></div><div class="TableShadowContainer"><div class="TableBottomShadow" style="background-image:url('.$layout_name.'/images/content/table-shadow-bm.gif)"><div class="TableBottomLeftShadow" style="background-image:url('.$layout_name.'/images/content/table-shadow-bl.gif)"></div><div class="TableBottomRightShadow" style="background-image:url('.$layout_name.'/images/content/table-shadow-br.gif)"></div></div></div></td></tr><tr><td><div class="TableShadowContainerRightTop"><div class="TableShadowRightTop" style="background-image:url('.$layout_name.'/images/content/table-shadow-rt.gif)"></div></div><div class="TableContentAndRightShadow" style="background-image:url('.$layout_name.'/images/content/table-shadow-rm.gif)"><div class="TableContentContainer"><table class="TableContent" width="100%">';
  285. if(count($location)>1) { // show server location filter
  286. $main_content .= '<tr id="filterbox_location"><td class="LabelV150"><span'.(isset($e['world']) ? ' class="red"' : '').'>World Location:</span></td><td><table width="100%"><tr><td width="33%" valign="top"><script>CreateFilterOption(\'server_location\', \'all\', \'all\')</script>&nbsp;&nbsp;</td>';
  287. $i=0;
  288. foreach($location as $k =>$v) {
  289. $i++;
  290. $main_content .= '<td '.($i == count($location) ? '' : 'width="33%" ').'valign="top"><script>CreateFilterOption(\'server_location\', \''.$k.'\', \''.$v.'\')</script>&nbsp;&nbsp;</td>';
  291. }
  292. $main_content .= '</tr></table></td></tr>';
  293. }
  294. $main_content .= '<tr id="filterbox_pvp"><td class="LabelV150"><span'.(isset($e['world']) ? ' class="red"' : '').'>World Type:</span></td><td><div>';
  295.  
  296. $optional=true; $open=true; $hardcore=true;
  297.  
  298. foreach($worlds as $k =>$v) { // remove selection if there's no valid worlds
  299. if($optional && $v[1] == 'optional')
  300. unset($optional);
  301. elseif($open && $v[1] == 'open')
  302. unset($open);
  303. elseif($hardcore && $v[1] == 'hardcore')
  304. unset($hardcore);
  305. elseif(!$optional && !$open && !$hardcore)
  306. break;
  307. }
  308.  
  309. $n = 0;
  310. foreach(array($optional, $open, $hardcore) as $k)
  311. if(!$k)
  312. $n++;
  313. $main_content .= '<table width="'.round(33.33 *  $n).'%"><tr>';
  314. if(!$optional)
  315. $main_content .= '<td width="'.(100 / $n).'%" align="center" valign="top"><b><script>CreateFilterOption(\'server_pvp_type\', \'optional\', \'Optional PvP\')</script></b>&nbsp;&nbsp;Only if both sides agree, characters can be fought<br/><br/></td>';
  316. if(!$open)
  317. $main_content .= '<td width="'.(100 / $n).'%" align="center" valign="top"><b><script>CreateFilterOption(\'server_pvp_type\', \'open\', \'Open PvP\')</script></b>&nbsp;&nbsp;Killing other characters is possible, but restricted<br/><br/></td>';
  318. if(!$hardcore)
  319. $main_content .= '<td align="center" valign="top"><b><script>CreateFilterOption(\'server_pvp_type\', \'hardcore\', \'Hardcore PvP\')</script></b>&nbsp;&nbsp;Killing other characters is not restricted at all<br/><br/></td>';
  320.  
  321. $main_content .= '</tr></table></div></td></tr><tr><td class="LabelV150"><span'.(isset($e['world']) ? ' class="red"' : '').'>World Name:</span></td><td><div id="js_world_box" style="display:none"><table width="100%"><tr id="world_list_tr" style="text-align:left"></tr></table><span onClick="ToggleVisibility(\'js_world_box\', \'suggested_world_box\'); UpdateServerList(); "><small>[<a style="cursor:pointer">suggest game world</a>]</small></span></div><div id="suggested_world_box">Suggested world: <span id="suggested_world_div"></span><br/><span onClick="ToggleVisibility(\'suggested_world_box\', \'js_world_box\'); "><small>[<a style="cursor:pointer">change game world</a></span>]</small></div></td></tr><tr><td><table id="js_world_box" width="100%"><tr id="world_list_tr"></tr></table><table id="plain_world_box" width="100%"><tr><td>';
  322. foreach($worlds as $k =>$v)
  323. $main_content .= '<input id="server_static_'.$config['site']['worlds'][$k].'" type=radio" name="world" value="'.$config['site]['worlds'][$k].'"'.($config['site']['worlds'][$k] == $_POST['world'] ? ' checked=checked"' : '').'><label for="server_static_'.$config['site]['worlds'][$k].'">'.$config['site']['worlds'][$k].'</label><br/>';
  324. $main_content .= '</td></tr></table></td></tr>'.(isset($e['world']) ? '<tr><td></td><td><span class=FormFieldError">'.$e['world].'</span></td></tr>' : '').'</table></div></div><div class="TableShadowContainer"><div class="TableBottomShadow" style="background-image:url('.$layout_name.'/images/content/table-shadow-bm.gif)"><div class="TableBottomLeftShadow" style="background-image:url('.$layout_name.'/images/content/table-shadow-bl.gif)"></div><div class="TableBottomRightShadow" style="background-image:url('.$layout_name.'/images/content/table-shadow-br.gif)"></div></div></div></td></tr><tr><td><div class="TableShadowContainerRightTop"><div class="TableShadowRightTop" style="background-image:url('.$layout_name.'/images/content/table-shadow-rt.gif)"></div></div><div class="TableContentAndRightShadow" style="background-image:url('.$layout_name.'/images/content/table-shadow-rm.gif)"><div class="TableContentContainer"><table class="TableContent" width="100%"><tr><td><b>Please select all of the following check boxes:</b></td></tr><tr><td><input type="checkbox" name="agreeagreement" value="true"  onClick="if(this.checked == true) {  document.getElementById(\'agreeagreement_errormessage\').innerHTML = \'\';} else {  document.getElementById(\'agreeagreement_errormessage\').innerHTML = \'You have to agree to the Tibia Service Agreement in order to create an account!\';}"'.($_POST['step'] == 'docreate' && !isset($e['agreement']) ? ' checked=checked"' : '').'/>I agree to the <a href="/index.php?subtopic=legaldocuments&page=agreement" target="_blank">Tibia Service Agreement</a>.</td></tr><tr><td><span id="agreeagreement_errormessage" class="FormFieldError">'.(isset($e['agreement]) ? $e['agreement'] : '').'</span></td></tr><tr><td><input type=checkbox" name="agreerules" value="true"  onClick="if(this.checked == true) {  document.getElementById(\'agreerules_errormessage\').innerHTML = \'\';} else {  document.getElementById(\'agreerules_errormessage\').innerHTML = \'You have to agree to the Tibia Rules in order to create an account!\';}"'.($_POST['step] == 'docreate' && !isset($e['rules']) ? ' checked=checked"' : '').'/>I agree to the <a href="/index.php?subtopic=legaldocuments&page=rules" target="_blank">Tibia Rules</a>.</td></tr><tr><td><span id="agreerules_errormessage" class="FormFieldError">'.(isset($e['rules]) ? $e['rules'] : '').'</span></td></tr><tr><td><input type=checkbox" name="agreeprivacy" value="true"  onClick="if(this.checked == true) {  document.getElementById(\'agreeprivacy_errormessage\').innerHTML = \'\';} else {  document.getElementById(\'agreeprivacy_errormessage\').innerHTML = \'You have to agree to the Tibia Privacy Policy in order to create an account!\';}"'.($_POST['step] == 'docreate' && !isset($e['privacy']) ? ' checked=checked"' : '').'/>I agree to the <a href="/index.php?subtopic=legaldocuments&page=privacy" target="_blank">Tibia Privacy Policy</a>.</td></tr><tr><td><span id="agreeprivacy_errormessage" class="FormFieldError">'.(isset($e['privacy]) ? $e['privacy'] : '').'</span></td></tr></table></div></div><div class="TableShadowContainer"><div class="TableBottomShadow" style="background-image:url('.$layout_name.'/images/content/table-shadow-bm.gif)"><div class="TableBottomLeftShadow" style="background-image:url('.$layout_name.'/images/content/table-shadow-bl.gif)"></div><div class="TableBottomRightShadow" style="background-image:url('.$layout_name.'/images/content/table-shadow-br.gif)"></div></div></div></td></tr><script type="text/javascript">PreselectWorld="';
  325. if(isset($_POST['world']) && !empty($_POST['world']))
  326. foreach($config['site']['worlds'] as $id =>$name)
  327. if($worlds[$id] && $name == $_POST['world']) {
  328. $main_content .= $name;
  329. break;
  330. }
  331. $main_content .= '";InitializeCharacterCreator(PreselectServerLocation, \''.(!$optional ? 'optional' : (!$open ? 'open' : 'hardcore')).'\')</script></table></div></table></div></td></tr><br/></div><center><table border="0" cellspacing="0" cellpadding="0"><tr><td style="border:0px"><input type="hidden" name=step value=docreate><input type="hidden" name=noframe value=""><div class="BigButton" style="background-image:url('.$layout_name.'/images/buttons/sbutton.gif)"><div onMouseOver="MouseOverBigButton(this)" onMouseOut="MouseOutBigButton(this)"><div class="BigButtonOver" style="background-image:url('.$layout_name.'/images/buttons/sbutton_over.gif)"></div><input class="ButtonText" type="image" name="Submit" alt="Submit" src="'.$layout_name.'/images/buttons/_sbutton_submit.gif"></div></div></td><tr></form></table></center><script type="text/javascript" language="javascript">document.forms[\'CreateAccountAndCharacter\'].elements[\'accountname\'].focus();</script><script type="text/javascript" src="account/generic.js"></script><script type="text/javascript" src="account/ajaxcip.js"></script>';

Editado por tiroleivi (veja o histórico de edições)
Link para o post
Compartilhar em outros sites

gesior nao conseguiu se conectar a sua Data Base, password esta configurado corretamente ? e seu usuario no mysql está configurado ?

Link para o post
Compartilhar em outros sites

Esta Configurado Tpw com a acc que ja vem na hora de configura o gersior eu consigo criar char deleta normal, mais na hora de criar conta na finalização da criação da conta da o ERRO.

 

CONFIG.LUA:

  1. accountManager = "yes"
  2. namelockManager = "yes"
  3. newPlayerChooseVoc = "yes"
  4. newPlayerSpawnPosX = 160
  5. newPlayerSpawnPosY = 54
  6. newPlayerSpawnPosZ = 7
  7. newPlayerTownId = 1
  8. newPlayerLevel = 8
  9. newPlayerMagicLevel = 0
  10. generateAccountNumber = "no"
  11.  
  12. redSkullLength = 180 * 60 * 1000
  13. blackSkullLength = 240 * 60 * 1000
  14. dailyFragsToRedSkull = 15
  15. weeklyFragsToRedSkull = 30
  16. monthlyFragsToRedSkull = 60
  17. dailyFragsToBlackSkull = 20
  18. weeklyFragsToBlackSkull = 90
  19. monthlyFragsToBlackSkull = 120
  20. dailyFragsToBanishment = 0
  21. weeklyFragsToBanishment = 0
  22. monthlyFragsToBanishment = 0
  23. blackSkulledDeathHealth = 40
  24. blackSkulledDeathMana = 0
  25. useBlackSkull = true
  26. useFragHandler = true
  27. advancedFragList = false
  28.  
  29. notationsToBan = 3
  30. warningsToFinalBan = 1
  31. warningsToDeletion = 5
  32. banLength = 3 * 24 * 60 * 60
  33. killsBanLength = 1 * 24 * 60 * 60
  34. finalBanLength = 5 * 24 * 60 * 60
  35. ipBanishmentLength = 9999 * 24 * 60 * 60
  36. broadcastBanishments = false
  37. maxViolationCommentSize = 200
  38. violationNameReportActionType = 2
  39. autoBanishUnknownBytes = false
  40.  
  41. worldType = "open"
  42. protectionLevel = 100
  43. pvpTileIgnoreLevelAndVocationProtection = true
  44. pzLocked = 30 * 1000
  45. huntingDuration = 45 * 1000
  46. criticalHitChance = 7
  47. criticalHitMultiplier = 1
  48. displayCriticalHitNotify = false
  49. removeWeaponAmmunition = false
  50. removeWeaponCharges = false
  51. removeRuneCharges = "false"
  52. whiteSkullTime = 2 * 60 * 1000
  53. noDamageToSameLookfeet = false
  54. showHealingDamage = true
  55. showHealingDamageForMonsters = false
  56. fieldOwnershipDuration = 5 * 1000
  57. stopAttackingAtExit = false
  58. oldConditionAccuracy = false
  59. loginProtectionPeriod = 0 * 1000
  60. deathLostPercent = 10
  61. stairhopDelay = 0 * 1000
  62. pushCreatureDelay = 0 * 500
  63. deathContainerId = 1987
  64. gainExperienceColor = 18
  65. addManaSpentInPvPZone = true
  66. squareColor = 0
  67. allowFightback = true
  68.  
  69. worldId = 0
  70. ip = "127.0.0.1"
  71. bindOnlyConfiguredIpAddress = false
  72. loginPort = 7171
  73. gamePort = 7172
  74. adminPort = 7171
  75. statusPort = 7171
  76. loginTries = 10
  77. retryTimeout = 2 * 1000
  78. loginTimeout = 5 * 1000
  79. maxPlayers = 1000
  80. motd = "*Bem Vindo ao Dark Baiak. Acesse: http://dark-baiak.servegame.com "
  81. displayOnOrOffAtCharlist = true
  82. onePlayerOnlinePerAccount = false
  83. allowClones = false
  84. serverName = "Dark baiak"
  85. loginMessage = "Bem-Vindo ao Dark Baiak! Acesse: http://dark-baiak.servegame.com"
  86. statusTimeout = 10 * 100
  87. replaceKickOnLogin = true
  88. forceSlowConnectionsToDisconnect = false
  89. loginOnlyWithLoginServer = false
  90. premiumPlayerSkipWaitList = false
  91.  
  92. sqlType = "mysql"
  93. sqlHost = "localhost"
  94. sqlPort = 3306
  95. sqlUser = "root"
  96. sqlPass = "******************"
  97. sqlDatabase = "darkbaiak"
  98. sqlFile = "darkbaiak.s3db"
  99. sqlKeepAlive = 0
  100. mysqlReadTimeout = 5000
  101. mysqlWriteTimeout = 5000
  102. encryptionType = "sha1"
  103.  
  104. deathListEnabled = true
  105. deathListRequiredTime = 1 * 60 * 1000
  106. deathAssistCount = 19
  107. maxDeathRecords = 5
  108.  
  109. ingameGuildManagement = false
  110. levelToFormGuild = 100
  111. premiumDaysToFormGuild = 0
  112. guildNameMinLength = 4
  113. guildNameMaxLength = 20
  114.  
  115. highscoreDisplayPlayers = 100
  116. updateHighscoresAfterMinutes = 2
  117.  
  118. buyableAndSellableHouses = true
  119. houseNeedPremium = false
  120. bedsRequirePremium = false
  121. levelToBuyHouse = 100
  122. housesPerAccount = 1
  123. houseRentAsPrice = false
  124. housePriceAsRent = false
  125. housePriceEachSquare = 10000
  126. houseRentPeriod = "weekly"
  127. houseCleanOld = 0
  128. guildHalls = false
  129.  
  130. timeBetweenActions = 200
  131. timeBetweenExActions = 1000
  132. checkCorpseOwner = false
  133. hotkeyAimbotEnabled = true
  134. maximumDoorLevel = 500
  135.  
  136. mapName = "Baiak Yurots.otbm"
  137. mapAuthor = "Dark Baiak World OT Server"
  138. randomizeTiles = true
  139. useHouseDataStorage = false
  140. storeTrash = true
  141. cleanProtectedZones = true
  142. mailboxDisabledTowns = "-1"
  143.  
  144. defaultPriority = "high"
  145. niceLevel = 5
  146. coresUsed = "-1"
  147. optimizeDatabaseAtStartup = true
  148. removePremiumOnInit = true
  149. confirmOutdatedVersion = false
  150.  
  151. maxMessageBuffer = 10
  152. bufferMutedOnSpellFailure = false
  153.  
  154. dataDirectory = "data/"
  155. allowChangeOutfit = true
  156. allowChangeColors = true
  157. allowChangeAddons = true
  158. disableOutfitsForPrivilegedPlayers = false
  159. bankSystem = true
  160. saveGlobalStorage = true
  161. displaySkillLevelOnAdvance = false
  162. spellNameInsteadOfWords = false
  163. emoteSpells = true
  164. promptExceptionTracerErrorBox = true
  165. storePlayerDirection = false
  166. monsterLootMessage = 3
  167. monsterLootMessageType = 25
  168. separateViplistPerCharacter = false
  169.  
  170. ghostModeInvisibleEffect = true
  171. ghostModeSpellEffects = true
  172.  
  173. idleWarningTime = 1 * 60 * 1000
  174. idleKickTime = 2 * 60 * 1000
  175. expireReportsAfterReads = 1
  176. playerQueryDeepness = 2
  177. maxItemsPerPZTile = 0
  178. maxItemsPerHouseTile = 0
  179.  
  180. freePremium = true
  181. premiumForPromotion = false
  182.  
  183. blessingOnlyPremium = false
  184. blessingReductionBase = 30
  185. blessingReductionDecreament = 5
  186. eachBlessReduction = 8
  187.  
  188. experienceStages = true
  189. rateExperience = 500
  190. rateExperienceFromPlayers = 0
  191. rateSkill = 60
  192. rateMagic = 40
  193. rateLoot = 8
  194. rateSpawn = 5
  195.  
  196. rateMonsterHealth = 1.0
  197. rateMonsterMana = 1.0
  198. rateMonsterAttack = 1.0
  199. rateMonsterDefense = 1.0
  200.  
  201. minLevelThresholdForKilledPlayer = 0.9
  202. maxLevelThresholdForKilledPlayer = 1.1
  203.  
  204. rateStaminaLoss = 0
  205. rateStaminaGain = 10
  206. rateStaminaThresholdGain = 12
  207. staminaRatingLimitTop = 40 * 60
  208. staminaRatingLimitBottom = 14 * 60
  209. rateStaminaAboveNormal = 1.0
  210. rateStaminaUnderNormal = 1.0
  211. staminaThresholdOnlyPremium = false
  212.  
  213. experienceShareRadiusX = 30
  214. experienceShareRadiusY = 30
  215. experienceShareRadiusZ = 1
  216. experienceShareLevelDifference = 2 / 3
  217. extraPartyExperienceLimit = 20
  218. extraPartyExperiencePercent = 5
  219. experienceShareActivity = 2 * 60 * 1000
  220.  
  221. globalSaveEnabled = false
  222. globalSaveHour = 24
  223. shutdownAtGlobalSave = true
  224. cleanMapAtGlobalSave = false
  225.  
  226. deSpawnRange = 2
  227. deSpawnRadius = 50
  228.  
  229. maxPlayerSummons = 2
  230. teleportAllSummons = false
  231. teleportPlayerSummons = false
  232.  
  233. ownerName = "Dark Baiak World OT Server"
  234. ownerEmail = "[email protected]"
  235. url = "http://dark-baiak.servegame.com/"
  236. location = "Brazil"
  237. displayGamemastersWithOnlineCommand = false
  238.  
  239. adminLogsEnabled = true
  240. displayPlayersLogging = true
  241. prefixChannelLogs = ""
  242. runFile = ""
  243. outLogName = ""
  244. errorLogName = ""
  245. truncateLogsOnStartup = false

 
Database :
 
b9gfmh.jpg
 
 
Create Account : 
 
11jlnax.jpg
Editado por tiroleivi (veja o histórico de edições)
Link para o post
Compartilhar em outros sites

A sua senha está correta no seu config.lua??

Te ajudei?? REP + e ficamos quites... <ahttp://www.tibiaking.com/forum/uploads/emoticons/default_happyy.png' alt=';D'>

Atenciosamente,

Daniel.

Abraços!

Link para o post
Compartilhar em outros sites

poste seu creataccount.php, mas utilize os spoilers.

 CREATE ACCOUNT.PHP

  1. <b>
  2. <?php
  3. $location = array(
  4. 'GER' =>'Europe',
  5. // 'USA' =>'North America'
  6. );
  7. $default = 'all';
  8.  
  9. $worlds = array();
  10. $worlds[0] = array('GER', 'open');
  11. /*
  12. $worlds[1] = array('GER', 'optional');
  13. $worlds[2] = array('GER', 'hardcore');
  14. $worlds[3] = array('USA', 'open');
  15. $worlds[4] = array('USA', 'optional');
  16. $worlds[5] = array('USA', 'hardcore');
  17. */
  18.  
  19. $voc = array(); // if empty, Rook Sample will be used
  20. $voc[1] = 'Sorcerer';
  21. $voc[2] = 'Druid';
  22. $voc[3] = 'Paladin';
  23. $voc[4] = 'Knight';
  24.  
  25. $suggestname = NULL; // not available
  26. $version = '860'; // for download link
  27.  
  28. foreach($worlds as $k =>$v) // remove invalid worlds
  29. if(!isset($location[$v[0]]) || !isset($config['site']['worlds'][$k]))
  30. unset($worlds[$k]);
  31.  
  32. $tmp = array();
  33. foreach($location as $k =>$v) // remove invalid/unused locations
  34. foreach($worlds as $i =>$j)
  35. if($j[0] == $k) {
  36. $tmp[$k] = $v;
  37. break;
  38. }
  39. $location = $tmp; unset($tmp);
  40.  
  41. if(isset($_POST['step']) && $_POST['step'] == 'docreate') {
  42. $e = array();
  43. $s = isset($_POST['accountname']) ? $_POST['accountname'] : '';
  44. if($s == '')
  45. $e['acc'] = 'Please enter an account name!';
  46. elseif(strlen($s) < 6)
  47. $e['acc'] = 'This account name is too short!';
  48. elseif(strlen($s) > 30)
  49. $e['acc'] = 'This account name is too long!';
  50. else {
  51. $s = strtoupper($s);
  52.  
  53. if(!ctype_alnum($s))
  54. $e['acc'] = 'This account name has an invalid format. Your account name may only consist of numbers 0-9 and letters A-Z!';
  55. elseif(!preg_match('/[A-Z]/', $s))
  56. $e['acc'] = 'Your account name must include at least one letter A-Z!';
  57. else {
  58. $con = mysql_pconnect($config['server']['sqlHost'], $config['server']['sqlUser'], $config['server']['sqlPass']) or die('MySQL connection error.');
  59. mysql_select_db($config['server']['sqlDatabase']);
  60.  
  61. if(mysql_num_rows(mysql_query('SELECT id FROM accounts WHERE name=\''.mysql_escape_string($s).'\' LIMIT 1')) != 0)
  62. $e['acc'] = 'This account name is already used. Please select another one!';
  63. }
  64. }
  65.  
  66. $s = isset($_POST['name']) ? trim($_POST['name']) : '';
  67.  
  68. if(empty($s))
  69. $e['name'] = 'Please enter a name for your character!';
  70. elseif(strlen($s) < 2 || strlen($s) > 29)
  71. $e['name'] = 'A name must have at least 2 but no more than 29 letters!';
  72. elseif(preg_match('/[^a-zA-Z ]/', $s))
  73. $e['name'] = 'This name contains invalid letters. Please use only A-Z, a-z and space!';
  74. elseif(!ctype_upper($s[0]))
  75. $e['name'] = 'The first letter of a name has to be a capital letter!';
  76. elseif(strpos($s, '  ') !== false)
  77. $e['name'] = 'This name contains more than one space between words. Please use only one space between words!';
  78. else {
  79. foreach(explode(' ', $s) as $k =>$v) {
  80. $words[$k] = str_split($v);
  81. $len = strlen($v);
  82. if($len == 1) {
  83. $e['name'] = 'This name contains a word with only one letter. Please use more than one letter for each word!';
  84. break;
  85. }
  86. elseif($len > 14) {
  87. $e['name'] = 'This name contains a word that is too long. Please use no more than 14 letters for each word!';
  88. break;
  89. }
  90. }
  91. if(!isset($e['name'])) {
  92. $total=0;
  93. foreach($words as $k =>$p) {
  94. if(isset($e['name']))
  95. break;
  96. $total++;
  97. if($total > 3) {
  98. $e['name'] = 'This name contains more than 3 words. Please choose another name!';
  99. break;
  100. }
  101. $len=0;
  102. foreach($p as $i =>$j) {
  103. $len++;
  104. if($i != 0 && ctype_upper($j)) {
  105. $e['name'] = 'In names capital letters are only allowed at the beginning of a word!';
  106. break;
  107. }
  108. elseif($i == $len-1) {
  109. $ff=null;
  110. for($h=0;$h<strlen($v); $h++) {
  111. if(in_array(strtolower($v[$h]), array('a','e','i','o','u')) !== false) {
  112. $ff=true;
  113. break;
  114. }
  115. }
  116. if(!$ff) {
  117. $e['name'] = 'This name contains a word without vowels. Please choose another name!';
  118. break;
  119. }
  120. }
  121. }
  122. }
  123. if(!isset($e['name'])) {
  124. $s = strtolower($s);
  125. for($i = 0; $i < strlen($s); $i++)
  126. if($s[$i] == $s[($i+1)] && $s[$i] == $s[($i+2)]) {
  127. $e['name'] = 'This character name is already used. Please select another one!';
  128. break;
  129. }
  130. if(!isset($e['name'])) {
  131. foreach(array('aa ', 'ee', 'ii', 'oo', 'uu', 'gm','cm', 'aff ', 'god ', 'abc', 'tutor', 'game', 'admin', 'the ') as $v)
  132. if($v == substr($s, 0, strlen($v))) {
  133. $e['name'] = 'This character name is already used. Please select another one!';
  134. break;
  135. }
  136. if(!isset($e['name'])) {
  137. foreach(array('game', 'customer', 'support', 'fuck', 'haha', 'sux', ' abc', 'suck', 'noob', 'tutor', 'admin', 'account', 'gay', 'password', 'manager') as $v)
  138. if(strpos($s, $v) !== false) {
  139. $e['name'] = 'This character name is already used. Please select another one!';
  140. break;
  141. }
  142. if(!isset($e['name'])) {
  143. if(!isset($con)) {
  144. $con = mysql_pconnect($config['server']['sqlHost'], $config['server']['sqlUser'], $config['server']['sqlPass']) or die('MySQL connection error.');
  145. mysql_select_db($config['server']['sqlDatabase']);
  146. }
  147. if(mysql_num_rows(mysql_query('SELECT id FROM players WHERE name=\''.mysql_escape_string($s).'\' LIMIT 1')) != 0)
  148. $e['name'] = 'This character name is already used. Please select another one!';
  149. }
  150. }
  151. }
  152. }
  153. }
  154. }
  155.  
  156. if(!isset($_POST['world']) || empty($_POST['world']))
  157. $e['world'] = 'Please select a game world for your character!';
  158.  
  159. if(!isset($_POST['sex']) || ($_POST['sex'] != 'male' && $_POST['sex'] != 'female'))
  160. $e['sex'] = 'Please select the sex for your character!';
  161.  
  162. if(count($voc) != 0 && (!isset($_POST['vocation']) || !is_numeric($_POST['vocation']) || !isset($voc[$_POST['vocation']])))
  163. $e['vocation'] = 'Please select the vocation for your character!';
  164.  
  165. $s = isset($_POST['email']) ? $_POST['email'] : '';
  166.  
  167. if($s == '')
  168. $e['email'] = 'Please enter your email address!';
  169. elseif(strlen($s) > 49)
  170. $e['email'] = 'Your email address is too long!';
  171. elseif(!filter_var($s, FILTER_VALIDATE_EMAIL))
  172. $e['email'] = 'This email address has an invalid format. Please enter a correct email address!';
  173. else {
  174. if(!isset($con)) {
  175. $con = mysql_pconnect($config['server']['sqlHost'], $config['server']['sqlUser'], $config['server']['sqlPass']) or die('MySQL connection error.');
  176. mysql_select_db($config['server']['sqlDatabase']);
  177. }
  178. if(mysql_num_rows(mysql_query('SELECT id FROM accounts WHERE email=\''.mysql_escape_string($s).'\' LIMIT 1')) != 0)
  179. $e['email'] = 'This email address is already used. Please enter another email address!';
  180. }
  181.  
  182. $s1 = isset($_POST['password1']) ? $_POST['password1'] : '';
  183. $s2 = isset($_POST['password2']) ? $_POST['password2'] : '';
  184.  
  185. if(empty($s2))
  186. $e['pass'] = 'Please enter the password again!';
  187. elseif($s1 != $s2)
  188. $e['pass'] = 'The two passwords do not match!';
  189. else {
  190. $err = array();
  191. if(strlen($s1) < 8 || strlen($s1) > 29)
  192. $err[] = 'The password must have at least 8 and less than 30 letters!';
  193. if(!ctype_alnum($s1))
  194. $err[] = 'The password contains invalid letters!';
  195. if(!preg_match('/[a-zA-Z]/', $s1))
  196. $err[] = 'The password must contain at least one letter A-Z or a-z!';
  197. elseif(!preg_match('/[0-9]/', $s1))
  198. $err[] = 'The password must contain at least one letter other than A-Z or a-z!';
  199.  
  200. if(count($err) != 0) {
  201. $e['pass'] = '';
  202. for($i=0; $i < count($err); $i++)
  203. $e['pass'] .= ($i == 0 ? '' : '<br/>').$err[$i];
  204. }
  205. }
  206.  
  207. if(!isset($_POST['agreeagreement']) || empty($_POST['agreeagreement']))
  208. $e['agreement'] = 'You have to agree to the Tibia Service Agreement in order to create an account!';
  209. if(!isset($_POST['agreerules']) || empty($_POST['agreerules']))
  210. $e['rules'] = 'You have to agree to the Tibia Rules in order to create an account!';
  211. if(!isset($_POST['agreeprivacy']) || empty($_POST['agreeprivacy']))
  212. $e['privacy'] = 'You have to agree to the Tibia Privacy Policy in order to create an account!';
  213.  
  214. if(count($e) == 0) {
  215. $worldid = NULL;
  216. foreach($config['site']['worlds'] as $id =>$name)
  217. if($worlds[$id] && $name == $_POST['world']) {
  218. $worldid = $id;
  219. break;
  220. }
  221. if($worldid === FALSE)
  222. $e['world'] = 'Please select a valid game world.';
  223. }
  224.  
  225. if(count($e) != 0) {
  226. $main_content = '<div class="SmallBox"><div class="MessageContainer"><div class="BoxFrameHorizontal" style="background-image:url('.$layout_name.'/images/content/box-frame-horizontal.gif)"/></div><div class="BoxFrameEdgeLeftTop" style="background-image:url('.$layout_name.'/images/content/box-frame-edge.gif)"/></div><div class="BoxFrameEdgeRightTop" style="background-image:url('.$layout_name.'/images/content/box-frame-edge.gif)"/></div><div class="ErrorMessage"><div class="BoxFrameVerticalLeft" style="background-image:url('.$layout_name.'/images/content/box-frame-vertical.gif)"/></div><div class="BoxFrameVerticalRight" style="background-image:url('.$layout_name.'/images/content/box-frame-vertical.gif)"/></div><div class="AttentionSign" style="background-image:url('.$layout_name.'/images/content/attentionsign.gif)"/></div><b>The Following Errors Have Occurred:</b><br/>';
  227. foreach($e as $error) $main_content .= $error.'<br/>';
  228. $main_content .= '</div><div class="BoxFrameHorizontal" style="background-image:url('.$layout_name.'/images/content/box-frame-horizontal.gif)"/></div><div class="BoxFrameEdgeRightBottom" style="background-image:url('.$layout_name.'/images/content/box-frame-edge.gif)"/></div><div class="BoxFrameEdgeLeftBottom" style="background-image:url('.$layout_name.'/images/content/box-frame-edge.gif)"/></div></div></div><br/>';
  229. }
  230. else {
  231. $random = rand(1, 9999999);
  232. $n = $random;
  233. $cur = array();
  234.  
  235. $q = mysql_query('SELECT id FROM accounts');
  236. while ($r = mysql_fetch_array($q, MYSQL_NUM))
  237. $cur[] = $r[0];
  238.  
  239. while(true)
  240. {
  241. if(!in_array($n, $cur))
  242. break;
  243.  
  244. $n++;
  245.  
  246. if($n > 9999999)
  247. $n = 1;
  248.  
  249. if($n == $random)
  250. die('Failed to create account.');
  251. }
  252.  
  253. if(mysql_query("INSERT INTO accounts (id,name,password,email,created) VALUES($n,'".$_POST['accountname']."','".($config['server']['encryptionType'] == 'plain' ? $_POST['password1'] : hash($config['server']['encryptionType'], $_POST['password1']))."','".$_POST['email']."',".time().")") === true) {
  254. $sample = (count($voc) == 0 ? 'Rook' : $voc[$_POST['vocation']]).' Sample';
  255. $q = mysql_query("SELECT id,vocation,town_id,experience,level,maglevel,health,healthmax,mana,manamax,soul,lookbody,lookfeet,lookhead,looklegs,lookaddons,cap,save,posx,posy,posz FROM players WHERE name='$sample' LIMIT 1");
  256. if(mysql_num_rows($q) != 1)
  257. die('Missing sample character ('.$sample.')');
  258.  
  259. $q = mysql_fetch_array($q);
  260. mysql_query('INSERT INTO players (name,world_id,account_id,level,vocation,health,healthmax,experience,lookbody,lookfeet,lookhead,looklegs,looktype,lookaddons,maglevel,mana,manamax,soul,town_id,posx,posy,posz,cap,sex,created) VALUES(\''.$_POST['name'].'\','.$worldid.','.$n.','.$q['level'].','.$q['vocation'].','.$q['health'].','.$q['healthmax'].','.$q['experience'].','.$q['lookbody'].','.$q['lookfeet'].','.$q['lookhead'].','.$q['looklegs'].','.($_POST['sex'] == 'female' ? 136 : 128).','.$q['lookaddons'].','.$q['maglevel'].','.$q['mana'].','.$q['manamax'].','.$q['soul'].','.$q['town_id'].','.$q['posx'].','.$q['posy'].','.$q['posz'].','.$q['cap'].','.($_POST['sex'] == 'female' ? 0 : 1).','.time().')');
  261. }
  262. else die('Failed to create account.');
  263. $main_content = '<div class="SmallBox"><div class="MessageContainer"><div class="BoxFrameHorizontal" style="background-image:url('.$layout_name.'/images/content/box-frame-horizontal.gif)"/></div><div class="BoxFrameEdgeLeftTop" style="background-image:url('.$layout_name.'/images/content/box-frame-edge.gif)"/></div><div class="BoxFrameEdgeRightTop" style="background-image:url('.$layout_name.'/images/content/box-frame-edge.gif)"/></div><div class="Message"><div class="BoxFrameVerticalLeft" style="background-image:url('.$layout_name.'/images/content/box-frame-vertical.gif)"/></div><div class="BoxFrameVerticalRight" style="background-image:url('.$layout_name.'/images/content/box-frame-vertical.gif)"/></div><table><tr><td class="LabelV">Note:</td><td style="width:100%"><p>Your account and character have been created successfully.</p></td></tr></table></div><div class="BoxFrameHorizontal" style="background-image:url('.$layout_name.'/images/content/box-frame-horizontal.gif)"/></div><div class="BoxFrameEdgeRightBottom" style="background-image:url('.$layout_name.'/images/content/box-frame-edge.gif)"/></div><div class="BoxFrameEdgeLeftBottom" style="background-image:url('.$layout_name.'/images/content/box-frame-edge.gif)"/></div></div></div><div class="BoxFrameHorizontal" style="background-image:url('.$layout_name.'/images/content/box-frame-horizontal.gif)"></div><div class="BoxFrameEdgeRightBottom" style="background-image:url('.$layout_name.'/images/content/box-frame-edge.gif)"></div><div class="BoxFrameEdgeLeftBottom" style="background-image:url('.$layout_name.'/images/content/box-frame-edge.gif)"></div><br/><div class="TableContainer"><table class="Table4" cellpadding="0" cellspacing="0"><div class="CaptionContainer"><div class="CaptionInnerContainer"><span class="CaptionEdgeLeftTop" style="background-image:url('.$layout_name.'/images/content/box-frame-edge.gif)"/></span><span class="CaptionEdgeRightTop" style="background-image:url('.$layout_name.'/images/content/box-frame-edge.gif)"/></span><span class="CaptionBorderTop" style="background-image:url('.$layout_name.'/images/content/table-headline-border.gif)"></span><span class="CaptionVerticalLeft" style="background-image:url('.$layout_name.'/images/content/box-frame-vertical.gif)"/></span><div class="Text">Download Client</div><span class="CaptionVerticalRight" style="background-image:url('.$layout_name.'/images/content/box-frame-vertical.gif)"/></span><span class="CaptionBorderBottom" style="background-image:url('.$layout_name.'/images/content/table-headline-border.gif)"></span><span class="CaptionEdgeLeftBottom" style="background-image:url('.$layout_name.'/images/content/box-frame-edge.gif)"/></span><span class="CaptionEdgeRightBottom" style="background-image:url('.$layout_name.'/images/content/box-frame-edge.gif)"/></span></div></div><tr><td><div class="InnerTableContainer"><table style="width:100%"><tr><td><table width="100%" cellpadding=0 cellspacing=0><tr><td style="vertical-align:top"><div class="TableShadowContainerRightTop"><div class="TableShadowRightTop" style="background-image:url('.$layout_name.'/images/content/table-shadow-rt.gif)"></div></div><div class="TableContentAndRightShadow" style="background-image:url('.$layout_name.'/images/content/table-shadow-rm.gif)"><div class="TableContentContainer"><table class="TableContent" width="100%"><tr><td><table style="width:100%;text-align:center"><tr><td><a href="http://tibiaclient.com/files/tibia'.$version.'.exe" type="application/octet-stream" target="_top"><img style="width:180px;height:180px;border:0px" src="account/download_windows.png"/></a></td><td><a href="http://tibiaclient.com/files/tibia'.$version.'.tar" type="application/octet-stream" target="_top"><img style="width:180px;height:180px;border:0px" src="account/download_linux.png"/><br/></a></td></tr><tr><td valign="top"><a href="http://tibiaclient.com/files/tibia'.$version.'.exe" type="application/octet-stream" target="_top">Windows Tibia Client '.(sprintf('%01.2f', $version / 100)).'</a></td><td valign="top"><a href="http://tibiaclient.com/files/tibia'.$version.'.tar" type="application/octet-stream" target="_top">Linux Tibia Client '.(sprintf('%01.2f', $version / 100)).'</a></td></tr><tr><td colspan="2">[<span class="HelpLink" onClick="window.open(\'http://www.tibia.com/support/content/help.php?subtopic=requirementes\' \'Help\', \'width=380px, height=310px, scrollbars=yes\')"><a>system requirements</a></span>]</td></tr></table></td></tr></table></div></div><div class="TableShadowContainer"><div class="TableBottomShadow" style="background-image:url('.$layout_name.'/images/content/table-shadow-bm.gif)"><div class="TableBottomLeftShadow" style="background-image:url('.$layout_name.'/images/content/table-shadow-bl.gif)"></div><div class="TableBottomRightShadow" style="background-image:url('.$layout_name.'/images/content/table-shadow-br.gif)"></div></div></div></td><td style="vertical-align:top"><div class="TableShadowContainerRightTop"><div class="TableShadowRightTop" style="background-image:url('.$layout_name.'/images/content/table-shadow-rt.gif)"></div></div><div class="TableContentAndRightShadow" style="background-image:url('.$layout_name.'/images/content/table-shadow-rm.gif)"><div class="TableContentContainer"><table class="TableContent" width="100%"><tr><td style="text-align:center"><img style="width:254px;height:218px;margin:7px" src="account/successful_download.jpg"/></td></tr></table></div></div><div class="TableShadowContainer"><div class="TableBottomShadow" style="background-image:url('.$layout_name.'/images/content/table-shadow-bm.gif)"><div class="TableBottomLeftShadow" style="background-image:url('.$layout_name.'/images/content/table-shadow-bl.gif)"></div><div class="TableBottomRightShadow" style="background-image:url('.$layout_name.'/images/content/table-shadow-br.gif)"></div></div></div></td></tr></table><tr><td><div class="TableShadowContainerRightTop"><div class="TableShadowRightTop" style="background-image:url('.$layout_name.'/images/content/table-shadow-rt.gif)"></div></div><div class="TableContentAndRightShadow" style="background-image:url('.$layout_name.'/images/content/table-shadow-rm.gif)"><div class="TableContentContainer"><table class="TableContent" width="100%"><tr><td class="LabelV">Disclaimer</td></tr><tr><td>The software and any related documentation is provided "as is" without warranty of any kind. The entire risk arising out of use of the software remains with you. In no event shall CipSoft GmbH be liable for any damages to your computer or loss of data.</td></tr></table></div></div><div class="TableShadowContainer"><div class="TableBottomShadow" style="background-image:url('.$layout_name.'/images/content/table-shadow-bm.gif)"><div class="TableBottomLeftShadow" style="background-image:url('.$layout_name.'/images/content/table-shadow-bl.gif)"></div><div class="TableBottomRightShadow" style="background-image:url('.$layout_name.'/images/content/table-shadow-br.gif)"></div></div></div></td></tr></table></div></table></div></td></tr>';
  264. return;
  265. }
  266. } else $_POST['step'] = '';
  267.  
  268. $main_content .= '<script type="text/javascript" src="account/jquery.js"></script>
  269. <script type="text/javascript" src="account/create_character.js"></script>
  270. <script type="text/javascript">var PreselectServerLocation="'.$default.'";var g_FormName="CreateAccountAndCharacter";var g_FieldName="accountname";document.getElementById("ActiveSubmenuItemIcon_createaccount").style.visibility = "visible";';
  271. foreach($worlds as $k =>$v) // create dynamic server list
  272. $main_content .= 'ServerList.push(new Array(\''.$config['site']['worlds'][$k].'\', \''.$v[0].'\', \''.$v[1].'\'));';
  273. $main_content .= '</script><div style="position:relative;top:0px;left:0px"><form action="/index.php?subtopic=createaccount" method=post name="CreateAccountAndCharacter"><div class="TableContainer"><table class="Table5" cellpadding="0" cellspacing="0"><div class="CaptionContainer"><div class="CaptionInnerContainer"><span class="CaptionEdgeLeftTop" style="background-image:url('.$layout_name.'/images/content/box-frame-edge.gif)"></span><span class="CaptionEdgeRightTop" style="background-image:url('.$layout_name.'/images/content/box-frame-edge.gif)"></span><span class="CaptionBorderTop" style="background-image:url('.$layout_name.'/images/content/table-headline-border.gif)"></span><span class="CaptionVerticalLeft" style="background-image:url('.$layout_name.'/images/content/box-frame-vertical.gif)"></span><div class="Text">Create New Account</div><span class="CaptionVerticalRight" style="background-image:url('.$layout_name.'/images/content/box-frame-vertical.gif)"></span><span class="CaptionBorderBottom" style="background-image:url('.$layout_name.'/images/content/table-headline-border.gif)"></span><span class="CaptionEdgeLeftBottom" style="background-image:url('.$layout_name.'/images/content/box-frame-edge.gif)"></span><span class="CaptionEdgeRightBottom" style="background-image:url('.$layout_name.'/images/content/box-frame-edge.gif)"></span></div></div><tr><td><div class="InnerTableContainer"><table style="width:100%"><tr><td><div class="TableShadowContainerRightTop"><div class="TableShadowRightTop" style="background-image:url('.$layout_name.'/images/content/table-shadow-rt.gif)"></div></div><div class="TableContentAndRightShadow" style="background-image:url('.$layout_name.'/images/content/table-shadow-rm.gif)"><div class="TableContentContainer"><table class="TableContent" width="100%"><tr><td class="LabelV150"><span id="accountname_label"'.(isset($e['acc']) ? ' class=red"' : '').'>Account Name:</span></td><td><input id="accountname" name="accountname" class="CipAjaxInput" style="width:206px;float:left" value="'.(isset($_POST['accountname]) ? htmlspecialchars(substr($_POST['accountname'], 0, 30)) : '').'" size=30" maxlength="30" onBlur="SendAjaxCip({DataType: \'Container\'}, {Href: \'account/ajax_accountname.php\',PostData: \'a_AccountName=\'+this.value,Method: \'POST\'})"/><div id="accountname_indicator" class="InputIndicator" style="background-image:url(account/'.($_POST['step] != 'docreate' || isset($e['acc']) ? 'n' : '').'ok.gif)"></div></td></tr><tr><td></td><td><span id=accountname_errormessage" class="FormFieldError">'.(isset($e['acc]) ? $e['acc'] : '').'</span></td></tr><tr><td class=LabelV150"><span id="email_label"'.(isset($e['email]) ? ' class="red"' : '').'>Email Address:</span></td><td><input id="email" name="email" class="CipAjaxInput" style="width:206px;float:left" value="'.(isset($_POST['email']) ? htmlspecialchars(substr($_POST['email'], 0, 50)) : '').'" autocomplete=off" size="30" maxlength="50" onBlur="SendAjaxCip({DataType: \'Container\'}, {Href: \'account/ajax_email.php\',PostData: \'a_EMail=\'+this.value,Method: \'POST\'})"/><div id="email_indicator" class="InputIndicator" style="background-image:url(account/'.($_POST['step] != 'docreate' || isset($e['email']) ? 'n' : '').'ok.gif)"></div></td></tr><tr><td></td><td><span id=email_errormessage" class="FormFieldError">'.(isset($e['email]) ? $e['email'] : '').'</span></td></tr><tr><td class=LabelV150"><span id="password1_label"'.(isset($e['pass]) ? ' class="red"' : '').'>Password:</span></td><td><input id="password1" type="password" autocomplete="off" name="password1" style="width:206px;float:left" value="'.(isset($_POST['password1']) ? htmlspecialchars(substr($_POST['password1'], 0, 30)) : '').'" size=30" maxlength="30" onBlur="SendAjaxCip({DataType: \'Container\'}, {Href: \'account/ajax_password.php\',PostData: \'a_Password1=\'+getElementById(\'password1\').value+\'&a_Password2=\'+getElementById(\'password2\').value,Method: \'POST\'})"/><div id="password1_indicator" class="InputIndicator" style="background-image:url(account/'.($_POST['step] != 'docreate' || isset($e['pass']) ? 'n' : '').'ok.gif)"></div></td></tr><tr><td class=LabelV150"><span id="password2_label"'.(isset($e['pass]) ? ' class="red"' : '').'>Password Again:</span></td><td><input id="password2" type="password" name="password2" style="width:206px;float:left" value="'.(isset($_POST['password2']) ? htmlspecialchars(substr($_POST['password2'], 0, 30)) : '').'" size=30" maxlength="30" onBlur="SendAjaxCip({DataType: \'Container\'}, {Href: \'account/ajax_password.php\',PostData: \'a_Password1=\'+getElementById(\'password1\').value+\'&a_Password2=\'+getElementById(\'password2\').value,Method: \'POST\'})"/><div id="password2_indicator" class="InputIndicator" style="background-image:url(account/'.($_POST['step] != 'docreate' || isset($e['pass']) ? 'n' : '').'ok.gif)"></div></td></tr><tr><td></td><td><span id=password_errormessage" class="FormFieldError">'.(isset($e['pass]) ? $e['pass'] : '').'</span></td></tr></table></div></div><div class=TableShadowContainer"><div class="TableBottomShadow" style="background-image:url('.$layout_name.'/images/content/table-shadow-bm.gif)"><div class="TableBottomLeftShadow" style="background-image:url('.$layout_name.'/images/content/table-shadow-bl.gif)"></div><div class="TableBottomRightShadow" style="background-image:url('.$layout_name.'/images/content/table-shadow-br.gif)"></div></div></div></td></tr><tr><td><div class="TableShadowContainerRightTop"><div class="TableShadowRightTop" style="background-image:url('.$layout_name.'/images/content/table-shadow-rt.gif)"></div></div><div class="TableContentAndRightShadow" style="background-image:url('.$layout_name.'/images/content/table-shadow-rm.gif)"><div class="TableContentContainer"><table class="TableContent" width="100%"><tr><td class="LabelV150"><span id="charactername_label"'.(isset($e['name]) ? ' class="red"' : '').'>Character Name:</span></td><td><input id="charactername" name="name" class="CipAjaxInput" style="width:206px;float:left;position:relative" style="float:left" value="'.(isset($_POST['name']) ? htmlspecialchars(str_replace('+', ' ', substr(trim($_POST['name']), 0, 30))) : '').'" size=30" maxlength="30" onBlur="SendAjaxCip({DataType: \'Container\'}, {Href: \'account/ajax_charactername.php\',PostData: \'a_CharacterName=\'+this.value,Method: \'POST\'})"/><div id="charactername_indicator" class="InputIndicator" style="background-image:url(account/'.($_POST['step] != 'docreate' || isset($e['name']) ? 'n' : '').'ok.gif)"></div>';
  274. if($suggestname)
  275. $main_content .= '<br/><small>[<a class="CipAjaxLink" href="https://secure.tibia.com/account/content/ajax_suggestname.php" ajaxcip="true" ajaxcip_datatype="Container">suggest name</a>]</small>';
  276. $main_content .= '</td></tr><tr><td></td><td><span id="charactername_errormessage" class="FormFieldError">'.(isset($e['name']) ? $e['name'] : '').'</span></td></tr><tr><td class=LabelV150"><span'.(isset($e['sex]) ? ' class="red"' : '').'>Sex:</span></td><td><table width="100%"><tr><td><span style="margin-right:75px" class="OptionContainer"><label for="sex_male"><span class="OptionContainer"><input id="sex_male" type="radio" name="sex" value="male"'.(($_POST['sex'] == 'male' || $_POST['step'] != 'docreate') ? ' checked=checked"' : '').'/><label for="sex_male">male</label></span></label></span><span class="OptionContainer"><label for="sex_female"><span class="OptionContainer"><input id="sex_female" type="radio" name="sex" value="female"'.($_POST['sex] == 'female' ? ' checked="checked"' : '').'/><label for="sex_female">female</label></span></label></span></td><td></td></tr></table></td></tr>'.(isset($e['sex']) ? '<tr><td></td><td><span class=FormFieldError">'.$e['sex].'</span></td></tr>' : '');
  277. if(count($voc) != 0) {
  278. $main_content .= '<tr><td class="LabelV150"><span'.(isset($e['vocation']) ? ' class="red"' : '').'>Vocation:</span></td><td><table width="100%"><tr><td>';
  279. foreach($voc as $k => $v)
  280. $main_content .= '<span style="margin-right:15px" class="OptionContainer"><label for="vocation_'.$k.'">
  281. <span class="OptionContainer"><input id="vocation_'.$k.'" type="radio" name="vocation" value="'.$k.'"'.($_POST['vocation'] == $k ? ' checked="checked"' : '').'/><label for="vocation_'.$k.'">'.$v.'</label></span></label></span>';
  282. $main_content .= '</td><td></td></tr></table></td></tr>'.(isset($e['vocation']) ? '<tr><td></td><td><span class=FormFieldError">'.$e['vocation].'</span></td></tr>' : '');
  283. }
  284. $main_content .= '</table></div></div><div class="TableShadowContainer"><div class="TableBottomShadow" style="background-image:url('.$layout_name.'/images/content/table-shadow-bm.gif)"><div class="TableBottomLeftShadow" style="background-image:url('.$layout_name.'/images/content/table-shadow-bl.gif)"></div><div class="TableBottomRightShadow" style="background-image:url('.$layout_name.'/images/content/table-shadow-br.gif)"></div></div></div></td></tr><tr><td><div class="TableShadowContainerRightTop"><div class="TableShadowRightTop" style="background-image:url('.$layout_name.'/images/content/table-shadow-rt.gif)"></div></div><div class="TableContentAndRightShadow" style="background-image:url('.$layout_name.'/images/content/table-shadow-rm.gif)"><div class="TableContentContainer"><table class="TableContent" width="100%">';
  285. if(count($location)>1) { // show server location filter
  286. $main_content .= '<tr id="filterbox_location"><td class="LabelV150"><span'.(isset($e['world']) ? ' class="red"' : '').'>World Location:</span></td><td><table width="100%"><tr><td width="33%" valign="top"><script>CreateFilterOption(\'server_location\', \'all\', \'all\')</script>&nbsp;&nbsp;</td>';
  287. $i=0;
  288. foreach($location as $k =>$v) {
  289. $i++;
  290. $main_content .= '<td '.($i == count($location) ? '' : 'width="33%" ').'valign="top"><script>CreateFilterOption(\'server_location\', \''.$k.'\', \''.$v.'\')</script>&nbsp;&nbsp;</td>';
  291. }
  292. $main_content .= '</tr></table></td></tr>';
  293. }
  294. $main_content .= '<tr id="filterbox_pvp"><td class="LabelV150"><span'.(isset($e['world']) ? ' class="red"' : '').'>World Type:</span></td><td><div>';
  295.  
  296. $optional=true; $open=true; $hardcore=true;
  297.  
  298. foreach($worlds as $k =>$v) { // remove selection if there's no valid worlds
  299. if($optional && $v[1] == 'optional')
  300. unset($optional);
  301. elseif($open && $v[1] == 'open')
  302. unset($open);
  303. elseif($hardcore && $v[1] == 'hardcore')
  304. unset($hardcore);
  305. elseif(!$optional && !$open && !$hardcore)
  306. break;
  307. }
  308.  
  309. $n = 0;
  310. foreach(array($optional, $open, $hardcore) as $k)
  311. if(!$k)
  312. $n++;
  313. $main_content .= '<table width="'.round(33.33 *  $n).'%"><tr>';
  314. if(!$optional)
  315. $main_content .= '<td width="'.(100 / $n).'%" align="center" valign="top"><b><script>CreateFilterOption(\'server_pvp_type\', \'optional\', \'Optional PvP\')</script></b>&nbsp;&nbsp;Only if both sides agree, characters can be fought<br/><br/></td>';
  316. if(!$open)
  317. $main_content .= '<td width="'.(100 / $n).'%" align="center" valign="top"><b><script>CreateFilterOption(\'server_pvp_type\', \'open\', \'Open PvP\')</script></b>&nbsp;&nbsp;Killing other characters is possible, but restricted<br/><br/></td>';
  318. if(!$hardcore)
  319. $main_content .= '<td align="center" valign="top"><b><script>CreateFilterOption(\'server_pvp_type\', \'hardcore\', \'Hardcore PvP\')</script></b>&nbsp;&nbsp;Killing other characters is not restricted at all<br/><br/></td>';
  320.  
  321. $main_content .= '</tr></table></div></td></tr><tr><td class="LabelV150"><span'.(isset($e['world']) ? ' class="red"' : '').'>World Name:</span></td><td><div id="js_world_box" style="display:none"><table width="100%"><tr id="world_list_tr" style="text-align:left"></tr></table><span onClick="ToggleVisibility(\'js_world_box\', \'suggested_world_box\'); UpdateServerList(); "><small>[<a style="cursor:pointer">suggest game world</a>]</small></span></div><div id="suggested_world_box">Suggested world: <span id="suggested_world_div"></span><br/><span onClick="ToggleVisibility(\'suggested_world_box\', \'js_world_box\'); "><small>[<a style="cursor:pointer">change game world</a></span>]</small></div></td></tr><tr><td><table id="js_world_box" width="100%"><tr id="world_list_tr"></tr></table><table id="plain_world_box" width="100%"><tr><td>';
  322. foreach($worlds as $k =>$v)
  323. $main_content .= '<input id="server_static_'.$config['site']['worlds'][$k].'" type=radio" name="world" value="'.$config['site]['worlds'][$k].'"'.($config['site']['worlds'][$k] == $_POST['world'] ? ' checked=checked"' : '').'><label for="server_static_'.$config['site]['worlds'][$k].'">'.$config['site']['worlds'][$k].'</label><br/>';
  324. $main_content .= '</td></tr></table></td></tr>'.(isset($e['world']) ? '<tr><td></td><td><span class=FormFieldError">'.$e['world].'</span></td></tr>' : '').'</table></div></div><div class="TableShadowContainer"><div class="TableBottomShadow" style="background-image:url('.$layout_name.'/images/content/table-shadow-bm.gif)"><div class="TableBottomLeftShadow" style="background-image:url('.$layout_name.'/images/content/table-shadow-bl.gif)"></div><div class="TableBottomRightShadow" style="background-image:url('.$layout_name.'/images/content/table-shadow-br.gif)"></div></div></div></td></tr><tr><td><div class="TableShadowContainerRightTop"><div class="TableShadowRightTop" style="background-image:url('.$layout_name.'/images/content/table-shadow-rt.gif)"></div></div><div class="TableContentAndRightShadow" style="background-image:url('.$layout_name.'/images/content/table-shadow-rm.gif)"><div class="TableContentContainer"><table class="TableContent" width="100%"><tr><td><b>Please select all of the following check boxes:</b></td></tr><tr><td><input type="checkbox" name="agreeagreement" value="true"  onClick="if(this.checked == true) {  document.getElementById(\'agreeagreement_errormessage\').innerHTML = \'\';} else {  document.getElementById(\'agreeagreement_errormessage\').innerHTML = \'You have to agree to the Tibia Service Agreement in order to create an account!\';}"'.($_POST['step'] == 'docreate' && !isset($e['agreement']) ? ' checked=checked"' : '').'/>I agree to the <a href="/index.php?subtopic=legaldocuments&page=agreement" target="_blank">Tibia Service Agreement</a>.</td></tr><tr><td><span id="agreeagreement_errormessage" class="FormFieldError">'.(isset($e['agreement]) ? $e['agreement'] : '').'</span></td></tr><tr><td><input type=checkbox" name="agreerules" value="true"  onClick="if(this.checked == true) {  document.getElementById(\'agreerules_errormessage\').innerHTML = \'\';} else {  document.getElementById(\'agreerules_errormessage\').innerHTML = \'You have to agree to the Tibia Rules in order to create an account!\';}"'.($_POST['step] == 'docreate' && !isset($e['rules']) ? ' checked=checked"' : '').'/>I agree to the <a href="/index.php?subtopic=legaldocuments&page=rules" target="_blank">Tibia Rules</a>.</td></tr><tr><td><span id="agreerules_errormessage" class="FormFieldError">'.(isset($e['rules]) ? $e['rules'] : '').'</span></td></tr><tr><td><input type=checkbox" name="agreeprivacy" value="true"  onClick="if(this.checked == true) {  document.getElementById(\'agreeprivacy_errormessage\').innerHTML = \'\';} else {  document.getElementById(\'agreeprivacy_errormessage\').innerHTML = \'You have to agree to the Tibia Privacy Policy in order to create an account!\';}"'.($_POST['step] == 'docreate' && !isset($e['privacy']) ? ' checked=checked"' : '').'/>I agree to the <a href="/index.php?subtopic=legaldocuments&page=privacy" target="_blank">Tibia Privacy Policy</a>.</td></tr><tr><td><span id="agreeprivacy_errormessage" class="FormFieldError">'.(isset($e['privacy]) ? $e['privacy'] : '').'</span></td></tr></table></div></div><div class="TableShadowContainer"><div class="TableBottomShadow" style="background-image:url('.$layout_name.'/images/content/table-shadow-bm.gif)"><div class="TableBottomLeftShadow" style="background-image:url('.$layout_name.'/images/content/table-shadow-bl.gif)"></div><div class="TableBottomRightShadow" style="background-image:url('.$layout_name.'/images/content/table-shadow-br.gif)"></div></div></div></td></tr><script type="text/javascript">PreselectWorld="';
  325. if(isset($_POST['world']) && !empty($_POST['world']))
  326. foreach($config['site']['worlds'] as $id =>$name)
  327. if($worlds[$id] && $name == $_POST['world']) {
  328. $main_content .= $name;
  329. break;
  330. }
  331. $main_content .= '";InitializeCharacterCreator(PreselectServerLocation, \''.(!$optional ? 'optional' : (!$open ? 'open' : 'hardcore')).'\')</script></table></div></table></div></td></tr><br/></div><center><table border="0" cellspacing="0" cellpadding="0"><tr><td style="border:0px"><input type="hidden" name=step value=docreate><input type="hidden" name=noframe value=""><div class="BigButton" style="background-image:url('.$layout_name.'/images/buttons/sbutton.gif)"><div onMouseOver="MouseOverBigButton(this)" onMouseOut="MouseOutBigButton(this)"><div class="BigButtonOver" style="background-image:url('.$layout_name.'/images/buttons/sbutton_over.gif)"></div><input class="ButtonText" type="image" name="Submit" alt="Submit" src="'.$layout_name.'/images/buttons/_sbutton_submit.gif"></div></div></td><tr></form></table></center><script type="text/javascript" language="javascript">document.forms[\'CreateAccountAndCharacter\'].elements[\'accountname\'].focus();</script><script type="text/javascript" src="account/generic.js"></script><script type="text/javascript" src="account/ajaxcip.js"></script>';

A sua senha está correta no seu config.lua??

 

ESTÁ

Link para o post
Compartilhar em outros sites

Deixa eu entender.

Você criou uma conta nova para o seu MySql e essa conta não consegue se conectar.

É isso?

Ou você pegou o programa que veio uma conta do MySql e essa conta quem não consegue se conectar ?

 

Revendo seu post para mim o erro está claro.

Você em algum lugar não colocou a senha do seu MySql

veja nessa linha(58) do account.php

$con = mysql_pconnect($config['server']['sqlHost'], $config['server']['sqlUser'], $config['server']['sqlPass']) or die('MySQL connection error.');
    mysql_select_db($config['server']['sqlDatabase']);

 

$config<- isso aqui é algum lugar onde vc coloca as configurações do Mysql no PHP então precisa encontrar onde é e o erro lá em cima diz

(using password: NO)

Ou seja vc não colou o password

Editado por join (veja o histórico de edições)

Donate

 

Link para o post
Compartilhar em outros sites

TODO Banco de dados possui uma senha de acesso, assim outras pessoas nao conseguem acessar;

 

O seu problema eh que o sistema do site precisa acessar o banco de dados, mas voce nao configurou no config.php do site a senha do banco de dados (é a senha que voce usa pra acessar o phpmyadmin)

 

Correçao:entre no config.php na pasta do site e coloque a senha do banco de dados

 

assim o sistema do site trabalhará normalmente com o mysql

 

boa sorte

 

 

facebook.com/PokeJota

Link para o post
Compartilhar em outros sites

Deixa eu entender.

Você criou uma conta nova para o seu MySql e essa conta não consegue se conectar.

É isso?

Ou você pegou o programa que veio uma conta do MySql e essa conta quem não consegue se conectar ?

 

eu quero cria uma conta normal no site mais ela n consegue ser criada da o seguinte erro:

 

Warning: mysql_pconnect() [function.mysql-pconnect]: Access denied for user 'Global-Rush'@'localhost' (using password: NO) in C:\xampp\htdocs\createaccount.php on line 58

MySQL connection error.

Link para o post
Compartilhar em outros sites

Revendo seu post para mim o erro está claro.

Você em algum lugar não colocou a senha do seu MySql

veja nessa linha(58) do account.php

$con = mysql_pconnect($config['server']['sqlHost'], $config['server']['sqlUser'], $config['server']['sqlPass']) or die('MySQL connection error.');
    mysql_select_db($config['server']['sqlDatabase']);

 

$config<- isso aqui é algum lugar onde vc coloca as configurações do Mysql no PHP então precisa encontrar onde é e o erro lá em cima diz

(using password: NO)

Ou seja vc não colou o password

Donate

 

Link para o post
Compartilhar em outros sites

como o join disse acima, basta procurar a linha 58 que o erro cita e configurar corretamente a senha.

Te ajudei ? REP+

Link para o post
Compartilhar em outros sites

Galera o ERRO ta no CreateAccount eu troquei oque tava no site por outro e deu de criar conta normal.

 

CreateAccount - Velho :

  1. <b>
  2. <?php
  3. $location = array(
  4. 'GER' =>'Europe',
  5. // 'USA' =>'North America'
  6. );
  7. $default = 'all';
  8.  
  9. $worlds = array();
  10. $worlds[0] = array('GER', 'open');
  11. /*
  12. $worlds[1] = array('GER', 'optional');
  13. $worlds[2] = array('GER', 'hardcore');
  14. $worlds[3] = array('USA', 'open');
  15. $worlds[4] = array('USA', 'optional');
  16. $worlds[5] = array('USA', 'hardcore');
  17. */
  18.  
  19. $voc = array(); // if empty, Rook Sample will be used
  20. $voc[1] = 'Sorcerer';
  21. $voc[2] = 'Druid';
  22. $voc[3] = 'Paladin';
  23. $voc[4] = 'Knight';
  24.  
  25. $suggestname = NULL; // not available
  26. $version = '860'; // for download link
  27.  
  28. foreach($worlds as $k =>$v) // remove invalid worlds
  29. if(!isset($location[$v[0]]) || !isset($config['site']['worlds'][$k]))
  30. unset($worlds[$k]);
  31.  
  32. $tmp = array();
  33. foreach($location as $k =>$v) // remove invalid/unused locations
  34. foreach($worlds as $i =>$j)
  35. if($j[0] == $k) {
  36. $tmp[$k] = $v;
  37. break;
  38. }
  39. $location = $tmp; unset($tmp);
  40.  
  41. if(isset($_POST['step']) && $_POST['step'] == 'docreate') {
  42. $e = array();
  43. $s = isset($_POST['accountname']) ? $_POST['accountname'] : '';
  44. if($s == '')
  45. $e['acc'] = 'Please enter an account name!';
  46. elseif(strlen($s) < 6)
  47. $e['acc'] = 'This account name is too short!';
  48. elseif(strlen($s) > 30)
  49. $e['acc'] = 'This account name is too long!';
  50. else {
  51. $s = strtoupper($s);
  52.  
  53. if(!ctype_alnum($s))
  54. $e['acc'] = 'This account name has an invalid format. Your account name may only consist of numbers 0-9 and letters A-Z!';
  55. elseif(!preg_match('/[A-Z]/', $s))
  56. $e['acc'] = 'Your account name must include at least one letter A-Z!';
  57. else {
  58. $con = mysql_pconnect($config['server']['sqlHost'], $config['server']['sqlUser'], $config['server']['sqlPass']) or die('MySQL connection error.');
  59. mysql_select_db($config['server']['sqlDatabase']);
  60.  
  61. if(mysql_num_rows(mysql_query('SELECT id FROM accounts WHERE name=\''.mysql_escape_string($s).'\' LIMIT 1')) != 0)
  62. $e['acc'] = 'This account name is already used. Please select another one!';
  63. }
  64. }
  65.  
  66. $s = isset($_POST['name']) ? trim($_POST['name']) : '';
  67.  
  68. if(empty($s))
  69. $e['name'] = 'Please enter a name for your character!';
  70. elseif(strlen($s) < 2 || strlen($s) > 29)
  71. $e['name'] = 'A name must have at least 2 but no more than 29 letters!';
  72. elseif(preg_match('/[^a-zA-Z ]/', $s))
  73. $e['name'] = 'This name contains invalid letters. Please use only A-Z, a-z and space!';
  74. elseif(!ctype_upper($s[0]))
  75. $e['name'] = 'The first letter of a name has to be a capital letter!';
  76. elseif(strpos($s, '  ') !== false)
  77. $e['name'] = 'This name contains more than one space between words. Please use only one space between words!';
  78. else {
  79. foreach(explode(' ', $s) as $k =>$v) {
  80. $words[$k] = str_split($v);
  81. $len = strlen($v);
  82. if($len == 1) {
  83. $e['name'] = 'This name contains a word with only one letter. Please use more than one letter for each word!';
  84. break;
  85. }
  86. elseif($len > 14) {
  87. $e['name'] = 'This name contains a word that is too long. Please use no more than 14 letters for each word!';
  88. break;
  89. }
  90. }
  91. if(!isset($e['name'])) {
  92. $total=0;
  93. foreach($words as $k =>$p) {
  94. if(isset($e['name']))
  95. break;
  96. $total++;
  97. if($total > 3) {
  98. $e['name'] = 'This name contains more than 3 words. Please choose another name!';
  99. break;
  100. }
  101. $len=0;
  102. foreach($p as $i =>$j) {
  103. $len++;
  104. if($i != 0 && ctype_upper($j)) {
  105. $e['name'] = 'In names capital letters are only allowed at the beginning of a word!';
  106. break;
  107. }
  108. elseif($i == $len-1) {
  109. $ff=null;
  110. for($h=0;$h<strlen($v); $h++) {
  111. if(in_array(strtolower($v[$h]), array('a','e','i','o','u')) !== false) {
  112. $ff=true;
  113. break;
  114. }
  115. }
  116. if(!$ff) {
  117. $e['name'] = 'This name contains a word without vowels. Please choose another name!';
  118. break;
  119. }
  120. }
  121. }
  122. }
  123. if(!isset($e['name'])) {
  124. $s = strtolower($s);
  125. for($i = 0; $i < strlen($s); $i++)
  126. if($s[$i] == $s[($i+1)] && $s[$i] == $s[($i+2)]) {
  127. $e['name'] = 'This character name is already used. Please select another one!';
  128. break;
  129. }
  130. if(!isset($e['name'])) {
  131. foreach(array('aa ', 'ee', 'ii', 'oo', 'uu', 'gm','cm', 'aff ', 'god ', 'abc', 'tutor', 'game', 'admin', 'the ') as $v)
  132. if($v == substr($s, 0, strlen($v))) {
  133. $e['name'] = 'This character name is already used. Please select another one!';
  134. break;
  135. }
  136. if(!isset($e['name'])) {
  137. foreach(array('game', 'customer', 'support', 'fuck', 'haha', 'sux', ' abc', 'suck', 'noob', 'tutor', 'admin', 'account', 'gay', 'password', 'manager') as $v)
  138. if(strpos($s, $v) !== false) {
  139. $e['name'] = 'This character name is already used. Please select another one!';
  140. break;
  141. }
  142. if(!isset($e['name'])) {
  143. if(!isset($con)) {
  144. $con = mysql_pconnect($config['server']['sqlHost'], $config['server']['sqlUser'], $config['server']['sqlPass']) or die('MySQL connection error.');
  145. mysql_select_db($config['server']['sqlDatabase']);
  146. }
  147. if(mysql_num_rows(mysql_query('SELECT id FROM players WHERE name=\''.mysql_escape_string($s).'\' LIMIT 1')) != 0)
  148. $e['name'] = 'This character name is already used. Please select another one!';
  149. }
  150. }
  151. }
  152. }
  153. }
  154. }
  155.  
  156. if(!isset($_POST['world']) || empty($_POST['world']))
  157. $e['world'] = 'Please select a game world for your character!';
  158.  
  159. if(!isset($_POST['sex']) || ($_POST['sex'] != 'male' && $_POST['sex'] != 'female'))
  160. $e['sex'] = 'Please select the sex for your character!';
  161.  
  162. if(count($voc) != 0 && (!isset($_POST['vocation']) || !is_numeric($_POST['vocation']) || !isset($voc[$_POST['vocation']])))
  163. $e['vocation'] = 'Please select the vocation for your character!';
  164.  
  165. $s = isset($_POST['email']) ? $_POST['email'] : '';
  166.  
  167. if($s == '')
  168. $e['email'] = 'Please enter your email address!';
  169. elseif(strlen($s) > 49)
  170. $e['email'] = 'Your email address is too long!';
  171. elseif(!filter_var($s, FILTER_VALIDATE_EMAIL))
  172. $e['email'] = 'This email address has an invalid format. Please enter a correct email address!';
  173. else {
  174. if(!isset($con)) {
  175. $con = mysql_pconnect($config['server']['sqlHost'], $config['server']['sqlUser'], $config['server']['sqlPass']) or die('MySQL connection error.');
  176. mysql_select_db($config['server']['sqlDatabase']);
  177. }
  178. if(mysql_num_rows(mysql_query('SELECT id FROM accounts WHERE email=\''.mysql_escape_string($s).'\' LIMIT 1')) != 0)
  179. $e['email'] = 'This email address is already used. Please enter another email address!';
  180. }
  181.  
  182. $s1 = isset($_POST['password1']) ? $_POST['password1'] : '';
  183. $s2 = isset($_POST['password2']) ? $_POST['password2'] : '';
  184.  
  185. if(empty($s2))
  186. $e['pass'] = 'Please enter the password again!';
  187. elseif($s1 != $s2)
  188. $e['pass'] = 'The two passwords do not match!';
  189. else {
  190. $err = array();
  191. if(strlen($s1) < 8 || strlen($s1) > 29)
  192. $err[] = 'The password must have at least 8 and less than 30 letters!';
  193. if(!ctype_alnum($s1))
  194. $err[] = 'The password contains invalid letters!';
  195. if(!preg_match('/[a-zA-Z]/', $s1))
  196. $err[] = 'The password must contain at least one letter A-Z or a-z!';
  197. elseif(!preg_match('/[0-9]/', $s1))
  198. $err[] = 'The password must contain at least one letter other than A-Z or a-z!';
  199.  
  200. if(count($err) != 0) {
  201. $e['pass'] = '';
  202. for($i=0; $i < count($err); $i++)
  203. $e['pass'] .= ($i == 0 ? '' : '<br/>').$err[$i];
  204. }
  205. }
  206.  
  207. if(!isset($_POST['agreeagreement']) || empty($_POST['agreeagreement']))
  208. $e['agreement'] = 'You have to agree to the Tibia Service Agreement in order to create an account!';
  209. if(!isset($_POST['agreerules']) || empty($_POST['agreerules']))
  210. $e['rules'] = 'You have to agree to the Tibia Rules in order to create an account!';
  211. if(!isset($_POST['agreeprivacy']) || empty($_POST['agreeprivacy']))
  212. $e['privacy'] = 'You have to agree to the Tibia Privacy Policy in order to create an account!';
  213.  
  214. if(count($e) == 0) {
  215. $worldid = NULL;
  216. foreach($config['site']['worlds'] as $id =>$name)
  217. if($worlds[$id] && $name == $_POST['world']) {
  218. $worldid = $id;
  219. break;
  220. }
  221. if($worldid === FALSE)
  222. $e['world'] = 'Please select a valid game world.';
  223. }
  224.  
  225. if(count($e) != 0) {
  226. $main_content = '<div class="SmallBox"><div class="MessageContainer"><div class="BoxFrameHorizontal" style="background-image:url('.$layout_name.'/images/content/box-frame-horizontal.gif)"/></div><div class="BoxFrameEdgeLeftTop" style="background-image:url('.$layout_name.'/images/content/box-frame-edge.gif)"/></div><div class="BoxFrameEdgeRightTop" style="background-image:url('.$layout_name.'/images/content/box-frame-edge.gif)"/></div><div class="ErrorMessage"><div class="BoxFrameVerticalLeft" style="background-image:url('.$layout_name.'/images/content/box-frame-vertical.gif)"/></div><div class="BoxFrameVerticalRight" style="background-image:url('.$layout_name.'/images/content/box-frame-vertical.gif)"/></div><div class="AttentionSign" style="background-image:url('.$layout_name.'/images/content/attentionsign.gif)"/></div><b>The Following Errors Have Occurred:</b><br/>';
  227. foreach($e as $error) $main_content .= $error.'<br/>';
  228. $main_content .= '</div><div class="BoxFrameHorizontal" style="background-image:url('.$layout_name.'/images/content/box-frame-horizontal.gif)"/></div><div class="BoxFrameEdgeRightBottom" style="background-image:url('.$layout_name.'/images/content/box-frame-edge.gif)"/></div><div class="BoxFrameEdgeLeftBottom" style="background-image:url('.$layout_name.'/images/content/box-frame-edge.gif)"/></div></div></div><br/>';
  229. }
  230. else {
  231. $random = rand(1, 9999999);
  232. $n = $random;
  233. $cur = array();
  234.  
  235. $q = mysql_query('SELECT id FROM accounts');
  236. while ($r = mysql_fetch_array($q, MYSQL_NUM))
  237. $cur[] = $r[0];
  238.  
  239. while(true)
  240. {
  241. if(!in_array($n, $cur))
  242. break;
  243.  
  244. $n++;
  245.  
  246. if($n > 9999999)
  247. $n = 1;
  248.  
  249. if($n == $random)
  250. die('Failed to create account.');
  251. }
  252.  
  253. if(mysql_query("INSERT INTO accounts (id,name,password,email,created) VALUES($n,'".$_POST['accountname']."','".($config['server']['encryptionType'] == 'plain' ? $_POST['password1'] : hash($config['server']['encryptionType'], $_POST['password1']))."','".$_POST['email']."',".time().")") === true) {
  254. $sample = (count($voc) == 0 ? 'Rook' : $voc[$_POST['vocation']]).' Sample';
  255. $q = mysql_query("SELECT id,vocation,town_id,experience,level,maglevel,health,healthmax,mana,manamax,soul,lookbody,lookfeet,lookhead,looklegs,lookaddons,cap,save,posx,posy,posz FROM players WHERE name='$sample' LIMIT 1");
  256. if(mysql_num_rows($q) != 1)
  257. die('Missing sample character ('.$sample.')');
  258.  
  259. $q = mysql_fetch_array($q);
  260. mysql_query('INSERT INTO players (name,world_id,account_id,level,vocation,health,healthmax,experience,lookbody,lookfeet,lookhead,looklegs,looktype,lookaddons,maglevel,mana,manamax,soul,town_id,posx,posy,posz,cap,sex,created) VALUES(\''.$_POST['name'].'\','.$worldid.','.$n.','.$q['level'].','.$q['vocation'].','.$q['health'].','.$q['healthmax'].','.$q['experience'].','.$q['lookbody'].','.$q['lookfeet'].','.$q['lookhead'].','.$q['looklegs'].','.($_POST['sex'] == 'female' ? 136 : 128).','.$q['lookaddons'].','.$q['maglevel'].','.$q['mana'].','.$q['manamax'].','.$q['soul'].','.$q['town_id'].','.$q['posx'].','.$q['posy'].','.$q['posz'].','.$q['cap'].','.($_POST['sex'] == 'female' ? 0 : 1).','.time().')');
  261. }
  262. else die('Failed to create account.');
  263. $main_content = '<div class="SmallBox"><div class="MessageContainer"><div class="BoxFrameHorizontal" style="background-image:url('.$layout_name.'/images/content/box-frame-horizontal.gif)"/></div><div class="BoxFrameEdgeLeftTop" style="background-image:url('.$layout_name.'/images/content/box-frame-edge.gif)"/></div><div class="BoxFrameEdgeRightTop" style="background-image:url('.$layout_name.'/images/content/box-frame-edge.gif)"/></div><div class="Message"><div class="BoxFrameVerticalLeft" style="background-image:url('.$layout_name.'/images/content/box-frame-vertical.gif)"/></div><div class="BoxFrameVerticalRight" style="background-image:url('.$layout_name.'/images/content/box-frame-vertical.gif)"/></div><table><tr><td class="LabelV">Note:</td><td style="width:100%"><p>Your account and character have been created successfully.</p></td></tr></table></div><div class="BoxFrameHorizontal" style="background-image:url('.$layout_name.'/images/content/box-frame-horizontal.gif)"/></div><div class="BoxFrameEdgeRightBottom" style="background-image:url('.$layout_name.'/images/content/box-frame-edge.gif)"/></div><div class="BoxFrameEdgeLeftBottom" style="background-image:url('.$layout_name.'/images/content/box-frame-edge.gif)"/></div></div></div><div class="BoxFrameHorizontal" style="background-image:url('.$layout_name.'/images/content/box-frame-horizontal.gif)"></div><div class="BoxFrameEdgeRightBottom" style="background-image:url('.$layout_name.'/images/content/box-frame-edge.gif)"></div><div class="BoxFrameEdgeLeftBottom" style="background-image:url('.$layout_name.'/images/content/box-frame-edge.gif)"></div><br/><div class="TableContainer"><table class="Table4" cellpadding="0" cellspacing="0"><div class="CaptionContainer"><div class="CaptionInnerContainer"><span class="CaptionEdgeLeftTop" style="background-image:url('.$layout_name.'/images/content/box-frame-edge.gif)"/></span><span class="CaptionEdgeRightTop" style="background-image:url('.$layout_name.'/images/content/box-frame-edge.gif)"/></span><span class="CaptionBorderTop" style="background-image:url('.$layout_name.'/images/content/table-headline-border.gif)"></span><span class="CaptionVerticalLeft" style="background-image:url('.$layout_name.'/images/content/box-frame-vertical.gif)"/></span><div class="Text">Download Client</div><span class="CaptionVerticalRight" style="background-image:url('.$layout_name.'/images/content/box-frame-vertical.gif)"/></span><span class="CaptionBorderBottom" style="background-image:url('.$layout_name.'/images/content/table-headline-border.gif)"></span><span class="CaptionEdgeLeftBottom" style="background-image:url('.$layout_name.'/images/content/box-frame-edge.gif)"/></span><span class="CaptionEdgeRightBottom" style="background-image:url('.$layout_name.'/images/content/box-frame-edge.gif)"/></span></div></div><tr><td><div class="InnerTableContainer"><table style="width:100%"><tr><td><table width="100%" cellpadding=0 cellspacing=0><tr><td style="vertical-align:top"><div class="TableShadowContainerRightTop"><div class="TableShadowRightTop" style="background-image:url('.$layout_name.'/images/content/table-shadow-rt.gif)"></div></div><div class="TableContentAndRightShadow" style="background-image:url('.$layout_name.'/images/content/table-shadow-rm.gif)"><div class="TableContentContainer"><table class="TableContent" width="100%"><tr><td><table style="width:100%;text-align:center"><tr><td><a href="
  264. <p>Account name: <b>'.$reg_name.'</b></p>
  265. <p>Password: <b>'.trim($reg_password).'</b></p>
  266. <br />
  267. <p>After login you can:</p>
  268. <li>Create new characters
  269. <li>Change your current password
  270. <li>Change your current e-mail
  271. </body>
  272. </html>';
  273. require("phpmailer/class.phpmailer.php");
  274. $mail = new PHPMailer();
  275. if ($config['site']['smtp_enabled'] == "yes")
  276. {
  277. $mail->IsSMTP();
  278. $mail->Host = $config['site']['smtp_host'];
  279. $mail->Port = (int)$config['site']['smtp_port'];
  280. $mail->SMTPAuth = ($config['site']['smtp_auth'] ? true : false);
  281. $mail->Username = $config['site']['smtp_user'];
  282. $mail->Password = $config['site']['smtp_pass'];
  283. }
  284. else
  285. $mail->IsMail();
  286. $mail->IsHTML(true);
  287. $mail->From = $config['site']['mail_address'];
  288. $mail->AddAddress($reg_email);
  289. $mail->Subject = $config['server']['serverName']." - Registration";
  290. $mail->Body = $mailBody;
  291. if($mail->Send())
  292. {
  293. $main_content .= 'Conta Criada ! Vejo Voce no Tibia !<BR><BR>';
  294. $main_content .= '<TABLE WIDTH=100% BORDER=0 CELLSPACING=1 CELLPADDING=4>
  295. <TR><TD BGCOLOR="'.$config['site']['vdarkborder'].'" CLASS=white><B>Conta Criada !</B></TD></TR>
  296. <TR><TD BGCOLOR="'.$config['site']['darkborder'].'">
  297.  <TABLE BORDER=0 CELLPADDING=1><TR><TD>
  298.    <BR>Your account name is <b>'.$reg_name.'</b>.
  299. <BR><b><i>You will receive e-mail (<b>'.$reg_email.'</b>) with your password.</b></i><br>';
  300. $main_content .= '<a href="http://www.dynamic-world.com.br/?subtopic=accountmanagement''>http://www.dynamic-world.com.br/?subtopic=accountmanagement'>http://www.dynamic-world.com.br/?subtopic=accountmanagement" width="120"><b><font size=3">Logue Aqui</font></b></a>.<BR><BR>';
  301. $main_content .= '<br /><small>These informations were send on email address <b>'.$reg_email.'</b>. Please check your inbox/spam folder.';
  302. }
  303. else
  304. {
  305. $main_content .= '<br /><small>An error occorred while sending email! Account not created. Try again.</small>';
  306. $reg_account->delete();
  307. }
  308. }
  309. else
  310. {
  311. $main_content .= 'Your account has been created. Now you can login and create your first character. See you in Tibia!<BR><BR>';
  312. $main_content .= '<TABLE WIDTH=100% BORDER=0 CELLSPACING=1 CELLPADDING=4>
  313. <TR><TD BGCOLOR="'.$config['site']['vdarkborder'].'" CLASS=white><B>Account Created</B></TD></TR>
  314. <TR><TD BGCOLOR="'.$config['site']['darkborder'].'">
  315.  <TABLE BORDER=0 CELLPADDING=1><TR><TD>
  316.    <BR>Your account name is <b>'.$reg_name.'</b><br>You will need the account name and your password to play on '.$config['server']['serverName'].'.
  317.    Please keep your account name and password in a safe place and
  318.    never give your account name or password to anybody.<BR><BR>';
  319. if($config['site']['send_emails'] && $config['site']['send_register_email'])
  320. {
  321. $mailBody = '<html>
  322. <body>
  323. <h3>Your account name and password!</h3>
  324. <p>You or someone else registred on server <a href="'.$config['server']['url'].'"><b>'.$config['server']['serverName'].'</b></a> with this e-mail.</p>
  325. <p>Account name: <b>'.$reg_name.'</b></p>
  326. <p>Password: <b>'.trim($reg_password).'</b></p>
  327. <br />
  328. <p>After login you can:</p>
  329. <li>Create new characters
  330. <li>Change your current password
  331. <li>Change your current e-mail
  332. </body>
  333. </html>';
  334. require("phpmailer/class.phpmailer.php");
  335. $mail = new PHPMailer();
  336. if ($config['site']['smtp_enabled'] == "yes")
  337. {
  338. $mail->IsSMTP();
  339. $mail->Host = $config['site']['smtp_host'];
  340. $mail->Port = (int)$config['site']['smtp_port'];
  341. $mail->SMTPAuth = ($config['site']['smtp_auth'] ? true : false);
  342. $mail->Username = $config['site']['smtp_user'];
  343. $mail->Password = $config['site']['smtp_pass'];
  344. }
  345. else
  346. $mail->IsMail();
  347. $mail->IsHTML(true);
  348. $mail->From = $config['site']['mail_address'];
  349. $mail->AddAddress($reg_email);
  350. $mail->Subject = $config['server']['serverName']." - Registration";
  351. $mail->Body = $mailBody;
  352. if($mail->Send())
  353. $main_content .= '<br /><small>These informations were send on email address <b>'.$reg_email.'</b>.';
  354. else
  355. $main_content .= '<br /><small>An error occorred while sending email (<b>'.$reg_email.'</b>)!</small>';
  356. }
  357. }
  358. $main_content .= '</TD></TR></TABLE></TD></TR></TABLE><BR><BR>';
  359. }
  360. else
  361. {
  362. //SHOW ERRORs if data from form is wrong
  363. $main_content .= '<div class="SmallBox" >  <div class="MessageContainer" >    <div class="BoxFrameHorizontal" style="background-image:url('.$layout_name.'/images/content/box-frame-horizontal.gif);" /></div>    <div class="BoxFrameEdgeLeftTop" style="background-image:url('.$layout_name.'/images/content/box-frame-edge.gif);" /></div>    <div class="BoxFrameEdgeRightTop" style="background-image:url('.$layout_name.'/images/content/box-frame-edge.gif);" /></div>    <div class="ErrorMessage" >      <div class="BoxFrameVerticalLeft" style="background-image:url('.$layout_name.'/images/content/box-frame-vertical.gif);" /></div>      <div class="BoxFrameVerticalRight" style="background-image:url('.$layout_name.'/images/content/box-frame-vertical.gif);" /></div>      <div class="AttentionSign" style="background-image:url('.$layout_name.'/images/content/attentionsign.gif);" /></div><b>The Following Errors Have Occurred:</b><br/>';
  364. foreach($reg_form_errors as $show_msg)
  365. {
  366. $main_content .= '<li>'.$show_msg;
  367. }
  368. $main_content .= '</div>    <div class="BoxFrameHorizontal" style="background-image:url('.$layout_name.'/images/content/box-frame-horizontal.gif);" /></div>    <div class="BoxFrameEdgeRightBottom" style="background-image:url('.$layout_name.'/images/content/box-frame-edge.gif);" /></div>    <div class="BoxFrameEdgeLeftBottom" style="background-image:url('.$layout_name.'/images/content/box-frame-edge.gif);" /></div>  </div></div><br/>
  369. <BR>
  370. <CENTER>
  371. <TABLE BORDER=0 CELLSPACING=0 CELLPADDING=0><FORM ACTION=?subtopic=createaccount METHOD=post><TR><TD>
  372. <INPUT TYPE=hidden NAME=email VALUE="">
  373.  
  374. <INPUT TYPE=image NAME="Back" ALT="Back" SRC="'.$layout_name.'/images/buttons/sbutton_back.gif" BORDER=0 WIDTH=120 HEIGHT=18>
  375. </TD></TR></FORM></TABLE>
  376. </CENTER>';
  377. }
  378. }
  379. ?>

 

ALGUÉM PODE ME AJUDA COM O VELHO ???

Editado por tiroleivi (veja o histórico de edições)
Link para o post
Compartilhar em outros sites

Participe da conversa

Você pode postar agora e se cadastrar mais tarde. Se você tem uma conta, faça o login para postar com sua conta.

Visitante
Responder

×   Você colou conteúdo com formatação.   Remover formatação

  Apenas 75 emojis são permitidos.

×   Seu link foi automaticamente incorporado.   Mostrar como link

×   Seu conteúdo anterior foi restaurado.   Limpar o editor

×   Não é possível colar imagens diretamente. Carregar ou inserir imagens do URL.

  • Quem Está Navegando   0 membros estão online

    Nenhum usuário registrado visualizando esta página.

  • Conteúdo Similar

    • Por Tomaxx
      Olá Estou Com Um Problema Em Meu Gesior ACC 2015 Quando vou tentar adicionar uma nova pagina aparece o seguinte erro
       
       
       
      Error occured! Error ID: CRITICAL ERROR
      More info: Cannot load page changename, file does not exist.

      File: C:\xampp\htdocs\system/load.compat.php   Line: 20
      File: C:\xampp\htdocs/index.php   Line: 33
       
      Não sei onde adicionar a pagina só coloquei o arquivo dentro da pasta pages e mais nada
       
      Valendo REP ><
    • Por Tomaxx
      Olá Pessoal Eu aqui de novo Estou precisando de ajuda
       
       
      Adiciono Normal A Pagina De Cast System Lembrando Que O Meu é o gesior 2012 que não precisa adicionar a pagina no Index.php
       
      ai tento entrar na pagina segue código de erro
       
       
       
       
      Fatal error: Call to a member function fetchAll() on a non-object in C:\xampp\htdocs\pages\cast.php on line 158
       
       
       
      Segue minha pagina de cast Clique Aqui
       
       
       
      Lembrando que não é necessária mente esta pagina se alguém tiver uma que esta funcionando ok p:
       
       
      Valendo REP ><
    • Por Tomaxx
      Olá Gostaria de fazer um pedido
       
      Meu Gesior é esse dos novo da mesma plataforma do GESIOR VICTORWEBMASTER 1.0 V2
      tenho uma pagina de cast system aqui mas é do gesior antigo e não consigo adicionar neste novo gesior e gostaria de estar pedindo uma pagina de cast compatível com o novo gesior 
       
      Valendo REP ><
    • Por Tomaxx
      Olá eu aqui novamente rs bom amigos estou com o seguinte problema posso tentar por diversos nomes emails e etc... mas não fica verdinho segue imagens ressaltando que uso Gesior 2012 TFS 1.0
       
       
       
      Account
       
       

       
      Character
       

       
       
      Valendo REP
       
      ><
    • Por Helliab
      Compra e venda de personagens por pontos para Gesior ACC.
      Vamos lá..
       
      FOTOS:
       
      Venda:

       
       
      Compra:

       

       
       
      Crie um arquivo dentro do htdocs, chamado buychar.php e dentro dele coloque:
       
      <?PHP if($logged) { if ($action == '') { $main_content .= '<center>Here is the list of the current characters that are in the shop!</center>'; $main_content .= '<BR>'; $main_content .= '<TABLE BORDER=1 CELLSPACING=1 CELLPADDING=4 WIDTH=100%><TR BGCOLOR='.$config['site']['vdarkborder'].'><TD CLASS=white width="64px"><CENTER><B>Name</B></CENTER></TD><TD CLASS=white width="64px"><CENTER><B>Vocation</B></CENTER></TD><TD CLASS=white width="64px"><CENTER><B>Level</B></CENTER></TD><TD CLASS=white width="64px"><CENTER><B>Price</B></CENTER></TD><TD CLASS=white width="64px"><CENTER><B>Buy it</B></CENTER></TD></TR>'; $getall = $SQL->query('SELECT `id`, `name`, `price`, `status` FROM `sellchar` ORDER BY `id`')or die(mysql_error()); foreach ($getall as $tt) { $namer = $tt['name']; $queryt = $SQL->query("SELECT `name`, `vocation`, `level` FROM `players` WHERE `name` = '$namer'"); foreach ($queryt as $ty) { if ($ty['vocation'] == 1) { $tu = 'Sorcerer'; } else if ($ty['vocation'] == 2) { $tu = 'Druid'; } else if ($ty['vocation'] == 3) { $tu = 'Paladin'; } else if ($ty['vocation'] == 4) { $tu = 'Knight'; } else if ($ty['vocation'] == 5) { $tu = 'Sorcerer'; } else if ($ty['vocation'] == 6) { $tu = 'Druid'; } else if ($ty['vocation'] == 7) { $tu = 'Paladin'; } else if ($ty['vocation'] == 8) { $tu = 'Knight'; } $ee = $tt['name']; $ii = $tt['price']; $main_content .= '<TR BGCOLOR='.$config['site']['darkborder'].'><TD CLASS=black width="64px"><CENTER><B><a href="index.php?subtopic=characters&name='.$tt['name'].'">'.$tt['name'].'</a></B></CENTER></TD><TD CLASS=black width="64px"><CENTER><B>'.$tu.'</B></CENTER></TD><TD CLASS=black width="64px"><CENTER><B>'.$ty['level'].'</B></CENTER></TD><TD CLASS=black width="64px"><CENTER><B>'.$tt['price'].'</B></CENTER></TD><TD CLASS=black width="64px"><CENTER><B> <form action="?subtopic=buychar&action=buy" method="POST"> <input type="hidden" name="char" value="'.$ee.'"> <input type="hidden" name="price" value="'.$ii.'"> <input type="submit" name="submit" value="Buy it"></B></CENTER></TD></TR></form>'; } } $main_content .= '</TABLE>'; } if ($action == 'buy') { $name = $_POST['char']; $price = $_POST['price']; $ceh = $SQL->query("SELECT `name` FROM `sellchar` WHERE `name` = '$name'"); if ($ceh) { if ($name == '') { $main_content .= '<b><center>Select a character to buy first/b>'; } else { $user_premium_points = $account_logged->getCustomField('premium_points'); $user_id = $account_logged->getCustomField('id'); if ($user_premium_points >= $price) { $check = $SQL->query("SELECT * FROM `sellchar` WHERE `name` = '$name'") or die(mysql_error()); $check1 = $SQL->query("SELECT * FROM `players` WHERE `name` = '$name'") or die(mysql_error()); $check2 = $SQL->query("SELECT `oldid` FROM `sellchar` WHERE `name` = '$name'"); foreach ($check as $result) { foreach($check1 as $res) { foreach($check2 as $ress) { $oid = $ress['oldid']; $main_content .= '<center>You bought<b> '.$name.' ( '.$res['level'].' ) </b>for <b>'.$result['price'].' points.</b><br></center>'; $main_content .= '<br>'; $main_content .= '<center><b>The character is in your account, have fun!</b></center>'; $execute1 = $SQL->query("UPDATE `accounts` SET `premium_points` = `premium_points` - '$price' WHERE `id` = '$user_id'"); $execute2 = $SQL->query("UPDATE `players` SET `account_id` = '$user_id' WHERE `name` = '$name'"); $execute2 = $SQL->query("UPDATE `accounts` SET `premium_points` = `premium_points` + '$price' WHERE `id` = '$oid'"); $execute3 = $SQL->query("DELETE FROM `sellchar` WHERE `name` = '$name'"); } } } } else { $main_content .= '<center><b>You dont have enought premium points</b></center>'; } } } else { $main_content .= '<center><b>Character cannot be buyed</b></center>'; } } } else { $main_content .= '<center>Please log in first!</center>'; } ?>  
      depois crie um chamado sellchar.php e coloque isso:
      <?PHP if($logged) { $main_content .= '<center><b>Here you can put your character on sale!</center></b><br>'; $main_content .= 'If you put your character on sale anyone can buy it, you will lose acces to that character and you wont be able to log in with that character until someone buys it, you can also delete your offer by talking to an admin!<br><b>when someone buys your character you will get the price in points!</b>'; $main_content .= '<br>'; $main_content .= '<TABLE BORDER=1 CELLSPACING=1 CELLPADDING=4 WIDTH=100%><TR BGCOLOR='.$config['site']['vdarkborder'].'><TD CLASS=white width="64px"><CENTER><B>Sell your characters</B></CENTER></TD></TR>'; $main_content .= '<TR BGCOLOR='.$config['site']['darkborder'].'><TD CLASS=black width="64px"><B></B>'; $players_from_logged_acc = $account_logged->getPlayersList(); $players_from_logged_acc->orderBy('name'); $main_content .= '<form action="" method="post"><select name="char">'; foreach($players_from_logged_acc as $player) { $main_content .= '<option>'.$player->getName().'</option>'; } $main_content .= '</select>Select a character to sell<br>'; $main_content .= '<input type="text" name="price" maxlength="10" size="4" >Select the price of the character<br>'; $main_content .= '<input type="submit" name="submit" value="Sell character"></TD></TR>'; $main_content .= '</form></table>'; if (isset($_POST['submit'])) { $char = stripslashes($_POST['char']); $price = stripslashes($_POST['price']); if ($char && $price) { if(is_numeric(trim($_POST['price']))) { $check2 = $SQL->query("SELECT * FROM `players` WHERE `name` = '$char'") or die(mysql_error()); foreach ($check2 as $re) { $voc = $re['vocation']; $oid = $re['account_id']; } $check1 = $SQL->query("UPDATE `players` SET `account_id` = 1 WHERE `name` = '$char'") or die(mysql_error()); $check3 = $SQL->query("INSERT INTO `sellchar` VALUES ('','$char','$voc','$price','1','$oid')"); $main_content .= '<b><center>You added your character correctly, thanks!</b></center>'; header("Location: index.php?subtopic=buychar"); } else { $main_content .= '<b><center>Set a numeric price!!</b></center>'; } } else { $main_content .= '<b><center>Fill out all fields!</b></center>'; } } } else { $main_content .= '<b><center>Please log in first!</b></center>'; } ?>  
      depois disso vá em htdocs/layouts/layout que você usa/layouts e insira as duas páginas aonde você bem querer(sugiro que seja na aba shop, pois é venda e compra).. caso alguém não saiba posta aqui no tópico que eu ensino.
       
      Agora adicione isso no index.php
      case "sellchar";                 $topic = "Sell Char";                 $subtopic = "sellchar";                 include("sellchar.php");     break;          case "buychar";                 $topic = "Buy Char";                 $subtopic = "buychar";                 include("buychar.php");     break;  
      Agora acesse a database do OT e insira este comando SQL
      CREATE TABLE IF NOT EXISTS `sellchar` ( `id` int(11) NOT NULL AUTO_INCREMENT, `name` varchar(40) NOT NULL, `vocation` int(11) NOT NULL, `price` int(11) NOT NULL, `status` varchar(40) NOT NULL, `oldid` varchar(40) NOT NULL, PRIMARY KEY (`id`) ) ENGINE=InnoDB DEFAULT CHARSET=latin1; Pronto para ser usado!!
       
       
       
       
      obs1: Caso você não adicionou a página no layouts acesse assim:
       
      127.0.0.1/?subtopic=sellchar
      127.0.0.1/?subtopic=buychar
       
      obs2: não tem como a pessoa que colocou a venda tirá-lo depois, se algum programador se habilitar a fazer o esquema aí para nós, fico grato.
       
       
       
       
      --- Créditos ---
      Raggaer
      Helliab por trazer ao TK.
       
      REP++
       
      @helliabsantana
×
×
  • Criar Novo...

Informação Importante

Confirmação de Termo