A lightweight forum engine written in PHP. Repository is now obsolete and read-only. http://www.pioder.pl/uforum.html
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

83 lines
2.2 KiB

  1. <?php
  2. $msg ='';
  3. if ((isset($_POST['textedit'])) and (isset($_POST['nmsg'])) and (isset($_POST['username'])))
  4. {
  5. if (($_POST['textedit'] != '') and ($_POST['nmsg']!='') and ($_POST['username']!='') and (strlen($_POST['textedit'])>10) and (strlen($_POST['nmsg'])>5))
  6. {
  7. $nick = strip_tags($_POST['username']);
  8. $sql = "SELECT * FROM `".USERS_TABLE."` WHERE `nick`='$nick'";
  9. $result = DataBase::fetch(DataBase::sql_query($sql, 'CRITICAL','Could not obtain user information.'));
  10. if ($result['u_id']!='')
  11. {
  12. $_POST['textedit'] = Secure::TagsReplace($_POST['textedit']);
  13. $_POST['nmsg'] = strip_tags($_POST['nmsg']);
  14. Pms::SendMessage($_POST['textedit'],$_POST['nmsg'], $_POST['username']);
  15. message_forum($lng['post_is_saved'],'pms.php');
  16. }
  17. else
  18. {
  19. $message = $lng['no_user'];
  20. $msg = './skins/'.$default_skin.'/post_error_body.tpl';
  21. }
  22. }
  23. else
  24. {
  25. $message = $lng['perror_1'];
  26. $msg = './skins/'.$default_skin.'/post_error_body.tpl';
  27. }
  28. }
  29. else
  30. {
  31. if (isset($_GET['id']))
  32. {
  33. Secure::user_exists(intval($_GET['id']));
  34. $_POST['username'] = User::UserInformation(intval($_GET['id']), 'nick');
  35. }
  36. else
  37. {
  38. $_POST['username'] = '';
  39. }
  40. $_POST['nmsg']='';
  41. $_POST['textedit']='';
  42. }
  43. //add skin variables
  44. $skin = array(
  45. 'smiles'=>Post::SmilesShow(),
  46. //labels
  47. 'luser'=>$lng['user'],
  48. 'lsmiles'=>$lng['smiles'],
  49. 'lmsgname'=>$lng['msgname'],
  50. 'lmsg'=>$lng['message'],
  51. 'lsave'=>$lng['save'],
  52. 'lreset'=>$lng['reset'],
  53. 'lwritemsg'=>$lng['write_pm'],
  54. 'action'=>$_SERVER['REQUEST_URI']
  55. );
  56. $skin = array_push_associative($skin, GenerateHeader($lng['lpm'].': '.$lng['write_pm'], '</a>&gt;<a href="pms.php" class="navigator">'.$lng['lpm'].'</a> &gt; <a href="'.$_SERVER['REQUEST_URI'].'" class="navigator">'.$lng['write_pm']));
  57. if ($msg=='')
  58. {
  59. $msg='./skins/'.$default_skin.'/blank.tpl';
  60. }
  61. //do it!
  62. include('./skins/'.$default_skin.'/overall_header.tpl');
  63. include('./skins/'.$default_skin.'/msgs_new_body.tpl');
  64. if(RANK=='2')
  65. {
  66. $skin['pa_link']='<a href="admin/index.php" class="fsmall"><b>'.$lng['pa_link'].'</b></a>';
  67. }
  68. else
  69. {
  70. $skin['pa_link']='';
  71. }
  72. $stop = TimeGeneration();
  73. $skin['queries'] = ShowQueries($start, $stop);
  74. include('./skins/'.$default_skin.'/overall_footer.tpl');
  75. ?>