attachment.php
上传用户:gzy2002
上传日期:2010-02-11
资源大小:1785k
文件大小:2k
- <?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: attachment.php,v $
- // | $Date: 2004/02/10 01:34:26 $
- // | $Revision: 1.6 $
- // +-------------------------------------------------------------+
- // | File Details:
- // | - Attachment downloading and processing.
- // +-------------------------------------------------------------+
- error_reporting(E_ALL ^ E_NOTICE);
- include "./../global.php";
- // default do
- $_REQUEST['do'] = trim($_REQUEST['do']);
- if (!isset($_REQUEST['do']) or $_REQUEST['do'] == "") {
- $_REQUEST['do'] = "download";
- }
- // globalise variables
- $global = array (
- array('id')
- );
- rg($global);
- ############################### DOWNLOAD ATTACHMENT ###############################
- if ($_REQUEST['do'] == 'download') {
- get_attachment($id, 'faq_attachments', 1);
- }
- ############################### DELETE ATTACHMENT ###############################
- if ($_REQUEST['do'] == 'delete') {
- $result = $db->query_return("SELECT blobid, filename, articleid FROM faq_attachments WHERE id = '$id'");
- $db->query("DELETE FROM faq_attachments WHERE id = '$id'");
- $db->query("DELETE FROM blobs WHERE id = '$result[id]'");
- jump("view.php?id=$result[ticketid]&articleid=$result[articleid]", 'Attachment deleted.');
- }