-
Notifications
You must be signed in to change notification settings - Fork 1
/
motd.php
99 lines (72 loc) · 2.33 KB
/
motd.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
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
<?php
/*
AMXBans v6.0
Copyright 2009, 2010 by SeToY & |PJ|ShOrTy
This file is part of AMXBans.
AMXBans is free software, but it's licensed under the
Creative Commons - Attribution-NonCommercial-ShareAlike 2.0
AMXBans is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
You should have received a copy of the cc-nC-SA along with AMXBans.
If not, see <http://creativecommons.org/licenses/by-nc-sa/2.0/>.
*/
session_start();
require_once("include/config.inc.php");
if (!function_exists('geoip_country_code_by_addr')) {
require_once("include/geoip.inc");
}
require_once("include/amxx_langs.inc.php");
require_once("include/functions.inc.php");
#$bid=(int)$_GET["bid"];
$sid=htmlspecialchars($_GET["sid"]);
$show_admin=(int)$_GET["adm"];
//get language for player from url
$lang=$_GET["lang"];
if($amxx_langs[$lang]) {
$_SESSION['lang']=$amxx_langs[$lang];
} else {
$_SESSION['lang']="english";
}
//check GET bid
#$query=mysql_query("SELECT min(bid),max(bid) FROM ".$config->db_prefix."_bans") or die (mysql_error());
#if($bid < mysql_result($query,0,0) || $bid > mysql_result($query,0,1)) $bid=0;
//check steamid or bid
if(strpos($sid,"STEAM") !== false) {
$is_steamid=true;
} else if(substr($sid,0,1)=="B" && strlen($sid) > 1) {
$bid=(int)substr($sid,1);
} else $sid=0;
$smarty = new dynamicPage;
//check GET adm
if($show_admin < 0 || $show_admin > 1) $show_admin=0;
$smarty->assign("show_admin",$show_admin);
// Get ban details
if($bid) {
$ban=sql_get_ban_details($bid);
$smarty->assign("ban_detail",$ban);
}
// Get ban details history with steam
if($is_steamid===true) {
$count=0;
$exp_bans=sql_get_ban_details_motd_exp($sid,$count);
$smarty->assign("exp_count",$count);
$smarty->assign("exp_bans",$exp_bans);
$smarty->assign("history",1);
}
//no valid bid
if(!$sid) {
echo "no valid data";
exit;
}
/****************************************************************
* Template parsing *
****************************************************************/
$title = "Bandetails";
if(file_exists("templates/".$config->design."/amxbans.css")) {
$smarty->assign("design",$config->design);
}
$smarty->assign("title",$title);
$smarty->assign("dir",$config->document_root);
$smarty->display('motd.tpl');
?>