email_article.php
上传用户:gzy2002
上传日期:2010-02-11
资源大小:1785k
文件大小:3k
源码类别:

电子政务应用

开发平台:

Java

  1. <?php
  2. // +-------------------------------------------------------------+
  3. // | DeskPRO v [2.0.1 Production]
  4. // | Copyright (C) 2001 - 2004 Headstart Solutions Limited
  5. // | Supplied by WTN-WDYL
  6. // | Nullified by WTN-WDYL
  7. // | Distribution via WebForum, ForumRU and associated file dumps
  8. // +-------------------------------------------------------------+
  9. // | DESKPRO IS NOT FREE SOFTWARE
  10. // +-------------------------------------------------------------+
  11. // | License ID : Full Enterprise License =) ...
  12. // | License Owner : WTN-WDYL Team
  13. // +-------------------------------------------------------------+
  14. // | $RCSfile: email_article.php,v $
  15. // | $Date: 2004/02/10 01:34:25 $
  16. // | $Revision: 1.13 $
  17. // +-------------------------------------------------------------+
  18. // | File Details:
  19. // | - FAQ Article e-mail handler
  20. // +-------------------------------------------------------------+
  21. error_reporting(E_ALL & ~E_NOTICE);
  22. require_once('./global.php');
  23. //Nullify WTN-WDYL Team
  24. // default do
  25. $_REQUEST['do'] = trim($_REQUEST['do']);
  26. if (!isset($_REQUEST['do']) or $_REQUEST['do'] == "") {
  27. $_REQUEST['do'] = "email_article";
  28. }
  29. $template_cache = templatecache('HF_header_small,FAQ_email');
  30. ############################### PREPARE FORMS ###############################
  31. $articleid = $_REQUEST['articleid'];
  32. // get article data
  33. $article = $db->query_return("
  34. SELECT * FROM faq_articles WHERE id = '" . intval($_REQUEST[articleid]) . "'
  35. ");
  36. if ($db->num_rows() < 1) {
  37. error('no_article');
  38. }
  39. // check if it can be sent to guests (category 0)
  40. $db->query("SELECT * FROM faq_permissions WHERE catid = '$article[category]' AND groupid = 1");
  41. if ($db->num_rows() < 1) {
  42. error('no_permission');
  43. }
  44. eval(makeeval('header', 'HF_header_small'));
  45. ############################### SHOW FORM ###############################
  46. if ($_REQUEST['do'] == "email_article") {
  47. $showform = 1;
  48. eval(makeeval('echo', 'FAQ_email'));
  49. }
  50. ############################### SAY THANKS ###############################
  51. if ($_REQUEST['do'] == "email_article2") {
  52. if (!validate_email($_REQUEST['send_email'])) {
  53. $error_send = 1;
  54. $showform = 1;
  55. }
  56. if (!validate_email($_REQUEST['from_email'])) {
  57. $error_from = 1;
  58. $showform = 1;
  59. }
  60. if (!$_REQUEST[name]) {
  61. $error_name = 1;
  62. $showform = 1;
  63. }
  64. if ($showform) {
  65. $show_message = "error";
  66. } else {
  67. $show_message = "email_thanks";
  68. // now we send the email
  69. $user_details['email'] = $_REQUEST['send_email'];
  70. $user_details = update_user_details($user_details);;
  71. eval(makeemaileval('message', 'BODY_faq_article_sent', $subject));
  72. dp_mail($user_details['email'], $subject, $message, array($_REQUEST[name], $_REQUEST[from_email]));
  73. }
  74. eval(makeeval('echo', 'FAQ_email'));
  75. }
  76. ?>