⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 comments.php

📁 本代码是为客户联系管理而做的系统
💻 PHP
字号:
<?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: comments.php,v $
// | $Date: 2004/02/10 01:34:26 $
// | $Revision: 1.10 $
// +-------------------------------------------------------------+
// | File Details:
// | - View new comments
// +-------------------------------------------------------------+

error_reporting(E_ALL ^ E_NOTICE);

include "./../global.php";

tech_nav('faq');

// default do
$_REQUEST['do'] = trim($_REQUEST['do']);
if (!isset($_REQUEST['do']) or $_REQUEST['do'] == "") {
	$_REQUEST['do'] = "view";
}

// globalise variables
$global = array	(
			array('id')
);
rg($global);

include ("./faq_include.php");

############################### DELETE COMMMENT ###############################

if ($_REQUEST['do'] == 'delcomment') {
	
	if ($user['p_delete_c_k']) {
		$db->query("DELETE FROM faq_comments WHERE id = '$_REQUEST[comment]'");
		alert("Comment deleted.");
	} else {
		alert("You don't have permission to delete comments.");
	}
	$_REQUEST['do'] = 'view';

}

############################### MARK READ ###############################

if ($_REQUEST['do'] == 'not_new') {

	if ($id) {
		$db->query("UPDATE faq_comments SET new = 0 WHERE id = '$id'");
		alert('Comment marked not new');
	}

	$_REQUEST['do'] = 'view';

}

############################### SEND GENERIC RESPONSE ###############################

if ($_REQUEST['do'] == 'standard_email') {

	// need to get email address
	$comment = $db->query_return("SELECT * FROM faq_comments WHERE id = '$id' AND new");

	if (is_array($comment)) {

		if ($comment[useremail]) {
			$user_details['email'] = $comment[useremail];
		} else {
			$user_details = $db->query_return("SELECT email FROM user WHERE id = '$comment[userid]'");
		}

		// get article
		$article = $db->query_return("SELECT * FROM faq_articles WHERE id = '$comment[articleid]'");

		// now send the standard email address
		if (validate_email($user_details['email'])) {
			$user_details = update_user_details($user_details);
			eval(makeemaileval('message', 'BODY_comment_standard', $subject));
			dp_mail($user_details['email'], $subject, $message);
		}

		if ($id) {
			$db->query("UPDATE faq_comments SET new = 0 WHERE id = '$id'");
			alert("Acknowledgement email sent ($user_details[email]) and comment updated to not new");
		}
	}

	$_REQUEST['do'] = 'view';

}

############################### VIEW NEW COMMENTS ###############################

if ($_REQUEST['do'] == "view") {

	$db->query("
		SELECT faq_comments.*, faq_articles.answer, user.username, user.email, faq_articles.question, faq_articles.title
		FROM faq_comments
		LEFT JOIN faq_articles ON (faq_articles.id = faq_comments.articleid)
		LEFT JOIN user ON (user.id = faq_comments.userid)
		WHERE new
	");

	while ($result = $db->row_array()) {

		if ($result[userid]) {
			$show_name = "<a href=\"./../users/view.php?id=$result[userid]\">$result[username]</a>";
		} else {
			$show_name = $result[useremail];
		}

		$table[] = array(
			"<a href=\"./view.php?articleid=$result[articleid]\">$result[title]</a>",
			$result[comments],
			$show_name,
			"<a href=\"./comments.php?do=standard_email&id=$result[id]\">Acknowledge</a> | <a href=\"./../tickets/newticket.php?commentid=$result[id]\">Start Ticket</a> | <a href=\"./comments.php?do=not_new&id=$result[id]\">No Response</a>"
		);
	}

	if (!is_array($table)) {
		$table[] = 'There are currently no new FAQ comments';
	}

	$cols = array('Title', 'User Comments', 'Submitter', 'Mark Read & Respond');
	table_header('View and respond to FAQ comments');
	table_content($cols, $table);
	table_footer();

}

tech_footer();
?>

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -