-
Notifications
You must be signed in to change notification settings - Fork 2
/
news_admin.php
259 lines (238 loc) · 7.94 KB
/
news_admin.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
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
<?
include('inc/db_connect.php');
$stat = mysql_fetch_array(mysql_query("SELECT * FROM players WHERE user='".addslashes($user)."' AND pass='".addslashes($pass)."'"));
if (empty($stat['id']) || $stat['bloked']) {
echo"<script>top.window.location = 'index.php?action=logout';</script>";
exit;
}
elseif ($stat['user'] != 'migon') {
echo"<script>top.window.location = 'index.php?action=logout';</script>";
exit;
}
?>
<html>
<head>
<title>Acres Of The Hope</title>
<link rel=stylesheet type="text/css" href="i/main.css">
<meta http-equiv=Content-Type content="text/html; charset=windows-1251">
<META Http-Equiv=Cache-Control Content=no-cache>
<meta http-equiv=PRAGMA content=NO-CACHE>
<META Http-Equiv=Expires Content=0>
</head>
<style>
td {
TEXT-ALIGN: Center;
}
/* News Style */
.eDetails {
border-top: 1px dashed #DBB270;
border-bottom: 1px dashed #DBB270;
font-family: Tahoma, Arial, Sans-Serif;
color: #A88956;
padding-bottom: 5px;
padding-top: 3px;
text-align: left;
font-size: 7pt;
}
/* ------------- */
</style>
<body bottomMargin="0" leftMargin="0" topMargin="0" rightMargin="0"
style="background-image: url('i/index1/bg.jpg')">
<div align="center">
<center>
<table border="0" cellpadding="0" cellspacing="0"
style="border-collapse: collapse" width="90%" height="100%"
bgcolor="#E8ECD1">
<tr>
<td width="24" background="i/index1/bgline_left.jpg" rowspan="3"></td>
<td height="30" background="i/index1/bgcont_center.gif"><img
border="0" src="i/index1/bgcont_left1.gif" align="left" hspace="0"
width="105" height="30"><img border="0"
src="i/index1/bgcont_right1.gif" align="right" hspace="0" width="105"
height="30"></td>
<td width="24" background="i/index1/bgline_right.jpg" rowspan="3"></td>
</tr>
<tr>
<td height="100%" align="center" valign=top>
<center>
<center><font class=title><b>Àäìèíêà íîâîñòåé</b></font></center>
<br>
<body bgcolor=FCFAF3>
<table width=100% cellspacing=0 cellpadding=3 border=0>
<tr>
<td align=right>
<table cellspacing=2 cellpadding=2
style='border-style: outset; border-width: 2; WIDTH: 98.6%'
border=1>
<tr>
<td align=center width=33%><B><a href='news_admin.php?act=add'>Äîáàâèòü
Íîâîñòü</b></td>
<td align=center width=33%><B><a href='news_admin.php?act=del'>Óäàëèòü
Íîâîñòü</b></td>
<td align=center width=33%><B><a href='news_admin.php?act=news'>Ðåäàêòèðîâàòü
Íîâîñòè</b></td>
</tr>
</table>
<br>
<table align=center cellspacing=0 cellpadding=3 bordercolor=CCCCCC
border=1 width=80% bgcolor=e2e2e2>
<?
$new=mysql_query("SELECT * FROM news ORDER BY id");
while($data = mysql_fetch_array($new)){
$tema=$data["tema"];
$date=$data["data"];
$avtor=$data["user"];
$id=$data["id"];
$avt = mysql_fetch_array(mysql_query("select * from players where user='".$avtor."'"));
print"
<div align='center'>
<table width=90% bordercolor=4f3908>
<tr><td style='padding:3px;'>
<div class='eDetails' style='clear:both;'>
Òåìà: <b><i>$tema</b></i>
| Äîáàâèë: <SCRIPT LANGUAGE=\"JavaScript\" SRC=\"i/show_inf.js\"></SCRIPT><SCRIPT language=JavaScript>
show_inf('$avt[user]','$avt[id]','$avt[level]','$avt[rank]','$avt[tribe]');
</SCRIPT> |
Äàòà: <u>$date</u> |
ID: <b>$id</b>";
print"
</div>
</td></tr></table>";
}
echo"<hr>";
switch($act){
case"add":
if(@$adds){
$tems = HtmlSpecialChars($tems);
$texxt = stripslashes($texxt);
$tems=str_replace("\n","<br>",$tems);
$texxt=str_replace("\n","<br>",$texxt);
$hourdiff = "0";
$timeadjust = ($hourdiff * 60 * 60);
$this_time = date("d.m.y H:i",time() + $timeadjust);
$max = mysql_fetch_array(mysql_query("SELECT MAX(id) as id FROM news"));
$NEWMAXID = $max['id'] + 1;
$QQQQ = mysql_query("INSERT INTO `news` VALUES('".$NEWMAXID."','".$stat['user']."','".$texxt."','".$tems."','".$this_time."')");
if($QQQQ){
print "<center>Íîâîñòü äîáàâëåíà.</center>";
require_once("inc/chat/functions.php");
insert_msg("×èòàéòå íîâîñòè...","","","1",$stat['user'],"",$stat['room']);
}
else{
print "Êàêàåòî Îøèáêà!";
}
}
print"
<form method='POST'>
<table border=0>
<tr>
<td>
<input name='tems' size='65' style='float: right'></font><font size='4'><span lang='ru'>Òåìà:</span></font></td>
</tr>
<tr>
<td>
<textarea name=texxt rows=50 cols=255 style='height: 153; width:493; font-size:12pt'></textarea></td>
</tr>
<tr>
<td>
<center><input type='submit' value='Îòïðàâèòü' class=input name='adds'> <input type='reset' class=input value='Ñòåðåòü' name='B4'>
</center>
</td>
</tr>
</table>
</form>";
break; }
switch($act){
case"del":
if (@$dels) {
mysql_query("DELETE FROM News WHERE id='".$idss."'");
echo"Íîâîñòü óäàëèíà!";
}
echo"<table border=0><tr>
<td><form method=post>
<b>ID:</b>
<input type=text name=idss size=2>
<input type=submit class=input name=dels value='Óäàëèòü'></td>
</tr>
</table>
</form>";
break; }
switch($act){
case"news":
echo"
<form action='news_admin.php' method=post>
<input type=hidden name=act value=news>
Àéäè: <input type=text name=idc value='$idc'> <input type=submit class=input value='Íàéòè'>
</form>";
if($idc)
{
$user = HtmlSpecialChars($user);
$tema = HtmlSpecialChars($tema);
$texxt = stripslashes($texxt);
$text = str_replace('\n','<br>',$text);
$text = str_replace('','<br>',$text);
$query = "select * from news where id='$idc'";
$result = mysql_query($query);
$num=mysql_num_rows($result);
if($num==0)
{
echo"<b><i>Íîâîñòü íå íàéäåíà!</i></b><br>";
}
else
{
$row = mysql_fetch_array($result);
if($dos)
{
$result = mysql_query("update news set text='$text', tema='$temas', user='$users' where id='".$idc."'");
if($result)echo"<b>Äàííûå óñïåøíî ñîõðàíåíû</b><br>";
else echo"<b><i>Ïðîèçîøëà íåïðåäâèäåìàÿ îøèáêà!</i></b><br>";
$row = mysql_fetch_array(mysql_query("select * from news where id='$idc'"));
}
elseif($doc)
{
mysql_query("delete from news where id='$id_news'");
if($result)echo"<b>Íîâîñòü óäàëèíà</b><br>";
}
echo"<form action='news_admin.php' methdo=post>
<input type=hidden name=act value=news>
<input type=hidden name=idc value='$idc'>
<input type=hidden name=id_news value='$row[id]'>
<table border=0>
<tr><td>Id Íîâîñòè:</td><td><b>$row[id]</b></td></tr>
<tr><td>Òåìà:</td><td><input type=text size=25 name=temas value='$row[tema]'></td></tr>
<tr><td>Àâòîð (Òî÷íûé íèê!):</td><td><input type=text size=25 name=users value='$row[user]'></td></tr>
<tr><td>Òåêñò:</td><td><textarea name=text rows=7 cols=255 style='height: 100; width:293'>".stripslashes($row[text])."</textarea></td></tr>
";
echo"</table>
<input type=submit name=dos class=input value='Ñîõðàíèòü äàííûå'> <input type=submit name=doc class=input value='Óäàëèòü ýòó íîâîñòü'></form>";
}
}
break; }
?>
<br>
<center><small>Äëÿ êîðåêòíîé èãðû ñäåëàéòå íàñòðîéêè â âàøåì
áðàóçåðå:<br>
<b>Âèä -> Êîäèðîâêà -> Àâòîâûáîð</b></small> <br>
<br>
<br>
<font face="Verdana" size="2">
<center><u><small>Acres Of The Hope (Âñå ïðàâà çàùèùåíû)</small></u></center>
<br>
<br></center>
</font>
</table>
</center>
</td>
</tr>
<tr>
<td height="30" background="i/index1/bgcont_center_down.gif"><img
border="0" src="i/index1/bgfoo_left.gif" align="left" hspace="0"
width="105" height="30"><img border="0"
src="i/index1/bgfoo_right.gif" align="right" hspace="0" width="105"
height="30"></td>
</tr>
</table>
</center>
</div>
</body>
</html>