Advertisement
Guest User

Untitled

a guest
Nov 2nd, 2016
46
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 161.05 KB | None | 0 0
  1. <?php
  2. date_default_timezone_set('America/Araguaina');
  3. if(!defined('INITIALIZED'))
  4. exit;
  5.  
  6. if(!$logged)
  7. if($action == "logout")
  8. $main_content .= '
  9. <div class="TableContainer" >
  10. <table class="Table1" cellpadding="0" cellspacing="0" >
  11. <div class="CaptionContainer" >
  12. <div class="CaptionInnerContainer" >
  13. <span class="CaptionEdgeLeftTop" style="background-image:url('.$layout_name.'/images/content/box-frame-edge.gif);" /></span>
  14. <span class="CaptionEdgeRightTop" style="background-image:url('.$layout_name.'/images/content/box-frame-edge.gif);" /></span>
  15. <span class="CaptionBorderTop" style="background-image:url('.$layout_name.'/images/content/table-headline-border.gif);" ></span>
  16. <span class="CaptionVerticalLeft" style="background-image:url('.$layout_name.'/images/content/box-frame-vertical.gif);" /></span>
  17. <div class="Text" >Logout Successful</div>
  18. <span class="CaptionVerticalRight" style="background-image:url('.$layout_name.'/images/content/box-frame-vertical.gif);" /></span>
  19. <span class="CaptionBorderBottom" style="background-image:url('.$layout_name.'/images/content/table-headline-border.gif);" ></span>
  20. <span class="CaptionEdgeLeftBottom" style="background-image:url('.$layout_name.'/images/content/box-frame-edge.gif);" /></span>
  21. <span class="CaptionEdgeRightBottom" style="background-image:url('.$layout_name.'/images/content/box-frame-edge.gif);" /></span>
  22. </div>
  23. </div>
  24. <tr>
  25. <td>
  26. <div class="InnerTableContainer" >
  27. <table style="width:100%;" >
  28. <tr>
  29. <td>You have logged out of your '.htmlspecialchars($config['server']['serverName']).' account. In order to view your account you need to <a href="?subtopic=accountmanagement" >log in</a> again.</td>
  30. </tr>
  31. </table>
  32. </div>
  33. </td>
  34. </tr>
  35. </table>
  36. </div>';
  37. else
  38. {
  39. $passB = '<span>Password:</span>';
  40. $logB = '<span>Account Name:</span>';
  41. if(isset($isTryingToLogin))
  42. {
  43. $main_content .= '
  44. <div class="SmallBox" >
  45. <div class="MessageContainer" >
  46. <div class="BoxFrameHorizontal" style="background-image:url('.$layout_name.'/images/content/box-frame-horizontal.gif);" /></div>
  47. <div class="BoxFrameEdgeLeftTop" style="background-image:url('.$layout_name.'/images/content/box-frame-edge.gif);" /></div>
  48. <div class="BoxFrameEdgeRightTop" style="background-image:url('.$layout_name.'/images/content/box-frame-edge.gif);" /></div>
  49. <div class="ErrorMessage" >
  50. <div class="BoxFrameVerticalLeft" style="background-image:url('.$layout_name.'/images/content/box-frame-vertical.gif);" /></div>
  51. <div class="BoxFrameVerticalRight" style="background-image:url('.$layout_name.'/images/content/box-frame-vertical.gif);" /></div>
  52. <div class="AttentionSign" style="background-image:url('.$layout_name.'/images/content/attentionsign.gif);" /></div>
  53. <b>The Following Errors Have Occurred:</b><br/>';
  54. switch(Visitor::getLoginState())
  55. {
  56. case Visitor::LOGINSTATE_NO_ACCOUNT:
  57. $main_content .= 'Account with that name doesn\'t exist.<br/>';
  58. $logB = '<span style="color:red;">Account Name:</span>';
  59. break;
  60. case Visitor::LOGINSTATE_WRONG_PASSWORD:
  61. $main_content .= 'Wrong password to account.<br/>';
  62. $passB = '<span style="color:red;">Password:</span>';
  63. break;
  64. }
  65. $main_content .= '
  66. </div>
  67. <div class="BoxFrameHorizontal" style="background-image:url('.$layout_name.'/images/content/box-frame-horizontal.gif);" /></div>
  68. <div class="BoxFrameEdgeRightBottom" style="background-image:url('.$layout_name.'/images/content/box-frame-edge.gif);" /></div>
  69. <div class="BoxFrameEdgeLeftBottom" style="background-image:url('.$layout_name.'/images/content/box-frame-edge.gif);" />
  70. </div>
  71. </div>
  72. </div><br/>';
  73. }
  74. $main_content .= '
  75. <form action="?subtopic=accountmanagement" method="post" style="margin: 0px; padding: 0px;">
  76. <div class="TableContainer" >
  77. <table class="Table5" cellpadding="0" cellspacing="0" >
  78. <div class="CaptionContainer" >
  79. <div class="CaptionInnerContainer" >
  80. <span class="CaptionEdgeLeftTop" style="background-image:url('.$layout_name.'/images/content/box-frame-edge.gif);" /></span>
  81. <span class="CaptionEdgeRightTop" style="background-image:url('.$layout_name.'/images/content/box-frame-edge.gif);" /></span>
  82. <span class="CaptionBorderTop" style="background-image:url('.$layout_name.'/images/content/table-headline-border.gif);" ></span>
  83. <span class="CaptionVerticalLeft" style="background-image:url('.$layout_name.'/images/content/box-frame-vertical.gif);" /></span>
  84. <div class="Text" >Account Login</div>
  85. <span class="CaptionVerticalRight" style="background-image:url('.$layout_name.'/images/content/box-frame-vertical.gif);" /></span>
  86. <span class="CaptionBorderBottom" style="background-image:url('.$layout_name.'/images/content/table-headline-border.gif);" ></span>
  87. <span class="CaptionEdgeLeftBottom" style="background-image:url('.$layout_name.'/images/content/box-frame-edge.gif);" /></span>
  88. <span class="CaptionEdgeRightBottom" style="background-image:url('.$layout_name.'/images/content/box-frame-edge.gif);" /></span>
  89. </div>
  90. </div>
  91. <tr>
  92. <td>
  93. <div class="InnerTableContainer" >
  94. <table style="width:100%;" >
  95. <tr>
  96. <td>
  97. <div class="TableShadowContainerRightTop" >
  98. <div class="TableShadowRightTop" style="background-image:url('.$layout_name.'/images/content/table-shadow-rt.gif);" ></div>
  99. </div>
  100. <div class="TableContentAndRightShadow" style="background-image:url('.$layout_name.'/images/content/table-shadow-rm.gif);" >
  101. <div class="TableContentContainer" >
  102. <table class="TableContent" width="100%" style="border:1px solid #faf0d7;" >
  103. <tr>
  104. <td>
  105. <table style="float: left; width: 370px;" cellpadding="0" cellspacing="0" >
  106. <tr>
  107. <td class="LabelV120" ><span>'.$logB.'</span></td>
  108. <td><input type="password" name="account_login" size="35" maxlength="30" ></td>
  109. </tr>
  110. <tr>
  111. <td class="LabelV120" ><span>'.$passB.'</span></td>
  112. <td><input type="password" name="password_login" size="35" maxlength="29" ></td>
  113. </tr>
  114. </table>
  115. <div style="float: right; font-size: 1px;" >
  116. <input type="hidden" name="page" value="overview" >
  117. <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>
  118. <input class="ButtonText" type="image" name="Login" alt="Login" src="'.$layout_name.'/images/buttons/_sbutton_login.gif" >
  119. </div>
  120. </div>
  121. </form>
  122. <div style="width: 2px; height: 2px;" ></div>
  123. <form action="/?subtopic=lostaccount" method="post" style="padding:0px;margin:0px;" >
  124. <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>
  125. <input class="ButtonText" type="image" name="Account lost?" alt="Account lost?" src="'.$layout_name.'/images/buttons/_sbutton_accountlost.gif" >
  126. </div>
  127. </div>
  128. </form>
  129. </div>
  130. </td>
  131. </tr>
  132. </table>
  133. </div>
  134. </div>
  135. <div class="TableShadowContainer" >
  136. <div class="TableBottomShadow" style="background-image:url('.$layout_name.'/images/content/table-shadow-bm.gif);" >
  137. <div class="TableBottomLeftShadow" style="background-image:url('.$layout_name.'/images/content/table-shadow-bl.gif);" ></div>
  138. <div class="TableBottomRightShadow" style="background-image:url('.$layout_name.'/images/content/table-shadow-br.gif);" ></div>
  139. </div>
  140. </div>
  141. </td>
  142. </tr>
  143. </table>
  144. </div>
  145. </table>
  146. </div>
  147. </td>
  148. </tr>
  149. <br/>
  150. <center>
  151. <h1>New to '.$config['server']['serverName'].'?</h1>
  152. </center>
  153. <div class="TableContainer" >
  154. <table class="Table5" cellpadding="0" cellspacing="0" >
  155. <div class="CaptionContainer" >
  156. <div class="CaptionInnerContainer" >
  157. <span class="CaptionEdgeLeftTop" style="background-image:url('.$layout_name.'/images/content/box-frame-edge.gif);" /></span>
  158. <span class="CaptionEdgeRightTop" style="background-image:url('.$layout_name.'/images/content/box-frame-edge.gif);" /></span>
  159. <span class="CaptionBorderTop" style="background-image:url('.$layout_name.'/images/content/table-headline-border.gif);" ></span>
  160. <span class="CaptionVerticalLeft" style="background-image:url('.$layout_name.'/images/content/box-frame-vertical.gif);" /></span>
  161. <div class="Text" >New Player</div>
  162. <span class="CaptionVerticalRight" style="background-image:url('.$layout_name.'/images/content/box-frame-vertical.gif);" /></span>
  163. <span class="CaptionBorderBottom" style="background-image:url('.$layout_name.'/images/content/table-headline-border.gif);" ></span>
  164. <span class="CaptionEdgeLeftBottom" style="background-image:url('.$layout_name.'/images/content/box-frame-edge.gif);" /></span>
  165. <span class="CaptionEdgeRightBottom" style="background-image:url('.$layout_name.'/images/content/box-frame-edge.gif);" /></span>
  166. </div>
  167. </div>
  168. <tr>
  169. <td>
  170. <div class="InnerTableContainer" >
  171. <table style="width:100%;" >
  172. <tr>
  173. <td>
  174. <div class="TableShadowContainerRightTop" >
  175. <div class="TableShadowRightTop" style="background-image:url('.$layout_name.'/images/content/table-shadow-rt.gif);" ></div>
  176. </div>
  177. <div class="TableContentAndRightShadow" style="background-image:url('.$layout_name.'/images/content/table-shadow-rm.gif);" >
  178. <div class="TableContentContainer" >
  179. <table class="TableContent" width="100%" style="border:1px solid #faf0d7;" >
  180. <tr>
  181. <td >
  182. <div style="float: right; margin-top: 20px;" >
  183. <form class="MediumButtonForm" action="/?subtopic=createaccount" method="post" >
  184. <div class="MediumButtonBackground" style="background-image:url('.$layout_name.'/images/buttons/mediumbutton.gif)" onMouseOver="MouseOverMediumButton(this);" onMouseOut="MouseOutMediumButton(this);" ><div class="MediumButtonOver" style="background-image:url('.$layout_name.'/images/buttons/mediumbutton-over.gif)" onMouseOver="MouseOverMediumButton(this);" onMouseOut="MouseOutMediumButton(this);" ></div>
  185. <input class="MediumButtonText" type="image" name="Create Account" alt="Create Account" src="'.$layout_name.'/images/buttons/mediumbutton_createaccount.png" />
  186. </div>
  187. </form>
  188. </div>
  189. <div id="LoginCreateAccountBox" >
  190. <p><b>'.$config['server']['serverName'].'...</b></p>
  191. <div style="margin-left: 10px;" >
  192. <p>... where hardcore gaming meets fantasy.</p>
  193. <p>... where friendships last a lifetime.</p>
  194. <p>... unites adventurers since 1997!</p>
  195. </div>
  196. </div>
  197. </table>
  198. </div>
  199. </div>
  200. <div class="TableShadowContainer" >
  201. <div class="TableBottomShadow" style="background-image:url('.$layout_name.'/images/content/table-shadow-bm.gif);" >
  202. <div class="TableBottomLeftShadow" style="background-image:url('.$layout_name.'/images/content/table-shadow-bl.gif);" ></div>
  203. <div class="TableBottomRightShadow" style="background-image:url('.$layout_name.'/images/content/table-shadow-br.gif);" ></div>
  204. </div>
  205. </div>
  206. </td>
  207. </tr>
  208. </table>
  209. </div>
  210. </table>
  211. </div>
  212. </td>
  213. </tr>';
  214. }
  215. else
  216. {
  217.  
  218.  
  219. //Here start our new accountmanagement ;D
  220. if($action == "")
  221. {
  222. if($account_logged->getCustomField('premdays') > 0)
  223. $account_statusOver = '
  224. <span class="green">
  225. <span class="BigBoldText"><b><font color="green">Premium Account, '. $account_logged->getPremDays() .' days left</font></b></span>
  226. </span>';
  227. else
  228. $account_statusOver = '
  229. <span class="red">
  230. <span class="BigBoldText"><b><font color="red">Free Account</font></b></span>
  231. </span>';
  232.  
  233. if($account_logged->getCustomField('premdays') > 0)
  234. $account_statusPic = '<img class="AccountStatusImage" src="'.$layout_name.'/images/account/account-status_green.gif" alt="free account">';
  235. else
  236. $account_statusPic = '<img class="AccountStatusImage" src="'.$layout_name.'/images/account/account-status_red.gif" alt="free account">';
  237.  
  238. $main_content .= '
  239. <center>
  240. <table>
  241. <tbody>
  242. <tr>
  243. <td><img src="'.$layout_name.'/images/content/headline-bracer-left.gif"></td>
  244. <td style="text-align:center;vertical-align:middle;horizontal-align:center;font-size:17px;font-weight:bold;">Welcome to your account '.$account_logged->getRLName().'!<br></td>
  245. <td><img src="'.$layout_name.'/images/content/headline-bracer-right.gif"></td>
  246. </tr>
  247. </tbody>
  248. </table>
  249. </center>
  250. <br>';
  251. $main_content .= '
  252. <div class="TableContainer">
  253. <div class="CaptionContainer">
  254. <div class="CaptionInnerContainer">
  255. <span class="CaptionEdgeLeftTop" style="background-image:url('.$layout_name.'/images/content/box-frame-edge.gif);"></span>
  256. <span class="CaptionEdgeRightTop" style="background-image:url('.$layout_name.'/images/content/box-frame-edge.gif);"></span>
  257. <span class="CaptionBorderTop" style="background-image:url('.$layout_name.'/images/content/table-headline-border.gif);"></span>
  258. <span class="CaptionVerticalLeft" style="background-image:url('.$layout_name.'/images/content/box-frame-vertical.gif);"></span>
  259. <div class="Text">Account Status</div>
  260. <span class="CaptionVerticalRight" style="background-image:url('.$layout_name.'/images/content/box-frame-vertical.gif);"></span>
  261. <span class="CaptionBorderBottom" style="background-image:url('.$layout_name.'/images/content/table-headline-border.gif);"></span>
  262. <span class="CaptionEdgeLeftBottom" style="background-image:url('.$layout_name.'/images/content/box-frame-edge.gif);"></span>
  263. <span class="CaptionEdgeRightBottom" style="background-image:url('.$layout_name.'/images/content/box-frame-edge.gif);"></span>
  264. </div>
  265. </div>
  266. <table class="Table5" cellpadding="0" cellspacing="0">
  267. <tbody>
  268. <tr>
  269. <td>
  270. <div class="InnerTableContainer">
  271. <table style="width:100%;">
  272. <tbody>
  273. <tr>
  274. <td>
  275. <div class="TableShadowContainerRightTop">
  276. <div class="TableShadowRightTop" style="background-image:url('.$layout_name.'/images/content/table-shadow-rt.gif);"></div>
  277. </div>
  278. <div class="TableContentAndRightShadow" style="background-image:url('.$layout_name.'/images/content/table-shadow-rm.gif);">
  279. <div class="TableContentContainer">
  280. <table class="TableContent" width="100%" style="border:1px solid #faf0d7;">
  281. <tbody>
  282. <tr>
  283. <td>'.$account_statusPic.'</td>
  284. <td width="100%" valign="middle">
  285. '.$account_statusOver.'';
  286. $main_content .= '';
  287. $main_content .= '
  288. </td>
  289. <td>
  290. <form action="?subtopic=accountmanagement&action=manage" method="post" style="padding:0px;margin:0px;">
  291. <div class="BigButton" style="background-image:url('.$layout_name.'/images/buttons/sbutton.gif)">
  292. <div onmouseover="MouseOverBigButton(this);" onmouseout="MouseOutBigButton(this);"><div class="BigButtonOver" style="background-image:url('.$layout_name.'/images/buttons/sbutton_over.gif);">
  293. </div>
  294. <input class="ButtonText" type="image" name="Manage Account" alt="Manage Account" src="'.$layout_name.'/images/buttons/_sbutton_manageaccount.gif">
  295. </div>
  296. </div>
  297. </form>
  298. <div style="font-size:1px;height:4px;"></div>
  299. <form action="?subtopic=buypoints" method="post" style="padding:0px;margin:0px;">
  300. <div class="BigButton" style="background-image:url('.$layout_name.'/images/buttons/sbutton_green.gif)">
  301. <div onmouseover="MouseOverBigButton(this);" onmouseout="MouseOutBigButton(this);"><div class="BigButtonOver" style="background-image:url('.$layout_name.'/images/buttons/sbutton_green_over.gif);"></div>
  302. <input class="ButtonText" type="image" name="Get Premium" alt="Get Premium" src="'.$layout_name.'/images/buttons/_sbutton_getpremium.gif">
  303. </div>
  304. </div>
  305. </form>
  306. <div style="font-size:1px;height:4px;"></div>
  307. <form action="?subtopic=accountmanagement&action=logout" method="post" style="padding:0px;margin:0px;">
  308. <div class="BigButton" style="background-image:url('.$layout_name.'/images/buttons/sbutton_red.gif)">
  309. <div onmouseover="MouseOverBigButton(this);" onmouseout="MouseOutBigButton(this);"><div class="BigButtonOver" style="background-image:url('.$layout_name.'/images/buttons/sbutton_red_over.gif);"></div>
  310. <input class="ButtonText" type="image" name="Logout" alt="Logout" src="'.$layout_name.'/images/buttons/_sbutton_logout.gif">
  311. </div>
  312. </div>
  313. </form>
  314. </td>
  315. </tr>
  316. </tbody>
  317. </table>
  318. </div>
  319. </div>
  320. <div class="TableShadowContainer">
  321. <div class="TableBottomShadow" style="background-image:url('.$layout_name.'/images/content/table-shadow-bm.gif);">
  322. <div class="TableBottomLeftShadow" style="background-image:url('.$layout_name.'/images/content/table-shadow-bl.gif);"></div>
  323. <div class="TableBottomRightShadow" style="background-image:url('.$layout_name.'/images/content/table-shadow-br.gif);"></div>
  324. </div>
  325. </div>
  326. </td>
  327. </tr>
  328. </tbody>
  329. </table>
  330. </div>
  331. </td>
  332. </tr>
  333. </tbody>
  334. </table>
  335. </div>
  336. <br>';
  337. //REGISTRAR
  338. $account_reckey = $account_logged->getCustomField("key");
  339. if(empty($account_reckey))
  340. $main_content .= '
  341. <div class="SmallBox" >
  342. <div class="MessageContainer" >
  343. <div class="BoxFrameHorizontal" style="background-image:url('.$layout_name.'/images/content/box-frame-horizontal.gif);" /></div>
  344. <div class="BoxFrameEdgeLeftTop" style="background-image:url('.$layout_name.'/images/content/box-frame-edge.gif);" /></div>
  345. <div class="BoxFrameEdgeRightTop" style="background-image:url('.$layout_name.'/images/content/box-frame-edge.gif);" /></div>
  346. <div class="Message" >
  347. <div class="BoxFrameVerticalLeft" style="background-image:url('.$layout_name.'/images/content/box-frame-vertical.gif);" /></div>
  348. <div class="BoxFrameVerticalRight" style="background-image:url('.$layout_name.'/images/content/box-frame-vertical.gif);" /></div>
  349. <table class="HintBox" >
  350. <tr>
  351. <td>
  352. <div class="BoxButtons" >
  353. <form action="?subtopic=accountmanagement&action=registeraccount" method="post" style="padding:0px;margin:0px;" >
  354. <div class="BigButton" style="background-image:url('.$layout_name.'/images/buttons/sbutton.gif)" >
  355. <div onMouseOver="MouseOverBigButton(this);" onMouseOut="MouseOutBigButton(this);" >
  356. <div class="BigButtonOver" style="background-image:url('.$layout_name.'/images/buttons/sbutton_over.gif);" ></div>
  357. <input class="ButtonText" type="image" name="Register Account" alt="Register Account" src="'.$layout_name.'/images/buttons/_sbutton_registeraccount.gif" >
  358. </div>
  359. </div>
  360. </form>
  361. <div style="font-size:1px;height:4px;" ></div>
  362. </div>
  363. <p><b>Your account is not registered!</b></p>
  364. <p>You need to click here to register your account and receive your recovery key. Please take carefull your Recovery Key.</p>
  365. <p>In case you have lost your Recovery Key, you can request the new recovery key for your account again.</p>
  366. </td>
  367. <tr>
  368. </table>
  369. </div>
  370. <div class="BoxFrameHorizontal" style="background-image:url('.$layout_name.'/images/content/box-frame-horizontal.gif);" /></div>
  371. <div class="BoxFrameEdgeRightBottom" style="background-image:url('.$layout_name.'/images/content/box-frame-edge.gif);" /></div>
  372. <div class="BoxFrameEdgeLeftBottom" style="background-image:url('.$layout_name.'/images/content/box-frame-edge.gif);" /></div>
  373. </div>
  374. </div><br/>
  375. ';
  376. //CHARACTERS
  377. $main_content .= '
  378. <div class="RowsWithOverEffect">
  379. <div class="TableContainer">
  380. <div class="CaptionContainer">
  381. <div class="CaptionInnerContainer">
  382. <span class="CaptionEdgeLeftTop" style="background-image:url('.$layout_name.'/images/content/box-frame-edge.gif);"></span>
  383. <span class="CaptionEdgeRightTop" style="background-image:url('.$layout_name.'/images/content/box-frame-edge.gif);"></span>
  384. <span class="CaptionBorderTop" style="background-image:url('.$layout_name.'/images/content/table-headline-border.gif);"></span>
  385. <span class="CaptionVerticalLeft" style="background-image:url('.$layout_name.'/images/content/box-frame-vertical.gif);"></span>
  386. <div class="Text">Characters</div>
  387. <span class="CaptionVerticalRight" style="background-image:url('.$layout_name.'/images/content/box-frame-vertical.gif);"></span>
  388. <span class="CaptionBorderBottom" style="background-image:url('.$layout_name.'/images/content/table-headline-border.gif);"></span>
  389. <span class="CaptionEdgeLeftBottom" style="background-image:url('.$layout_name.'/images/content/box-frame-edge.gif);"></span>
  390. <span class="CaptionEdgeRightBottom" style="background-image:url('.$layout_name.'/images/content/box-frame-edge.gif);"></span>
  391. </div>
  392. </div>
  393. <table class="Table3" cellpadding="0" cellspacing="0">
  394. <tbody>
  395. <tr>
  396. <td>
  397. <div class="InnerTableContainer">
  398. <table style="width:100%;">
  399. <tbody>
  400. <tr>
  401. <td>
  402. <div class="TableShadowContainerRightTop">
  403. <div class="TableShadowRightTop" style="background-image:url('.$layout_name.'/images/content/table-shadow-rt.gif);"></div>
  404. </div>
  405. <div class="TableContentAndRightShadow" style="background-image:url('.$layout_name.'/images/content/table-shadow-rm.gif);">
  406. <div class="TableContentContainer">
  407. <table class="TableContent" width="100%" style="border:1px solid #faf0d7;">
  408. <tbody>
  409. <tr class="LabelH">
  410. <td></td>
  411. <td style="width:40%;">Name</td>
  412. <td style="width:120px!important;">World</td>
  413. <td style="width:90px!important;">Status</td>
  414. <td style="width:90px!important;">&nbsp;</td>
  415. </tr>';
  416.  
  417. $account_players = $account_logged->getPlayersList();
  418. //show list of players on account
  419. $var = 0;
  420. foreach($account_players as $account_player)
  421. {
  422. $player_number_counter++;
  423. if($var==0) {
  424. $preview = ' previewstate="0"';
  425. } else {
  426. $preview = '';
  427. }
  428.  
  429. if($var==0) {
  430. $display = 'block';
  431. } else {
  432. $display = 'none';
  433. }
  434.  
  435. if($var==0) {
  436. $displayNum = 'none';
  437. } else {
  438. $displayNum = 'inline';
  439. }
  440.  
  441. if($var==0) {
  442. $displayBold = 'bold';
  443. } else {
  444. $displayBold = 'normal';
  445. }
  446.  
  447. if($var==0) {
  448. $displayFont = '13';
  449. } else {
  450. $displayFont = '10';
  451. }
  452.  
  453. $main_content .='
  454. <tr id="CharacterRow_'.$player_number_counter.'"
  455. onmouseover="InRowWithOverEffect(&#39;CharacterRow_'.$player_number_counter.'&#39;,';
  456.  
  457. if(is_int($player_number_counter / 2))
  458. $main_content .= '&#39;#e7d1af&#39;';
  459. else
  460. $main_content .= '&#39;#ffedd1&#39;';
  461.  
  462.  
  463. $main_content .='
  464. );"
  465. onmouseout="OutRowWithOverEffect(&#39;CharacterRow_'.$player_number_counter.'&#39;,';
  466.  
  467. if(is_int($player_number_counter / 2))
  468. $main_content .= '&#39;#d5c0a1&#39;';
  469. else
  470. $main_content .= '&#39;#f1e0c6&#39;';
  471.  
  472. $main_content .='
  473. );"
  474. onclick="FocusCharacter('.$player_number_counter.', &#39;'.urlencode($account_player->getName()).'&#39;, '.$config['site']['max_players_per_account'].');"
  475. class="Odd" style="font-weight: '.$displayBold.';';
  476.  
  477. if(is_int($player_number_counter / 2))
  478. $main_content .= 'background-color: #3a3738;">';
  479. else
  480. $main_content .= 'background-color: #3a3738;">';
  481.  
  482. $main_content .='
  483. <td style="width:40px;text-align:center;padding:2px;">
  484. <span id="CharacterNumberOf_'.$player_number_counter.'" style="display: '.$displayNum.';">'.$player_number_counter.'.</span>
  485. <span id="PlayButtonOf_'.$player_number_counter.'" style="display: '.$display.';">
  486. <span name="FlashClientPlayButton" id="FlashClientPlayButton" playlink="#" ' . $preview . '>';
  487.  
  488. if($account_player->isDeleted())
  489. {
  490. $main_content .= '<img style="border:0px;" src="'.$layout_name.'/images/account/play-not-button.gif">';
  491. } else {
  492. $main_content .= '
  493. <a href="#" >
  494. <img style="border:0px;" onmouseover="InMiniButton(this, &#39;&#39;);" onmouseout="OutMiniButton(this, &#39;&#39;);" src="'.$layout_name.'/images/account/play-button.gif">
  495. </a>';
  496. }
  497.  
  498. $main_content .='
  499. </span>
  500. </span>
  501. </td>
  502. <td id="CharacterCell2_'.$player_number_counter.'">
  503. <span style="white-space:nowrap;vertical-align:middle;">
  504. <span id="CharacterNameOf_'.$player_number_counter.'" style="font-size: '.$displayFont.'pt;">'.htmlspecialchars($account_player->getName()).'</span><br>
  505. <span id="CharacterNameOf_'.$player_number_counter.'"><small>'.htmlspecialchars($vocation_name[$account_player->getPromotion()][$account_player->getVocation()]).' - Level '.$account_player->getLevel().'</small></span>
  506. </span>
  507. </td>
  508. <td id="CharacterCell2_'.$player_number_counter.'">
  509. <span style="white-space:nowrap;">'.htmlspecialchars($config['server']['serverName']).'</span>
  510. </td>
  511. <td id="CharacterCell3_'.$player_number_counter.'">';
  512. if(!$account_player->isOnline())
  513. $main_content .= '<font color="red"><b>offline</b></font>';
  514. else
  515. $main_content .= '<font color="green"><b>online</b></font>';
  516. if($account_player->isDeleted())
  517. {
  518. $main_content .= 'deleted';
  519. }
  520. $main_content .='
  521. </td>
  522. <td id="CharacterCell4_'.$player_number_counter.'" style="text-align:center;">
  523. <span id="CharacterOptionsOf_'.$player_number_counter.'" style="display: '.$display.';">
  524. <span style="font-weight:normal;">[<a href="?subtopic=accountmanagement&action=changecomment&name='.urlencode($account_player->getName()).'">Edit</a>]</span>';
  525. if($account_player->isDeleted())
  526. {
  527. $main_content .= '<br><span style="font-weight:normal;">[<a href="?subtopic=accountmanagement&action=undelete&name='.urlencode($account_player->getName()).'">Undelete</a>]</span>';
  528. } else {
  529. $main_content .= '<br><span style="font-weight:normal;">[<a href="?subtopic=accountmanagement&action=deletecharacter&name='.urlencode($account_player->getName()).'">Delete</a>]</span>';
  530. }
  531.  
  532. $main_content .= '
  533. </span>
  534. </td>
  535. </tr>';
  536. $var++;
  537. }
  538. $main_content .='
  539. </tbody>
  540. </table>
  541. </div>
  542. </div>
  543. <div class="TableShadowContainer">
  544. <div class="TableBottomShadow" style="background-image:url('.$layout_name.'/images/content/table-shadow-bm.gif);">
  545. <div class="TableBottomLeftShadow" style="background-image:url('.$layout_name.'/images/content/table-shadow-bl.gif);"></div>
  546. <div class="TableBottomRightShadow" style="background-image:url('.$layout_name.'/images/content/table-shadow-br.gif);"></div>
  547. </div>
  548. </div>
  549. </td>
  550. </tr>
  551. <tr>
  552. <td>
  553. <table class="InnerTableButtonRow" cellpadding="0" cellspacing="0">
  554. <tbody>
  555. <tr>
  556. <td></td>
  557. <td align="right" style="padding-right:7px;width:100%;">
  558. <form action="?subtopic=accountmanagement&action=createcharacter" method="post" style="padding:0px;margin:0px;">
  559. <input type="hidden" name="selectedcharacter" value="Draz Mytos">
  560. <div class="BigButton" style="background-image:url('.$layout_name.'/images/buttons/sbutton.gif)">
  561. <div onmouseover="MouseOverBigButton(this);" onmouseout="MouseOutBigButton(this);"><div class="BigButtonOver" style="background-image:url('.$layout_name.'/images/buttons/sbutton_over.gif);"></div>
  562. <input class="ButtonText" type="image" name="Create Character" alt="Create Character" src="'.$layout_name.'/images/buttons/_sbutton_createcharacter.gif">
  563. </div>
  564. </div>
  565. </form>
  566. </td>
  567. </tr>
  568. </tbody>
  569. </table>
  570. </td>
  571. </tr>
  572. </tbody>
  573. </table>
  574. </div>
  575. </td>
  576. </tr>
  577. </tbody>
  578. </table>
  579. </div>
  580. </div>
  581. <br><br>';
  582. //MIGRATION TOOL ;D
  583. if($group_id_of_acc_logged >= $config['site']['access_admin_panel']){
  584. $main_content .= '
  585. <div class="SmallBox">
  586. <div class="MessageContainer">
  587. <div class="BoxFrameHorizontal" style="background-image:url('.$layout_name.'/images/content/box-frame-horizontal.gif);"></div>
  588. <div class="BoxFrameEdgeLeftTop" style="background-image:url('.$layout_name.'/images/content/box-frame-edge.gif);"></div>
  589. <div class="BoxFrameEdgeRightTop" style="background-image:url('.$layout_name.'/images/content/box-frame-edge.gif);"></div>
  590. <div class="Message">
  591. <div class="BoxFrameVerticalLeft" style="background-image:url('.$layout_name.'/images/content/box-frame-vertical.gif);"></div>
  592. <div class="BoxFrameVerticalRight" style="background-image:url('.$layout_name.'/images/content/box-frame-vertical.gif);"></div>
  593. <table class="HintBox">
  594. <tbody>
  595. <tr>
  596. <td>
  597. <p><b>Admin Panel</b></p>
  598. <p>Click <a href="?subtopic=cpanel">here</a> to go your new <strong>Admin Panel</strong></p>
  599. <p>Click <a href="?subtopic=shopadmin">here</a> to go your new <strong>Shop Admin</strong></p>
  600. </td>
  601. </tr>
  602. <tr></tr>
  603. </tbody>
  604. </table>
  605. </div>
  606. <div class="BoxFrameHorizontal" style="background-image:url('.$layout_name.'/images/content/box-frame-horizontal.gif);"></div>
  607. <div class="BoxFrameEdgeRightBottom" style="background-image:url('.$layout_name.'/images/content/box-frame-edge.gif);"></div>
  608. <div class="BoxFrameEdgeLeftBottom" style="background-image:url('.$layout_name.'/images/content/box-frame-edge.gif);"></div>
  609. </div>
  610. </div>
  611. <br>';
  612. }else{
  613. $main_content .= '
  614. <div class="SmallBox">
  615. <div class="MessageContainer">
  616. <div class="BoxFrameHorizontal" style="background-image:url('.$layout_name.'/images/content/box-frame-horizontal.gif);"></div>
  617. <div class="BoxFrameEdgeLeftTop" style="background-image:url('.$layout_name.'/images/content/box-frame-edge.gif);"></div>
  618. <div class="BoxFrameEdgeRightTop" style="background-image:url('.$layout_name.'/images/content/box-frame-edge.gif);"></div>
  619. <div class="Message">
  620. <div class="BoxFrameVerticalLeft" style="background-image:url('.$layout_name.'/images/content/box-frame-vertical.gif);"></div>
  621. <div class="BoxFrameVerticalRight" style="background-image:url('.$layout_name.'/images/content/box-frame-vertical.gif);"></div>
  622. <table class="HintBox">
  623. <tbody>
  624. <tr>
  625. <td>
  626. <p><b>New Account Management</b></p>
  627. <p>This is the main page of managing your account, here you will have the key to your account information displayed and updated, enjoy! </p>
  628. </td>
  629. </tr>
  630. <tr></tr>
  631. </tbody>
  632. </table>
  633. </div>
  634. <div class="BoxFrameHorizontal" style="background-image:url('.$layout_name.'/images/content/box-frame-horizontal.gif);"></div>
  635. <div class="BoxFrameEdgeRightBottom" style="background-image:url('.$layout_name.'/images/content/box-frame-edge.gif);"></div>
  636. <div class="BoxFrameEdgeLeftBottom" style="background-image:url('.$layout_name.'/images/content/box-frame-edge.gif);"></div>
  637. </div>
  638. </div>
  639. <br>';
  640. }
  641. }
  642. //Here finish our new account management
  643.  
  644. if($action == "manage")
  645. {
  646. $account_reckey = $account_logged->getCustomField("key");
  647. if($account_logged->getPremDays() > 0)
  648. $account_status = '<b><font color="green">Premium Account, '. $account_logged->getPremDays() .' days left</font></b>';
  649. else
  650. $account_status = '<b><font color="red">Free Account</font></b>';
  651. if(empty($account_reckey))
  652. $account_registred = '<b><font color="red">No</font></b>';
  653. else
  654. if($config['site']['generate_new_reckey'] && $config['site']['send_emails'])
  655. $account_registred = '<b><font color="green">Yes ( <a href="?subtopic=accountmanagement&action=newreckey"> Buy new Rec key </a> )</font></b>';
  656. else
  657. $account_registred = '<b><font color="green">Yes</font></b>';
  658.  
  659. $account_created = $account_logged->getCreateDate();
  660. $account_email = $account_logged->getEMail();
  661. $account_email_new_time = $account_logged->getCustomField("email_new_time");
  662. if($account_email_new_time > 1)
  663. $account_email_new = $account_logged->getCustomField("email_new");
  664. $account_rlname = $account_logged->getRLName();
  665. $account_location = $account_logged->getLocation();
  666.  
  667. $main_content .= '
  668. <div class="SmallBox" >
  669. <div class="MessageContainer" >
  670. <div class="BoxFrameHorizontal" style="background-image:url('.$layout_name.'/images/content/box-frame-horizontal.gif);" /></div>
  671. <div class="BoxFrameEdgeLeftTop" style="background-image:url('.$layout_name.'/images/content/box-frame-edge.gif);" /></div>
  672. <div class="BoxFrameEdgeRightTop" style="background-image:url('.$layout_name.'/images/content/box-frame-edge.gif);" /></div>
  673. <div class="Message" >
  674. <div class="BoxFrameVerticalLeft" style="background-image:url('.$layout_name.'/images/content/box-frame-vertical.gif);" />
  675. </div>
  676. <div class="BoxFrameVerticalRight" style="background-image:url('.$layout_name.'/images/content/box-frame-vertical.gif);" /></div>
  677. <table style="width:100%;" >
  678. <td style="width:100%;text-align:center;" >
  679. <nobr>[<a href="#General+Information" >General Information</a>]</nobr>
  680. <nobr>[<a href="#Registration" >Registration</a>]</nobr>
  681. </td>
  682. <td>
  683. <form action="?subtopic=buypoints" method="post" style="padding:0px;margin:0px;" >
  684. <div class="BigButton" style="background-image:url('.$layout_name.'/images/buttons/sbutton_green.gif)" >
  685. <div onMouseOver="MouseOverBigButton(this);" onMouseOut="MouseOutBigButton(this);" ><div class="BigButtonOver" style="background-image:url('.$layout_name.'/images/buttons/sbutton_green_over.gif);" ></div>
  686. <input class="ButtonText" type="image" name="Get Premium" alt="Get Premium" src="'.$layout_name.'/images/buttons/_sbutton_getpremium.gif" >
  687. </div>
  688. </div>
  689. </form>
  690. <div style="font-size:1px;height:4px;" ></div>
  691. <table border="0" cellspacing="0" cellpadding="0" >
  692. <form action="?subtopic=accountmanagement" method="post" >
  693. <tr>
  694. <td style="border:0px;" >
  695. <input type="hidden" name=page value=overview >
  696. <div class="BigButton" style="background-image:url('.$layout_name.'/images/buttons/sbutton.gif)" >
  697. <div onMouseOver="MouseOverBigButton(this);" onMouseOut="MouseOutBigButton(this);" ><div class="BigButtonOver" style="background-image:url('.$layout_name.'/images/buttons/sbutton_over.gif);" ></div>
  698. <input class="ButtonText" type="image" name="Overview" alt="Overview" src="'.$layout_name.'/images/buttons/_sbutton_overview.gif" >
  699. </div>
  700. </div>
  701. </td>
  702. </tr>
  703. </form>
  704. </table>
  705. </td>
  706. </tr>
  707. </table>
  708. </div>
  709. <div class="BoxFrameHorizontal" style="background-image:url('.$layout_name.'/images/content/box-frame-horizontal.gif);" /></div>
  710. <div class="BoxFrameEdgeRightBottom" style="background-image:url('.$layout_name.'/images/content/box-frame-edge.gif);" /></div>
  711. <div class="BoxFrameEdgeLeftBottom" style="background-image:url('.$layout_name.'/images/content/box-frame-edge.gif);" /></div>
  712. </div>
  713. </div><br/>';
  714. $main_content .= '
  715. <a name="General+Information" ></a>
  716. <div class="TopButtonContainer" >
  717. <div class="TopButton" >
  718. <a href="#top" >
  719. <image style="border:0px;" src="'.$layout_name.'/images/content/back-to-top.gif" />
  720. </a>
  721. </div>
  722. </div>
  723. <div class="TableContainer" >
  724. <table class="Table3" cellpadding="0" cellspacing="0" >
  725. <div class="CaptionContainer" >
  726. <div class="CaptionInnerContainer" >
  727. <span class="CaptionEdgeLeftTop" style="background-image:url('.$layout_name.'/images/content/box-frame-edge.gif);" /></span>
  728. <span class="CaptionEdgeRightTop" style="background-image:url('.$layout_name.'/images/content/box-frame-edge.gif);" /></span>
  729. <span class="CaptionBorderTop" style="background-image:url('.$layout_name.'/images/content/table-headline-border.gif);" ></span>
  730. <span class="CaptionVerticalLeft" style="background-image:url('.$layout_name.'/images/content/box-frame-vertical.gif);" /></span>
  731. <div class="Text" >General Information</div>
  732. <span class="CaptionVerticalRight" style="background-image:url('.$layout_name.'/images/content/box-frame-vertical.gif);" /></span>
  733. <span class="CaptionBorderBottom" style="background-image:url('.$layout_name.'/images/content/table-headline-border.gif);" ></span>
  734. <span class="CaptionEdgeLeftBottom" style="background-image:url('.$layout_name.'/images/content/box-frame-edge.gif);" /></span>
  735. <span class="CaptionEdgeRightBottom" style="background-image:url('.$layout_name.'/images/content/box-frame-edge.gif);" /></span>
  736. </div>
  737. </div>
  738. <tr>
  739. <td>
  740. <div class="InnerTableContainer" >
  741. <table style="width:100%;" >
  742. <tr>
  743. <td>
  744. <div class="TableShadowContainerRightTop" >
  745. <div class="TableShadowRightTop" style="background-image:url('.$layout_name.'/images/content/table-shadow-rt.gif);" ></div>
  746. </div>
  747. <div class="TableContentAndRightShadow" style="background-image:url('.$layout_name.'/images/content/table-shadow-rm.gif);" >
  748. <div class="TableContentContainer" >
  749. <table class="TableContent" width="100%" >
  750. <tr style="background-color:#3a3738;" >
  751. <td class="LabelV" >Account Name:</td>
  752. <td style="width:90%;" >
  753. <div style="position:relative;width:100%;" >
  754. <span id="DisplayAccountID" >'.str_repeat('*', strlen(htmlspecialchars($account_logged->getName()))).'</span>
  755. <span id="MaskedAccountID" style="visibility:hidden;display:none" >'.str_repeat('*', strlen(htmlspecialchars($account_logged->getName()))).'</span>
  756. <span id="ReadableAccountID" style="visibility:hidden;display:none" >'.htmlspecialchars($account_logged->getName()).'</span>
  757. <img id="ButtonAccountID" onMouseDown="ToggleMaskedText(\'AccountID\');" style="position:absolute;right:0px;top:2px;cursor:pointer;" src="'.$layout_name.'/images/general/show.gif" />
  758. </div>
  759. </td>
  760. </tr>
  761. <tr style="background-color:#3a3738;" >
  762. <td class="LabelV" >Email Address:</td>
  763. <td style="width:90%;" >
  764. <div style="position:relative;width:100%;" >
  765. <span id="DisplayEMail" >'.str_repeat('*', strlen(htmlspecialchars($account_email))).'</span>
  766. <span id="MaskedEMail" style="visibility:hidden;display:none" >'.str_repeat('*', strlen(htmlspecialchars($account_email))).'</span>
  767. <span id="ReadableEMail" style="visibility:hidden;display:none" >'.htmlspecialchars($account_email).'</span>
  768. <img id="ButtonEMail" onMouseDown="ToggleMaskedText(\'EMail\');" style="position:absolute;right:0px;top:2px;cursor:pointer;" src="'.$layout_name.'/images/general/show.gif" />
  769. </div>
  770. </td>
  771. </tr>
  772. <tr style="background-color:#3a3738;" >
  773. <td class="LabelV" >Created:</td>
  774. <td>'.date("M d Y, G:i:s", $account_created).'</td>
  775. </tr>
  776. <tr style="background-color:#3a3738;" >
  777. <td class="LabelV" >Last Login:</td>
  778. <td>'.date("M d Y, G:i:s", time()).'</td>
  779. </tr>
  780. <tr style="background-color:#3a3738;" >
  781. <td class="LabelV" >Account Status:</td>
  782. <td>'.$account_status;
  783.  
  784. $main_content .= '
  785. </td>
  786. </tr>
  787. </table>
  788. </div>
  789. </div>
  790. <div class="TableShadowContainer" >
  791. <div class="TableBottomShadow" style="background-image:url('.$layout_name.'/images/content/table-shadow-bm.gif);" >
  792. <div class="TableBottomLeftShadow" style="background-image:url('.$layout_name.'/images/content/table-shadow-bl.gif);" ></div>
  793. <div class="TableBottomRightShadow" style="background-image:url('.$layout_name.'/images/content/table-shadow-br.gif);" ></div>
  794. </div>
  795. </div>
  796. </td>
  797. </tr>
  798. <tr>
  799. <td>
  800. <table class="InnerTableButtonRow" cellpadding="0" cellspacing="0" >
  801. <tr>
  802. <td>
  803. <table border="0" cellspacing="0" cellpadding="0" >
  804. <form action="?subtopic=accountmanagement&action=changepassword" method="post" >
  805. <tr>
  806. <td style="border:0px;" ><div class="BigButton" style="background-image:url('.$layout_name.'/images/buttons/sbutton.gif)" >
  807. <div onMouseOver="MouseOverBigButton(this);" onMouseOut="MouseOutBigButton(this);" ><div class="BigButtonOver" style="background-image:url('.$layout_name.'/images/buttons/sbutton_over.gif);" ></div>
  808. <input class="ButtonText" type="image" name="Change Password" alt="Change Password" src="'.$layout_name.'/images/buttons/_sbutton_changepassword.gif" >
  809. </div>
  810. </div>
  811. </td>
  812. </tr>
  813. </form>
  814. </table>
  815. <td></td>
  816. <td>
  817. <table class="InnerTableButtonRow" cellpadding="0" cellspacing="0" >
  818. <form action="?subtopic=accountmanagement&action=changeemail" method="post" >
  819. <tr>
  820. <td style="border:0px;" ><input type="hidden" name=step value=changename >
  821. <div class="BigButton" style="background-image:url('.$layout_name.'/images/buttons/sbutton.gif)" >
  822. <div onMouseOver="MouseOverBigButton(this);" onMouseOut="MouseOutBigButton(this);" ><div class="BigButtonOver" style="background-image:url('.$layout_name.'/images/buttons/sbutton_over.gif);" ></div>
  823. <input class="ButtonText" type="image" name="Change Email" alt="Rename Account" src="'.$layout_name.'/images/buttons/_sbutton_changeemail.gif" >
  824. </div>
  825. </div>
  826. </td>
  827. </tr>
  828. </form>
  829. </table>
  830. </td>
  831. </tr>
  832. </table>
  833. </td>
  834. </tr>
  835. </table>
  836. </div>
  837. </table>
  838. </div>
  839. </td>
  840. </tr><br/><br/>';
  841. if($account_email_new_time > 1)
  842. if($account_email_new_time < time())
  843. $account_email_change = '<br>(You can accept <b>'.htmlspecialchars($account_email_new).'</b> as a new email.)';
  844. else
  845. {
  846. $account_email_change = ' <br>You can accept <b>new e-mail after '.date("j F Y", $account_email_new_time).".</b>";
  847.  
  848. $main_content .= '
  849. <div class="SmallBox" >
  850. <div class="MessageContainer" >
  851. <div class="BoxFrameHorizontal" style="background-image:url('.$layout_name.'/images/content/box-frame-horizontal.gif);" /></div>
  852. <div class="BoxFrameEdgeLeftTop" style="background-image:url('.$layout_name.'/images/content/box-frame-edge.gif);" /></div>
  853. <div class="BoxFrameEdgeRightTop" style="background-image:url('.$layout_name.'/images/content/box-frame-edge.gif);" /></div>
  854. <div class="Message" >
  855. <div class="BoxFrameVerticalLeft" style="background-image:url('.$layout_name.'/images/content/box-frame-vertical.gif);" /></div>
  856. <div class="BoxFrameVerticalRight" style="background-image:url('.$layout_name.'/images/content/box-frame-vertical.gif);" /></div>
  857. <table>
  858. <tr>
  859. <td class="LabelV" >Note:</td>
  860. <td style="width:100%;" >A request has been submitted to change the email address of this account to <b>'.htmlspecialchars($account_email_new).'</b>. After <b>'.date("j F Y, G:i:s", $account_email_new_time).'</b> you can accept the new email address and finish the process. Please cancel the request if you do not want your email address to be changed! Also cancel the request if you have no access to the new email address!</td>
  861. </tr>
  862. </table>
  863. <div align="center" >
  864. <table border="0" cellspacing="0" cellpadding="0" >
  865. <form action="?subtopic=accountmanagement&action=changeemail" method="post" >
  866. <tr>
  867. <td style="border:0px;" >
  868. <div class="BigButton" style="background-image:url('.$layout_name.'/images/buttons/sbutton.gif)" >
  869. <div onMouseOver="MouseOverBigButton(this);" onMouseOut="MouseOutBigButton(this);" >
  870. <div class="BigButtonOver" style="background-image:url('.$layout_name.'/images/buttons/sbutton_over.gif);" ></div>
  871. <input class="ButtonText" type="image" name="Edit" alt="Edit" src="'.$layout_name.'/images/buttons/_sbutton_edit.gif" >
  872. </div>
  873. </div>
  874. </td>
  875. </tr>
  876. </form>
  877. </table>
  878. </div>
  879. </div>
  880. <div class="BoxFrameHorizontal" style="background-image:url('.$layout_name.'/images/content/box-frame-horizontal.gif);" /></div>
  881. <div class="BoxFrameEdgeRightBottom" style="background-image:url('.$layout_name.'/images/content/box-frame-edge.gif);" /></div>
  882. <div class="BoxFrameEdgeLeftBottom" style="background-image:url('.$layout_name.'/images/content/box-frame-edge.gif);" /></div>
  883. </div>
  884. </div>
  885. <br/><br/>';
  886. }
  887.  
  888. //REGISTRATION
  889. $main_content .= '
  890. <a name="Registration" ></a>
  891. <div class="TopButtonContainer" >
  892. <div class="TopButton" >
  893. <a href="#top" >
  894. <image style="border:0px;" src="'.$layout_name.'/images/content/back-to-top.gif" />
  895. </a>
  896. </div>
  897. </div>
  898. <div class="TableContainer" >
  899. <table class="Table5" cellpadding="0" cellspacing="0" >
  900. <div class="CaptionContainer" >
  901. <div class="CaptionInnerContainer" >
  902. <span class="CaptionEdgeLeftTop" style="background-image:url('.$layout_name.'/images/content/box-frame-edge.gif);" /></span>
  903. <span class="CaptionEdgeRightTop" style="background-image:url('.$layout_name.'/images/content/box-frame-edge.gif);" /></span>
  904. <span class="CaptionBorderTop" style="background-image:url('.$layout_name.'/images/content/table-headline-border.gif);" ></span>
  905. <span class="CaptionVerticalLeft" style="background-image:url('.$layout_name.'/images/content/box-frame-vertical.gif);" /></span>
  906. <div class="Text" >Registration</div>
  907. <span class="CaptionVerticalRight" style="background-image:url('.$layout_name.'/images/content/box-frame-vertical.gif);" /></span>
  908. <span class="CaptionBorderBottom" style="background-image:url('.$layout_name.'/images/content/table-headline-border.gif);" ></span>
  909. <span class="CaptionEdgeLeftBottom" style="background-image:url('.$layout_name.'/images/content/box-frame-edge.gif);" /></span>
  910. <span class="CaptionEdgeRightBottom" style="background-image:url('.$layout_name.'/images/content/box-frame-edge.gif);" /></span>
  911. </div>
  912. </div>
  913. <tr>
  914. <td>
  915. <div class="InnerTableContainer" >
  916. <table style="width:100%;" >
  917. <tr>
  918. <td>
  919. <div class="TableShadowContainerRightTop" >
  920. <div class="TableShadowRightTop" style="background-image:url('.$layout_name.'/images/content/table-shadow-rt.gif);" ></div>
  921. </div>
  922. <div class="TableContentAndRightShadow" style="background-image:url('.$layout_name.'/images/content/table-shadow-rm.gif);" >
  923. <div class="TableContentContainer" >
  924. <table class="TableContent" width="100%" >
  925. <tr>
  926. <td>
  927. <table style="width:100%;">
  928. <tr>
  929. <td class="LabelV" >Real Name:</td>
  930. <td style="width:90%;" >'.$account_rlname.'</td>
  931. </tr>
  932. <tr>
  933. <td class="LabelV" >Contact Email:</td>
  934. <td style="width:90%;" >'.$account_location.'</td>
  935. </tr>
  936. </table>
  937. </td>
  938. <td align=right>
  939. <table border="0" cellspacing="0" cellpadding="0" >
  940. <form action="?subtopic=accountmanagement&action=changeinfo" method="post" >
  941. <tr>
  942. <td style="border:0px;" >
  943. <div class="BigButton" style="background-image:url('.$layout_name.'/images/buttons/sbutton.gif)" >
  944. <div onMouseOver="MouseOverBigButton(this);" onMouseOut="MouseOutBigButton(this);" >
  945. <div class="BigButtonOver" style="background-image:url('.$layout_name.'/images/buttons/sbutton_over.gif);" ></div>
  946. <input class="ButtonText" type="image" name="Edit" alt="Edit" src="'.$layout_name.'/images/buttons/_sbutton_edit.gif" >
  947. </div>
  948. </div>
  949. </td>
  950. </tr>
  951. </form>
  952. </table>
  953. </td>
  954. </tr>
  955. </table>
  956. </div>
  957. </div>
  958. <div class="TableShadowContainer" >
  959. <div class="TableBottomShadow" style="background-image:url('.$layout_name.'/images/content/table-shadow-bm.gif);" >
  960. <div class="TableBottomLeftShadow" style="background-image:url('.$layout_name.'/images/content/table-shadow-bl.gif);" ></div>
  961. <div class="TableBottomRightShadow" style="background-image:url('.$layout_name.'/images/content/table-shadow-br.gif);" ></div>
  962. </div>
  963. </div>
  964. </td>
  965. </tr>
  966. </table>
  967. </div>
  968. </table>
  969. </div>
  970. </td>
  971. </tr><br/>';
  972. }
  973. //########### CHANGE PASSWORD ##########
  974. if($action == "changepassword") {
  975. $new_password = trim($_POST['newpassword']);
  976. $new_password2 = trim($_POST['newpassword2']);
  977. $old_password = trim($_POST['oldpassword']);
  978. if(empty($new_password) && empty($new_password2) && empty($old_password))
  979. {
  980. $main_content .= 'Please enter your current password and a new password. For your security, please enter the new password twice.<br/><br/><form action="?subtopic=accountmanagement&action=changepassword" method="post" ><div class="TableContainer" ><table class="Table1" 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" >Change Password</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 class="LabelV" ><span >New Password:</span></td><td style="width:90%;" ><input type="password" name="newpassword" size="30" maxlength="29" ></td></tr><tr><td class="LabelV" ><span >New Password Again:</span></td><td><input type="password" name="newpassword2" size="30" maxlength="29" ></td></tr><tr><td class="LabelV" ><span >Current Password:</span></td><td><input type="password" name="oldpassword" size="30" maxlength="29" ></td></tr></table> </div> </table></div></td></tr><br/><table style="width:100%;" ><tr align="center"><td><table border="0" cellspacing="0" cellpadding="0" ><tr><td style="border:0px;" ><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></td><td><table border="0" cellspacing="0" cellpadding="0" ><form action="?subtopic=accountmanagement" method="post" ><tr><td style="border:0px;" ><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="Back" alt="Back" src="'.$layout_name.'/images/buttons/_sbutton_back.gif" ></div></div></td></tr></form></table></td></tr></table>';
  981. }
  982. else
  983. {
  984. if(empty($new_password) || empty($new_password2) || empty($old_password))
  985. {
  986. $show_msgs[] = "Please fill in form.";
  987. }
  988. if($new_password != $new_password2)
  989. {
  990. $show_msgs[] = "The new passwords do not match!";
  991. }
  992. if(empty($show_msgs))
  993. {
  994. if(!check_password($new_password))
  995. {
  996. $show_msgs[] = "New password contains illegal chars (a-z, A-Z and 0-9 only!) or lenght.";
  997. }
  998. if(!$account_logged->isValidPassword($old_password))
  999. {
  1000. $show_msgs[] = "Current password is incorrect!";
  1001. }
  1002. }
  1003. if(!empty($show_msgs))
  1004. {
  1005. //show errors
  1006. $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/>';
  1007. foreach($show_msgs as $show_msg) {
  1008. $main_content .= '<li>'.$show_msg;
  1009. }
  1010. $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/>';
  1011. //show form
  1012. $main_content .= 'Please enter your current password and a new password. For your security, please enter the new password twice.<br/><br/><form action="?subtopic=accountmanagement&action=changepassword" method="post" ><div class="TableContainer" ><table class="Table1" 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" >Change Password</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 class="LabelV" ><span >New Password:</span></td><td style="width:90%;" ><input type="password" name="newpassword" size="30" maxlength="29" ></td></tr><tr><td class="LabelV" ><span >New Password Again:</span></td><td><input type="password" name="newpassword2" size="30" maxlength="29" ></td></tr><tr><td class="LabelV" ><span >Current Password:</span></td><td><input type="password" name="oldpassword" size="30" maxlength="29" ></td></tr></table> </div> </table></div></td></tr><br/><table style="width:100%;" ><tr align="center"><td><table border="0" cellspacing="0" cellpadding="0" ><tr><td style="border:0px;" ><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></td><td><table border="0" cellspacing="0" cellpadding="0" ><form action="?subtopic=accountmanagement" method="post" ><tr><td style="border:0px;" ><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="Back" alt="Back" src="'.$layout_name.'/images/buttons/_sbutton_back.gif" ></div></div></td></tr></form></table></td></tr></table>';
  1013. }
  1014. else
  1015. {
  1016. $org_pass = $new_password;
  1017. $account_logged->setPassword($new_password);
  1018. $account_logged->save();
  1019. $main_content .= '<div class="TableContainer" > <table class="Table1" 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" >Password Changed</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>Your password has been changed.';
  1020. if($config['site']['send_emails'] && $config['site']['send_mail_when_change_password'])
  1021. {
  1022. $mailBody = '<html>
  1023. <body>
  1024. <h3>Password to account changed!</h3>
  1025. <p>You or someone else changed password to your account on server <a href="'.$config['server']['url'].'"><b>'.htmlspecialchars($config['server']['serverName']).'</b></a>.</p>
  1026. <p>New password: <b>'.htmlspecialchars($org_pass).'</b></p>
  1027. </body>
  1028. </html>';
  1029. $mail = new PHPMailer();
  1030. if ($config['site']['smtp_enabled'])
  1031. {
  1032. $mail->IsSMTP();
  1033. $mail->Host = $config['site']['smtp_host'];
  1034. $mail->Port = (int)$config['site']['smtp_port'];
  1035. $mail->SMTPAuth = $config['site']['smtp_auth'];
  1036. $mail->Username = $config['site']['smtp_user'];
  1037. $mail->Password = $config['site']['smtp_pass'];
  1038. }
  1039. else
  1040. $mail->IsMail();
  1041. $mail->IsHTML(true);
  1042. $mail->From = $config['site']['mail_address'];
  1043. $mail->AddAddress($account_logged->getEMail());
  1044. $mail->Subject = $config['server']['serverName']." - Changed password";
  1045. $mail->Body = $mailBody;
  1046. if($mail->Send())
  1047. $main_content .= '<br /><small>Your new password were send on email address <b>'.htmlspecialchars($account_logged->getEMail()).'</b>.</small>';
  1048. else
  1049. $main_content .= '<br /><small>An error occorred while sending email with password!</small>';
  1050. }
  1051. $main_content .= '</td></tr> </table> </div> </table></div></td></tr><br/><center><table border="0" cellspacing="0" cellpadding="0" ><form action="?subtopic=accountmanagement" method="post" ><tr><td style="border:0px;" ><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="Back" alt="Back" src="'.$layout_name.'/images/buttons/_sbutton_back.gif" ></div></div></td></tr></form></table></center>';
  1052. $_SESSION['password'] = $new_password;
  1053. }
  1054. }
  1055. }
  1056.  
  1057. //############# CHANGE E-MAIL ###################
  1058. if($action == "changeemail")
  1059. {
  1060. $account_email_new_time = $account_logged->getCustomField("email_new_time");
  1061. if($account_email_new_time > 10) {$account_email_new = $account_logged->getCustomField("email_new"); }
  1062. if($account_email_new_time < 10)
  1063. {
  1064. if($_POST['changeemailsave'] == 1)
  1065. {
  1066. $account_email_new = trim($_POST['new_email']);
  1067. $post_password = trim($_POST['password']);
  1068. if(empty($account_email_new))
  1069. {
  1070. $change_email_errors[] = "Please enter your new email address.";
  1071. }
  1072. else
  1073. {
  1074. if(!check_mail($account_email_new))
  1075. {
  1076. $change_email_errors[] = "E-mail address is not correct.";
  1077. }
  1078. }
  1079. if(empty($post_password))
  1080. {
  1081. $change_email_errors[] = "Please enter password to your account.";
  1082. }
  1083. else
  1084. {
  1085. if(!$account_logged->isValidPassword($post_password))
  1086. {
  1087. $change_email_errors[] = "Wrong password to account.";
  1088. }
  1089. }
  1090. if(empty($change_email_errors))
  1091. {
  1092. $account_email_new_time = time() + $config['site']['email_days_to_change'] * 24 * 3600;
  1093. $account_logged->set("email_new", $account_email_new);
  1094. $account_logged->set("email_new_time", $account_email_new_time);
  1095. $account_logged->save();
  1096. $main_content .= '<div class="TableContainer" > <table class="Table1" 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" >New Email Address Requested</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>You have requested to change your email address to <b>'.htmlspecialchars($account_email_new).'</b>. The actual change will take place after <b>'.date("j F Y, G:i:s", $account_email_new_time).'</b>, during which you can cancel the request at any time.</td></tr> </table> </div> </table></div></td></tr><br/><center><table border="0" cellspacing="0" cellpadding="0" ><form action="?subtopic=accountmanagement" method="post" ><tr><td style="border:0px;" ><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="Back" alt="Back" src="'.$layout_name.'/images/buttons/_sbutton_back.gif" ></div></div></td></tr></form></table></center>';
  1097. }
  1098. else
  1099. {
  1100. //show errors
  1101. $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/>';
  1102. foreach($change_email_errors as $change_email_error)
  1103. {
  1104. $main_content .= '<li>'.$change_email_error.'</li>';
  1105. }
  1106. $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/>';
  1107. //show form
  1108. $main_content .= 'Please enter your password and the new email address. Make sure that you enter a valid email address which you have access to. <b>For security reasons, the actual change will be finalised after a waiting period of '.$config['site']['email_days_to_change'].' days.</b><br/><br/><form action="?subtopic=accountmanagement&action=changeemail" method="post" ><div class="TableContainer" > <table class="Table1" 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" >Change Email Address</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 class="LabelV" ><span >New Email Address:</span></td> <td style="width:90%;" ><input name="new_email" value="'.htmlspecialchars($_POST['new_email']).'" size="30" maxlength="50" ></td><tr></tr><td class="LabelV" ><span >Password:</span></td> <td><input type="password" name="password" size="30" maxlength="29" ></td></tr> </table> </div> </table></div></td></tr><br/><table style="width:100%;" ><tr align="center"><td><table border="0" cellspacing="0" cellpadding="0" ><tr><td style="border:0px;" ><input type="hidden" name=changeemailsave value=1 ><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></td><td><table border="0" cellspacing="0" cellpadding="0" ><form action="?subtopic=accountmanagement" method="post" ><tr><td style="border:0px;" ><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="Back" alt="Back" src="'.$layout_name.'/images/buttons/_sbutton_back.gif" ></div></div></td></tr></form></table></td></tr></table>';
  1109. }
  1110. }
  1111. else
  1112. {
  1113. $main_content .= 'Please enter your password and the new email address. Make sure that you enter a valid email address which you have access to. <b>For security reasons, the actual change will be finalised after a waiting period of '.$config['site']['email_days_to_change'].' days.</b><br/><br/><form action="?subtopic=accountmanagement&action=changeemail" method="post" ><div class="TableContainer" > <table class="Table1" 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" >Change Email Address</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 class="LabelV" ><span >New Email Address:</span></td> <td style="width:90%;" ><input name="new_email" value="'.htmlspecialchars($_POST['new_email']).'" size="30" maxlength="50" ></td><tr></tr><td class="LabelV" ><span >Password:</span></td> <td><input type="password" name="password" size="30" maxlength="29" ></td></tr> </table> </div> </table></div></td></tr><br/><table style="width:100%;" ><tr align="center"><td><table border="0" cellspacing="0" cellpadding="0" ><tr><td style="border:0px;" ><input type="hidden" name=changeemailsave value=1 ><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></td><td><table border="0" cellspacing="0" cellpadding="0" ><form action="?subtopic=accountmanagement" method="post" ><tr><td style="border:0px;" ><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="Back" alt="Back" src="'.$layout_name.'/images/buttons/_sbutton_back.gif" ></div></div></td></tr></form></table></td></tr></table>';
  1114. }
  1115. }
  1116. else
  1117. {
  1118. if($account_email_new_time < time())
  1119. {
  1120. if($_POST['changeemailsave'] == 1)
  1121. {
  1122. $account_logged->set("email_new", "");
  1123. $account_logged->set("email_new_time", 0);
  1124. $account_logged->setEmail($account_email_new);
  1125. $account_logged->save();
  1126. $main_content .= '<div class="TableContainer" > <table class="Table1" 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" >Email Address Change Accepted</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>You have accepted <b>'.htmlspecialchars($account_logged->getEmail()).'</b> as your new email adress.</td></tr> </table> </div> </table></div></td></tr><br/><center><table border="0" cellspacing="0" cellpadding="0" ><form action="?subtopic=accountmanagement" method="post" ><tr><td style="border:0px;" ><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="Back" alt="Back" src="'.$layout_name.'/images/buttons/_sbutton_back.gif" ></div></div></td></tr></form></table></center>';
  1127. }
  1128. else
  1129. {
  1130. $main_content .= '<div class="TableContainer" > <table class="Table1" 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" >Email Address Change Accepted</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>Do you accept <b>'.htmlspecialchars($account_email_new).'</b> as your new email adress?</td></tr> </table> </div> </table></div></td></tr><br /><table width="100%"><tr><td width="30">&nbsp;</td><td align=left><form action="?subtopic=accountmanagement&action=changeemail" method="post"><input type="hidden" name="changeemailsave" value=1 ><INPUT TYPE=image NAME="I Agree" SRC="'.$layout_name.'/images/buttons/sbutton_iagree.gif" BORDER=0 WIDTH=120 HEIGHT=17></FORM></td><td align=left><form action="?subtopic=accountmanagement&action=changeemail" method="post"><input type="hidden" name="emailchangecancel" value=1 ><input type=image name="Cancel" src="'.$layout_name.'/images/buttons/sbutton_cancel.gif" BORDER=0 WIDTH=120 HEIGHT=17></form></td><td align=right><form action="?subtopic=accountmanagement" method="post" ><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="Back" alt="Back" src="'.$layout_name.'/images/buttons/_sbutton_back.gif" ></div></div></form></td><td width="30">&nbsp;</td></tr></table>';
  1131. }
  1132. }
  1133. else
  1134. {
  1135. $main_content .= '<div class="TableContainer" > <table class="Table1" 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" >Change of Email Address</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>A request has been submitted to change the email address of this account to <b>'.htmlspecialchars($account_email_new).'</b>.<br/>The actual change will take place on <b>'.date("j F Y, G:i:s", $account_email_new_time).'</b>.<br>If you do not want to change your email address, please click on "Cancel".</td></tr> </table> </div> </table></div></td></tr><br/><table style="width:100%;" ><tr align="center"><td><table border="0" cellspacing="0" cellpadding="0" ><form action="?subtopic=accountmanagement&action=changeemail" method="post" ><tr><td style="border:0px;" ><input type="hidden" name="emailchangecancel" value=1 ><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="Cancel" alt="Cancel" src="'.$layout_name.'/images/buttons/_sbutton_cancel.gif" ></div></div></td></tr></form></table></td><td><table border="0" cellspacing="0" cellpadding="0" ><form action="?subtopic=accountmanagement" method="post" ><tr><td style="border:0px;" ><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="Back" alt="Back" src="'.$layout_name.'/images/buttons/_sbutton_back.gif" ></div></div></td></tr></form></table></td></tr></table>';
  1136. }
  1137. }
  1138. if($_POST['emailchangecancel'] == 1)
  1139. {
  1140. $account_logged->set("email_new", "");
  1141. $account_logged->set("email_new_time", 0);
  1142. $account_logged->save();
  1143. $main_content = '<div class="TableContainer" > <table class="Table1" 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" >Email Address Change Cancelled</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>Your request to change the email address of your account has been cancelled. The email address will not be changed.</td></tr> </table> </div> </table></div></td></tr><br/><center><table border="0" cellspacing="0" cellpadding="0" ><form action="?subtopic=accountmanagement" method="post" ><tr><td style="border:0px;" ><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="Back" alt="Back" src="'.$layout_name.'/images/buttons/_sbutton_back.gif" ></div></div></td></tr></form></table></center>';
  1144. }
  1145. }
  1146.  
  1147. //########### CHANGE PUBLIC INFORMATION (about account owner) ######################
  1148. if($action == "changeinfo") {
  1149. $new_rlname = htmlspecialchars(trim($_POST['info_rlname']));
  1150. $new_location = htmlspecialchars(trim($_POST['info_location']));
  1151. if($_POST['changeinfosave'] == 1) {
  1152. //save data from form
  1153. $account_logged->set("rlname", $new_rlname);
  1154. $account_logged->set("location", $new_location);
  1155. $account_logged->save();
  1156. $main_content .= '<div class="TableContainer" > <table class="Table1" 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" >Public Information Changed</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>Your public information has been changed.</td></tr> </table> </div> </table></div></td></tr><br><center><table border="0" cellspacing="0" cellpadding="0" ><form action="?subtopic=accountmanagement" method="post" ><tr><td style="border:0px;" ><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="Back" alt="Back" src="'.$layout_name.'/images/buttons/_sbutton_back.gif" ></div></div></td></tr></form></table></center>';
  1157. }
  1158. else
  1159. {
  1160. //show form
  1161. $account_rlname = $account_logged->getCustomField("rlname");
  1162. $account_location = $account_logged->getCustomField("location");
  1163. $main_content .= 'Here you can tell other players about yourself. This information will be displayed alongside the data of your characters. If you do not want to fill in a certain field, just leave it blank.<br/><br/><form action="?subtopic=accountmanagement&action=changeinfo" method=post><div class="TableContainer" > <table class="Table1" 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" >Change Public Information</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 class="LabelV" >Real Name:</td><td style="width:90%;" ><input name="info_rlname" value="'.$account_rlname.'" size="30" maxlength="50" ></td></tr><tr><td class="LabelV" >Contact Email:</td><td><input name="info_location" value="'.$account_location.'" size="30" maxlength="50" ></td></tr></table> </div> </table></div></td></tr><br/><table width="100%"><tr align="center"><td><table border="0" cellspacing="0" cellpadding="0" ><tr><td style="border:0px;" ><input type="hidden" name="changeinfosave" value="1" ><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></td><td><table border="0" cellspacing="0" cellpadding="0" ><form action="?subtopic=accountmanagement" method="post" ><tr><td style="border:0px;" ><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="Back" alt="Back" src="'.$layout_name.'/images/buttons/_sbutton_back.gif" ></div></div></td></tr></form></table></td></tr></table>';
  1164. }
  1165. }
  1166.  
  1167. //############## GENERATE RECOVERY KEY ###########
  1168. if($action == "registeraccount")
  1169. {
  1170. $reg_password = trim($_POST['reg_password']);
  1171. $old_key = $account_logged->getCustomField("key");
  1172. if($_POST['registeraccountsave'] == "1")
  1173. {
  1174. if($account_logged->isValidPassword($reg_password))
  1175. {
  1176. if(empty($old_key))
  1177. {
  1178. $dontshowtableagain = 1;
  1179. $acceptedChars = 'ABCDEFGHIJKLMNPQRSTUVWXYZ123456789';
  1180. $max = strlen($acceptedChars)-1;
  1181. $new_rec_key = NULL;
  1182. // 10 = number of chars in generated key
  1183. for($i=0; $i < 10; $i++) {
  1184. $cnum[$i] = $acceptedChars{mt_rand(0, $max)};
  1185. $new_rec_key .= $cnum[$i];
  1186. }
  1187. $account_logged->set("key", $new_rec_key);
  1188. $account_logged->save();
  1189. $main_content .= '<div class="TableContainer" > <table class="Table1" 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" >Account Registered</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%;" >Thank you for registering your account! You can now recover your account if you have lost access to the assigned email address by using the following<br/><br/><font size="5">&nbsp;&nbsp;&nbsp;<b>Recovery Key: '.htmlspecialchars($new_rec_key).'</b></font><br/><br/><br/><b>Important:</b><ul><li>Write down this recovery key carefully.</li><li>Store it at a safe place!</li>';
  1190. if($config['site']['send_emails'] && $config['site']['send_mail_when_generate_reckey'])
  1191. {
  1192. $mailBody = '<html>
  1193. <body>
  1194. <h3>New recovery key!</h3>
  1195. <p>You or someone else generated recovery key to your account on server <a href="'.$config['server']['url'].'"><b>'.htmlspecialchars($config['server']['serverName']).'</b></a>.</p>
  1196. <p>Recovery key: <b>'.htmlspecialchars($new_rec_key).'</b></p>
  1197. </body>
  1198. </html>';
  1199. $mail = new PHPMailer();
  1200. if ($config['site']['smtp_enabled'])
  1201. {
  1202. $mail->IsSMTP();
  1203. $mail->Host = $config['site']['smtp_host'];
  1204. $mail->Port = (int)$config['site']['smtp_port'];
  1205. $mail->SMTPAuth = $config['site']['smtp_auth'];
  1206. $mail->Username = $config['site']['smtp_user'];
  1207. $mail->Password = $config['site']['smtp_pass'];
  1208. }
  1209. else
  1210. $mail->IsMail();
  1211. $mail->IsHTML(true);
  1212. $mail->From = $config['site']['mail_address'];
  1213. $mail->AddAddress($account_logged->getEMail());
  1214. $mail->Subject = $config['server']['serverName']." - recovery key";
  1215. $mail->Body = $mailBody;
  1216. if($mail->Send())
  1217. $main_content .= '<br /><small>Your recovery key were send on email address <b>'.htmlspecialchars($account_logged->getEMail()).'</b>.</small>';
  1218. else
  1219. $main_content .= '<br /><small>An error occorred while sending email with recovery key! You will not receive e-mail with this key.</small>';
  1220. }
  1221. $main_content .= '</ul> </table> </div> </table></div></td></tr><br/><center><table border="0" cellspacing="0" cellpadding="0" ><form action="?subtopic=accountmanagement" method="post" ><tr><td style="border:0px;" ><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="Back" alt="Back" src="'.$layout_name.'/images/buttons/_sbutton_back.gif" ></div></div></td></tr></form></table></center>';
  1222. }
  1223. else
  1224. $reg_errors[] = 'Your account is already registred.';
  1225. }
  1226. else
  1227. $reg_errors[] = 'Wrong password to account.';
  1228. }
  1229. if($dontshowtableagain != 1)
  1230. {
  1231. //show errors if not empty
  1232. if(!empty($reg_errors))
  1233. {
  1234. $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/>';
  1235. foreach($reg_errors as $reg_error)
  1236. $main_content .= '<li>'.$reg_error;
  1237. $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/>';
  1238. }
  1239. //show form
  1240. $main_content .= 'To generate recovery key for your account please enter your password.<br/><br/><form action="?subtopic=accountmanagement&action=registeraccount" method="post" ><input type="hidden" name="registeraccountsave" value="1"><div class="TableContainer" > <table class="Table1" 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" >Generate recovery key</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 class="LabelV" ><span >Password:</td><td><input type="password" name="reg_password" size="30" maxlength="29" ></td></tr> </table> </div> </table></div></td></tr><br/><table style="width:100%" ><tr align="center" ><td><table border="0" cellspacing="0" cellpadding="0" ><tr><td style="border:0px;" ><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></td><td><table border="0" cellspacing="0" cellpadding="0" ><form action="?subtopic=accountmanagement" method="post" ><tr><td style="border:0px;" ><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="Back" alt="Back" src="'.$layout_name.'/images/buttons/_sbutton_back.gif" ></div></div></td></tr></form></table></td></tr></table>';
  1241. }
  1242. }
  1243.  
  1244. //############## GENERATE NEW RECOVERY KEY ###########
  1245. if($action == "newreckey")
  1246. {
  1247. $reg_password = trim($_POST['reg_password']);
  1248. $reckey = $account_logged->getCustomField("key");
  1249. if((!$config['site']['generate_new_reckey'] || !$config['site']['send_emails']) || empty($reckey))
  1250. $main_content .= 'You cant get new rec key';
  1251. else
  1252. {
  1253. $points = $account_logged->getCustomField('vip_time');
  1254. if($_POST['registeraccountsave'] == "1")
  1255. {
  1256. if($account_logged->isValidPassword($reg_password))
  1257. {
  1258. if($points >= $config['site']['generate_new_reckey_price'])
  1259. {
  1260. $dontshowtableagain = 1;
  1261. $acceptedChars = 'ABCDEFGHIJKLMNPQRSTUVWXYZ123456789';
  1262. $max = strlen($acceptedChars)-1;
  1263. $new_rec_key = NULL;
  1264. // 10 = number of chars in generated key
  1265. for($i=0; $i < 10; $i++) {
  1266. $cnum[$i] = $acceptedChars{mt_rand(0, $max)};
  1267. $new_rec_key .= $cnum[$i];
  1268. }
  1269. $main_content .= '<div class="TableContainer" > <table class="Table1" 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" >Account Registered</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%;" ><ul>';
  1270. $mailBody = '<html>
  1271. <body>
  1272. <h3>New recovery key!</h3>
  1273. <p>You or someone else generated recovery key to your account on server <a href="'.$config['server']['url'].'"><b>'.htmlspecialchars($config['server']['serverName']).'</b></a>.</p>
  1274. <p>Recovery key: <b>'.htmlspecialchars($new_rec_key).'</b></p>
  1275. </body>
  1276. </html>';
  1277. $mail = new PHPMailer();
  1278. if ($config['site']['smtp_enabled'])
  1279. {
  1280. $mail->IsSMTP();
  1281. $mail->Host = $config['site']['smtp_host'];
  1282. $mail->Port = (int)$config['site']['smtp_port'];
  1283. $mail->SMTPAuth = $config['site']['smtp_auth'];
  1284. $mail->Username = $config['site']['smtp_user'];
  1285. $mail->Password = $config['site']['smtp_pass'];
  1286. }
  1287. else
  1288. $mail->IsMail();
  1289. $mail->IsHTML(true);
  1290. $mail->From = $config['site']['mail_address'];
  1291. $mail->AddAddress($account_logged->getEMail());
  1292. $mail->Subject = $config['server']['serverName']." - new recovery key";
  1293. $mail->Body = $mailBody;
  1294. if($mail->Send())
  1295. {
  1296. $account_logged->set("key", $new_rec_key);
  1297. $account_logged->set("vip_time", $account_logged->get("vip_time")-$config['site']['generate_new_reckey_price']);
  1298. $account_logged->save();
  1299. $main_content .= '<br />Your recovery key were send on email address <b>'.htmlspecialchars($account_logged->getEMail()).'</b> for '.$config['site']['generate_new_reckey_price'].' premium points.';
  1300. }
  1301. else
  1302. $main_content .= '<br />An error occorred while sending email ( <b>'.htmlspecialchars($account_logged->getEMail()).'</b> ) with recovery key! Recovery key not changed. Try again.';
  1303. $main_content .= '</ul> </table> </div> </table></div></td></tr><br/><center><table border="0" cellspacing="0" cellpadding="0" ><form action="?subtopic=accountmanagement" method="post" ><tr><td style="border:0px;" ><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="Back" alt="Back" src="'.$layout_name.'/images/buttons/_sbutton_back.gif" ></div></div></td></tr></form></table></center>';
  1304. }
  1305. else
  1306. $reg_errors[] = 'You need '.$config['site']['generate_new_reckey_price'].' premium points to generate new recovery key. You have <b>'.$points.'<b> premium points.';
  1307. }
  1308. else
  1309. $reg_errors[] = 'Wrong password to account.';
  1310. }
  1311. if($dontshowtableagain != 1)
  1312. {
  1313. //show errors if not empty
  1314. if(!empty($reg_errors))
  1315. {
  1316. $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/>';
  1317. foreach($reg_errors as $reg_error)
  1318. $main_content .= '<li>'.$reg_error.'</li>';
  1319. $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/>';
  1320. }
  1321. //show form
  1322. $main_content .= 'To generate NEW recovery key for your account please enter your password.<br/><font color="red"><b>New recovery key cost '.$config['site']['generate_new_reckey_price'].' Premium Points.</font> You have '.$points.' premium points. You will receive e-mail with this recovery key.</b><br/><form action="?subtopic=accountmanagement&action=newreckey" method="post" ><input type="hidden" name="registeraccountsave" value="1"><div class="TableContainer" > <table class="Table1" 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" >Generate recovery key</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 class="LabelV" ><span >Password:</td><td><input type="password" name="reg_password" size="30" maxlength="29" ></td></tr> </table> </div> </table></div></td></tr><br/><table style="width:100%" ><tr align="center" ><td><table border="0" cellspacing="0" cellpadding="0" ><tr><td style="border:0px;" ><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></td><td><table border="0" cellspacing="0" cellpadding="0" ><form action="?subtopic=accountmanagement" method="post" ><tr><td style="border:0px;" ><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="Back" alt="Back" src="'.$layout_name.'/images/buttons/_sbutton_back.gif" ></div></div></td></tr></form></table></td></tr></table>';
  1323. }
  1324. }
  1325. }
  1326.  
  1327.  
  1328.  
  1329. //###### CHANGE CHARACTER COMMENT ######
  1330. if($action == "changecomment")
  1331. {
  1332. $player_name = $_REQUEST['name'];
  1333. $signature = htmlspecialchars(substr(trim($_POST['signature']),0,2000));
  1334. $new_comment = htmlspecialchars(substr(trim($_POST['comment']),0,2000));
  1335. $new_hideacc = (int) $_POST['accountvisible'];
  1336. if(check_name($player_name))
  1337. {
  1338. $player = new Player();
  1339. $player->find($player_name);
  1340. if($player->isLoaded())
  1341. {
  1342. $player_account = $player->getAccount();
  1343. if($account_logged->getId() == $player_account->getId())
  1344. {
  1345. if($_POST['changecommentsave'] == 1)
  1346. {
  1347. $player->set("hide_char", $new_hideacc);
  1348. $player->set("comment", $new_comment);
  1349. $player->set("signature", $signature);
  1350. $player->save();
  1351. $main_content .= '<div class="TableContainer" > <table class="Table1" 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" >Character Information Changed</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>The character information has been changed.</td></tr> </table> </div> </table></div></td></tr><br><center><table border="0" cellspacing="0" cellpadding="0" ><form action="?subtopic=accountmanagement" method="post" ><tr><td style="border:0px;" ><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="Back" alt="Back" src="'.$layout_name.'/images/buttons/_sbutton_back.gif" ></div></div></td></tr></form></table></center>';
  1352. }
  1353. else
  1354. {
  1355. $main_content .= '
  1356. Here you can see and edit the information about your character.<br/>If you do not want to specify a certain field, just leave it blank.<br/><br/>
  1357. <form action="?subtopic=accountmanagement&action=changecomment" method="post" >
  1358. <div class="TableContainer" >
  1359. <table class="Table5" cellpadding="0" cellspacing="0" >
  1360. <div class="CaptionContainer" >
  1361. <div class="CaptionInnerContainer" >
  1362. <span class="CaptionEdgeLeftTop" style="background-image:url('.$layout_name.'/images/content/box-frame-edge.gif);" /></span>
  1363. <span class="CaptionEdgeRightTop" style="background-image:url('.$layout_name.'/images/content/box-frame-edge.gif);" /></span>
  1364. <span class="CaptionBorderTop" style="background-image:url('.$layout_name.'/images/content/table-headline-border.gif);" ></span>
  1365. <span class="CaptionVerticalLeft" style="background-image:url('.$layout_name.'/images/content/box-frame-vertical.gif);" /></span>
  1366. <div class="Text" >Edit Character Information</div>
  1367. <span class="CaptionVerticalRight" style="background-image:url('.$layout_name.'/images/content/box-frame-vertical.gif);" /></span>
  1368. <span class="CaptionBorderBottom" style="background-image:url('.$layout_name.'/images/content/table-headline-border.gif);" ></span>
  1369. <span class="CaptionEdgeLeftBottom" style="background-image:url('.$layout_name.'/images/content/box-frame-edge.gif);" /></span>
  1370. <span class="CaptionEdgeRightBottom" style="background-image:url('.$layout_name.'/images/content/box-frame-edge.gif);" /></span>
  1371. </div>
  1372. </div>
  1373. <tr>
  1374. <td>
  1375. <div class="InnerTableContainer" >
  1376. <table style="width:100%;" >
  1377. <tr>
  1378. <td>
  1379. <div class="TableShadowContainerRightTop" >
  1380. <div class="TableShadowRightTop" style="background-image:url('.$layout_name.'/images/content/table-shadow-rt.gif);" ></div>
  1381. </div>
  1382. <div class="TableContentAndRightShadow" style="background-image:url('.$layout_name.'/images/content/table-shadow-rm.gif);" >
  1383. <div class="TableContentContainer" >
  1384. <table class="TableContent" width="100%" >
  1385. <tr>
  1386. <td class="LabelV" >Name:</td>
  1387. <td style="width:80%;" >'.htmlspecialchars($player_name).'</td>
  1388. </tr>
  1389. <tr>
  1390. <td class="LabelV" >Hide Account:</td><td>';
  1391. if($player->getCustomField("hide_char") == 1)
  1392. {
  1393. $main_content .= '
  1394. <input type="checkbox" name="accountvisible" value="1" checked="checked">';
  1395. }
  1396. else
  1397. {
  1398. $main_content .= '
  1399. <input type="checkbox" name="accountvisible" value="1" >';
  1400. }
  1401. $main_content .= '
  1402. check to hide your account information
  1403. </td>
  1404. </tr>
  1405. </table>
  1406. </div>
  1407. </div>
  1408. <div class="TableShadowContainer" >
  1409. <div class="TableBottomShadow" style="background-image:url('.$layout_name.'/images/content/table-shadow-bm.gif);" >
  1410. <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>
  1411. </div>
  1412. </td>
  1413. </tr>
  1414. <tr>
  1415. <td>
  1416. <div class="TableShadowContainerRightTop" >
  1417. <div class="TableShadowRightTop" style="background-image:url('.$layout_name.'/images/content/table-shadow-rt.gif);" ></div>
  1418. </div>
  1419. <div class="TableContentAndRightShadow" style="background-image:url('.$layout_name.'/images/content/table-shadow-rm.gif);" >
  1420. <div class="TableContentContainer" >
  1421. <table class="TableContent" width="100%" >
  1422. <tr>
  1423. <td class="LabelV" ><span >Comment:</span></td>
  1424. <td style="width:80%;" >
  1425. <textarea name="comment" rows="10" cols="50" wrap="virtual" >'.$player->getCustomField("comment").'</textarea><br>
  1426. </td>
  1427. </tr>
  1428. <tr>
  1429. <td class="LabelV" style="white-space:normal;" ><span >Forum Signature:</span></td>
  1430. <td style="width:80%;" >
  1431. <textarea name="signature" rows="4" cols="50" wrap="virtual" >'.$player->getCustomField("signature").'</textarea>
  1432. </td>
  1433. </tr>
  1434. </table>
  1435. </div>
  1436. </div>
  1437. <div class="TableShadowContainer" >
  1438. <div class="TableBottomShadow" style="background-image:url('.$layout_name.'/images/content/table-shadow-bm.gif);" >
  1439. <div class="TableBottomLeftShadow" style="background-image:url('.$layout_name.'/images/content/table-shadow-bl.gif);" ></div>
  1440. <div class="TableBottomRightShadow" style="background-image:url('.$layout_name.'/images/content/table-shadow-br.gif);" ></div>
  1441. </div>
  1442. </div>
  1443. </td>
  1444. </tr>
  1445. </td>
  1446. </tr>
  1447. </table>
  1448. </div>
  1449. </table>
  1450. </div>
  1451. </td>
  1452. </tr><br/>
  1453. <table style="width:100%" >
  1454. <tr align="center" >
  1455. <td>
  1456. <table border="0" cellspacing="0" cellpadding="0" >
  1457. <tr>
  1458. <td style="border:0px;" >
  1459. <input type="hidden" name="name" value="'.htmlspecialchars($player->getName()).'">
  1460. <input type="hidden" name="changecommentsave" value="1">
  1461. <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>
  1462. <input class="ButtonText" type="image" name="Submit" alt="Submit" src="'.$layout_name.'/images/buttons/_sbutton_submit.gif" >
  1463. </div>
  1464. </div>
  1465. </td>
  1466. <tr>
  1467. </form>
  1468. </table>
  1469. </td>
  1470. <td>
  1471. <table border="0" cellspacing="0" cellpadding="0" >
  1472. <form action="?subtopic=accountmanagement" method="post" >
  1473. <tr>
  1474. <td style="border:0px;" >
  1475. <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>
  1476. <input class="ButtonText" type="image" name="Back" alt="Back" src="'.$layout_name.'/images/buttons/_sbutton_back.gif" ></div></div>
  1477. </td>
  1478. </tr>
  1479.  
  1480. </form>
  1481. </table>
  1482. </td>
  1483. </tr>
  1484. </table>';
  1485. }
  1486. }
  1487. else
  1488. {
  1489. $main_content .= "Error. Character <b>".htmlspecialchars($player_name)."</b> is not on your account.";
  1490. }
  1491. }
  1492. else
  1493. {
  1494. $main_content .= "Error. Character with this name doesn't exist.";
  1495. }
  1496. }
  1497. else
  1498. {
  1499. $main_content .= "Error. Name contain illegal characters.";
  1500. }
  1501. }
  1502.  
  1503. //### DELETE character from account ###
  1504. if($action == "deletecharacter")
  1505. {
  1506. $player_name = trim($_POST['delete_name']);
  1507. $password_verify = trim($_POST['delete_password']);
  1508. if($_POST['deletecharactersave'] == 1)
  1509. {
  1510. if(!empty($player_name) && !empty($password_verify))
  1511. {
  1512. if(check_name($player_name))
  1513. {
  1514. $player = new Player();
  1515. $player->find($player_name);
  1516. if($player->isLoaded())
  1517. {
  1518. $player_account = $player->getAccount();
  1519. if($account_logged->getId() == $player_account->getId())
  1520. {
  1521. if($account_logged->isValidPassword($password_verify))
  1522. {
  1523. if(!$player->isOnline())
  1524. {
  1525. //dont show table "delete character" again
  1526. $dontshowtableagain = 1;
  1527. //delete player
  1528. $player->set('deleted', 1);
  1529. $player->save();
  1530. $main_content .= '
  1531. <div class="TableContainer" >
  1532. <table class="Table1" cellpadding="0" cellspacing="0" >
  1533. <div class="CaptionContainer" >
  1534. <div class="CaptionInnerContainer" >
  1535. <span class="CaptionEdgeLeftTop" style="background-image:url('.$layout_name.'/images/content/box-frame-edge.gif);" /></span>
  1536. <span class="CaptionEdgeRightTop" style="background-image:url('.$layout_name.'/images/content/box-frame-edge.gif);" /></span>
  1537. <span class="CaptionBorderTop" style="background-image:url('.$layout_name.'/images/content/table-headline-border.gif);" ></span>
  1538. <span class="CaptionVerticalLeft" style="background-image:url('.$layout_name.'/images/content/box-frame-vertical.gif);" /></span>
  1539. <div class="Text" >Character Deleted</div>
  1540. <span class="CaptionVerticalRight" style="background-image:url('.$layout_name.'/images/content/box-frame-vertical.gif);" /></span>
  1541. <span class="CaptionBorderBottom" style="background-image:url('.$layout_name.'/images/content/table-headline-border.gif);" ></span>
  1542. <span class="CaptionEdgeLeftBottom" style="background-image:url('.$layout_name.'/images/content/box-frame-edge.gif);" /></span>
  1543. <span class="CaptionEdgeRightBottom" style="background-image:url('.$layout_name.'/images/content/box-frame-edge.gif);" /></span>
  1544. </div>
  1545. </div>
  1546. <tr>
  1547. <td>
  1548. <div class="InnerTableContainer" >
  1549. <table style="width:100%;" >
  1550. <tr>
  1551. <td>The character <b>'.htmlspecialchars($player_name).'</b> has been deleted.</td>
  1552. </tr>
  1553. </table>
  1554. </div>
  1555. </table>
  1556. </div>
  1557. </td>
  1558. </tr>
  1559. <br>
  1560. <center>
  1561. <table border="0" cellspacing="0" cellpadding="0" >
  1562. <form action="?subtopic=accountmanagement" method="post" >
  1563. <tr>
  1564. <td style="border:0px;" >
  1565. <div class="BigButton" style="background-image:url('.$layout_name.'/images/buttons/sbutton.gif)" >
  1566. <div onMouseOver="MouseOverBigButton(this);" onMouseOut="MouseOutBigButton(this);" >
  1567. <div class="BigButtonOver" style="background-image:url('.$layout_name.'/images/buttons/sbutton_over.gif);" ></div>
  1568. <input class="ButtonText" type="image" name="Back" alt="Back" src="'.$layout_name.'/images/buttons/_sbutton_back.gif" >
  1569. </div>
  1570. </div>
  1571. </td>
  1572. </tr>
  1573. </form>
  1574. </table>
  1575. </center>';
  1576. }
  1577. else
  1578. $delete_errors[] = 'This character is online.';
  1579. }
  1580. else
  1581. {
  1582. $delete_errors[] = 'Wrong password to account.';
  1583. }
  1584. }
  1585. else
  1586. {
  1587. $delete_errors[] = 'Character <b>'.htmlspecialchars($player_name).'</b> is not on your account.';
  1588. }
  1589. }
  1590. else
  1591. {
  1592. $delete_errors[] = 'Character with this name doesn\'t exist.';
  1593. }
  1594. }
  1595. else
  1596. {
  1597. $delete_errors[] = 'Name contain illegal characters.';
  1598. }
  1599. }
  1600. else
  1601. {
  1602. $delete_errors[] = 'Character name or/and password is empty. Please fill in form.';
  1603. }
  1604. }
  1605. if($dontshowtableagain != 1)
  1606. {
  1607. if(!empty($delete_errors))
  1608. {
  1609. $main_content .= '
  1610. <div class="SmallBox" >
  1611. <div class="MessageContainer" >
  1612. <div class="BoxFrameHorizontal" style="background-image:url('.$layout_name.'/images/content/box-frame-horizontal.gif);" /></div>
  1613. <div class="BoxFrameEdgeLeftTop" style="background-image:url('.$layout_name.'/images/content/box-frame-edge.gif);" /></div>
  1614. <div class="BoxFrameEdgeRightTop" style="background-image:url('.$layout_name.'/images/content/box-frame-edge.gif);" /></div>
  1615. <div class="ErrorMessage" >
  1616. <div class="BoxFrameVerticalLeft" style="background-image:url('.$layout_name.'/images/content/box-frame-vertical.gif);" /></div>
  1617. <div class="BoxFrameVerticalRight" style="background-image:url('.$layout_name.'/images/content/box-frame-vertical.gif);" /></div>
  1618. <div class="AttentionSign" style="background-image:url('.$layout_name.'/images/content/attentionsign.gif);" /></div>
  1619. <b>The Following Errors Have Occurred:</b><br/>';
  1620. foreach($delete_errors as $delete_error)
  1621. {
  1622. $main_content .= '<li>'.$delete_error;
  1623. }
  1624. $main_content .= '
  1625. </div>
  1626. <div class="BoxFrameHorizontal" style="background-image:url('.$layout_name.'/images/content/box-frame-horizontal.gif);" /></div>
  1627. <div class="BoxFrameEdgeRightBottom" style="background-image:url('.$layout_name.'/images/content/box-frame-edge.gif);" /></div>
  1628. <div class="BoxFrameEdgeLeftBottom" style="background-image:url('.$layout_name.'/images/content/box-frame-edge.gif);" /></div>
  1629. </div>
  1630. </div><br/>';
  1631. }
  1632. $main_content .= 'To delete this character enter your password and click on "Submit". You can undelete the character within the first 2 months (60 days) after the deletion. After this time the character is deleted for good and cannot be restored anymore!.<br/><br/>
  1633. <form action="?subtopic=accountmanagement&action=deletecharacter" method="post" >
  1634. <input type="hidden" name="deletecharactersave" value="1">
  1635. <div class="TableContainer" >
  1636. <table class="Table1" cellpadding="0" cellspacing="0" >
  1637. <div class="CaptionContainer" >
  1638. <div class="CaptionInnerContainer" >
  1639. <span class="CaptionEdgeLeftTop" style="background-image:url('.$layout_name.'/images/content/box-frame-edge.gif);" /></span>
  1640. <span class="CaptionEdgeRightTop" style="background-image:url('.$layout_name.'/images/content/box-frame-edge.gif);" /></span>
  1641. <span class="CaptionBorderTop" style="background-image:url('.$layout_name.'/images/content/table-headline-border.gif);" ></span>
  1642. <span class="CaptionVerticalLeft" style="background-image:url('.$layout_name.'/images/content/box-frame-vertical.gif);" /></span>
  1643. <div class="Text" >Delete Character</div>
  1644. <span class="CaptionVerticalRight" style="background-image:url('.$layout_name.'/images/content/box-frame-vertical.gif);" /></span>
  1645. <span class="CaptionBorderBottom" style="background-image:url('.$layout_name.'/images/content/table-headline-border.gif);" ></span>
  1646. <span class="CaptionEdgeLeftBottom" style="background-image:url('.$layout_name.'/images/content/box-frame-edge.gif);" /></span>
  1647. <span class="CaptionEdgeRightBottom" style="background-image:url('.$layout_name.'/images/content/box-frame-edge.gif);" /></span>
  1648. </div>
  1649. </div>
  1650. <tr>
  1651. <td>
  1652. <div class="InnerTableContainer" >
  1653. <table style="width:100%;" >
  1654. <tr>
  1655. <td class="LabelV" ><span >Character Name:</td>
  1656. <td style="width:90%;" >
  1657. <input type="hidden" name="delete_name" value="'.$_GET['name'].'" size="30" maxlength="29" >
  1658. <p>'.$_GET['name'].'</p>
  1659. </td>
  1660. </tr>
  1661. <tr>
  1662. <td class="LabelV" ><span >Password:</td>
  1663. <td>
  1664. <input type="password" name="delete_password" size="30" maxlength="29" >
  1665. </td>
  1666. </tr>
  1667. </table>
  1668. </div>
  1669. </table>
  1670. </div>
  1671. </td>
  1672. </tr><br/>
  1673. <table style="width:100%" >
  1674. <tr align="center" >
  1675. <td>
  1676. <table border="0" cellspacing="0" cellpadding="0" >
  1677. <tr>
  1678. <td style="border:0px;" >
  1679. <div class="BigButton" style="background-image:url('.$layout_name.'/images/buttons/sbutton.gif)" >
  1680. <div onMouseOver="MouseOverBigButton(this);" onMouseOut="MouseOutBigButton(this);" >
  1681. <div class="BigButtonOver" style="background-image:url('.$layout_name.'/images/buttons/sbutton_over.gif);" ></div>
  1682. <input class="ButtonText" type="image" name="Submit" alt="Submit" src="'.$layout_name.'/images/buttons/_sbutton_submit.gif" >
  1683. </div>
  1684. </div>
  1685. </td>
  1686. <tr>
  1687. </form>
  1688. </table>
  1689. </td>
  1690. <td>
  1691. <table border="0" cellspacing="0" cellpadding="0" >
  1692. <form action="?subtopic=accountmanagement" method="post" >
  1693. <tr>
  1694. <td style="border:0px;" >
  1695. <div class="BigButton" style="background-image:url('.$layout_name.'/images/buttons/sbutton.gif)" >
  1696. <div onMouseOver="MouseOverBigButton(this);" onMouseOut="MouseOutBigButton(this);" >
  1697. <div class="BigButtonOver" style="background-image:url('.$layout_name.'/images/buttons/sbutton_over.gif);" ></div>
  1698. <input class="ButtonText" type="image" name="Back" alt="Back" src="'.$layout_name.'/images/buttons/_sbutton_back.gif" >
  1699. </div>
  1700. </div>
  1701. </td>
  1702. </tr>
  1703. </form>
  1704. </table>
  1705. </td>
  1706. </tr>
  1707. </table>';
  1708. }
  1709. }
  1710.  
  1711.  
  1712. //### UNDELETE character from account ###
  1713. if($action == "undelete")
  1714. {
  1715. $player_name = trim($_GET['name']);
  1716. if(!empty($player_name))
  1717. {
  1718. if(check_name($player_name))
  1719. {
  1720. $player = new Player();
  1721. $player->find($player_name);
  1722. if($player->isLoaded())
  1723. {
  1724. $player_account = $player->getAccount();
  1725. if($account_logged->getId() == $player_account->getId())
  1726. {
  1727. if(!$player->isOnline())
  1728. {
  1729. $player->set('deleted', 0);
  1730. $player->save();
  1731. $main_content .= '<div class="TableContainer" > <table class="Table1" 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" >Character Undeleted</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>The character <b>'.htmlspecialchars($player_name).'</b> has been undeleted.</td></tr> </table> </div> </table></div></td></tr><br><center><table border="0" cellspacing="0" cellpadding="0" ><form action="?subtopic=accountmanagement" method="post" ><tr><td style="border:0px;" ><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="Back" alt="Back" src="'.$layout_name.'/images/buttons/_sbutton_back.gif" ></div></div></td></tr></form></table></center>';
  1732. }
  1733. else
  1734. $delete_errors[] = 'This character is online.';
  1735. }
  1736. else
  1737. $delete_errors[] = 'Character <b>'.htmlspecialchars($player_name).'</b> is not on your account.';
  1738. }
  1739. else
  1740. $delete_errors[] = 'Character with this name doesn\'t exist.';
  1741. }
  1742. else
  1743. $delete_errors[] = 'Name contain illegal characters.';
  1744. }
  1745. }
  1746.  
  1747. //## CREATE CHARACTER on account ###
  1748. if($action == "createcharacter")
  1749. {
  1750. if(count($config['site']['worlds']) > 1)
  1751. {
  1752. if(isset($_REQUEST['world']))
  1753. $world_id = (int) $_REQUEST['world'];
  1754. }
  1755. else
  1756. $world_id = 0;
  1757. if(!isset($world_id))
  1758. {
  1759. $main_content .= 'Before you can create character you must select world: ';
  1760. foreach($config['site']['worlds'] as $id => $world_n)
  1761. $main_content .= '<br /><a href="?subtopic=accountmanagement&action=createcharacter&world='.$id.'">- '.htmlspecialchars($world_n).'</a>';
  1762. $main_content .= '<br /><h3><a href="?subtopic=accountmanagement">BACK</a></h3>';
  1763. }
  1764. else
  1765. {
  1766. $main_content .= '<script type="text/javascript">
  1767. var nameHttp;
  1768.  
  1769. function checkName()
  1770. {
  1771. if(document.getElementById("newcharname").value=="")
  1772. {
  1773. document.getElementById("name_check").innerHTML = \'<b><font color="red">Please enter new character name.</font></b>\';
  1774. return;
  1775. }
  1776. nameHttp=GetXmlHttpObject();
  1777. if (nameHttp==null)
  1778. {
  1779. return;
  1780. }
  1781. var newcharname = document.getElementById("newcharname").value;
  1782. var url="?subtopic=ajax_check_name&name=" + newcharname + "&uid="+Math.random();
  1783. nameHttp.onreadystatechange=NameStateChanged;
  1784. nameHttp.open("GET",url,true);
  1785. nameHttp.send(null);
  1786. }
  1787.  
  1788. function NameStateChanged()
  1789. {
  1790. if (nameHttp.readyState==4)
  1791. {
  1792. document.getElementById("name_check").innerHTML=nameHttp.responseText;
  1793. }
  1794. }
  1795. </script>';
  1796. $newchar_name = ucwords(strtolower(trim($_POST['newcharname'])));
  1797. $newchar_sex = $_POST['newcharsex'];
  1798. $newchar_vocation = $_POST['newcharvocation'];
  1799. $newchar_town = $_POST['newchartown'];
  1800. if($_POST['savecharacter'] != 1)
  1801. {
  1802. $main_content .= 'Please choose a name';
  1803. if(count($config['site']['newchar_vocations'][$world_id]) > 1)
  1804. $main_content .= ', vocation';
  1805. $main_content .= ' and sex for your character. <br/>In any case the name must not violate the naming conventions stated in the <a href="?subtopic=tibiarules" target="_blank" >'.htmlspecialchars($config['server']['serverName']).' Rules</a>, or your character might get deleted or name locked.';
  1806. if($account_logged->getPlayersList()->count() >= $config['site']['max_players_per_account'])
  1807. $main_content .= '<b><font color="red"> You have maximum number of characters per account on your account. Delete one before you make new.</font></b>';
  1808. $main_content .= '<br/><br/><form action="?subtopic=accountmanagement&action=createcharacter" method="post" ><input type="hidden" name="world" value="'.$world_id.'" ><input type="hidden" name=savecharacter value="1" ><div class="TableContainer" > <table class="Table3" 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 Character</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 class="LabelH" ><td style="width:50%;" ><span >Name</td><td><span >Sex</td></tr><tr class="Odd" ><td><input id="newcharname" name="newcharname" onkeyup="checkName();" value="'.htmlspecialchars($newchar_name).'" size="30" maxlength="29" ><BR><font size="1" face="verdana,arial,helvetica"><div id="name_check">Please enter your character name.</div></font></td><td>';
  1809. $main_content .= '<input type="radio" name="newcharsex" value="1" ';
  1810. if($newchar_sex == 1)
  1811. $main_content .= 'checked="checked" ';
  1812. $main_content .= '>male<br/>';
  1813. $main_content .= '<input type="radio" name="newcharsex" value="0" ';
  1814. if($newchar_sex == "0")
  1815. $main_content .= 'checked="checked" ';
  1816. $main_content .= '>female<br/></td></tr></table></div></div></table></div>';
  1817. if(count($config['site']['newchar_towns'][$world_id]) > 1 || count($config['site']['newchar_vocations'][$world_id]) > 1)
  1818. $main_content .= '<div class="InnerTableContainer" > <table style="width:100%;" ><tr>';
  1819. if(count($config['site']['newchar_vocations'][$world_id]) > 1)
  1820. {
  1821. $main_content .= '<td><table class="TableContent" width="100%" ><tr class="Odd" valign="top"><td width="160"><br /><b>Select your vocation:</b></td><td><table class="TableContent" width="100%" >';
  1822. foreach($config['site']['newchar_vocations'][$world_id] as $char_vocation_key => $sample_char)
  1823. {
  1824. $main_content .= '<tr><td><input type="radio" name="newcharvocation" value="'.$char_vocation_key.'" ';
  1825. if($newchar_vocation == $char_vocation_key)
  1826. $main_content .= 'checked="checked" ';
  1827. $main_content .= '>'.htmlspecialchars($vocation_name[0][$char_vocation_key]).'</td></tr>';
  1828. }
  1829. $main_content .= '</table></table></td>';
  1830. }
  1831. if(count($config['site']['newchar_towns'][$world_id]) > 1)
  1832. {
  1833. $main_content .= '<td><table class="TableContent" width="100%" ><tr class="Odd" valign="top"><td width="160"><br /><b>Select your city:</b></td><td><table class="TableContent" width="100%" >';
  1834. foreach($config['site']['newchar_towns'][$world_id] as $town_id)
  1835. {
  1836. $main_content .= '<tr><td><input type="radio" name="newchartown" value="'.$town_id.'" ';
  1837. if($newchar_town == $town_id)
  1838. $main_content .= 'checked="checked" ';
  1839. $main_content .= '>'.htmlspecialchars($towns_list[$world_id][$town_id]).'</td></tr>';
  1840. }
  1841. $main_content .= '</table></table></td>';
  1842. }
  1843. if(count($config['site']['newchar_towns'][$world_id]) > 1 || count($config['site']['newchar_vocations'][$world_id]) > 1)
  1844. $main_content .= '</tr></table></div>';
  1845. $main_content .= '</table></div></td></tr><br/><table style="width:100%;" ><tr align="center" ><td><table border="0" cellspacing="0" cellpadding="0" ><tr><td style="border:0px;" ><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></td><td><table border="0" cellspacing="0" cellpadding="0" ><form action="?subtopic=accountmanagement" method="post" ><tr><td style="border:0px;" ><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="Back" alt="Back" src="'.$layout_name.'/images/buttons/_sbutton_back.gif" ></div></div></td></tr></form></table></td></tr></table>';
  1846. }
  1847. else
  1848. {
  1849. if(empty($newchar_name))
  1850. $newchar_errors[] = 'Please enter a name for your character!';
  1851. if(empty($newchar_sex) && $newchar_sex != "0")
  1852. $newchar_errors[] = 'Please select the sex for your character!';
  1853. if(count($config['site']['newchar_vocations'][$world_id]) > 1)
  1854. {
  1855. if(empty($newchar_vocation))
  1856. $newchar_errors[] = 'Please select a vocation for your character.';
  1857. }
  1858. else
  1859. $newchar_vocation = $config['site']['newchar_vocations'][$world_id][0];
  1860. if(count($config['site']['newchar_towns'][$world_id]) > 1)
  1861. {
  1862. if(empty($newchar_town))
  1863. $newchar_errors[] = 'Please select a town for your character.';
  1864. }
  1865. else
  1866. $newchar_town = $config['site']['newchar_towns'][$world_id][0];
  1867. if(empty($newchar_errors))
  1868. {
  1869. if(!check_name_new_char($newchar_name))
  1870. $newchar_errors[] = 'This name contains invalid letters, words or format. Please use only a-Z, - , \' and space.';
  1871. if($newchar_sex != 1 && $newchar_sex != "0")
  1872. $newchar_errors[] = 'Sex must be equal <b>0 (female)</b> or <b>1 (male)</b>.';
  1873. if(count($config['site']['newchar_vocations'][$world_id]) > 1)
  1874. {
  1875. $newchar_vocation_check = FALSE;
  1876. foreach($config['site']['newchar_vocations'][$world_id] as $char_vocation_key => $sample_char)
  1877. if($newchar_vocation == $char_vocation_key)
  1878. $newchar_vocation_check = TRUE;
  1879. if(!$newchar_vocation_check)
  1880. $newchar_errors[] = 'Unknown vocation. Please fill in form again.';
  1881. }
  1882. else
  1883. $newchar_vocation = 0;
  1884. }
  1885. if(empty($newchar_errors))
  1886. {
  1887. $check_name_in_database = new Player();
  1888. $check_name_in_database->find($newchar_name);
  1889. if($check_name_in_database->isLoaded())
  1890. $newchar_errors[] .= 'This name is already used. Please choose another name!';
  1891. $number_of_players_on_account = $account_logged->getPlayersList()->count();
  1892. if($number_of_players_on_account >= $config['site']['max_players_per_account'])
  1893. $newchar_errors[] .= 'You have too many characters on your account <b>('.$number_of_players_on_account.'/'.$config['site']['max_players_per_account'].')</b>!';
  1894. }
  1895. if(empty($newchar_errors))
  1896. {
  1897. $char_to_copy_name = $config['site']['newchar_vocations'][$world_id][$newchar_vocation];
  1898. $char_to_copy = new Player();
  1899. $char_to_copy->find($char_to_copy_name);
  1900. if(!$char_to_copy->isLoaded())
  1901. $newchar_errors[] .= 'Wrong characters configuration. Try again or contact with admin. ADMIN: Edit file config/config.php and set valid characters to copy names. Character to copy <b>'.htmlspecialchars($char_to_copy_name).'</b> doesn\'t exist.';
  1902. }
  1903. if(empty($newchar_errors))
  1904. {
  1905. // load items and skills of player before we change ID
  1906. $char_to_copy->getItems()->load();
  1907. $char_to_copy->loadSkills();
  1908.  
  1909. if($newchar_sex == "0")
  1910. $char_to_copy->setLookType(136);
  1911. $char_to_copy->setID(null); // save as new character
  1912. $char_to_copy->setLastIP(0);
  1913. $char_to_copy->setLastLogin(0);
  1914. $char_to_copy->setLastLogout(0);
  1915. $char_to_copy->setName($newchar_name);
  1916. $char_to_copy->setAccount($account_logged);
  1917. $char_to_copy->setSex($newchar_sex);
  1918. $char_to_copy->setTown($newchar_town);
  1919. $char_to_copy->setPosX(0);
  1920. $char_to_copy->setPosY(0);
  1921. $char_to_copy->setPosZ(0);
  1922. $char_to_copy->setWorldID((int) $world_id);
  1923. $char_to_copy->setCreateIP(Visitor::getIP());
  1924. $char_to_copy->setCreateDate(time());
  1925. $char_to_copy->setSave(); // make character saveable
  1926. $char_to_copy->save(); // now it will load 'id' of new player
  1927. if($char_to_copy->isLoaded())
  1928. {
  1929. $char_to_copy->saveItems();
  1930. $char_to_copy->saveSkills();
  1931. $main_content .= '<div class="TableContainer" > <table class="Table1" 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" >Character Created</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>The character <b>'.htmlspecialchars($newchar_name).'</b> has been created.<br/>Please select the outfit when you log in for the first time.<br/><br/><b>See you on '.$config['server']['serverName'].'!</b></td></tr> </table> </div> </table></div></td></tr><br/><center><table border="0" cellspacing="0" cellpadding="0" ><form action="?subtopic=accountmanagement" method="post" ><tr><td style="border:0px;" ><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="Back" alt="Back" src="'.$layout_name.'/images/buttons/_sbutton_back.gif" ></div></div></td></tr></form></table></center>';
  1932. }
  1933. else
  1934. {
  1935. echo "Error. Can\'t create character. Probably problem with database. Try again or contact with admin.";
  1936. exit;
  1937. }
  1938. }
  1939. else
  1940. {
  1941. $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/>';
  1942. foreach($newchar_errors as $newchar_error)
  1943. $main_content .= '<li>'.$newchar_error;
  1944. $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/>';
  1945. $main_content .= 'Please choose a name';
  1946. if(count($config['site']['newchar_vocations'][$world_id]) > 1)
  1947. $main_content .= ', vocation';
  1948. $main_content .= ' and sex for your character. <br/>In any case the name must not violate the naming conventions stated in the <a href="?subtopic=tibiarules" target="_blank" >'.$config['server']['serverName'].' Rules</a>, or your character might get deleted or name locked.<br/><br/><form action="?subtopic=accountmanagement&action=createcharacter" method="post" ><input type="hidden" name="world" value="'.$world_id.'" ><input type="hidden" name=savecharacter value="1" ><div class="TableContainer" > <table class="Table3" 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 Character</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 class="LabelH" ><td style="width:50%;" ><span >Name</td><td><span >Sex</td></tr><tr class="Odd" ><td><input id="newcharname" name="newcharname" onkeyup="checkName();" value="'.$newchar_name.'" size="30" maxlength="29" ><BR><font size="1" face="verdana,arial,helvetica"><div id="name_check">Please enter your character name.</div></font></td><td>';
  1949. $main_content .= '<input type="radio" name="newcharsex" value="1" ';
  1950. if($newchar_sex == 1)
  1951. $main_content .= 'checked="checked" ';
  1952. $main_content .= '>male<br/>';
  1953. $main_content .= '<input type="radio" name="newcharsex" value="0" ';
  1954. if($newchar_sex == "0")
  1955. $main_content .= 'checked="checked" ';
  1956. $main_content .= '>female<br/></td></tr></table></div></div></table></div>';
  1957. if(count($config['site']['newchar_towns'][$world_id]) > 1 || count($config['site']['newchar_vocations'][$world_id]) > 1)
  1958. $main_content .= '<div class="InnerTableContainer" > <table style="width:100%;" ><tr>';
  1959. if(count($config['site']['newchar_vocations'][$world_id]) > 1)
  1960. {
  1961. $main_content .= '<td><table class="TableContent" width="100%" ><tr class="Odd" valign="top"><td width="160"><br /><b>Select your vocation:</b></td><td><table class="TableContent" width="100%" >';
  1962. foreach($config['site']['newchar_vocations'][$world_id] as $char_vocation_key => $sample_char)
  1963. {
  1964. $main_content .= '<tr><td><input type="radio" name="newcharvocation" value="'.htmlspecialchars($char_vocation_key).'" ';
  1965. if($newchar_vocation == $char_vocation_key)
  1966. $main_content .= 'checked="checked" ';
  1967. $main_content .= '>'.htmlspecialchars($vocation_name[0][$char_vocation_key]).'</td></tr>';
  1968. }
  1969. $main_content .= '</table></table></td>';
  1970. }
  1971. if(count($config['site']['newchar_towns'][$world_id]) > 1)
  1972. {
  1973. $main_content .= '<td><table class="TableContent" width="100%" ><tr class="Odd" valign="top"><td width="160"><br /><b>Select your city:</b></td><td><table class="TableContent" width="100%" >';
  1974. foreach($config['site']['newchar_towns'][$world_id] as $town_id)
  1975. {
  1976. $main_content .= '<tr><td><input type="radio" name="newchartown" value="'.htmlspecialchars($town_id).'" ';
  1977. if($newchar_town == $town_id)
  1978. $main_content .= 'checked="checked" ';
  1979. $main_content .= '>'.htmlspecialchars($towns_list[$world_id][$town_id]).'</td></tr>';
  1980. }
  1981. $main_content .= '</table></table></td>';
  1982. }
  1983. if(count($config['site']['newchar_towns'][$world_id]) > 1 || count($config['site']['newchar_vocations'][$world_id]) > 1)
  1984. $main_content .= '</tr></table></div>';
  1985. $main_content .= '</table></div></td></tr><br/><table style="width:100%;" ><tr align="center" ><td><table border="0" cellspacing="0" cellpadding="0" ><tr><td style="border:0px;" ><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></td><td><table border="0" cellspacing="0" cellpadding="0" ><form action="?subtopic=accountmanagement" method="post" ><tr><td style="border:0px;" ><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="Back" alt="Back" src="'.$layout_name.'/images/buttons/_sbutton_back.gif" ></div></div></td></tr></form></table></td></tr></table>';
  1986. }
  1987. }
  1988. }
  1989. }
  1990. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement