forked from Bigjoos/U-232-V5
-
Notifications
You must be signed in to change notification settings - Fork 0
/
contactstaff.php
66 lines (65 loc) · 3.72 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
64
65
66
<?php
/**
|--------------------------------------------------------------------------|
| https://github.com/Bigjoos/ |
|--------------------------------------------------------------------------|
| Licence Info: GPL |
|--------------------------------------------------------------------------|
| Copyright (C) 2010 U-232 V5 |
|--------------------------------------------------------------------------|
| A bittorrent tracker source based on TBDev.net/tbsource/bytemonsoon. |
|--------------------------------------------------------------------------|
| Project Leaders: Mindless, Autotron, whocares, Swizzles. |
|--------------------------------------------------------------------------|
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _
/ \ / \ / \ / \ / \ / \ / \ / \ / \ / \ / \ / \ / \ / \ / \
( U | - | 2 | 3 | 2 )-( S | o | u | r | c | e )-( C | o | d | e )
\_/ \_/ \_/ \_/ \_/ \_/ \_/ \_/ \_/ \_/ \_/ \_/ \_/ \_/ \_/
*/
require_once (__DIR__ . 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'));
$stdhead = array(
/** include css **/
'css' => array(
'contact_staff'
)
);
if ($_SERVER['REQUEST_METHOD'] == 'POST') {
$msg = isset($_POST['msg']) ? htmlsafechars($_POST['msg']) : '';
$subject = isset($_POST['subject']) ? htmlsafechars($_POST['subject']) : '';
$returnto = isset($_POST['returnto']) ? htmlsafechars($_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 (sql_query('INSERT INTO staffmessages (sender, added, msg, subject) VALUES(' . sqlesc($CURUSER['id']) . ', ' . TIME_NOW . ', ' . 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'], ((is_object($GLOBALS["___mysqli_ston"])) ? mysqli_error($GLOBALS["___mysqli_ston"]) : (($___mysqli_res = mysqli_connect_error()) ? $___mysqli_res : false))));
} else {
$HTMLOUT = "
<div class='container'><h1 class='text-center'><img src='images/global.design/support.png' alt='' title='Support'/>Contact Staff</h1>
<form method='post' name='message' action='" . $_SERVER['PHP_SELF'] . "'>
<table class='table table-bordered'>
<tr><td>
<h1 class='text-center'>{$lang['contactstaff_title']}</h1>
<p class='text-center small'>{$lang['contactstaff_info']}</p>
</td></tr>
<tr><td>
<input class='form-control' type='text' placeholder='{$lang['contactstaff_subject']}'>
</td></tr>
<tr><td align='center' colspan='2'>";
if (isset($_GET['returnto'])) $HTMLOUT.= "<input type='hidden' name='returnto' value='" . urlencode($_GET['returnto']) . "' />";
$HTMLOUT.= "<textarea class='form-control' name='msg' rows='10'></textarea>
</td>
</tr>
<tr><td class='text-center'><input type='submit' value='{$lang['contactstaff_sendit']}' class='btn btn-default' /></td></tr>
</table>
</form></div><br>";
echo stdhead($lang['contactstaff_header'], true, $stdhead) . $HTMLOUT . stdfoot();
}
?>