-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathbuddys.php
190 lines (176 loc) · 8.31 KB
/
buddys.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
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
<?php
/*
##########################################################################
# #
# Version 4 / / / #
# -----------__---/__---__------__----__---/---/- #
# | /| / /___) / ) (_ ` / ) /___) / / #
# _|/_|/__(___ _(___/_(__)___/___/_(___ _/___/___ #
# Free Content / Management System #
# / #
# #
# #
# Copyright 2005-2011 by webspell.org #
# #
# visit webSPELL.org, webspell.info to get webSPELL for free #
# - Script runs under the GNU GENERAL PUBLIC LICENSE #
# - It's NOT allowed to remove this copyright-tag #
# -- http://www.fsf.org/licensing/licenses/gpl.html #
# #
# Code based on WebSPELL Clanpackage (Michael Gruber - webspell.at), #
# Far Development by Development Team - webspell.org #
# #
# visit webspell.org #
# #
##########################################################################
##########################################################################
# #
# Version 4 / / / #
# -----------__---/__---__------__----__---/---/- #
# | /| / /___) / ) (_ ` / ) /___) / / #
# _|/_|/__(___ _(___/_(__)___/___/_(___ _/___/___ #
# Society / Edition #
# / #
# #
# modified by webspell|k3rmit (Stefan Giesecke) in 2009 #
# #
# - Modifications are released under the GNU GENERAL PUBLIC LICENSE #
# - It is NOT allowed to remove this copyright-tag #
# - http://www.fsf.org/licensing/licenses/gpl.html #
# #
##########################################################################
*/
if(isset($_GET['action'])) $action = $_GET['action'];
else $action = '';
if($action=="add") {
include("_mysql.php");
include("_settings.php");
include("_functions.php");
$_language->read_module('buddys');
if(!$userID) redirect('index.php?site=buddys', $_language->module['not_logged'], 3);
elseif(!isset($_GET['id']) OR !is_numeric($_GET['id'])) redirect('index.php?site=buddys', $_language->module['add_nouserid'], 3);
else {
if($_GET['id'] == $userID){
redirect('index.php?site=buddys', $_language->module['add_yourself'], 3);
die();
}
if(mysql_num_rows(safe_query("SELECT userID FROM ".PREFIX."user WHERE userID='".$_GET['id']."'"))) {
safe_query("INSERT INTO ".PREFIX."buddys (userID, buddy, banned) values ('$userID', '".$_GET['id']."', '0') ");
header("Location: index.php?site=buddys");
}
else redirect('index.php?site=buddys', $_language->module['add_notexists'], 3);
}
}
elseif($action=="ignore") {
include("_mysql.php");
include("_settings.php");
include("_functions.php");
$_language->read_module('buddys');
if(!$userID) redirect('index.php?site=buddys', $_language->module['not_logged'], 3);
elseif(!isset($_GET['id']) OR !is_numeric($_GET['id'])) redirect('index.php?site=buddys', $_language->module['add_nouserid'], 3);
else {
if($_GET['id'] == $userID){
redirect('index.php?site=buddys', $_language->module['add_yourself'], 3);
die();
}
if(mysql_num_rows(safe_query("SELECT userID FROM ".PREFIX."user WHERE userID='".$_GET['id']."'"))) {
safe_query("UPDATE ".PREFIX."buddys SET banned='1' WHERE userID='$userID' AND buddy='".$_GET['id']."'");
header("Location: index.php?site=buddys");
}
else redirect('index.php?site=buddys', $_language->module['add_notexists'], 3);
}
}
elseif($action=="readd") {
include("_mysql.php");
include("_settings.php");
include("_functions.php");
$_language->read_module('buddys');
if(!$userID) redirect('index.php?site=buddys', $_language->module['not_logged'], 3);
elseif(!isset($_GET['id']) OR !is_numeric($_GET['id'])) redirect('index.php?site=buddys', $_language->module['add_nouserid'], 3);
else {
safe_query("UPDATE ".PREFIX."buddys SET banned='0' WHERE userID='$userID' AND buddy='".$_GET['id']."'");
header("Location: index.php?site=buddys");
}
}
elseif($action=="delete") {
include("_mysql.php");
include("_settings.php");
include("_functions.php");
$_language->read_module('buddys');
if(!$userID) redirect('index.php?site=buddys', $_language->module['not_logged'], 3);
elseif(!isset($_GET['id']) OR !is_numeric($_GET['id'])) redirect('index.php?site=buddys', $_language->module['add_nouserid'], 3);
else {
safe_query("DELETE FROM ".PREFIX."buddys WHERE userID='$userID' AND buddy='".$_GET['id']."'");
header("Location: index.php?site=buddys");
}
}
elseif($userID) {
$_language->read_module('buddys');
eval ("\$title_buddys = \"".gettemplate("title_buddys")."\";");
echo $title_buddys;
eval ("\$buddys_head = \"".gettemplate("buddys_head")."\";");
echo $buddys_head;
$ergebnis=safe_query("SELECT * FROM ".PREFIX."buddys WHERE userID='$userID' AND banned='0'");
$anz=mysql_num_rows($ergebnis);
if($anz) {
$n=1;
while($ds=mysql_fetch_array($ergebnis)) {
if($n%2) {
$bg1=BG_1;
$bg2=BG_2;
}
else {
$bg1=BG_1;
$bg2=BG_2;
}
$flag = '[flag]'.getcountry($ds['buddy']).'[/flag]';
$country=flags($flag);
$nickname=getnickname($ds['buddy']);
if(isclanmember($ds['buddy'])) $member='<img src="images/icons/member.gif" width="6" height="11" alt="Clanmember" />';
else $member='';
if(isonline($ds['buddy'])=="offline") $statuspic='<img src="images/icons/offline.gif" width="7" height="7" alt="offline" />';
else $statuspic='<img src="images/icons/online.gif" width="7" height="7" alt="online" />';
eval ("\$buddys_content = \"".gettemplate("buddys_content")."\";");
echo $buddys_content;
$n++;
}
}
else echo'<tr><td colspan="4" bgcolor="'.BG_1.'">'.$_language->module['buddy_nousers'].'</td></tr>';
eval ("\$buddys_foot = \"".gettemplate("buddys_foot")."\";");
echo $buddys_foot;
eval ("\$ignore_head = \"".gettemplate("ignore_head")."\";");
echo $ignore_head;
$ergebnis=safe_query("SELECT * FROM ".PREFIX."buddys WHERE userID='$userID' AND banned='1'");
$anz=mysql_num_rows($ergebnis);
if($anz) {
$n=1;
while($ds=mysql_fetch_array($ergebnis)) {
if($n%2) {
$bg1=BG_1;
$bg2=BG_2;
}
else {
$bg1=BG_1;
$bg2=BG_2;
}
$flag = '[flag]'.getcountry($ds['buddy']).'[/flag]';
$country=flags($flag);
$nickname=getnickname($ds['buddy']);
if(isclanmember($ds['buddy'])) $member=' <img src="images/icons/member.gif" width="6" height="11" alt="Clanmember" />';
else $member='';
if(isonline($ds['buddy'])=="offline") $statuspic='<img src="images/icons/offline.gif" width="7" height="7" alt="offline" />';
else $statuspic='<img src="images/icons/online.gif" width="7" height="7" alt="online" />';
eval ("\$ignore_content = \"".gettemplate("ignore_content")."\";");
echo $ignore_content;
$n++;
}
}
else echo '<tr><td colspan="4" bgcolor="'.BG_1.'">'.$_language->module['ignore_nousers'].'</td></tr>';
eval ("\$ignore_foot = \"".gettemplate("ignore_foot")."\";");
echo $ignore_foot;
}
else {
$_language->read_module('buddys');
if(!$userID) redirect('index.php?site=buddys', $_language->module['not_logged'], 3);
}
?>