autoload.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: autoload.php,v $
- // | $Date: 2004/02/10 01:34:28 $
- // | $Revision: 1.22 $
- // +-------------------------------------------------------------+
- // | File Details:
- // | - Hidden frame element, reloads periodically to check for alert popup
- // | and sound events.
- // +-------------------------------------------------------------+
- error_reporting(E_ALL ^ E_NOTICE);
- require("./../global.php");
- reload_index();
- ?>
- <html>
- <head>
- <?php
- if ($user['alert_frequency'] AND (!$_REQUEST['noload'])) {
- echo '<META HTTP-EQUIV="refresh" content="'
- . ($user['alert_frequency']*60) .
- ";autoload.php?time=$newtime"></head><body bgcolor="#BBBBFF">";
- }
- if (!($user['alert_popup'] OR $user['alert_sound'])) {
- exit();
- }
- if ($_REQUEST['time']) {
- $time = $_REQUEST['time'];
- } else {
- $time = mktime() - ($user['alert_frequency'] * 60); $result = 0;
- }
- ?>
- </HEAD>
- <BODY>
- <?php
- // new tickets
- if ($user['alert_new_all'] == "1") {
- $db->query("
- SELECT id FROM ticket
- WHERE is_open
- AND !tech
- AND date_opened >= '$time'
- ");
- if ($db->num_rows()) {
- $result = 1;
- }
- }
- // replies to tickets (all replied)
- if ($user['alert_reply_all'] == "1") {
-
- $db->query("
- SELECT ticket.id AS id
- FROM ticket_message, ticket
- WHERE ticket.id = ticket_message.ticketid
- AND date > '$time'
- AND ticket_message.userid
- GROUP BY ticketid
- ");
- if ($db->num_rows()) {
- $result = 1;
- }
- // just your own replies
- } elseif ($user['alert_reply_your'] == "1") {
-
- $db->query("
- SELECT ticket.id AS id
- FROM ticket_message, ticket
- WHERE ticket.id = ticket_message.ticketid
- AND techid = '$user[id]'
- AND date > '$time'
- AND ticket_message.userid
- GROUP BY ticketid
- ");
- if ($db->num_rows()) {
- $result = 1;
- }
- }
- // private messages
- if ($user['alert_pm'] == "1") {
-
- $db->query("
- SELECT pm_source.id AS id
- FROM pm_relations, pm_source
- WHERE techid = '$user[id]'
- AND timestamp > '$time'
- AND pm_relations.pmid = pm_source.id
- AND !is_read
- ");
- if ($db->num_rows()) {
- $result = 1;
- }
- }
- // Only take action if there's anything worth alerting on
- if ($result) {
-
- if ($user['alert_popup']) {
- echo "<SCRIPT LANGUAGE="JavaScript">window.open('./popup.php?time=$time','deskpro','toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=yes,resizable=yes,width=275,height=290,left=50,top=50');</SCRIPT>";
- }
-
- if ($user['alert_sound']) {
- echo "<EMBED SRC="../../sounds/13.wav" AUTOSTART="TRUE" WIDTH="0" HEIGHT="0" LOOP="FALSE" HIDDEN="TRUE">";
- }
- }
- echo "</BODY></HTML>";