-
Notifications
You must be signed in to change notification settings - Fork 6
/
chat_invite.php
25 lines (23 loc) · 1.06 KB
/
chat_invite.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
<?php
/**
* @package chat_invite.php
* @author John Doe <[email protected]>
* @since 2009-12-23
* @version 2010-07-28
*/
error_reporting(E_ALL);
/*
12/23/09 initial release
7/28/10 Added inclusion of startup.inc.php for checking of network status and setting of file name variables to support no-maps versions of scripts.
*/
@session_start();
require_once($_SESSION['fip']); //7/28/10
// housekeep old invites
$query = "DELETE from `$GLOBALS[mysql_prefix]chat_invites` WHERE `_on` < DATE_SUB(NOW(),INTERVAL 1 DAY )";
$result = mysql_query($query); //
$now = mysql_format_date(time() - (get_variable('delta_mins')*60));
// note: 'to' is a comma sep'd string of id's, with 0 = all
$query = "INSERT INTO `$GLOBALS[mysql_prefix]chat_invites` (`to`, `_by`, `_from`, _on) VALUES ('{$_GET['frm_to']}', {$_GET['frm_user']}, '{$_SERVER['REMOTE_ADDR']}', '{$now}');";
$result = mysql_query($query) or do_error($query,'mysql_query() failed',mysql_error(), basename( __FILE__), __LINE__);
print "";
?>