-
Notifications
You must be signed in to change notification settings - Fork 0
/
setup.inc.php
67 lines (55 loc) · 2.82 KB
/
setup.inc.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
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
<?
$n = $_POST['n'];
$r = $_POST['r'];
$id = $_POST['id'];
$banid = $_POST['banid'];
$email = $_POST['email'];
$dropid = $_POST['dropid'];
$s = $_POST['s'];
$l = $_POST['l'];
$p = $_POST['p'];
$k = $_POST['k'];
//if (!defined('PROGRAM_OPEN') ) {die("This Page can't be loaded this way.");}
// Setup Key Variables
$DataDirectory = 'data'; // Set this to the directory where you will store the text database files, for security this should be below html access, don't put a / on the end of it
$MaxUsers = '100'; // Maximum number of people allowed to chat at one time
$MaxGuests = '20'; // Maximum number of people allowed to log in as guests
$TimeOut = '60'; // How many seconds before they time out
$Database[User] = ''; // Change this to the name of the database user who has permission to connect to this database
$Database[Password] = ''; // Change this to the database users password
$Database[DatabaseName] = ''; // Change this to the name of the database you want to connect to
$Database[Host] = 'localhost'; // Change this the host name or ip of the database to connect to, almost always its localhost
$Database[TablePrefix] = 'chat_'; // If you want to run more than one chat, you can rename all the table with this prefix and it will use those ones, however you will need a unique setup_inc and text database directory for each installation
$EmailAddress = ''; // Set this to the email address you will send from for lost passords auto-send new one
$UniqueKey = 'aSTrdsfP'; // Write some random letters and numbers here, this will be used to create player keys so others can't POST to the php files pretending to be them
// DO NOT CHANGE the following
// These are commonly used routines
unset($Safe); // A safe and clean place to store information
//set_magic_quotes_runtime(0); // So null does not become /0
$now = time();
function Dienice($msg,$details="")
{// To speed things up I'm just going to include a file so it only loads if needed, rare call
printf("$msg&em=$details");exit;
}
function ConnectDB()
{global $Database;
$tmp = mysql_connect ($Database[Host], $Database[User], $Database[Password]) or Dienice('&e=10','Unable to Connect at this time, please try again later');
mysql_select_db ($Database[DatabaseName]) or Dienice('&e=11','Unable to Connect at this time, please try again later');
}
function IsANumber($value)
{if (ereg("^[0-9]+$",$value)) {return true;}
else {return false;}
}
function CleanInput($value)
{$value = str_replace(''',"'",$value);
if (get_magic_quotes_gpc ()) {$value = stripslashes($value);} // Only Strip if added, we'll make up for it with the function below
// $value = trim(ereg_replace("[\n\r&|]+",'',$value));
$value = trim(ereg_replace("[\n\r&]+",'',$value));
return $value;
}
function CleanForDB($value)
{
$value = addslashes($value);
return $value;
}
?>