Unsupported scripts and control panel web app for a hosting company
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.

adminannouncements.php 1.3KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152
  1. <?PHP
  2. require_once('lib/dashboard.php');
  3. require_once('lib/account.php');
  4. checkAccess(ADMIN);
  5. define('TITLE', 'Admin - Announcements');
  6. require_once('admin.menu.php');
  7. if (get_magic_quotes_gpc()) {
  8. foreach ($_POST as $k => $v) {
  9. $_POST[$k] = stripslashes($v);
  10. }
  11. }
  12. if (isset($_POST['title']) && isset($_POST['type']) && isset($_POST['body'])) {
  13. if (isset($_POST['preview'])) {
  14. define('MESSAGE_TITLE', $_POST['title']);
  15. define('MESSAGE_TYPE', 'preview: ' . $_POST['type']);
  16. define('MESSAGE_TIME', time());
  17. define('MESSAGE_BODY', $_POST['body']);
  18. require_once('lib/header.php');
  19. require_once('pages/viewmessage.php');
  20. } else {
  21. $sql = 'INSERT INTO messages (message_type, message_title, message_time,';
  22. $sql .= ' message_body) VALUES (\'' . m($_POST['type']) . '\', \'';
  23. $sql .= m($_POST['title']) . '\', ' . time() . ', \'' . m($_POST['body']);
  24. $sql .= '\')';
  25. mysql_query($sql) or mf(__FILE__, __LINE__, $sql);
  26. if ($_POST['type'] == 'announcement') {
  27. require_once('/home/utd/common/messagemail.php');
  28. messagemail(mysql_insert_id());
  29. }
  30. header('Location: ' . CP_PATH . 'adminannouncements');
  31. exit();
  32. }
  33. } else {
  34. require_once('lib/header.php');
  35. require_once('pages/admin.announcements.php');
  36. }
  37. require_once('pages/admin.addannouncement.php');
  38. require_once('lib/footer.php');
  39. ?>