Advertisement
Guest User

Untitled

a guest
Mar 20th, 2016
89
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 24.06 KB | None | 0 0
  1. <?php
  2. /*
  3. ##########################################################################
  4. # #
  5. # Version 4 / / / #
  6. # -----------__---/__---__------__----__---/---/- #
  7. # | /| / /___) / ) (_ ` / ) /___) / / #
  8. # _|/_|/__(___ _(___/_(__)___/___/_(___ _/___/___ #
  9. # Free Content / Management System #
  10. # / #
  11. # #
  12. # #
  13. # Copyright 2005-2010 by webspell.org #
  14. # #
  15. # visit webSPELL.org, webspell.info to get webSPELL for free #
  16. # - Script runs under the GNU GENERAL PUBLIC LICENSE #
  17. # - It's NOT allowed to remove this copyright-tag #
  18. # -- http://www.fsf.org/licensing/licenses/gpl.html #
  19. # #
  20. # Code based on WebSPELL Clanpackage (Michael Gruber - webspell.at), #
  21. # Far Development by Development Team - webspell.org #
  22. # #
  23. # visit webspell.org #
  24. # #
  25. ##########################################################################
  26. */
  27.  
  28. $_language->read_module('myprofile');
  29.  
  30. if(!$userID) echo $_language->module['not_logged_in'];
  31.  
  32. else {
  33.  
  34. $showerror = '';
  35. eval ("\$title_myprofile = \"".gettemplate("title_myprofile")."\";");
  36. echo $title_myprofile;
  37.  
  38. if(isset($_POST['submit'])) {
  39. $nickname = htmlspecialchars(mb_substr(trim($_POST['nickname']), 0, 30));
  40. if(isset($_POST['mail'])) $mail = $_POST['mail'];
  41. else $mail="";
  42. if(isset($_POST['mail_hide'])) $mail_hide = true;
  43. else $mail_hide = false;
  44. $usernamenew = mb_substr(trim($_POST['usernamenew']), 0, 30);
  45. $usertext = $_POST['usertext'];
  46. $firstname = $_POST['firstname'];
  47. $lastname = $_POST['lastname'];
  48. $b_day = $_POST['b_day'];
  49. $b_month = $_POST['b_month'];
  50. $b_year = $_POST['b_year'];
  51. $sex = $_POST['sex'];
  52. $flag = $_POST['flag'];
  53. $town = $_POST['town'];
  54. $icq = $_POST['icq'];
  55. $icq = str_replace('-','',$icq); // Replace -
  56. $about = $_POST['messageabout'];
  57. $clantag = $_POST['clantag'];
  58. $clanname = $_POST['clanname'];
  59. $clanhp = $_POST['clanhp'];
  60. $clanirc = $_POST['clanirc'];
  61. $clanhistory = $_POST['clanhistory'];
  62. $cpu = $_POST['cpu'];
  63. $mainboard = $_POST['mainboard'];
  64. $monitor = $_POST['monitor'];
  65. $ram = $_POST['ram'];
  66. $graphiccard = $_POST['graphiccard'];
  67. $soundcard = $_POST['soundcard'];
  68. $connection = $_POST['connection'];
  69. $keyboard = $_POST['keyboard'];
  70. $mouse = $_POST['mouse'];
  71. $mousepad = $_POST['mousepad'];
  72. $newsletter = $_POST['newsletter'];
  73. $homepage = str_replace('http://', '', $_POST['homepage']);
  74. $pm_mail = $_POST['pm_mail'];
  75. $avatar = $_FILES['avatar'];
  76. $userpic = $_FILES['userpic'];
  77. $language = $_POST['language'];
  78. $id = $userID;
  79.  
  80. $error_array = array();
  81.  
  82. if(isset($_POST['userID']) or isset($_GET['userID']) or $userID=="") die($_language->module['not_logged_in']);
  83.  
  84. if(isset($_POST['delavatar'])) {
  85. $filepath = "./images/avatars/";
  86. if(file_exists($filepath.$id.'.gif')) @unlink($filepath.$id.'.gif');
  87. if(file_exists($filepath.$id.'.jpg')) @unlink($filepath.$id.'.jpg');
  88. if(file_exists($filepath.$id.'.png')) @unlink($filepath.$id.'.png');
  89. safe_query("UPDATE ".PREFIX."user SET avatar='' WHERE userID='".$id."'");
  90. }
  91. if(isset($_POST['deluserpic'])) {
  92. $filepath = "./images/userpics/";
  93. if(file_exists($filepath.$id.'.gif')) @unlink($filepath.$id.'.gif');
  94. if(file_exists($filepath.$id.'.jpg')) @unlink($filepath.$id.'.jpg');
  95. if(file_exists($filepath.$id.'.png')) @unlink($filepath.$id.'.png');
  96. safe_query("UPDATE ".PREFIX."user SET userpic='' WHERE userID='".$id."'");
  97. }
  98.  
  99. //avatar
  100. $filepath = "./images/avatars/";
  101. if($avatar['name'] != "" or ($_POST['avatar_url'] != "" and $_POST['avatar_url'] != "http://")) {
  102. if($avatar['name'] != "") {
  103. move_uploaded_file($avatar['tmp_name'], $filepath.$avatar['name'].".tmp");
  104. }
  105. else {
  106. $avatar['name'] = strrchr($_POST['avatar_url'],"/");
  107. if(!copy($_POST['avatar_url'],$filepath.$avatar['name'].".tmp")) {
  108. $error_array['can_not_copy'] = $_language->module['can_not_copy'];
  109. }
  110. }
  111. if(!array_key_exists('can_not_copy', $error_array))
  112. {
  113. @chmod($filepath.$avatar['name'].".tmp", $new_chmod);
  114. $info = getimagesize($filepath.$avatar['name'].".tmp");
  115. if($info[0] < 91 && $info[1] < 91) {
  116. $pic = '';
  117. if($info[2] == 1) $pic=$id.'.gif';
  118. elseif($info[2] == 2) $pic=$id.'.jpg';
  119. elseif($info[2] == 3) $pic=$id.'.png';
  120. if($pic != "") {
  121. if(file_exists($filepath.$id.'.gif')) @unlink($filepath.$id.'.gif');
  122. if(file_exists($filepath.$id.'.jpg')) @unlink($filepath.$id.'.jpg');
  123. if(file_exists($filepath.$id.'.png')) @unlink($filepath.$id.'.png');
  124. rename($filepath.$avatar['name'].'.tmp', $filepath.$pic);
  125. safe_query("UPDATE ".PREFIX."user SET avatar='".$pic."' WHERE userID='".$id."'");
  126. }
  127. else {
  128. if(unlink($filepath.$avatar['name'].".tmp")) {
  129. $error_array[] = $_language->module['invalid_picture-format'];
  130. }
  131. else {
  132. $error_array[] = $_language->module['upload_failed'];
  133. }
  134. }
  135. }
  136. else {
  137. $pic = '';
  138. if($info[2] == 1) $pic=$id.'.gif';
  139. elseif($info[2] == 2) $pic=$id.'.jpg';
  140. elseif($info[2] == 3) $pic=$id.'.png';
  141. if($pic != "") {
  142. if(file_exists($filepath.$id.'.gif')) @unlink($filepath.$id.'.gif');
  143. if(file_exists($filepath.$id.'.jpg')) @unlink($filepath.$id.'.jpg');
  144. if(file_exists($filepath.$id.'.png')) @unlink($filepath.$id.'.png');
  145. rename($filepath.$avatar['name'].'.tmp', $filepath.$pic);
  146. $image = $filepath.$pic;
  147. $destination = $image;
  148. $max_width = 90;
  149. $max_height = 90;
  150. $picsize = getimagesize($image);
  151. $source_width = $picsize[0];
  152. $source_height = $picsize[1];
  153. $filetype = strtolower(strrchr($pic, "."));
  154. if ($filetype == ".jpeg" || $filetype == ".jpg") {
  155. $source_image = imagecreatefromjpeg($image);
  156. } elseif ($filetype == ".gif") {
  157. $source_image = imagecreatefromgif($image);
  158. } elseif ($filetype == ".png") {
  159. $source_image = imagecreatefrompng($image);
  160. }
  161. if ($source_width > $max_width) {
  162. $conversion = $max_width/$source_width;
  163. $destination_width = $max_width;
  164. $destination_height = ceil($source_height*$conversion);
  165. } elseif ($source_height > $max_height) {
  166. $conversion = $max_height/$source_height;
  167. $destination_height = $max_height;
  168. $destination_width = ceil($source_width*$conversion);
  169. } else {
  170. $destination_width = $source_width;
  171. $destination_height = $source_height;
  172. }
  173. if ($destination_width > $max_width) {
  174. $conversion = $max_width/$destination_width;
  175. $destination_width = $max_width;
  176. $destination_height = ceil($destination_height*$conversion);
  177. } elseif ($destination_height > $max_height) {
  178. $conversion = $max_height/$destination_height;
  179. $destination_height = $max_height;
  180. $destination_width = ceil($destination_width*$conversion);
  181. } else {
  182. $destination_width = $destination_width;
  183. $destination_height = $destination_height;
  184. }
  185. $destination_image = imagecreatetruecolor($destination_width, $destination_height);
  186. imagecopyresized($destination_image, $source_image, 0, 0, 0, 0, $destination_width, $destination_height, $source_width, $source_height);
  187. if ($filetype == ".jpeg" || $filetype == ".jpg") {
  188. imagejpeg($destination_image, "$destination", 100);
  189. } elseif ($filetype == ".gif") {
  190. imagegif($destination_image, "$destination", 100);
  191. } elseif ($filetype == ".png") {
  192. imagepng($destination_image, "$destination");
  193. }
  194. safe_query("UPDATE ".PREFIX."user SET avatar='".$pic."' WHERE userID='".$id."'");
  195. }
  196. else {
  197. if(unlink($filepath.$avatar['name'].".tmp")) {
  198. $error_array[] = $_language->module['invalid_picture-format'];
  199. }
  200. else {
  201. $error_array[] = $_language->module['upload_failed'];
  202. }
  203. }
  204. }
  205. }
  206. }
  207.  
  208. //userpic
  209. $filepath = "./images/userpics/";
  210. if($userpic['name'] != "" or ($_POST['userpic_url'] != "" and $_POST['userpic_url'] != "http://")) {
  211. if($userpic['name'] != "") {
  212. move_uploaded_file($userpic['tmp_name'], $filepath.$userpic['name'].".tmp");
  213. } else {
  214. $userpic['name'] = strrchr($_POST['userpic_url'],"/");
  215. if(!copy($_POST['userpic_url'],$filepath.$userpic['name'].".tmp")) {
  216. $error_array['can_not_copy'] = $_language->module['can_not_copy'];
  217. }
  218. }
  219. if(!array_key_exists('can_not_copy', $error_array))
  220. {
  221. @chmod($filepath.$userpic['name'].".tmp", $new_chmod);
  222. $info = getimagesize($filepath.$userpic['name'].".tmp");
  223. if($info[0] < 231 && $info[1] < 211) {
  224. $pic = '';
  225. if($info[2] == 1) $pic=$id.'.gif';
  226. elseif($info[2] == 2) $pic=$id.'.jpg';
  227. elseif($info[2] == 3) $pic=$id.'.png';
  228. if($pic != "") {
  229. if(file_exists($filepath.$id.'.gif')) @unlink($filepath.$id.'.gif');
  230. if(file_exists($filepath.$id.'.jpg')) @unlink($filepath.$id.'.jpg');
  231. if(file_exists($filepath.$id.'.png')) @unlink($filepath.$id.'.png');
  232. rename($filepath.$userpic['name'].".tmp", $filepath.$pic);
  233. safe_query("UPDATE ".PREFIX."user SET userpic='".$pic."' WHERE userID='".$id."'");
  234. }
  235. else {
  236. if(unlink($filepath.$userpic['name'].".tmp")) {
  237. $error_array[] = $_language->module['invalid_picture-format'];
  238. }
  239. else {
  240. $error_array[] = $_language->module['upload_failed'];
  241. }
  242. }
  243. }
  244. else {
  245. $pic = '';
  246. if($info[2] == 1) $pic=$id.'.gif';
  247. elseif($info[2] == 2) $pic=$id.'.jpg';
  248. elseif($info[2] == 3) $pic=$id.'.png';
  249. if($pic != "") {
  250. if(file_exists($filepath.$id.'.gif')) @unlink($filepath.$id.'.gif');
  251. if(file_exists($filepath.$id.'.jpg')) @unlink($filepath.$id.'.jpg');
  252. if(file_exists($filepath.$id.'.png')) @unlink($filepath.$id.'.png');
  253. rename($filepath.$userpic['name'].".tmp", $filepath.$pic);
  254. $image = $filepath.$pic;
  255. $destination = $image;
  256. $max_width = 230;
  257. $max_height = 210;
  258. $picsize = getimagesize($image);
  259. $source_width = $picsize[0];
  260. $source_height = $picsize[1];
  261. $filetype = strtolower(strrchr($pic, "."));
  262. if ($filetype == ".jpeg" || $filetype == ".jpg") {
  263. $source_image = imagecreatefromjpeg($image);
  264. } elseif ($filetype == ".gif") {
  265. $source_image = imagecreatefromgif($image);
  266. } elseif ($filetype == ".png") {
  267. $source_image = imagecreatefrompng($image);
  268. }
  269. if ($source_width > $max_width) {
  270. $conversion = $max_width/$source_width;
  271. $destination_width = $max_width;
  272. $destination_height = ceil($source_height*$conversion);
  273. } elseif ($source_height > $max_height) {
  274. $conversion = $max_height/$source_height;
  275. $destination_height = $max_height;
  276. $destination_width = ceil($source_width*$conversion);
  277. } else {
  278. $destination_width = $source_width;
  279. $destination_height = $source_height;
  280. }
  281. if ($destination_width > $max_width) {
  282. $conversion = $max_width/$destination_width;
  283. $destination_width = $max_width;
  284. $destination_height = ceil($destination_height*$conversion);
  285. } elseif ($destination_height > $max_height) {
  286. $conversion = $max_height/$destination_height;
  287. $destination_height = $max_height;
  288. $destination_width = ceil($destination_width*$conversion);
  289. } else {
  290. $destination_width = $destination_width;
  291. $destination_height = $destination_height;
  292. }
  293. $destination_image = imagecreatetruecolor($destination_width, $destination_height);
  294. imagecopyresized($destination_image, $source_image, 0, 0, 0, 0, $destination_width, $destination_height, $source_width, $source_height);
  295. if ($filetype == ".jpeg" || $filetype == ".jpg") {
  296. imagejpeg($destination_image, "$destination", 100);
  297. } elseif ($filetype == ".gif") {
  298. imagegif($destination_image, "$destination", 100);
  299. } elseif ($filetype == ".png") {
  300. imagepng($destination_image, "$destination");
  301. }
  302. safe_query("UPDATE ".PREFIX."user SET userpic='".$pic."' WHERE userID='".$id."'");
  303. }
  304. else {
  305. if(unlink($filepath.$userpic['name'].".tmp")) {
  306. $error_array[] = $_language->module['invalid_picture-format'];
  307. }
  308. else {
  309. $error_array[] = $_language->module['upload_failed'];
  310. }
  311. }
  312. }
  313. }
  314. }
  315.  
  316. $birthday = $b_year.'-'.$b_month.'-'.$b_day;
  317.  
  318. $qry = "SELECT userID FROM ".PREFIX."user WHERE username = '".$usernamenew."' AND userID != ".$userID." LIMIT 0,1";
  319. if(mysql_num_rows(safe_query($qry))) {
  320. $error_array[] = $_language->module['username_aleady_in_use'];
  321. }
  322.  
  323. $qry = "SELECT userID FROM ".PREFIX."user WHERE nickname = '".$nickname."' AND userID!=".$userID." LIMIT 0,1";
  324. if(mysql_num_rows(safe_query($qry))) {
  325. $error_array[] = $_language->module['nickname_already_in_use'];
  326. }
  327.  
  328. if(count($error_array))
  329. {
  330. $fehler=implode('<br />&#8226; ', $error_array);
  331. $showerror = '<div class="errorbox">
  332. <b>'.$_language->module['errors_there'].':</b><br /><br />
  333. &#8226; '.$fehler.'
  334. </div>';
  335. }
  336. else
  337. {
  338. safe_query("UPDATE `".PREFIX."user`
  339. SET
  340. nickname='".$nickname."',
  341. username='".$usernamenew."',
  342. email_hide='".$mail_hide."',
  343. firstname='".$firstname."',
  344. lastname='".$lastname."',
  345. sex='".$sex."',
  346. country='".$flag."',
  347. town='".$town."',
  348. birthday='".$birthday."',
  349. icq='".$icq."',
  350. usertext='".$usertext."',
  351. clantag='".$clantag."',
  352. clanname='".$clanname."',
  353. clanhp='".$clanhp."',
  354. clanirc='".$clanirc."',
  355. clanhistory='".$clanhistory."',
  356. cpu='".$cpu."',
  357. mainboard='".$mainboard."',
  358. ram='".$ram."',
  359. monitor='".$monitor."',
  360. graphiccard='".$graphiccard."',
  361. soundcard='".$soundcard."',
  362. verbindung='".$connection."',
  363. keyboard='".$keyboard."',
  364. mouse='".$mouse."',
  365. mousepad='".$mousepad."',
  366. mailonpm='".$pm_mail."',
  367. newsletter='".$newsletter."',
  368. homepage='".$homepage."',
  369. about='".$about."',
  370. language='".$language."'
  371. WHERE
  372. userID='".$id."'");
  373.  
  374. redirect("index.php?site=profile&amp;id=$id", $_language->module['profile_updated'],3);
  375. }
  376. }
  377.  
  378. if(isset($_GET['action']) AND $_GET['action']=="editpwd") {
  379.  
  380. $bg1 = BG_1;
  381. $bg2 = BG_2;
  382. $bg3 = BG_3;
  383. $bg4 = BG_4;
  384. $border = BORDER;
  385.  
  386. eval("\$myprofile_editpwd = \"".gettemplate("myprofile_editpwd")."\";");
  387. echo $myprofile_editpwd;
  388.  
  389. }
  390.  
  391. elseif(isset($_POST['savepwd'])) {
  392.  
  393. $oldpwd = $_POST['oldpwd'];
  394. $pwd1 = $_POST['pwd1'];
  395. $pwd2 = $_POST['pwd2'];
  396. $id = $userID;
  397.  
  398. $ergebnis = safe_query("SELECT password FROM ".PREFIX."user WHERE userID='".$id."'");
  399. $ds = mysql_fetch_array($ergebnis);
  400.  
  401. if(!(mb_strlen(trim($oldpwd)))) {
  402. $error = $_language->module['forgot_old_pw'];
  403. die('<b>ERROR: '.$error.'</b><br /><br /><input type="button" onclick="javascript:history.back()" value="'.$_language->module['back'].'" />');
  404. }
  405. $oldmd5pwd = md5($oldpwd);
  406. if($oldmd5pwd != $ds['password']) {
  407. $error = $_language->module['old_pw_not_valid'];
  408. die('<b>ERROR: '.$error.'</b><br /><br /><input type="button" onclick="javascript:history.back()" value="'.$_language->module['back'].'" />');
  409. }
  410. if($pwd1 == $pwd2) {
  411. if(!(mb_strlen(trim($pwd1)))) {
  412. $error = $_language->module['forgot_new_pw'];
  413. die('<b>ERROR: '.$error.'</b><br /><br /><input type="button" onclick="javascript:history.back()" value="'.$_language->module['back'].'" />');
  414. }
  415. }
  416. else {
  417. $error = $_language->module['repeated_pw_not_valid'];
  418. die('<b>ERROR: '.$error.'</b><br /><br /><input type="button" onclick="javascript:history.back()" value="'.$_language->module['back'].'" />');
  419. }
  420. $newmd5pwd = md5(stripslashes($pwd1));
  421. safe_query("UPDATE ".PREFIX."user SET password='".$newmd5pwd."' WHERE userID='".$userID."'");
  422.  
  423. //logout
  424. unset($_SESSION['ws_auth']);
  425. unset($_SESSION['ws_lastlogin']);
  426. session_destroy();
  427.  
  428. redirect('index.php?site=login', $_language->module['pw_changed'],3);
  429.  
  430. }
  431.  
  432. elseif(isset($_GET['action']) AND $_GET['action']=="editmail") {
  433.  
  434. $bg1 = BG_1;
  435. $bg2 = BG_2;
  436. $bg3 = BG_3;
  437. $bg4 = BG_4;
  438. $border = BORDER;
  439.  
  440. eval("\$myprofile_editmail = \"".gettemplate("myprofile_editmail")."\";");
  441. echo $myprofile_editmail;
  442.  
  443. }
  444.  
  445. elseif(isset($_POST['savemail'])){
  446.  
  447. $activationkey = createkey(20);
  448. $activationlink = 'http://'.$hp_url.'/index.php?site=register&mailkey='.$activationkey;
  449. $pwd = $_POST['oldpwd'];
  450. $mail1 = $_POST['mail1'];
  451. $mail2 = $_POST['mail2'];
  452.  
  453. $ergebnis = safe_query("SELECT password, username FROM ".PREFIX."user WHERE userID='".$userID."'");
  454. $ds = mysql_fetch_array($ergebnis);
  455. $username = $ds['username'];
  456. if(!(mb_strlen(trim($pwd)))) {
  457. $error = $_language->module['forgot_old_pw'];
  458. die('<b>ERROR: '.$error.'</b><br /><br /><input type="button" onclick="javascript:history.back()" value="'.$_language->module['back'].'" />');
  459. }
  460. $md5pwd = md5(stripslashes($pwd));
  461. if($md5pwd != $ds['password']) {
  462. die('<b>ERROR: '.$error.'</b><br /><br /><input type="button" onclick="javascript:history.back()" value="'.$_language->module['back'].'" />');
  463. }
  464. if($mail1 == $mail2) {
  465. if(!(mb_strlen(trim($mail1)))) {
  466. $error = $_language->module['mail_not_valid'];
  467. die('<b>ERROR: '.$error.'</b><br /><br /><input type="button" onclick="javascript:history.back()" value="'.$_language->module['back'].'" />');
  468. }
  469. }
  470. else {
  471. $error = $_language->module['repeated_pw_not_valid'];
  472. die('<b>ERROR: '.$error.'</b><br /><br /><input type="button" onclick="javascript:history.back()" value="'.$_language->module['back'].'" />');
  473. }
  474.  
  475. // check e-mail
  476.  
  477. if(!validate_email($mail1)){
  478. $error=$_language->module['invalid_mail'];
  479. die('<b>ERROR: '.$error.'</b><br /><br /><input type="button" onclick="javascript:history.back()" value="'.$_language->module['back'].'" />');
  480. }
  481.  
  482. safe_query("UPDATE ".PREFIX."user SET email_change = '".$mail1."', email_activate = '".$activationkey."' WHERE userID='".$userID."'");
  483.  
  484. $ToEmail = $mail1;
  485. $ToName = $username;
  486. $header = str_replace(Array('%homepage_url%'), Array($hp_url), $_language->module['mail_subject']);
  487. $Message = str_replace(Array('%username%', '%activationlink%', '%pagetitle%', '%homepage_url%'), Array($username, $activationlink, $hp_title, $hp_url), $_language->module['mail_text']);
  488.  
  489. if(mail($ToEmail,$header, $Message, "From:".$admin_email."\nContent-type: text/plain; charset=utf-8\n")) echo $_language->module['mail_changed'];
  490. else echo $_language->module['mail_failed'];
  491.  
  492. }
  493.  
  494. else {
  495. $ergebnis = safe_query("SELECT * FROM ".PREFIX."user WHERE userID='".$userID."'");
  496. $anz = mysql_num_rows($ergebnis);
  497. if($anz) {
  498. $ds = mysql_fetch_array($ergebnis);
  499. $flag = '[flag]'.$ds['country'].'[/flag]';
  500. $country = flags($flag);
  501. $country = str_replace("<img","<img id='county'",$country);
  502. $sex = '<option value="m">'.$_language->module['male'].'</option><option value="f">'.$_language->module['female'].'</option><option value="u">'.$_language->module['unknown'].'</option>';
  503. $sex = str_replace('value="'.$ds['sex'].'"','value="'.$ds['sex'].'" selected="selected"',$sex);
  504. if($ds['newsletter'] == "1") $newsletter = '<option value="1" selected="selected">'.$_language->module['yes'].'</option><option value="0">'.$_language->module['no'].'</option>';
  505. else $newsletter = '<option value="1">'.$_language->module['yes'].'</option><option value="0" selected="selected">'.$_language->module['no'].'</option>';
  506. if($ds['mailonpm'] == "1") $pm_mail = '<option value="1" selected="selected">'.$_language->module['yes'].'</option><option value="0">'.$_language->module['no'].'</option>';
  507. else $pm_mail = '<option value="1">'.$_language->module['yes'].'</option><option value="0" selected="selected">'.$_language->module['no'].'</option>';
  508. if($ds['email_hide']) $email_hide = ' checked="checked"';
  509. else $email_hide = '';
  510. $b_day = mb_substr($ds['birthday'],8,2);
  511. $b_month = mb_substr($ds['birthday'],5,2);
  512. $b_year = mb_substr($ds['birthday'],0,4);
  513. $countries = str_replace(" selected=\"selected\"", "", $countries);
  514. $countries = str_replace('value="'.$ds['country'].'"', 'value="'.$ds['country'].'" selected="selected"', $countries);
  515. if($ds['avatar']) $viewavatar = '&#8226; <a href="javascript:MM_openBrWindow(\'images/avatars/'.$ds['avatar'].'\',\'avatar\',\'width=120,height=120\')">'.$_language->module['avatar'].'</a>';
  516. else $viewavatar = $_language->module['avatar'];
  517. if($ds['userpic']) $viewpic = '&#8226; <a href="javascript:MM_openBrWindow(\'images/userpics/'.$ds['userpic'].'\',\'userpic\',\'width=250,height=230\')">'.$_language->module['userpic'].'</a>';
  518. else $viewpic = $_language->module['userpic'];
  519.  
  520. $usertext = getinput($ds['usertext']);
  521. $clanhistory = clearfromtags($ds['clanhistory']);
  522. $clanname = clearfromtags($ds['clanname']);
  523. $clantag = clearfromtags($ds['clantag']);
  524. $clanirc = clearfromtags($ds['clanirc']);
  525. $firstname = clearfromtags($ds['firstname']);
  526. $lastname = clearfromtags($ds['lastname']);
  527. $town = clearfromtags($ds['town']);
  528. $cpu = clearfromtags($ds['cpu']);
  529. $mainboard = clearfromtags($ds['mainboard']);
  530. $ram = clearfromtags($ds['ram']);
  531. $monitor = clearfromtags($ds['monitor']);
  532. $graphiccard = clearfromtags($ds['graphiccard']);
  533. $soundcard = clearfromtags($ds['soundcard']);
  534. $connection = clearfromtags($ds['verbindung']);
  535. $keyboard = clearfromtags($ds['keyboard']);
  536. $mouse = clearfromtags($ds['mouse']);
  537. $mousepad = clearfromtags($ds['mousepad']);
  538. $clanhp = getinput($ds['clanhp']);
  539. $about = getinput($ds['about']);
  540. $nickname = $ds['nickname'];
  541. $username = getinput($ds['username']);
  542. $email = getinput($ds['email']);
  543. $icq = getinput($ds['icq']);
  544. $homepage = getinput($ds['homepage']);
  545. $langdirs = '';
  546. $filepath = "languages/";
  547.  
  548. // Select all possible languages
  549. $mysql_langs = array();
  550. $query = safe_query("SELECT lang, language FROM ".PREFIX."news_languages");
  551. while($dx = mysql_fetch_assoc($query)){
  552. $mysql_langs[$dx['lang']] = $dx['language'];
  553. }
  554. if($dh = opendir($filepath)) {
  555. while($file = mb_substr(readdir($dh), 0, 2)) {
  556. if($file != "." and $file!=".." and is_dir($filepath.$file)) {
  557. if(isset($mysql_langs[$file])){
  558. $name = $mysql_langs[$file];
  559. $name = ucfirst($name);
  560. $langdirs .= '<option value="'.$file.'">'.$name.'</option>';
  561. }
  562. else {
  563. $langdirs .= '<option value="'.$file.'">'.$file.'</option>';
  564. }
  565. }
  566. }
  567. closedir($dh);
  568. }
  569.  
  570. if($ds['language']) $langdirs = str_replace('"'.$ds['language'].'"', '"'.$ds['language'].'" selected="selected"', $langdirs);
  571. else $langdirs = str_replace('"'.$_language->language.'"', '"'.$_language->language.'" selected="selected"', $langdirs);
  572.  
  573. $bg1 = BG_1;
  574. $bg2 = BG_2;
  575. $bg3 = BG_3;
  576. $bg4 = BG_4;
  577.  
  578. eval("\$myprofile = \"".gettemplate("myprofile")."\";");
  579. echo $myprofile;
  580.  
  581. }
  582. else echo $_language->module['not_logged_in'];
  583. }
  584. }
  585. ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement