email_article.php
上传用户:gzy2002
上传日期:2010-02-11
资源大小:1785k
文件大小:3k
- <?php
- // +-------------------------------------------------------------+
- // | DeskPRO v [2.0.1 Production]
- // | Copyright (C) 2001 - 2004 Headstart Solutions Limited
- // | Supplied by WTN-WDYL
- // | Nullified by WTN-WDYL
- // | Distribution via WebForum, ForumRU and associated file dumps
- // +-------------------------------------------------------------+
- // | DESKPRO IS NOT FREE SOFTWARE
- // +-------------------------------------------------------------+
- // | License ID : Full Enterprise License =) ...
- // | License Owner : WTN-WDYL Team
- // +-------------------------------------------------------------+
- // | $RCSfile: email_article.php,v $
- // | $Date: 2004/02/10 01:34:25 $
- // | $Revision: 1.13 $
- // +-------------------------------------------------------------+
- // | File Details:
- // | - FAQ Article e-mail handler
- // +-------------------------------------------------------------+
- error_reporting(E_ALL & ~E_NOTICE);
- require_once('./global.php');
- //Nullify WTN-WDYL Team
- // default do
- $_REQUEST['do'] = trim($_REQUEST['do']);
- if (!isset($_REQUEST['do']) or $_REQUEST['do'] == "") {
- $_REQUEST['do'] = "email_article";
- }
- $template_cache = templatecache('HF_header_small,FAQ_email');
- ############################### PREPARE FORMS ###############################
- $articleid = $_REQUEST['articleid'];
- // get article data
- $article = $db->query_return("
- SELECT * FROM faq_articles WHERE id = '" . intval($_REQUEST[articleid]) . "'
- ");
- if ($db->num_rows() < 1) {
- error('no_article');
- }
- // check if it can be sent to guests (category 0)
- $db->query("SELECT * FROM faq_permissions WHERE catid = '$article[category]' AND groupid = 1");
- if ($db->num_rows() < 1) {
- error('no_permission');
- }
- eval(makeeval('header', 'HF_header_small'));
- ############################### SHOW FORM ###############################
-
- if ($_REQUEST['do'] == "email_article") {
- $showform = 1;
- eval(makeeval('echo', 'FAQ_email'));
- }
- ############################### SAY THANKS ###############################
- if ($_REQUEST['do'] == "email_article2") {
- if (!validate_email($_REQUEST['send_email'])) {
- $error_send = 1;
- $showform = 1;
- }
- if (!validate_email($_REQUEST['from_email'])) {
- $error_from = 1;
- $showform = 1;
- }
- if (!$_REQUEST[name]) {
- $error_name = 1;
- $showform = 1;
- }
- if ($showform) {
- $show_message = "error";
- } else {
-
- $show_message = "email_thanks";
- // now we send the email
- $user_details['email'] = $_REQUEST['send_email'];
- $user_details = update_user_details($user_details);;
- eval(makeemaileval('message', 'BODY_faq_article_sent', $subject));
- dp_mail($user_details['email'], $subject, $message, array($_REQUEST[name], $_REQUEST[from_email]));
- }
- eval(makeeval('echo', 'FAQ_email'));
- }
- ?>