-
Notifications
You must be signed in to change notification settings - Fork 4
/
contactstaff.php
63 lines (53 loc) · 2.61 KB
/
contactstaff.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
<?php
/**
* http://btdev.net:1337/svn/test/Installer09_Beta
* Licence Info: GPL
* Copyright (C) 2010 BTDev Installer v.1
* A bittorrent tracker source based on TBDev.net/tbsource/bytemonsoon.
* Project Leaders: Mindless,putyn.
**/
require_once(dirname(__FILE__).DIRECTORY_SEPARATOR.'include'.DIRECTORY_SEPARATOR.'bittorrent.php');
require_once(INCL_DIR.'user_functions.php');
require_once(INCL_DIR.'pager_functions.php');
require_once(INCL_DIR.'html_functions.php');
dbconn(false);
loggedinorreturn();
$lang = array_merge(load_language('global'), load_language('contactstaff'));
if($_SERVER['REQUEST_METHOD'] == 'POST') {
$msg = isset($_POST['msg']) ? $_POST['msg'] : '';
$subject = isset($_POST['subject']) ? $_POST['subject'] : '';
$returnto = isset($_POST['returnto']) ? $_POST['returnto'] : $_SERVER['PHP_SELF'];
if (empty($msg))
stderr($lang['contactstaff_error'],$lang['contactstaff_no_msg']);
if (empty($subject))
stderr($lang['contactstaff_error'],$lang['contactstaff_no_sub']);
if(mysql_query('INSERT INTO staffmessages (sender, added, msg, subject) VALUES('.$CURUSER['id'].', '.time().', '.sqlesc($msg).', '.sqlesc($subject).')')) {
$mc1->delete_value('staff_mess_');
header('Refresh: 3; url='.urldecode($returnto)); //redirect but wait 3 seconds
stderr($lang['contactstaff_success'],$lang['contactstaff_success_msg']);
} else
stderr($lang['contactstaff_error'],sprintf($lang['contactstaff_mysql_err'],mysql_error()));
} else {
$HTMLOUT ="<form method='post' name='message' action='".$_SERVER['PHP_SELF']."'>
<table class='main' width='450' border='0' cellspacing='0' cellpadding='2'>
<tr><td align='center' colspan='2'>
<h1>{$lang['contactstaff_title']}</h1>
<p class='small'>{$lang['contactstaff_info']}</p>
</td></tr>
<tr><td align='right'>
{$lang['contactstaff_subject']}
</td><td align='left'>
<input type='text' size='50' name='subject' style='margin-left: 5px;' />
</td></tr>
<tr><td align='center' colspan='2'>";
if (isset($_GET['returnto']))
$HTMLOUT .="<input type='hidden' name='returnto' value='".urlencode($_GET['returnto'])."' />";
$HTMLOUT .="<textarea name='msg' cols='80' rows='15'></textarea>
</td>
</tr>
<tr><td align='center' colspan='2'><input type='submit' value='{$lang['contactstaff_sendit']}' class='btn' /></td></tr>
</table>
</form>";
print stdhead($lang['contactstaff_header']).$HTMLOUT . stdfoot();
}
?>