1 |
<?PHP |
2 |
|
3 |
###################################################################### |
4 |
# PHP-NUKE: Web Portal System |
5 |
# =========================== |
6 |
# |
7 |
# Copyright (c) 2000 by Francisco Burzi (fburzi@ncc.org.ve) |
8 |
# http://www.ncc.org.ve/php-nuke.php |
9 |
# |
10 |
# This modules is the main administration part |
11 |
# |
12 |
# This program is free software. You can redistribute it and/or modify |
13 |
# it under the terms of the GNU General Public License as published by |
14 |
# the Free Software Foundation; either version 2 of the License. |
15 |
###################################################################### |
16 |
|
17 |
include("auth.inc.php"); |
18 |
if (!IsSet($mainfile)) { include ('mainfile.php'); } |
19 |
|
20 |
/*********************************************************/ |
21 |
/* Login Function */ |
22 |
/*********************************************************/ |
23 |
|
24 |
function login() { |
25 |
include ('header.php'); |
26 |
?> |
27 |
|
28 |
<form action="admin.php" method="post"> |
29 |
<table col=2> |
30 |
<tr><td><?php echo translate("AdminID"); ?></td> |
31 |
<td><input type="text" NAME="aid" SIZE=20 MAXLENGTH=20></td></tr> |
32 |
<tr><td><?php echo translate("Password"); ?></td> |
33 |
<td><input type="password" NAME="pwd" SIZE=20 MAXLENGTH=18> </td></tr> |
34 |
<input type="hidden" NAME="op" value="login"> |
35 |
<tr><td colspan=2><input type="submit" VALUE="<?php echo translate("Login"); ?>"></td></tr> |
36 |
</table> |
37 |
</form> |
38 |
<? |
39 |
include ('footer.php'); |
40 |
} |
41 |
|
42 |
/*********************************************************/ |
43 |
/* Administration Menu Function */ |
44 |
/*********************************************************/ |
45 |
|
46 |
function GraphicAdmin() { |
47 |
include ("config.php"); |
48 |
if ($admingraphic) { |
49 |
echo " |
50 |
<center>$font4<b><a href=admin.php>".translate("Administration Menu")."</a></b>"; |
51 |
if($banners) { |
52 |
echo" |
53 |
<b><a href=admin.php?op=BannersAdmin>".translate("Banners Administration")."</a></center></b><br><br>"; |
54 |
} else { |
55 |
echo "</center><br><br>"; |
56 |
} |
57 |
echo" |
58 |
<table border=0 width=100% cellspacing=1><tr> |
59 |
<td align=center><a href=admin.php?op=adminStory><img src=images/menu/admin/postnew.gif border=0></a><br>$font2<b>".translate("NEW Article")."</b> |
60 |
</td><td align=center><a href=admin.php?op=topicsmanager><img src=images/menu/admin/topicsman.gif border=0></a><br>$font2<b>".translate("Topics Manager")."</b> |
61 |
</td><td align=center><a href=admin.php?op=lblocks><img src=images/menu/admin/leftblock.gif border=0></a><br>$font2<b>".translate("Left Blocks")."</b> |
62 |
</td><td align=center><a href=admin.php?op=rblocks><img src=images/menu/admin/rightblock.gif border=0></a><br>$font2<b>".translate("Right Blocks")."</b> |
63 |
</td><td align=center><a href=admin.php?op=mod_users><img src=images/menu/admin/users.gif border=0></a><br>$font2<b>".translate("Edit Users")."</b> |
64 |
</td><td align=center><a href=admin.php?op=mod_authors><img src=images/menu/admin/authors.gif border=0></a><br>$font2<b>".translate("Edit Admins")."</b> |
65 |
</tr><tr> |
66 |
</td><td align=center><a href=admin.php?op=ablock><img src=images/menu/admin/adminblock.gif border=0></a><br>$font2<b>".translate("Admin Block")."</b> |
67 |
</td><td align=center><a href=admin.php?op=mblock><img src=images/menu/admin/mainblock.gif border=0></a><br>$font2<b>".translate("Main Block")."</b> |
68 |
</td><td align=center><a href=admin.php?op=create><img src=images/menu/admin/newpoll.gif border=0></a><br>$font2<b>".translate("Surveys/Polls")."</b> |
69 |
</td><td align=center><a href=admin.php?op=hreferer><img src=images/menu/admin/referer.gif border=0></a><br>$font2<b>".translate("HTTP Referers")."</b> |
70 |
</td><td align=center><a href=admin.php?op=sections><img src=images/menu/admin/sections.gif border=0></a><br>$font2<b>".translate("Sections Manager")."</b> |
71 |
</td><td align=center><a href=admin.php?op=links><img src=images/menu/admin/links.gif border=0></a><br>$font2<b>".translate("Web Links")."</b> |
72 |
</tr><tr> |
73 |
</td><td align=center><a href=admin.php?op=events><img src=images/menu/admin/events.gif border=0></a><br>$font2<b>".translate("Events")."</b> |
74 |
</td><td align=center><a href=admin.php?op=logout><img src=images/menu/admin/exit.gif border=0></a><br>$font2<b>".translate("Logout / Exit")."</b> |
75 |
</td></tr></table></center><br><br>$font3"; |
76 |
|
77 |
} else { |
78 |
|
79 |
echo " |
80 |
<center>$font4<b><a href=admin.php>".translate("Administration Menu")."</a></b>"; |
81 |
if($banners) { |
82 |
echo" |
83 |
<b><a href=admin.php?op=BannersAdmin>".translate("Banners Administration")."</a></center></b><br><br>"; |
84 |
} else { |
85 |
echo "</center><br><br>"; |
86 |
} |
87 |
echo " |
88 |
<table border=0 width=100% cellspacing=1><tr> |
89 |
<td align=center><a href=admin.php?op=adminStory>$font2<b>".translate("NEW Article")."</b></a> |
90 |
</td><td align=center><a href=admin.php?op=topicsmanager>$font2<b>".translate("Topics Manager")."</b></a> |
91 |
</td><td align=center><a href=admin.php?op=lblocks>$font2<b>".translate("Left Blocks")."</b></a> |
92 |
</td><td align=center><a href=admin.php?op=rblocks>$font2<b>".translate("Right Blocks")."</b></a> |
93 |
</td><td align=center><a href=admin.php?op=mod_users>$font2<b>".translate("Edit Users")."</b></a> |
94 |
</td><td align=center><a href=admin.php?op=mod_authors>$font2<b>".translate("Edit Admins")."</b></a> |
95 |
</tr><tr> |
96 |
</td><td align=center><a href=admin.php?op=ablock>$font2<b>".translate("Admin Block")."</b></a> |
97 |
</td><td align=center><a href=admin.php?op=mblock>$font2<b>".translate("Main Block")."</b></a> |
98 |
</td><td align=center><a href=admin.php?op=create>$font2<b>".translate("Surveys/Polls")."</b></a> |
99 |
</td><td align=center><a href=admin.php?op=hreferer>$font2<b>".translate("HTTP Referers")."</b></a> |
100 |
</td><td align=center><a href=admin.php?op=sections>$font2<b>".translate("Sections Manager")."</b></a> |
101 |
</td><td align=center><a href=admin.php?op=links>$font2<b>".translate("Web Links")."</b></a> |
102 |
</tr><tr> |
103 |
</td><td align=center><a href=admin.php?op=events>$font2<b>".translate("Events")."</b></a> |
104 |
</td><td align=center><a href=admin.php?op=logout>$font2<b>".translate("Logout / Exit")."</b></a> |
105 |
</td></tr></table></center><br><br>$font3"; |
106 |
|
107 |
} |
108 |
} |
109 |
|
110 |
/*********************************************************/ |
111 |
/* Events Functions to have a Historic Events */ |
112 |
/*********************************************************/ |
113 |
|
114 |
function events() { |
115 |
include ("header.php"); |
116 |
GraphicAdmin(); |
117 |
dbconnect(); |
118 |
echo " |
119 |
<table border=0 width=100% cellpadding=0 cellspacing=1 bgcolor=000000><tr><td> |
120 |
<table border=0 width=100% cellpadding=8 cellspacing=0 bgcolor=FFFFFF><tr><td> |
121 |
<center><font face=Verdana,Arial,Helvetica size=4><b>".translate("Events")."</b></center><br><br> |
122 |
<font size=3><b>".translate("Add Event:")."</b><br><br><font size=2> |
123 |
<form action=admin.php method=post>"; |
124 |
$nday = "1"; |
125 |
echo "".translate("Day:")." <select name=did>"; |
126 |
while ($nday<=31) { |
127 |
echo "<option name=did>$nday</option>"; |
128 |
$nday++; |
129 |
} |
130 |
echo "</select>"; |
131 |
$nmonth = "1"; |
132 |
echo "".translate("Month:")." <select name=mid>"; |
133 |
while ($nmonth<=12) { |
134 |
echo "<option name=mid>$nmonth</option>"; |
135 |
$nmonth++; |
136 |
} |
137 |
echo "</select>".translate("Year:")." <input type=text name=yid maxlength=4 size=5><br><br> |
138 |
".translate("Event Description:")."<br> |
139 |
<textarea name=content cols=60 rows=10></textarea><br><br> |
140 |
<input type=hidden name=op value=eventsadd> |
141 |
<input type=submit value=".translate("Send")."> |
142 |
</form> |
143 |
|
144 |
<br><br> |
145 |
<font size=3><b>".translate("Event Maintenance (Edit/Delete):")."</b><br><br><foint size=2> |
146 |
<form action=admin.php method=post>"; |
147 |
$nday = "1"; |
148 |
echo "".translate("Day:")." <select name=did>"; |
149 |
while ($nday<=31) { |
150 |
echo "<option name=did>$nday</option>"; |
151 |
$nday++; |
152 |
} |
153 |
echo "</select>"; |
154 |
$nmonth = "1"; |
155 |
echo "".translate("Month:")." <select name=mid>"; |
156 |
while ($nmonth<=12) { |
157 |
echo "<option name=mid>$nmonth</option>"; |
158 |
$nmonth++; |
159 |
} |
160 |
echo " |
161 |
<br><br> |
162 |
<input type=hidden name=op value=eventsmaintenance> |
163 |
<input type=submit value=".translate("Edit")."> |
164 |
</form> |
165 |
|
166 |
</td></tr></table></td></tr></table> |
167 |
"; |
168 |
include ('footer.php'); |
169 |
} |
170 |
|
171 |
function eventsadd($did, $mid, $yid, $content) { |
172 |
dbconnect(); |
173 |
mysql_query("insert into ephem values (NULL, '$did', '$mid', '$yid', '$content')"); |
174 |
Header("Location: admin.php?op=events"); |
175 |
} |
176 |
|
177 |
function eventsmaintenance($did, $mid) { |
178 |
include ("header.php"); |
179 |
GraphicAdmin(); |
180 |
dbconnect(); |
181 |
echo "<table border=0 width=100% cellpadding=0 cellspacing=1 bgcolor=000000><tr><td> |
182 |
<table border=0 width=100% cellpadding=8 cellspacing=0 bgcolor=FFFFFF><tr><td> |
183 |
<center><font face=Verdana,Arial,Helvetica size=4><b>".translate("Events Maintenance")."</b></center><br><br>"; |
184 |
$result=mysql_query("select eid, did, mid, yid, content from ephem where did=$did AND mid=$mid"); |
185 |
while(list($eid, $did, $mid, $yid, $content) = mysql_fetch_row($result)) { |
186 |
echo "<font face=Verdana,Arial,Helvetica size=2><b>$yid</b> [ <a href=admin.php?op=eventsedit&eid=$eid&did=$did&mid=$mid>".translate("Edit")."</a> | <a href=admin.php?op=eventsdel&eid=$eid&did=$did&mid=$mid>".translate("Delete")."</a> ]<br> |
187 |
<font size=1>$content<br><br><br>"; |
188 |
} |
189 |
echo "</td></tr></table></td></tr></table>"; |
190 |
include ('footer.php'); |
191 |
} |
192 |
|
193 |
function eventsdel($eid, $did, $mid) { |
194 |
dbconnect(); |
195 |
mysql_query("delete from ephem where eid=$eid"); |
196 |
Header("Location: admin.php?op=eventsmaintenance&did=$did&mid=$mid"); |
197 |
} |
198 |
|
199 |
function eventsedit($eid, $did, $mid) { |
200 |
include ("header.php"); |
201 |
GraphicAdmin(); |
202 |
dbconnect(); |
203 |
$result=mysql_query("select yid, content from ephem where eid=$eid"); |
204 |
list($yid, $content) = mysql_fetch_row($result); |
205 |
echo " |
206 |
<table border=0 width=100% cellpadding=0 cellspacing=1 bgcolor=000000><tr><td> |
207 |
<table border=0 width=100% cellpadding=8 cellspacing=0 bgcolor=FFFFFF><tr><td> |
208 |
<center><font face=Verdana,Arial,Helvetica size=4><b>".translate("Events Maintenance")."</b></center><br><br> |
209 |
<font size=3><b>".translate("Edit Event:")."</b><br><br><font size=2> |
210 |
<form action=admin.php method=post>"; |
211 |
echo "".translate("Year:")." <input type=text name=yid value=$yid maxlength=4 size=5><br><br> |
212 |
".translate("Event Description:")."<br> |
213 |
<textarea name=content cols=60 rows=10>$content</textarea><br><br> |
214 |
<input type=hidden name=did value=$did> |
215 |
<input type=hidden name=mid value=$mid> |
216 |
<input type=hidden name=eid value=$eid> |
217 |
<input type=hidden name=op value=eventschange> |
218 |
<input type=submit value=".translate("Send")."> |
219 |
</form> |
220 |
</td></tr></table></td></tr></table> |
221 |
"; |
222 |
include ('footer.php'); |
223 |
} |
224 |
|
225 |
function eventschange($eid, $did, $mid, $yid, $content) { |
226 |
dbconnect(); |
227 |
$content = stripslashes(FixQuotes($content)); |
228 |
mysql_query("update ephem set yid='$yid', content='$content' where eid=$eid"); |
229 |
Header("Location: admin.php?op=eventsmaintenance&did=$did&mid=$mid"); |
230 |
} |
231 |
|
232 |
/*********************************************************/ |
233 |
/* Web Links Functions to have a fun Search Engine */ |
234 |
/*********************************************************/ |
235 |
|
236 |
function links() { |
237 |
include ("header.php"); |
238 |
GraphicAdmin(); |
239 |
dbconnect(); |
240 |
echo " |
241 |
<table border=0 width=100% cellpadding=0 cellspacing=0 bgcolor=000000><tr><td> |
242 |
<table border=0 width=100% cellpadding=8 cellspacing=1 bgcolor=FFFFFF><tr><td> |
243 |
<center><a href=links.php><img src=images/links/web.gif border=0></a><br><br>"; |
244 |
$result=mysql_query("select * from links_links"); |
245 |
$numrows = mysql_num_rows($result); |
246 |
echo "<font size=2 face=Arial,Helvetica>".translate("There are")." <b>$numrows</b> ".translate("Links in our Database").""; |
247 |
echo "</td></tr></table></td></tr></table><br>"; |
248 |
|
249 |
// List Links waiting for validation |
250 |
|
251 |
$result = mysql_query("select lid, cid, sid, title, url, description, name, email from links_newlink order by lid"); |
252 |
$numrows = mysql_num_rows($result); |
253 |
if ($numrows>0) { |
254 |
echo " |
255 |
<table border=0 width=100% cellpadding=0 cellspacing=0 bgcolor=000000><tr><td> |
256 |
<table border=0 width=100% cellpadding=8 cellspacing=1 bgcolor=FFFFFF><tr><td> |
257 |
</center><font face=Arial,Helvetica size=3><b>".translate("Links Waiting for Validation")."</b><br><br><font size=2>"; |
258 |
while(list($lid, $cid, $sid, $title, $url, $description, $name, $email) = mysql_fetch_row($result)) { |
259 |
echo "<form action=admin.php method=post>"; |
260 |
echo "<font color=Blue>".translate("Link ID: ")."<font color=Black><b>$lid</b><br>"; |
261 |
echo "".translate("Page Title: ")."<input type=text name=title value=\"$title\" size=50 maxlength=100><br>"; |
262 |
echo "".translate("Page URL: ")."<input type=text name=url value=$url size=50 maxlength=100> [ <a target=_blank href=$url>".translate("Visit")."</a> ]<br>"; |
263 |
echo "".translate("Description: ")."<br><textarea name=description cols=60 rows=10>$description</textarea><br>"; |
264 |
echo "".translate("Name: ")."<input type=text name=name size=20 maxlength=100 value=\"$name\"> "; |
265 |
echo "".translate("Email: ")."<input type=text name=email size=20 maxlength=100 value=$email><br>"; |
266 |
|
267 |
$result2=mysql_query("select cid, title from links_categories order by title"); |
268 |
echo "<input type=hidden name=new value=1>"; |
269 |
echo "<input type=hidden name=lid value=$lid>"; |
270 |
echo "".translate("Category: ")."<select name=cat>"; |
271 |
while(list($ccid, $ctitle) = mysql_fetch_row($result2)) { |
272 |
$sel = ""; |
273 |
if ($cid==$ccid AND $sid==0) { |
274 |
$sel = "selected"; |
275 |
} |
276 |
echo "<option value=$ccid $sel>$ctitle</option>"; |
277 |
$result3=mysql_query("select sid, title from links_subcategories where cid=$ccid order by title"); |
278 |
while(list($ssid, $stitle) = mysql_fetch_row($result3)) { |
279 |
$sel = ""; |
280 |
if ($sid==$ssid) { |
281 |
$sel = "selected"; |
282 |
} |
283 |
echo "<option value=$ccid-$ssid $sel>$ctitle / $stitle</option>"; |
284 |
} |
285 |
} |
286 |
echo "</select><input type=hidden name=op value=LinksAddLink><input type=submit value=".translate("Add")."> [ <a href=admin.php?op=LinksDelNew&lid=$lid>".translate("Delete")."</a> ]</form><br><hr noshade><br>"; |
287 |
|
288 |
} |
289 |
echo "</td></tr></table></td></tr></table><br>"; |
290 |
} else { |
291 |
} |
292 |
|
293 |
// Add a New Main Category |
294 |
|
295 |
echo " |
296 |
<table border=0 width=100% cellpadding=0 cellspacing=0 bgcolor=000000><tr><td> |
297 |
<table border=0 width=100% cellpadding=8 cellspacing=1 bgcolor=FFFFFF><tr><td> |
298 |
</center><form method=post action=admin.php> |
299 |
<font face=Arial,Helvetica size=3><b>".translate("Add a MAIN Category")."</b><br><br> |
300 |
".translate("Name: ")."<input type=text name=title size=30 maxlength=100> |
301 |
<input type=hidden name=op value=LinksAddCat> |
302 |
<input type=submit value=".translate("Add")."><br> |
303 |
</td></tr></table></td></tr></table></form><br>"; |
304 |
|
305 |
// Add a New Sub-Category |
306 |
|
307 |
$result = mysql_query("select * from links_categories"); |
308 |
$numrows = mysql_num_rows($result); |
309 |
if ($numrows>0) { |
310 |
echo " |
311 |
<table border=0 width=100% cellpadding=0 cellspacing=0 bgcolor=000000><tr><td> |
312 |
<table border=0 width=100% cellpadding=8 cellspacing=1 bgcolor=FFFFFF><tr><td> |
313 |
</center><form method=post action=admin.php> |
314 |
<font face=Arial,Helvetica size=3><b>".translate("Add a SUB-Category")."</b><br><br> |
315 |
".translate("Name: ")."<input type=text name=title size=30 maxlength=100> ".translate("in")." "; |
316 |
|
317 |
$result=mysql_query("select cid, title from links_categories order by title"); |
318 |
echo "<select name=cid>"; |
319 |
while(list($ccid, $ctitle) = mysql_fetch_row($result)) { |
320 |
echo "<option value=$ccid>$ctitle</option>"; |
321 |
} |
322 |
echo "</select> |
323 |
<input type=hidden name=op value=LinksAddSubCat> |
324 |
<input type=submit value=".translate("Add")."><br> |
325 |
</td></tr></table></td></tr></table></form><br>"; |
326 |
} else { |
327 |
} |
328 |
|
329 |
// Add a New Link to Database |
330 |
|
331 |
$result = mysql_query("select cid, title from links_categories"); |
332 |
$numrows = mysql_num_rows($result); |
333 |
if ($numrows>0) { |
334 |
echo " |
335 |
<table border=0 width=100% cellpadding=0 cellspacing=0 bgcolor=000000><tr><td> |
336 |
<table border=0 width=100% cellpadding=8 cellspacing=1 bgcolor=FFFFFF><tr><td> |
337 |
</center><form method=post action=admin.php> |
338 |
<font face=Arial,Helvetica size=3><b>".translate("Add a New Link")."</b><br><br> |
339 |
".translate("Page Title: ")."<input type=text name=title size=50 maxlength=100><br> |
340 |
".translate("Page URL: ")."<input type=text name=url size=50 maxlength=100 value=\"http://\"><br>"; |
341 |
$result=mysql_query("select cid, title from links_categories order by title"); |
342 |
echo "".translate("Category: ")."<select name=cat>"; |
343 |
while(list($cid, $title) = mysql_fetch_row($result)) { |
344 |
echo "<option value=$cid>$title</option>"; |
345 |
$result2=mysql_query("select sid, title from links_subcategories where cid=$cid order by title"); |
346 |
while(list($sid, $stitle) = mysql_fetch_row($result2)) { |
347 |
echo "<option value=$cid-$sid>$title / $stitle</option>"; |
348 |
} |
349 |
} |
350 |
echo "</select><br><br><br> |
351 |
".translate("Description: (255 characters max)")."<br><textarea name=description cols=60 rows=5></textarea><br><br><br> |
352 |
".translate("Name: ")."<input type=text name=name size=30 maxlength=60><br> |
353 |
".translate("E-Mail: ")."<input type=text name=email size=30 maxlength=60><br><br> |
354 |
<input type=hidden name=op value=LinksAddLink> |
355 |
<input type=hidden name=new value=0> |
356 |
<input type=hidden name=lid value=0> |
357 |
<center><input type=submit value=".translate("Add URL")."><br> |
358 |
</td></tr></table></td></tr></table></form><br>"; |
359 |
|
360 |
} else { |
361 |
} |
362 |
|
363 |
// Modify Category |
364 |
|
365 |
$result = mysql_query("select * from links_categories"); |
366 |
$numrows = mysql_num_rows($result); |
367 |
if ($numrows>0) { |
368 |
echo " |
369 |
<table border=0 width=100% cellpadding=0 cellspacing=0 bgcolor=000000><tr><td> |
370 |
<table border=0 width=100% cellpadding=8 cellspacing=1 bgcolor=FFFFFF><tr><td> |
371 |
</center><form method=post action=admin.php> |
372 |
<font face=Arial,Helvetica size=3><b>".translate("Modify Category")."</b><br><br>"; |
373 |
$result=mysql_query("select cid, title from links_categories order by title"); |
374 |
echo "".translate("Category: ")."<select name=cat>"; |
375 |
while(list($cid, $title) = mysql_fetch_row($result)) { |
376 |
echo "<option value=$cid>$title</option>"; |
377 |
$result2=mysql_query("select sid, title from links_subcategories where cid=$cid order by title"); |
378 |
while(list($sid, $stitle) = mysql_fetch_row($result2)) { |
379 |
echo "<option value=$cid-$sid>$title / $stitle</option>"; |
380 |
} |
381 |
} |
382 |
echo "</select> |
383 |
<input type=hidden name=op value=LinksModCat> |
384 |
<input type=submit value=".translate("Modify")."> |
385 |
</td></tr></table></td></tr></table></form><br>"; |
386 |
} else { |
387 |
} |
388 |
|
389 |
// Modify Links |
390 |
|
391 |
$result = mysql_query("select * from links_links"); |
392 |
$numrows = mysql_num_rows($result); |
393 |
if ($numrows>0) { |
394 |
echo " |
395 |
<table border=0 width=100% cellpadding=0 cellspacing=0 bgcolor=000000><tr><td> |
396 |
<table border=0 width=100% cellpadding=8 cellspacing=1 bgcolor=FFFFFF><tr><td> |
397 |
</center><form method=post action=admin.php> |
398 |
<font face=Arial,Helvetica size=3><b>".translate("Modify Links")."</b><br><br> |
399 |
".translate("Link ID: ")."<input type=text name=lid size=12 maxlength=11> |
400 |
<input type=hidden name=op value=LinksModLink> |
401 |
<input type=submit value=".translate("Modify")."> |
402 |
</td></tr></table></td></tr></table></form><br>"; |
403 |
} else { |
404 |
} |
405 |
|
406 |
|
407 |
include ("footer.php"); |
408 |
} |
409 |
|
410 |
function LinksModLink($lid) { |
411 |
include ("header.php"); |
412 |
GraphicAdmin(); |
413 |
$result = mysql_query("select cid, sid, title, url, description, name, email, hits from links_links where lid=$lid"); |
414 |
echo " |
415 |
<table border=0 width=100% cellpadding=0 cellspacing=0 bgcolor=000000><tr><td> |
416 |
<table border=0 width=100% cellpadding=8 cellspacing=1 bgcolor=FFFFFF><tr><td> |
417 |
</center><font face=Arial,Helvetica size=3><b>".translate("Modify Links")."</b><br><br><font size=2>"; |
418 |
while(list($cid, $sid, $title, $url, $description, $name, $email, $hits) = mysql_fetch_row($result)) { |
419 |
echo "<form action=admin.php method=post>"; |
420 |
echo "<font color=Blue>".translate("Link ID: ")."<font color=Black><b>$lid</b><br>"; |
421 |
echo "".translate("Page Title: ")."<input type=text name=title value=\"$title\" size=50 maxlength=100><br>"; |
422 |
echo "".translate("Page URL: ")."<input type=text name=url value=$url size=50 maxlength=100> [ <a href=$url>Visit</a> ]<br>"; |
423 |
echo "".translate("Description: ")."<br><textarea name=description cols=60 rows=10>$description</textarea><br>"; |
424 |
echo "".translate("Name: ")."<input type=text name=name size=50 maxlength=100 value=\"$name\"><br>"; |
425 |
echo "".translate("E-Mail: ")."<input type=text name=email size=50 maxlength=100 value=\"$email\"><br>"; |
426 |
echo "".translate("Hits: ")."<input type=text name=hits value=$hits size=12 maxlength=11><br>"; |
427 |
$result2=mysql_query("select cid, title from links_categories order by title"); |
428 |
echo "<input type=hidden name=lid value=$lid>"; |
429 |
echo "".translate("Category: ")."<select name=cat>"; |
430 |
while(list($ccid, $ctitle) = mysql_fetch_row($result2)) { |
431 |
$sel = ""; |
432 |
if ($cid==$ccid AND $sid==0) { |
433 |
$sel = "selected"; |
434 |
} |
435 |
echo "<option value=$ccid $sel>$ctitle</option>"; |
436 |
$result3=mysql_query("select sid, title from links_subcategories where cid=$ccid order by title"); |
437 |
while(list($ssid, $stitle) = mysql_fetch_row($result3)) { |
438 |
$sel = ""; |
439 |
if ($sid==$ssid) { |
440 |
$sel = "selected"; |
441 |
} |
442 |
echo "<option value=$ccid-$ssid $sel>$ctitle / $stitle</option>"; |
443 |
} |
444 |
} |
445 |
echo "</select><input type=hidden name=op value=LinksModLinkS><input type=submit value=".translate("Modify")."> [ <a href=admin.php?op=LinksDelLink&lid=$lid>".translate("Delete")."</a> ]<br>"; |
446 |
|
447 |
} |
448 |
echo "</td></tr></table></td></tr></table></form><br>"; |
449 |
include ("footer.php"); |
450 |
} |
451 |
|
452 |
function LinksModLinkS($lid, $title, $url, $description, $name, $email, $hits, $cat) { |
453 |
$cat = explode("-", $cat); |
454 |
if ($cat[1]=="") { |
455 |
$cat[1] = 0; |
456 |
} |
457 |
$title = stripslashes(FixQuotes($title)); |
458 |
$url = stripslashes(FixQuotes($url)); |
459 |
$description = stripslashes(FixQuotes($description)); |
460 |
$name = stripslashes(FixQuotes($name)); |
461 |
$email = stripslashes(FixQuotes($email)); |
462 |
mysql_query("update links_links set cid='$cat[0]', sid='$cat[1]', title='$title', url='$url', description='$description', name='$name', email='$email', hits='$hits' where lid=$lid"); |
463 |
Header("Location: admin.php?op=links"); |
464 |
} |
465 |
|
466 |
function LinksDelLink($lid) { |
467 |
mysql_query("delete from links_links where lid=$lid"); |
468 |
Header("Location: admin.php?op=links"); |
469 |
} |
470 |
|
471 |
function LinksModCat($cat) { |
472 |
include ("header.php"); |
473 |
GraphicAdmin(); |
474 |
dbconnect(); |
475 |
$cat = explode("-", $cat); |
476 |
if ($cat[1]=="") { |
477 |
$cat[1] = 0; |
478 |
} |
479 |
echo " |
480 |
<table border=0 width=100% cellpadding=0 cellspacing=0 bgcolor=000000><tr><td> |
481 |
<table border=0 width=100% cellpadding=8 cellspacing=1 bgcolor=FFFFFF><tr><td> |
482 |
<font size=3 face=Arial,Helvetica><b>".translate("Modify Category")."</b><br><br>"; |
483 |
if ($cat[1]==0) { |
484 |
$result=mysql_query("select title from links_categories where cid=$cat[0]"); |
485 |
list($title) = mysql_fetch_row($result); |
486 |
echo "<form action=admin.php method=get> |
487 |
".translate("Name: ")."<input type=text name=title value=\"$title\" size=51 maxlength=50><br> |
488 |
<input type=hidden name=sub value=\"0\"> |
489 |
<input type=hidden name=cid value=$cat[0]> |
490 |
<input type=hidden name=op value=LinksModCatS> |
491 |
<table border=0><tr><td><font size=3 face=Arial,Helvetica> |
492 |
<input type=submit value=".translate("Save Changes")."></td><td><font size=3 face=Arial,Helvetica></form> |
493 |
<form action=admin.php method=get> |
494 |
<input type=hidden name=sub value=\"0\"> |
495 |
<input type=hidden name=cid value=$cat[0]> |
496 |
<input type=hidden name=op value=LinksDelCat> |
497 |
<input type=submit value=".translate("Delete")."></td></tr></table></form>"; |
498 |
} else { |
499 |
$result=mysql_query("select title from links_categories where cid=$cat[0]"); |
500 |
list($ctitle) = mysql_fetch_row($result); |
501 |
$result2=mysql_query("select title from links_subcategories where sid=$cat[1]"); |
502 |
list($stitle) = mysql_fetch_row($result2); |
503 |
echo "<form action=admin.php method=get> |
504 |
".translate("Category Name: ")."$ctitle<br> |
505 |
".translate("Sub-Category Name: ")."<input type=text name=title value=\"$stitle\" size=51 maxlength=50><br> |
506 |
<input type=hidden name=sub value=1> |
507 |
<input type=hidden name=cid value=$cat[0]> |
508 |
<input type=hidden name=sid value=$cat[1]> |
509 |
<input type=hidden name=op value=LinksModCatS> |
510 |
<table border=0><tr><td><font size=3 face=Arial,Helvetica> |
511 |
<input type=submit value=".translate("Save Changes")."></td><td><font size=3 face=Arial,Helvetica></form> |
512 |
<form action=admin.php method=get> |
513 |
<input type=hidden name=sub value=1> |
514 |
<input type=hidden name=cid value=$cat[0]> |
515 |
<input type=hidden name=sid value=$cat[1]> |
516 |
<input type=hidden name=op value=LinksDelCat> |
517 |
<input type=submit value=".translate("Delete")."></td></tr></table></form>"; |
518 |
} |
519 |
|
520 |
echo "</td></tr></table></td></tr></table><br>"; |
521 |
include("footer.php"); |
522 |
} |
523 |
|
524 |
function LinksModCatS($cid, $sid, $sub, $title) { |
525 |
if ($sub==0) { |
526 |
mysql_query("update links_categories set title='$title' where cid=$cid"); |
527 |
} else { |
528 |
mysql_query("update links_subcategories set title='$title' where sid=$sid"); |
529 |
} |
530 |
|
531 |
Header("Location: admin.php?op=links"); |
532 |
} |
533 |
|
534 |
function LinksDelCat($cid, $sid, $sub, $ok=0) { |
535 |
if($ok==1) { |
536 |
if ($sub>0) { |
537 |
mysql_query("delete from links_subcategories where sid=$sid"); |
538 |
mysql_query("delete from links_links where sid=$sid"); |
539 |
} else { |
540 |
mysql_query("delete from links_categories where cid=$cid"); |
541 |
mysql_query("delete from links_subcategories where cid=$cid"); |
542 |
mysql_query("delete from links_links where cid=$cid AND sid=0"); |
543 |
} |
544 |
Header("Location: admin.php?op=links"); |
545 |
|
546 |
} else { |
547 |
|
548 |
include("header.php"); |
549 |
GraphicAdmin(); |
550 |
echo "<TABLE WIDTH=100% CELLSPACING=0 CELLPADDING=1 BORDER=0 BGCOLOR=000000><TR><TD COLSPAN=2> |
551 |
<TABLE WIDTH=100% CELLSPACING=0 CELLPADDING=8 BORDER=0 BGCOLOR=FFFFFF><TR><TD><center><br>"; |
552 |
echo "<font face=Arial,Helvetica size=3 color=Red>"; |
553 |
echo "<b>".translate("WARNING: Are you sure you want to delete this Category and ALL its Links?")."</b><br><br><font color=Black>"; |
554 |
} |
555 |
echo "[ <a href=admin.php?op=LinksDelCat&cid=$cid&sid=$sid&sub=$sub&ok=1>".translate("Yes")."</a> | <a href=admin.php?op=links>".translate("No")."</a> ]<br><br>"; |
556 |
echo "</TD></TR></TABLE></TD></TR></TABLE>"; |
557 |
include("footer.php"); |
558 |
|
559 |
} |
560 |
|
561 |
|
562 |
function LinksDelNew($lid) { |
563 |
mysql_query("delete from links_newlink where lid=$lid"); |
564 |
Header("Location: admin.php?op=links"); |
565 |
} |
566 |
|
567 |
function LinksAddCat($title) { |
568 |
$result = mysql_query("select cid from links_categories where title='$title'"); |
569 |
$numrows = mysql_num_rows($result); |
570 |
if ($numrows>0) { |
571 |
include("header.php"); |
572 |
GraphicAdmin(); |
573 |
echo "<TABLE WIDTH=100% CELLSPACING=0 CELLPADDING=1 BORDER=0 BGCOLOR=000000><TR><TD COLSPAN=2> |
574 |
<TABLE WIDTH=100% CELLSPACING=0 CELLPADDING=8 BORDER=0 BGCOLOR=FFFFFF><TR><TD><center><br>"; |
575 |
echo "<font face=Arial,Helvetica size=3 color=Red>"; |
576 |
echo "<b>".translate("ERROR: The Category")." $title ".translate("already exist!")."</b><br><br>"; |
577 |
echo "</TD></TR></TABLE></TD></TR></TABLE>"; |
578 |
include("footer.php"); |
579 |
} else { |
580 |
mysql_query("insert into links_categories values (NULL, '$title')"); |
581 |
Header("Location: admin.php?op=links"); |
582 |
} |
583 |
} |
584 |
|
585 |
function LinksAddSubCat($cid, $title) { |
586 |
$result = mysql_query("select cid from links_subcategories where title='$title' AND cid='$cid'"); |
587 |
$numrows = mysql_num_rows($result); |
588 |
if ($numrows>0) { |
589 |
include("header.php"); |
590 |
GraphicAdmin(); |
591 |
echo "<TABLE WIDTH=100% CELLSPACING=0 CELLPADDING=1 BORDER=0 BGCOLOR=000000><TR><TD COLSPAN=2> |
592 |
<TABLE WIDTH=100% CELLSPACING=0 CELLPADDING=8 BORDER=0 BGCOLOR=FFFFFF><TR><TD><center><br>"; |
593 |
echo "<font face=Arial,Helvetica size=3 color=Red>"; |
594 |
echo "<b>".translate("ERROR: The SubCategory")." $title ".translate("already exist!")."</b><br><br>"; |
595 |
echo "</TD></TR></TABLE></TD></TR></TABLE>"; |
596 |
include("footer.php"); |
597 |
} else { |
598 |
mysql_query("insert into links_subcategories values (NULL, '$cid', '$title')"); |
599 |
Header("Location: admin.php?op=links"); |
600 |
} |
601 |
} |
602 |
|
603 |
|
604 |
function LinksAddLink($new, $lid, $title, $url, $cat, $description, $name, $email) { |
605 |
dbconnect(); |
606 |
$result = mysql_query("select url from links_links where url='$url'"); |
607 |
$numrows = mysql_num_rows($result); |
608 |
if ($numrows>0) { |
609 |
include("header.php"); |
610 |
GraphicAdmin(); |
611 |
echo "<TABLE WIDTH=100% CELLSPACING=0 CELLPADDING=1 BORDER=0 BGCOLOR=000000><TR><TD COLSPAN=2> |
612 |
<TABLE WIDTH=100% CELLSPACING=0 CELLPADDING=8 BORDER=0 BGCOLOR=FFFFFF><TR><TD><center><br>"; |
613 |
echo "<font face=Arial,Helvetica size=3 color=Red>"; |
614 |
echo "<b>".translate("ERROR: This URL is already listed in the Database!")."</b><br><br>"; |
615 |
echo "</TD></TR></TABLE></TD></TR></TABLE>"; |
616 |
include("footer.php"); |
617 |
} else { |
618 |
|
619 |
// Check if Title exist |
620 |
if ($title=="") { |
621 |
include("header.php"); |
622 |
GraphicAdmin(); |
623 |
echo "<TABLE WIDTH=100% CELLSPACING=0 CELLPADDING=1 BORDER=0 BGCOLOR=000000><TR><TD COLSPAN=2> |
624 |
<TABLE WIDTH=100% CELLSPACING=0 CELLPADDING=8 BORDER=0 BGCOLOR=FFFFFF><TR><TD><center><br>"; |
625 |
echo "<font face=Arial,Helvetica size=3 color=Red>"; |
626 |
echo "<b>".translate("ERROR: You need to type a TITLE for your URL!")."</b><br><br>"; |
627 |
echo "</TD></TR></TABLE></TD></TR></TABLE>"; |
628 |
include("footer.php"); |
629 |
} |
630 |
// Check if URL exist |
631 |
if ($url=="") { |
632 |
include("header.php"); |
633 |
GraphicAdmin(); |
634 |
echo "<TABLE WIDTH=100% CELLSPACING=0 CELLPADDING=1 BORDER=0 BGCOLOR=000000><TR><TD COLSPAN=2> |
635 |
<TABLE WIDTH=100% CELLSPACING=0 CELLPADDING=8 BORDER=0 BGCOLOR=FFFFFF><TR><TD><center><br>"; |
636 |
echo "<font face=Arial,Helvetica size=3 color=Red>"; |
637 |
echo "<b>".translate("ERROR: You need to type a URL for your URL!")."</b><br><br>"; |
638 |
echo "</TD></TR></TABLE></TD></TR></TABLE>"; |
639 |
include("footer.php"); |
640 |
} |
641 |
// Check if Description exist |
642 |
if ($description=="") { |
643 |
include("header.php"); |
644 |
GraphicAdmin(); |
645 |
echo "<TABLE WIDTH=100% CELLSPACING=0 CELLPADDING=1 BORDER=0 BGCOLOR=000000><TR><TD COLSPAN=2> |
646 |
<TABLE WIDTH=100% CELLSPACING=0 CELLPADDING=8 BORDER=0 BGCOLOR=FFFFFF><TR><TD><center><br>"; |
647 |
echo "<font face=Arial,Helvetica size=3 color=Red>"; |
648 |
echo "<b>".translate("ERROR: You need to type a DESCRIPTION for your URL!")."</b><br><br>"; |
649 |
echo "</TD></TR></TABLE></TD></TR></TABLE>"; |
650 |
include("footer.php"); |
651 |
} |
652 |
$cat = explode("-", $cat); |
653 |
if ($cat[1]=="") { |
654 |
$cat[1] = 0; |
655 |
} |
656 |
$title = stripslashes(FixQuotes($title)); |
657 |
$url = stripslashes(FixQuotes($url)); |
658 |
$description = stripslashes(FixQuotes($description)); |
659 |
$name = stripslashes(FixQuotes($name)); |
660 |
$email = stripslashes(FixQuotes($email)); |
661 |
dbconnect(); |
662 |
mysql_query("insert into links_links values (NULL, '$cat[0]', '$cat[1]', '$title', '$url', '$description', now(), '$name', '$email', '0')"); |
663 |
include("header.php"); |
664 |
GraphicAdmin(); |
665 |
echo "<TABLE WIDTH=100% CELLSPACING=0 CELLPADDING=1 BORDER=0 BGCOLOR=000000><TR><TD COLSPAN=2> |
666 |
<TABLE WIDTH=100% CELLSPACING=0 CELLPADDING=8 BORDER=0 BGCOLOR=FFFFFF><TR><TD><center><br>"; |
667 |
echo "<font face=Arial,Helvetica size=3>"; |
668 |
echo "".translate("New Link added to the Database")."<br><br>"; |
669 |
echo "</TD></TR></TABLE></TD></TR></TABLE>"; |
670 |
if ($new==1) { |
671 |
mysql_query("delete from links_newlink where lid=$lid"); |
672 |
if ($email=="") { |
673 |
} else { |
674 |
$subject = "".translate("Your Link at $sitename").""; |
675 |
$message = "".translate("Hello")." $name:\n\n".translate("We approved your link submission for our search engine.")."\n\n".translate("Page Name: ")."$title\n".translate("Page URL: ")."$url\n".translate("Description: ")."$description\n\n\n".translate("You can browse our search engine at:")." $nuke_url/links.php\n\n".translate("Thanks for your submission!")."\n\n$sitename ".translate("team.").""; |
676 |
$from = "$sitename"; |
677 |
mail($email, $subject, $message, "From: $from\nX-Mailer: PHP/" . phpversion()); |
678 |
} |
679 |
} |
680 |
include("footer.php"); |
681 |
} |
682 |
} |
683 |
|
684 |
|
685 |
/*********************************************************/ |
686 |
/* Referer Functions to know who links us */ |
687 |
/*********************************************************/ |
688 |
|
689 |
function hreferer() { |
690 |
include ("header.php"); |
691 |
GraphicAdmin(); |
692 |
dbconnect(); |
693 |
echo " |
694 |
<center>$font4<b>".translate("HTTP Referers")."</b></center><br> |
695 |
<table border=0 width=100% cellpadding=0 cellspacing=0 bgcolor=000000><tr><td> |
696 |
<table border=0 width=100% cellpadding=8 cellspacing=1 bgcolor=FFFFFF><tr><td> |
697 |
<font face=Lucida,Verdana,Arial,Helvetica size=3> |
698 |
<center><b>".translate("Who is linking our site?")."</b></center><br><br> |
699 |
<font size=2> |
700 |
<table border=0 width=100%>"; |
701 |
$hresult = mysql_query("select rid, url from referer"); |
702 |
while(list($rid, $url) = mysql_fetch_row($hresult)) { |
703 |
echo "<tr><td bgcolor=CCCCCC><font face=Arial,Helvetica size=2>$rid</td>"; |
704 |
echo "<td bgcolor=CCCCCC><font face=Arial,Helvetica size=2><a target=_blank href=$url>$url</a></td></tr>"; |
705 |
} |
706 |
echo "</table>$font3"; |
707 |
echo "<form action=admin.php method=post>"; |
708 |
echo "<input type=hidden name=op value=delreferer>"; |
709 |
echo "<center><input type=submit value=\"".translate("Delete Referers")."\"></center>"; |
710 |
echo "</td></tr></table></td></tr></table>"; |
711 |
include ("footer.php"); |
712 |
} |
713 |
|
714 |
function delreferer() { |
715 |
mysql_query("delete from referer"); |
716 |
Header("Location: admin.php?op=AdminMain"); |
717 |
} |
718 |
|
719 |
/*********************************************************/ |
720 |
/* Banners Administration Functions */ |
721 |
/*********************************************************/ |
722 |
|
723 |
function BannersAdmin() { |
724 |
include ("header.php"); |
725 |
GraphicAdmin(); |
726 |
dbconnect(); |
727 |
echo "<font size=4><center><b>".translate("Banners Administration")."</b></center><br><br>"; |
728 |
// Banners List |
729 |
echo " |
730 |
<a name=top> |
731 |
<table border=0 width=100% cellpadding=0 cellspacing=0 bgcolor=000000><tr><td> |
732 |
<table border=0 width=100% cellpadding=8 cellspacing=1 bgcolor=FFFFFF><tr><td> |
733 |
<font face=Lucida,Verdana,Arial,Helvetica size=3> |
734 |
<center><b>".translate("Current Active Banners")."</b></center><br> |
735 |
<font size=3> |
736 |
<table width=100% border=0><tr> |
737 |
<td bgcolor=0000BA><font face=Arial,Helvetica color=white><center>".translate("ID")."</td> |
738 |
<td bgcolor=0000BA><font face=Arial,Helvetica color=white><center>".translate("Impressions")."</td> |
739 |
<td bgcolor=0000BA><font face=Arial,Helvetica color=white><center>".translate("Imp. Left")."</td> |
740 |
<td bgcolor=0000BA><font face=Arial,Helvetica color=white><center>".translate("Clicks")."</td> |
741 |
<td bgcolor=0000BA><font face=Arial,Helvetica color=white><center>".translate("% Clicks")."</td> |
742 |
<td bgcolor=0000BA><font face=Arial,Helvetica color=white><center>".translate("Client Name")."</td> |
743 |
<td bgcolor=0000BA><font face=Arial,Helvetica color=white><center>".translate("Functions")."</td><tr>"; |
744 |
$result = mysql_query("select bid, cid, imptotal, impmade, clicks, date from banner order by bid"); |
745 |
|
746 |
while(list($bid, $cid, $imptotal, $impmade, $clicks, $date) = mysql_fetch_row($result)) { |
747 |
$result2 = mysql_query("select cid, name from bannerclient where cid=$cid"); |
748 |
list($cid, $name) = mysql_fetch_row($result2); |
749 |
if($impmade==0) { |
750 |
$percent = 0; |
751 |
} else { |
752 |
$percent = substr(100 * $clicks / $impmade, 0, 5); |
753 |
} |
754 |
|
755 |
if($imptotal==0) { |
756 |
$left = "".translate("Unlimited").""; |
757 |
} else { |
758 |
$left = $imptotal-$impmade; |
759 |
} |
760 |
echo " |
761 |
<td bgcolor=008888 align=center><font face=Arial,Helvetica color=white>$bid</td> |
762 |
<td bgcolor=008888 align=center><font face=Arial,Helvetica color=white>$impmade</td> |
763 |
<td bgcolor=008888 align=center><font face=Arial,Helvetica color=white>$left</td> |
764 |
<td bgcolor=008888 align=center><font face=Arial,Helvetica color=white>$clicks</td> |
765 |
<td bgcolor=008888 align=center><font face=Arial,Helvetica color=white>$percent%</td> |
766 |
<td bgcolor=008888 align=center><font face=Arial,Helvetica color=white>$name</td> |
767 |
<td bgcolor=008888 align=center><font face=Arial,Helvetica color=white><a href=admin.php?op=BannerEdit&bid=$bid>".translate("Edit")."</a> | <a href=admin.php?op=BannerDelete&bid=$bid&ok=0>".translate("Delete")."</a></td><tr> |
768 |
"; |
769 |
} |
770 |
echo "</td></tr></table></td></tr></table></td></tr></table><br>"; |
771 |
// Finished Banners List |
772 |
echo " |
773 |
<a name=top> |
774 |
<table border=0 width=100% cellpadding=0 cellspacing=0 bgcolor=000000><tr><td> |
775 |
<table border=0 width=100% cellpadding=8 cellspacing=1 bgcolor=FFFFFF><tr><td> |
776 |
<font face=Lucida,Verdana,Arial,Helvetica size=3> |
777 |
<center><b>".translate("Finished Banners")."</b></center><br> |
778 |
<font size=3> |
779 |
<table width=100% border=0><tr> |
780 |
<td bgcolor=0000BA><font face=Arial,Helvetica color=white><center>".translate("ID")."</td> |
781 |
<td bgcolor=0000BA><font face=Arial,Helvetica color=white><center>".translate("Imp.")."</td> |
782 |
<td bgcolor=0000BA><font face=Arial,Helvetica color=white><center>".translate("Clicks")."</td> |
783 |
<td bgcolor=0000BA><font face=Arial,Helvetica color=white><center>".translate("% Clicks")."</td> |
784 |
<td bgcolor=0000BA><font face=Arial,Helvetica color=white><center>".translate("Date Started")."</td> |
785 |
<td bgcolor=0000BA><font face=Arial,Helvetica color=white><center>".translate("Date Ended")."</td> |
786 |
<td bgcolor=0000BA><font face=Arial,Helvetica color=white><center>".translate("Client Name")."</td> |
787 |
<td bgcolor=0000BA><font face=Arial,Helvetica color=white><center>".translate("Functions")."</td><tr>"; |
788 |
$result = mysql_query("select bid, cid, impressions, clicks, datestart, dateend from bannerfinish order by bid"); |
789 |
|
790 |
while(list($bid, $cid, $impressions, $clicks, $datestart, $dateend) = mysql_fetch_row($result)) { |
791 |
$result2 = mysql_query("select cid, name from bannerclient where cid=$cid"); |
792 |
list($cid, $name) = mysql_fetch_row($result2); |
793 |
$percent = substr(100 * $clicks / $impressions, 0, 5); |
794 |
echo " |
795 |
<td bgcolor=008888 align=center><font face=Arial,Helvetica color=white>$bid</td> |
796 |
<td bgcolor=008888 align=center><font face=Arial,Helvetica color=white>$impressions</td> |
797 |
<td bgcolor=008888 align=center><font face=Arial,Helvetica color=white>$clicks</td> |
798 |
<td bgcolor=008888 align=center><font face=Arial,Helvetica color=white>$percent%</td> |
799 |
<td bgcolor=008888 align=center><font face=Arial,Helvetica color=white>$datestart</td> |
800 |
<td bgcolor=008888 align=center><font face=Arial,Helvetica color=white>$dateend</td> |
801 |
<td bgcolor=008888 align=center><font face=Arial,Helvetica color=white>$name</td> |
802 |
<td bgcolor=008888 align=center><font face=Arial,Helvetica color=white><a href=admin.php?op=BannerFinishDelete&bid=$bid>".translate("Delete")."</a></td><tr> |
803 |
"; |
804 |
} |
805 |
echo "</td></tr></table></td></tr></table></td></tr></table><br>"; |
806 |
|
807 |
// Clients List |
808 |
echo " |
809 |
<table border=0 width=100% cellpadding=0 cellspacing=0 bgcolor=000000><tr><td> |
810 |
<table border=0 width=100% cellpadding=8 cellspacing=1 bgcolor=FFFFFF><tr><td> |
811 |
<font face=Lucida,Verdana,Arial,Helvetica size=3> |
812 |
<center><b>".translate("Advertising Clients")."</b></center><br> |
813 |
<font size=3> |
814 |
<table width=100% border=0><tr> |
815 |
<td bgcolor=0000BA><font face=Arial,Helvetica color=white><center>".translate("ID")."</td> |
816 |
<td bgcolor=0000BA><font face=Arial,Helvetica color=white><center>".translate("Client Name")."</td> |
817 |
<td bgcolor=0000BA><font face=Arial,Helvetica color=white><center>".translate("Active Banners")."</td> |
818 |
<td bgcolor=0000BA><font face=Arial,Helvetica color=white><center>".translate("Contact Name")."</td> |
819 |
<td bgcolor=0000BA><font face=Arial,Helvetica color=white><center>".translate("Contact Email")."</td> |
820 |
<td bgcolor=0000BA><font face=Arial,Helvetica color=white><center>".translate("Functions")."</td><tr>"; |
821 |
$result = mysql_query("select cid, name, contact, email from bannerclient order by cid"); |
822 |
|
823 |
while(list($cid, $name, $contact, $email) = mysql_fetch_row($result)) { |
824 |
$result2 = mysql_query("select cid from banner where cid=$cid"); |
825 |
$numrows = mysql_num_rows($result2); |
826 |
echo " |
827 |
<td bgcolor=008888 align=center><font face=Arial,Helvetica color=white>$cid</td> |
828 |
<td bgcolor=008888 align=center><font face=Arial,Helvetica color=white>$name</td> |
829 |
<td bgcolor=008888 align=center><font face=Arial,Helvetica color=white>$numrows</td> |
830 |
<td bgcolor=008888 align=center><font face=Arial,Helvetica color=white>$contact</td> |
831 |
<td bgcolor=008888 align=center><font face=Arial,Helvetica color=white>$email</td> |
832 |
<td bgcolor=008888 align=center><font face=Arial,Helvetica color=white><a href=admin.php?op=BannerClientEdit&cid=$cid>".translate("Edit")."</a> | <a href=admin.php?op=BannerClientDelete&cid=$cid>".translate("Delete")."</a></td><tr> |
833 |
"; |
834 |
} |
835 |
echo "</td></tr></table></td></tr></table></td></tr></table><br>"; |
836 |
// Add Banner |
837 |
$result = mysql_query("select * from bannerclient"); |
838 |
$numrows = mysql_num_rows($result); |
839 |
if($numrows>0) { |
840 |
echo" |
841 |
<table border=0 width=100% cellpadding=0 cellspacing=0 bgcolor=000000><tr><td> |
842 |
<table border=0 width=100% cellpadding=8 cellspacing=1 bgcolor=FFFFFF><tr><td> |
843 |
<font face=Lucida,Verdana,Arial,Helvetica size=3> |
844 |
<b>".translate("Add a New Banner")."</b></center><br><br> |
845 |
<font size=3> |
846 |
<form action=admin.php?op=BannersAdd method=post> |
847 |
".translate("Client Name: ")." |
848 |
<select name=cid>"; |
849 |
$result = mysql_query("select cid, name from bannerclient"); |
850 |
while(list($cid, $name) = mysql_fetch_row($result)) { |
851 |
echo "<option value=$cid>$name</option>"; |
852 |
} |
853 |
echo " |
854 |
</select><br> |
855 |
".translate("Impressions Purchased: ")."<input type=text name=imptotal size=12 maxlength=11> 0 = ".translate("Unlimited")."<br> |
856 |
".translate("Image URL: ")."<input type=text name=imageurl size=50 maxlength=100><br> |
857 |
".translate("Click URL: ")."<input type=text name=clickurl size=50 maxlength=200><br> |
858 |
<input type=hidden name=op value=BannersAdd> |
859 |
<input type=submit value=\"".translate("Add Banner")."\"> |
860 |
</td></tr></table></td></tr></table></form> |
861 |
"; |
862 |
} |
863 |
// Add Client |
864 |
echo" |
865 |
<table border=0 width=100% cellpadding=0 cellspacing=0 bgcolor=000000><tr><td> |
866 |
<table border=0 width=100% cellpadding=8 cellspacing=1 bgcolor=FFFFFF><tr><td> |
867 |
<font face=Lucida,Verdana,Arial,Helvetica size=3> |
868 |
<b>".translate("Add a New Client")."</b></center><br><br> |
869 |
<font size=3> |
870 |
<form action=admin.php?op=BannersAddClient method=post> |
871 |
".translate("Client Name: ")."<input type=text name=name size=30 maxlength=60><br> |
872 |
".translate("Contact Name: ")."<input type=text name=contact size=30 maxlength=60><br> |
873 |
".translate("Contact Email: ")."<input type=text name=email size=30 maxlength=60><br> |
874 |
".translate("Client Login: ")."<input type=text name=login size=12 maxlength=10><br> |
875 |
".translate("Client Password: ")."<input type=text name=passwd size=12 maxlength=10><br> |
876 |
".translate("Extra Info:")."<br><textarea name=extrainfo cols=60 rows=10></textarea><br> |
877 |
<input type=hidden name=op value=BannerAddClient> |
878 |
<input type=submit value=\"".translate("Add Client")."\"> |
879 |
</td></tr></table></td></tr></table></form> |
880 |
"; |
881 |
include ("footer.php"); |
882 |
} |
883 |
|
884 |
function BannersAdd($name, $cid, $imptotal, $imageurl, $clickurl) { |
885 |
mysql_query("insert into banner values (NULL, '$cid', '$imptotal', '1', '0', '$imageurl', '$clickurl', now())"); |
886 |
Header("Location: admin.php?op=BannersAdmin#top"); |
887 |
} |
888 |
|
889 |
function BannerAddClient($name, $contact, $email, $login, $passwd, $extrainfo) { |
890 |
mysql_query("insert into bannerclient values (NULL, '$name', '$contact', '$email', '$login', '$passwd', '$extrainfo')"); |
891 |
Header("Location: admin.php?op=BannersAdmin#top"); |
892 |
} |
893 |
|
894 |
function BannerFinishDelete($bid) { |
895 |
mysql_query("delete from bannerfinish where bid=$bid"); |
896 |
Header("Location: admin.php?op=BannersAdmin#top"); |
897 |
} |
898 |
|
899 |
function BannerDelete($bid, $ok=0) { |
900 |
if ($ok==1) { |
901 |
dbconnect(); |
902 |
mysql_query("delete from banner where bid='$bid'"); |
903 |
Header("Location: admin.php?op=BannersAdmin#top"); |
904 |
} else { |
905 |
include("header.php"); |
906 |
dbconnect(); |
907 |
GraphicAdmin(); |
908 |
$result=mysql_query("select cid, imptotal, impmade, clicks, imageurl, clickurl from banner where bid=$bid"); |
909 |
list($cid, $imptotal, $impmade, $clicks, $imageurl, $clickurl) = mysql_fetch_row($result); |
910 |
echo "<table border=0 bgcolor=000000 cellpadding=1 cellspacing=0 width=100%> |
911 |
<tr><td> |
912 |
<table border=0 bgcolor=FFFFFF cellpadding=1 cellspacing=0 width=100%> |
913 |
<tr><td><center> |
914 |
$font3<b>".translate("Delete Banner")."</b><br><br> |
915 |
<a href=$clickurl><img src=$imageurl border=1></a><br> |
916 |
<a href=$clickurl>$clickurl</a><br><br> |
917 |
<table width=100% border=0><tr> |
918 |
<td bgcolor=0000BA><font face=Arial,Helvetica color=white><center>".translate("ID")."</td> |
919 |
<td bgcolor=0000BA><font face=Arial,Helvetica color=white><center>".translate("Impressions")."</td> |
920 |
<td bgcolor=0000BA><font face=Arial,Helvetica color=white><center>".translate("Imp. Left")."</td> |
921 |
<td bgcolor=0000BA><font face=Arial,Helvetica color=white><center>".translate("Clicks")."</td> |
922 |
<td bgcolor=0000BA><font face=Arial,Helvetica color=white><center>".translate("% Clicks")."</td> |
923 |
<td bgcolor=0000BA><font face=Arial,Helvetica color=white><center>".translate("Client Name")."</td><tr>"; |
924 |
$result2 = mysql_query("select cid, name from bannerclient where cid=$cid"); |
925 |
list($cid, $name) = mysql_fetch_row($result2); |
926 |
$percent = substr(100 * $clicks / $impmade, 0, 5); |
927 |
if($imptotal==0) { |
928 |
$left = unlimited; |
929 |
} else { |
930 |
$left = $imptotal-$impmade; |
931 |
} |
932 |
echo " |
933 |
<td bgcolor=008888 align=center><font face=Arial,Helvetica color=white>$bid</td> |
934 |
<td bgcolor=008888 align=center><font face=Arial,Helvetica color=white>$impmade</td> |
935 |
<td bgcolor=008888 align=center><font face=Arial,Helvetica color=white>$left</td> |
936 |
<td bgcolor=008888 align=center><font face=Arial,Helvetica color=white>$clicks</td> |
937 |
<td bgcolor=008888 align=center><font face=Arial,Helvetica color=white>$percent%</td> |
938 |
<td bgcolor=008888 align=center><font face=Arial,Helvetica color=white>$name</td><tr> |
939 |
"; |
940 |
} |
941 |
echo "</td></tr></table><br> |
942 |
".translate("Are you sure you want to delete this Banner?")."<br><br> |
943 |
[ <a href=\"admin.php?op=BannersAdmin#top\">".translate("No")."</a> | <a href=\"admin.php?op=BannerDelete&bid=$bid&ok=1\">".translate("Yes")."</a> ]</center><br><br></center> |
944 |
</td></tr></table></center></td></tr></table>"; |
945 |
include("footer.php"); |
946 |
} |
947 |
|
948 |
function BannerEdit($bid) { |
949 |
include("header.php"); |
950 |
dbconnect(); |
951 |
GraphicAdmin(); |
952 |
$result=mysql_query("select cid, imptotal, impmade, clicks, imageurl, clickurl from banner where bid=$bid"); |
953 |
list($cid, $imptotal, $impmade, $clicks, $imageurl, $clickurl) = mysql_fetch_row($result); |
954 |
echo" |
955 |
<table border=0 width=100% cellpadding=0 cellspacing=0 bgcolor=000000><tr><td> |
956 |
<table border=0 width=100% cellpadding=8 cellspacing=1 bgcolor=FFFFFF><tr><td> |
957 |
<font face=Lucida,Verdana,Arial,Helvetica size=3> |
958 |
<center><b>".translate("Edit Banner")."</b><br><br> |
959 |
<img src=$imageurl border=1><br><br> |
960 |
<font size=3></center> |
961 |
<form action=admin.php?op=BannerChange method=post> |
962 |
".translate("Client Name: ")." |
963 |
<select name=cid> |
964 |
"; |
965 |
|
966 |
$result = mysql_query("select cid, name from bannerclient where cid=$cid"); |
967 |
list($cid, $name) = mysql_fetch_row($result); |
968 |
|
969 |
echo "<option value=$cid selected>$name</option>"; |
970 |
$result = mysql_query("select cid, name from bannerclient"); |
971 |
while(list($ccid, $name) = mysql_fetch_row($result)) { |
972 |
if($cid!=$ccid) { |
973 |
echo "<option value=$ccid>$name</option>"; |
974 |
} |
975 |
} |
976 |
echo "</select><br>"; |
977 |
if($imptotal==0) { |
978 |
$impressions = "".translate("Unlimited").""; |
979 |
} else { |
980 |
$impressions = $imptotal; |
981 |
} |
982 |
echo" |
983 |
".translate("Add More Impressions: ")."<input type=text name=impadded size=12 maxlength=11> ".translate("Purchased: ")."<b>$impressions</b> ".translate("Made: ")."<b>$impmade</b><br> |
984 |
".translate("Image URL: ")."<input type=text name=imageurl size=50 maxlength=60 value=\"$imageurl\"><br> |
985 |
".translate("Click URL: ")."<input type=text name=clickurl size=50 maxlength=100 value=\"$clickurl\"><br> |
986 |
<input type=hidden name=bid value=$bid> |
987 |
<input type=hidden name=imptotal value=$imptotal> |
988 |
<input type=hidden name=op value=BannerChange> |
989 |
<input type=submit value=\"".translate("Change Banner")."\"> |
990 |
</td></tr></table></td></tr></table></form> |
991 |
"; |
992 |
include("footer.php"); |
993 |
} |
994 |
|
995 |
function BannerChange($bid, $cid, $imptotal, $impadded, $imageurl, $clickurl) { |
996 |
dbconnect(); |
997 |
$imp = $imptotal+$impadded; |
998 |
mysql_query("update banner set cid='$cid', imptotal='$imp', imageurl='$imageurl', clickurl='$clickurl' where bid=$bid"); |
999 |
Header("Location: admin.php?op=BannersAdmin#top"); |
1000 |
} |
1001 |
|
1002 |
function BannerClientDelete($cid, $ok=0) { |
1003 |
if ($ok==1) { |
1004 |
dbconnect(); |
1005 |
mysql_query("delete from banner where cid='$cid'"); |
1006 |
mysql_query("delete from bannerclient where cid='$cid'"); |
1007 |
Header("Location: admin.php?op=BannersAdmin#top"); |
1008 |
} else { |
1009 |
include("header.php"); |
1010 |
dbconnect(); |
1011 |
GraphicAdmin(); |
1012 |
$result=mysql_query("select cid, name from bannerclient where cid=$cid"); |
1013 |
list($cid, $name) = mysql_fetch_row($result); |
1014 |
echo "<table border=0 bgcolor=000000 cellpadding=1 cellspacing=0 width=100%> |
1015 |
<tr><td> |
1016 |
<table border=0 bgcolor=FFFFFF cellpadding=1 cellspacing=0 width=100%> |
1017 |
<tr><td><center> |
1018 |
$font3<b>".translate("Delete Advertising Client")."</b><br><br> |
1019 |
".translate("You are about to delete client:")." <b>$name</b> ".translate("and all its Banners!!!")."<br><br>"; |
1020 |
$result2 = mysql_query("select imageurl, clickurl from banner where cid=$cid"); |
1021 |
$numrows = mysql_num_rows($result2); |
1022 |
if($numrows==0) { |
1023 |
echo "".translate("This client doesn't have any banner running now.")."<br><br>"; |
1024 |
} else { |
1025 |
echo "<font color=Red><b>".translate("WARNING!!!")."</b></font>$font3<br> |
1026 |
".translate("This client has the following ACTIVE BANNERS running in")." $sitename:<br><br>"; |
1027 |
} |
1028 |
while(list($imageurl, $clickurl) = mysql_fetch_row($result2)) { |
1029 |
echo" |
1030 |
<a href=$clickurl><img src=$imageurl border=1></a><br> |
1031 |
<a href=$clickurl>$clickurl</a><br><br> |
1032 |
"; |
1033 |
} |
1034 |
} |
1035 |
echo "".translate("Are you sure you want to delete this Client and ALL its Banners?")."<br><br> |
1036 |
[ <a href=\"admin.php?op=BannersAdmin#top\">".translate("No")."</a> | <a href=\"admin.php?op=BannerClientDelete&cid=$cid&ok=1\">".translate("Yes")."</a> ]</center><br><br></center> |
1037 |
</td></tr></table></center></td></tr></table>"; |
1038 |
include("footer.php"); |
1039 |
} |
1040 |
|
1041 |
function BannerClientEdit($cid) { |
1042 |
include("header.php"); |
1043 |
dbconnect(); |
1044 |
GraphicAdmin(); |
1045 |
$result = mysql_query("select name, contact, email, login, passwd, extrainfo from bannerclient where cid=$cid"); |
1046 |
list($name, $contact, $email, $login, $passwd, $extrainfo) = mysql_fetch_row($result); |
1047 |
echo" |
1048 |
<table border=0 width=100% cellpadding=0 cellspacing=0 bgcolor=000000><tr><td> |
1049 |
<table border=0 width=100% cellpadding=8 cellspacing=1 bgcolor=FFFFFF><tr><td> |
1050 |
<font face=Lucida,Verdana,Arial,Helvetica size=3> |
1051 |
<center><b>".translate("Edit Advertising Client")."</b><br><br></center> |
1052 |
<form action=admin.php?op=BannerClientChange method=post> |
1053 |
".translate("Client Name: ")."<input type=text name=name value=\"$name\" size=30 maxlength=60><br> |
1054 |
".translate("Contact Name: ")."<input type=text name=contact value=\"$contact\" size=30 maxlength=60><br> |
1055 |
".translate("Contact Email: ")."<input type=text name=email size=30 maxlength=60 value=\"$email\"><br> |
1056 |
".translate("Client Login: ")."<input type=text name=login size=12 maxlength=10 value=\"$login\"><br> |
1057 |
".translate("Client Password: ")."<input type=text name=passwd size=12 maxlength=10 value=\"$passwd\"><br> |
1058 |
".translate("Extra Info:")."<br><textarea name=extrainfo cols=60 rows=10>$extrainfo</textarea><br> |
1059 |
<input type=hidden name=cid value=$cid> |
1060 |
<input type=hidden name=op value=BannerClientChange> |
1061 |
<input type=submit value=\"".translate("Change Client")."\"> |
1062 |
</td></tr></table></td></tr></table></form> |
1063 |
"; |
1064 |
include("footer.php"); |
1065 |
} |
1066 |
|
1067 |
function BannerClientChange($cid, $name, $contact, $email, $extrainfo, $login, $passwd) { |
1068 |
dbconnect(); |
1069 |
mysql_query("update bannerclient set name='$name', contact='$contact', email='$email', login='$login', passwd='$passwd' where cid=$cid"); |
1070 |
Header("Location: admin.php?op=BannersAdmin#top"); |
1071 |
} |
1072 |
|
1073 |
/*********************************************************/ |
1074 |
/* Administration Main Function */ |
1075 |
/*********************************************************/ |
1076 |
|
1077 |
function adminMain() { |
1078 |
include ('header.php'); |
1079 |
// dbconnect(); |
1080 |
echo" |
1081 |
<table border=0 cellpadding=1 cellspacing=0 width=100% bgcolor=000000><tr><td> |
1082 |
<table border=0 cellpadding=5 cellspacing=0 width=100% bgcolor=FFFFFF><tr><td>"; |
1083 |
$dummy = 0; |
1084 |
$result = mysql_query("SELECT qid, subject, timestamp FROM queue order by timestamp"); |
1085 |
if(mysql_num_rows($result) == 0) { |
1086 |
echo "<table width=\"100%\"><tr><td bgcolor=\"#cccccc\" align=\"center\">$font3<b>".translate("No New Submissions")."</b></td></tr></table>"; |
1087 |
} else { |
1088 |
echo "<br><form action=\"admin.php\" method=\"post\"><table width=\"100%\" border=1 bgcolor=CCCCCC>"; |
1089 |
while (list($qid, $subject, $timestamp) = mysql_fetch_row($result)) { |
1090 |
$hour = "AM"; |
1091 |
ereg ("([0-9]{4})-([0-9]{1,2})-([0-9]{1,2}) ([0-9]{1,2}):([0-9]{1,2}):([0-9]{1,2})", $timestamp, $datetime); |
1092 |
if ($datetime[4] > 12) { $datetime[4] = $datetime[4]-12; $hour = "PM"; } |
1093 |
$datetime = date(translate("datestring"), mktime($datetime[4],$datetime[5],$datetime[6],$datetime[2],$datetime[3],$datetime[1])); |
1094 |
echo "<tr> |
1095 |
<td align=middle><font face=\"arial, helvetica\" SIZE=2>(<a href=admin.php?op=DeleteStory&qid=$qid>".translate("Delete")."</a>)</td> |
1096 |
<td width=100%><font face=\"arial, helvetica\" SIZE=3> |
1097 |
<a href=\"admin.php?op=DisplayStory&qid=$qid\">$subject</a></font> |
1098 |
</td><td align=right><font face=\"arial, helvetica\" SIZE=2>$timestamp</font> |
1099 |
</td></tr>"; |
1100 |
$dummy++; |
1101 |
} |
1102 |
if ($dummy < 1) { |
1103 |
echo "<tr><td bgcolor=\"#cccccc\" align=\"center\"><b>".translate("No New Submissions")."</b></td></tr></table></form>"; |
1104 |
} else { |
1105 |
?> |
1106 |
</table></form> |
1107 |
<?php |
1108 |
} |
1109 |
} |
1110 |
mysql_free_result($result); |
1111 |
?> |
1112 |
<font face=Arial,Helvetica> |
1113 |
<hr noshade> |
1114 |
<?php |
1115 |
GraphicAdmin(); |
1116 |
?> |
1117 |
<hr noshade> |
1118 |
<?php echo "<center>$font4<b>".translate("Last")." $admart ".translate("Articles")."</b></center></font>"; ?> |
1119 |
<br> |
1120 |
<?php |
1121 |
$result=mysql_query("select sid, title, time, topic, informant from stories order by time desc limit 0,$admart"); |
1122 |
echo "<center><table border=1 width=100%>"; |
1123 |
|
1124 |
while(list($sid, $title, $time, $topic, $informant) = mysql_fetch_row($result)) { |
1125 |
$ta=mysql_query("select topicname from topics where topicid=$topic"); |
1126 |
list($topicname) = mysql_fetch_row($ta); |
1127 |
formatTimestamp($time); |
1128 |
echo " |
1129 |
<tr><td align=right>$font2<b>$sid</b> |
1130 |
</td><td align=left width=100%>$font2<a href=article.php?sid=$sid>$title</a> |
1131 |
</td><td align=right>$font2$topicname |
1132 |
</td><td align=right>$font2<b>(<a href=admin.php?op=EditStory&sid=$sid>".translate("Edit")."</a>)</b> |
1133 |
</td><td align=right>$font2<b>(<a href=admin.php?op=RemoveStory&sid=$sid>".translate("Delete")."</a>)</b>"; |
1134 |
echo "</td></tr>"; |
1135 |
} |
1136 |
echo "</td></table></center>"; |
1137 |
?> |
1138 |
<center> |
1139 |
<form action="admin.php" method="post"> |
1140 |
<?php echo translate("Story ID:"); ?> <input type="text" NAME="sid" SIZE=10> |
1141 |
<select name="op"> |
1142 |
<option value="EditStory" SELECTED><?php echo translate("EditStory"); ?></option> |
1143 |
<option value="RemoveStory"><?php echo translate("RemoveStory"); ?></option></select> |
1144 |
<input type="submit" value="<?php echo translate("Go!");?>"></form></center> |
1145 |
<hr noshade> |
1146 |
<center> |
1147 |
<?PHP |
1148 |
$result = mysql_query("SELECT pollID, pollTitle, timeStamp FROM poll_desc ORDER BY pollID DESC limit 1"); |
1149 |
$object = mysql_fetch_object($result); |
1150 |
$pollTitle = $object->pollTitle; |
1151 |
echo translate("Current Poll:")." $pollTitle |
1152 |
<br><br></td></tr></table></td></tr></table>"; |
1153 |
mysql_free_result($result); |
1154 |
include ('footer.php'); |
1155 |
} |
1156 |
|
1157 |
/*********************************************************/ |
1158 |
/* Sections Manager Functions */ |
1159 |
/*********************************************************/ |
1160 |
|
1161 |
function sections() { |
1162 |
include("header.php"); |
1163 |
include("config.php"); |
1164 |
dbconnect(); |
1165 |
GraphicAdmin(); |
1166 |
$result = mysql_query("select secid, secname from sections order by secid"); |
1167 |
if (mysql_num_rows($result)==0) { |
1168 |
echo "<table border=0 bgcolor=000000 cellpadding=1 cellspacing=0 width=95%> |
1169 |
<tr><td> |
1170 |
<table border=0 bgcolor=FFFFFF cellpadding=1 cellspacing=0 width=100%>"; |
1171 |
} |
1172 |
if (mysql_num_rows($result) > 0) { |
1173 |
|
1174 |
echo "<table border=0 bgcolor=000000 cellpadding=1 cellspacing=0 width=100%> |
1175 |
<tr><td> |
1176 |
<table border=0 bgcolor=FFFFFF cellpadding=1 cellspacing=0 width=100%> |
1177 |
<tr><td>$font3<b><center>".translate("Current Active Sections")."</b><br>".translate("Click to Edit")."</center><br> |
1178 |
<center><table border=0 width=100% align=center cellpadding=1><tr><td align=center> |
1179 |
<font face=Arial,Helvetica>"; |
1180 |
while(list($secid, $secname) = mysql_fetch_array($result)) { |
1181 |
?> |
1182 |
|
1183 |
<li><?php echo "<a href=admin.php?op=sectionedit&secid=$secid>"; ?><?php echo "$secname"; ?></a> |
1184 |
<?php |
1185 |
} |
1186 |
echo "</td></tr></table>"; |
1187 |
|
1188 |
?> |
1189 |
</td></tr></table></td></tr></table> |
1190 |
<br> |
1191 |
|
1192 |
<table border=0 bgcolor=000000 cellpadding=1 cellspacing=0 width=100%> |
1193 |
<tr><td> |
1194 |
<table border=0 bgcolor=FFFFFF cellpadding=5 cellspacing=0 width=100%> |
1195 |
<tr><td> |
1196 |
<font face=Arial,Helvetica size=4><b><?php echo translate("Add Article in Sections"); ?></b><font size=2> |
1197 |
<br><br> |
1198 |
<form action="admin.php" method="post"><br> |
1199 |
<b><?php echo translate("Title:"); ?></b><br> |
1200 |
<input type="text" name="title" size=60 value=""><br><br> |
1201 |
<?php |
1202 |
$result = mysql_query("select secid, secname from sections order by secid"); |
1203 |
while(list($secid, $secname) = mysql_fetch_array($result)) { |
1204 |
echo "<input type=radio name=secid value=$secid>$secname<br>"; |
1205 |
} ?> |
1206 |
<br> |
1207 |
<b><?php echo translate("Content:"); ?></b><br> |
1208 |
<textarea name="content" cols=60 rows=10></textarea><br><br> |
1209 |
|
1210 |
<input type=hidden name=op value=secarticleadd> |
1211 |
<INPUT type="submit" value="<?php echo translate("Add Article!"); ?>"> |
1212 |
</form> |
1213 |
</td></tr></table></td></tr></table> |
1214 |
<br> |
1215 |
<table border=0 bgcolor=000000 cellpadding=1 cellspacing=0 width=100%> |
1216 |
<tr><td> |
1217 |
<table border=0 bgcolor=FFFFFF cellpadding=5 cellspacing=0 width=100%> |
1218 |
<tr><td> |
1219 |
<font face=Arial,Helvetica size=4><b><?php echo translate("Last"); echo " $admart "; echo translate("Articles"); ?></b><font size=2> |
1220 |
<br><br> |
1221 |
<ul> |
1222 |
<?php |
1223 |
$result = mysql_query("select artid, secid, title, content from seccont order by artid desc limit 0,$admart"); |
1224 |
while(list($artid, $secid, $title, $content) = mysql_fetch_array($result)) { |
1225 |
$result2 = mysql_query("select secid, secname from sections where secid='$secid'"); |
1226 |
list($secid, $secname) = mysql_fetch_row($result2); |
1227 |
echo "<li>$title ($secname) [ <a href=admin.php?op=secartedit&artid=$artid>".translate("Edit")."</a> ]"; |
1228 |
} ?> |
1229 |
</ul> |
1230 |
<form action="admin.php" method="post"> |
1231 |
<?php echo translate("Edit Article ID:"); ?> <input type="text" NAME="artid" SIZE=10> |
1232 |
<input type=hidden name=op value="secartedit"> |
1233 |
<input type="submit" value="<?php echo translate("Go!");?>"> |
1234 |
|
1235 |
<?php mysql_free_result($result); ?> |
1236 |
|
1237 |
</td></tr></table></td></tr></table></form> |
1238 |
</ul> |
1239 |
<?php } ?> |
1240 |
<table border=0 bgcolor=000000 cellpadding=1 cellspacing=0 width=100%> |
1241 |
<tr><td> |
1242 |
<table border=0 bgcolor=FFFFFF cellpadding=8 cellspacing=0 width=100%> |
1243 |
<tr><td> |
1244 |
<font face=Arial,Helvetica size=4><b><?php echo translate("Add a New Section"); ?></b><font size=2> |
1245 |
<br><br> |
1246 |
<form action="admin.php" method="post"><br> |
1247 |
<b><?php echo translate("Section Name:"); ?></b><br> |
1248 |
<input type="text" name="secname" size=40 maxlength=40><br><br> |
1249 |
<b><?php echo translate("Section Image:"); ?> </b> <?php echo translate("(example: opinion.gif)"); ?><br> |
1250 |
<input type="text" name="image" size=40 maxlength=50><br><br> |
1251 |
|
1252 |
<input type=hidden name=op value=sectionmake> |
1253 |
<INPUT type="submit" value="<?php echo translate("Add Section!"); ?>"> |
1254 |
</form> |
1255 |
</td></tr></table></td></tr></table></td></tr></table> |
1256 |
<?php |
1257 |
include("footer.php"); |
1258 |
} |
1259 |
|
1260 |
function secarticleadd($secid, $title, $content) { |
1261 |
dbconnect(); |
1262 |
$title = stripslashes(FixQuotes($title)); |
1263 |
$content = stripslashes(FixQuotes($content)); |
1264 |
mysql_query("INSERT INTO seccont VALUES (NULL,'$secid','$title','$content','0')"); |
1265 |
Header("Location: admin.php?op=sections"); |
1266 |
} |
1267 |
|
1268 |
function secartedit($artid) { |
1269 |
include("header.php"); |
1270 |
dbconnect(); |
1271 |
GraphicAdmin(); |
1272 |
$result = mysql_query("select artid, secid, title, content from seccont where artid='$artid'"); |
1273 |
list($artid, $secid, $title, $content) = mysql_fetch_array($result); |
1274 |
?> |
1275 |
|
1276 |
<table border=0 bgcolor=000000 cellpadding=1 cellspacing=0 width=100%> |
1277 |
<tr><td> |
1278 |
<table border=0 bgcolor=FFFFFF cellpadding=8 cellspacing=0 width=100%> |
1279 |
<tr><td> |
1280 |
<font face=Arial,Helvetica size=4><b><?php echo translate("Edit Article"); ?></b><font size=2> |
1281 |
<br><br> |
1282 |
<form action="admin.php" method="post"><br> |
1283 |
<b><?php echo translate("Title:"); ?></b><br> |
1284 |
<input type="text" name="title" size=60 value="<?php echo "$title"; ?>"><br><br> |
1285 |
|
1286 |
<?php |
1287 |
$result2 = mysql_query("select secid, secname from sections order by secname"); |
1288 |
while(list($secid2, $secname) = mysql_fetch_array($result2)) { |
1289 |
|
1290 |
if ($secid2==$secid) { $che = "checked"; } |
1291 |
echo "<input type=radio name=secid value=$secid2 $che>$secname<br>"; |
1292 |
$che = ""; |
1293 |
|
1294 |
} ?> |
1295 |
|
1296 |
<br> |
1297 |
<b><?php echo translate("Content"); ?></b><br> |
1298 |
<textarea name=content cols=60 rows=10><?php echo "$content"; ?></textarea> |
1299 |
<input type=hidden name=artid value="<?php echo "$artid"; ?>"> |
1300 |
<input type=hidden name=op value=secartchange> |
1301 |
<table border=0><tr><td> |
1302 |
<INPUT type="submit" value="<?php echo translate("Save Changes!"); ?>"> |
1303 |
</td><td></form> |
1304 |
<form action="admin.php" method="post"><br> |
1305 |
<input type=hidden name=artid value="<?php echo "$artid"; ?>"> |
1306 |
<input type=hidden name=op value=secartdelete> |
1307 |
<INPUT type="submit" value="<?php echo translate("Delete Article!"); ?>"> |
1308 |
</form></td></tr></table> |
1309 |
</td></tr></table></td></tr></table> |
1310 |
<?php |
1311 |
include("footer.php"); |
1312 |
} |
1313 |
|
1314 |
function sectionmake($secname, $image) { |
1315 |
dbconnect(); |
1316 |
$secname = stripslashes(FixQuotes($secname)); |
1317 |
$image = stripslashes(FixQuotes($image)); |
1318 |
mysql_query("INSERT INTO sections VALUES (NULL,'$secname', '$image')"); |
1319 |
Header("Location: admin.php?op=sections"); |
1320 |
} |
1321 |
|
1322 |
function sectionedit($secid) { |
1323 |
include("header.php"); |
1324 |
dbconnect(); |
1325 |
GraphicAdmin(); |
1326 |
$result = mysql_query("select secid, secname, image from sections where secid=$secid"); |
1327 |
list($secid, $secname, $image) = mysql_fetch_array($result); |
1328 |
|
1329 |
$result2 = mysql_query("select artid from seccont where secid=$secid"); |
1330 |
$number = mysql_num_rows($result2); |
1331 |
?> |
1332 |
<table border=0 bgcolor=000000 cellpadding=1 cellspacing=0 width=100%> |
1333 |
<tr><td> |
1334 |
<table border=0 bgcolor=FFFFFF cellpadding=8 cellspacing=0 width=100%> |
1335 |
<tr><td> |
1336 |
<?php echo "<img src=images/sections/$image border=0><br><br>"; ?> |
1337 |
<font face=Arial,Helvetica size=4><b><?php echo translate("Edit Section:"); ?> <?php echo "$secname"; ?></b><font size=2> |
1338 |
<br> |
1339 |
(This Section has <?php echo "$number"; ?> Articles attached) |
1340 |
<br><br> |
1341 |
<form action="admin.php" method="post"><br> |
1342 |
<b><?php echo translate("Section Name:"); ?></b> <?php echo translate("(40 characters Max.)"); ?><br> |
1343 |
<input type="text" name="secname" size=40 maxlength=40 value="<?php echo "$secname"; ?>"><br><br> |
1344 |
<b><?php echo translate("Section Image:"); ?></b> <?php echo translate("(example: opinion.gif)"); ?><br> |
1345 |
<input type="text" name="image" size=40 maxlength=50 value="<?php echo "$image"; ?>"><br><br> |
1346 |
<input type=hidden name=secid value="<?php echo "$secid"; ?>"> |
1347 |
<input type=hidden name=op value=sectionchange> |
1348 |
<table border=0><tr><td> |
1349 |
<INPUT type="submit" value="<?php echo translate("Save Changes!"); ?>"> |
1350 |
</td><td></form> |
1351 |
<form action="admin.php" method="post"><br> |
1352 |
<input type=hidden name=secid value="<?php echo "$secid"; ?>"> |
1353 |
<input type=hidden name=op value=sectiondelete> |
1354 |
<INPUT type="submit" value="Delete Section!"> |
1355 |
</form></td></tr></table> |
1356 |
|
1357 |
</td></tr></table></td></tr></table> |
1358 |
<?php |
1359 |
include("footer.php"); |
1360 |
} |
1361 |
|
1362 |
function sectionchange($secid, $secname, $image) { |
1363 |
dbconnect(); |
1364 |
$secname = stripslashes(FixQuotes($secname)); |
1365 |
$image = stripslashes(FixQuotes($image)); |
1366 |
mysql_query("update sections set secname='$secname', image='$image' where secid=$secid"); |
1367 |
Header("Location: admin.php?op=sections"); |
1368 |
} |
1369 |
|
1370 |
function secartchange($artid, $secid, $title, $content) { |
1371 |
|
1372 |
$title = stripslashes(FixQuotes($title)); |
1373 |
$content = stripslashes(FixQuotes($content)); |
1374 |
dbconnect(); |
1375 |
mysql_query("update seccont set secid='$secid', title='$title', content='$content' where artid=$artid"); |
1376 |
Header("Location: admin.php?op=sections"); |
1377 |
} |
1378 |
|
1379 |
function sectiondelete($secid, $ok=0) { |
1380 |
if ($ok==1) { |
1381 |
dbconnect(); |
1382 |
mysql_query("delete from seccont where secid='$secid'"); |
1383 |
mysql_query("delete from sections where secid='$secid'"); |
1384 |
Header("Location: admin.php?op=sections"); |
1385 |
} else { |
1386 |
include("header.php"); |
1387 |
dbconnect(); |
1388 |
GraphicAdmin(); |
1389 |
$result=mysql_query("select secname from sections where secid=$secid"); |
1390 |
list($secname) = mysql_fetch_row($result); |
1391 |
echo "<table border=0 bgcolor=000000 cellpadding=1 cellspacing=0 width=95%> |
1392 |
<tr><td> |
1393 |
<table border=0 bgcolor=FFFFFF cellpadding=1 cellspacing=0 width=100%> |
1394 |
<tr><td><center> |
1395 |
$font3<b>".translate("Delete Section: ")."$secname</b><br><br> |
1396 |
".translate("Are you sure you want to delete section")." $secname?<br> |
1397 |
".translate("This will delete ALL its articles!")."<br><br> |
1398 |
[ <a href=\"admin.php?op=sections\">".translate("No")."</a> | <a href=\"admin.php?op=sectiondelete&secid=$secid&ok=1\">".translate("Yes")."</a> ]</center><br><br></center> |
1399 |
</td></tr></table></center></td></tr></table>"; |
1400 |
include("footer.php"); |
1401 |
} |
1402 |
} |
1403 |
|
1404 |
function secartdelete($artid, $ok=0) { |
1405 |
if ($ok==1) { |
1406 |
dbconnect(); |
1407 |
mysql_query("delete from seccont where artid='$artid'"); |
1408 |
Header("Location: admin.php?op=sections"); |
1409 |
} else { |
1410 |
include("header.php"); |
1411 |
dbconnect(); |
1412 |
GraphicAdmin(); |
1413 |
$result = mysql_query("select title from seccont where artid=$artid"); |
1414 |
list($title) = mysql_fetch_row($result); |
1415 |
echo "<table border=0 bgcolor=000000 cellpadding=1 cellspacing=0 width=95%> |
1416 |
<tr><td> |
1417 |
<table border=0 bgcolor=FFFFFF cellpadding=8 cellspacing=0 width=100%> |
1418 |
<tr><td><center> |
1419 |
$font3<b>".translate("Delete Article: ")."$title</b><br><br> |
1420 |
".translate("Are you sure you want to delete this article?")."<br><br> |
1421 |
[ <a href=\"admin.php?op=sections\">".translate("No")."</a> | <a href=\"admin.php?op=secartdelete&artid=$artid&ok=1\">".translate("Yes")."</a> ]</center><br><br></center> |
1422 |
</td></tr></table></center></td></tr></table>"; |
1423 |
include("footer.php"); |
1424 |
} |
1425 |
} |
1426 |
|
1427 |
/*********************************************************/ |
1428 |
/* Topics Manager Functions */ |
1429 |
/*********************************************************/ |
1430 |
|
1431 |
function topicsmanager() { |
1432 |
include("header.php"); |
1433 |
dbconnect(); |
1434 |
GraphicAdmin(); |
1435 |
$result = mysql_query("select topicid, topicname, topicimage, topictext from topics order by topicid"); |
1436 |
if (mysql_num_rows($result)==0) { |
1437 |
echo "<table border=0 bgcolor=000000 cellpadding=2 cellspacing=0 width=95%> |
1438 |
<tr><td> |
1439 |
<table border=0 bgcolor=FFFFFF cellpadding=1 cellspacing=0 width=100%>"; |
1440 |
} |
1441 |
if (mysql_num_rows($result) > 0) { |
1442 |
|
1443 |
echo "<table border=0 bgcolor=000000 cellpadding=2 cellspacing=0 width=100%> |
1444 |
<tr><td> |
1445 |
<table border=0 bgcolor=FFFFFF cellpadding=1 cellspacing=0 width=100%> |
1446 |
<tr><td>$font3<b><center>".translate("Current Active Topics")."</b><br>".translate("Click to Edit")."</center><br> |
1447 |
<center><table border=0 width=100% align=center cellpadding=2><tr>"; |
1448 |
|
1449 |
|
1450 |
while(list($topicid, $topicname, $topicimage, $topictext) = mysql_fetch_array($result)) { |
1451 |
?> |
1452 |
|
1453 |
<td align=center> |
1454 |
<?php echo "<a href=admin.php?op=topicedit&topicid=$topicid>"; ?><img src=<?php echo "$tipath$topicimage"; ?> border=0></a><br> |
1455 |
<font face=Arial,Helvetica size=2><b><?php echo "$topictext"; ?> |
1456 |
</td> |
1457 |
<?php |
1458 |
|
1459 |
// Thanks to John Hoffmann from softlinux.org for the next 5 lines ;) |
1460 |
|
1461 |
$count++; |
1462 |
if ($count == 5) { |
1463 |
echo "</tr></tr>"; |
1464 |
$count = 0; |
1465 |
} |
1466 |
|
1467 |
?> |
1468 |
<?php |
1469 |
} |
1470 |
echo "</tr></table>"; |
1471 |
} |
1472 |
?> |
1473 |
</td></tr></table></td></tr></table> |
1474 |
<br><a name=Add> |
1475 |
<table border=0 bgcolor=000000 cellpadding=2 cellspacing=0 width=100%> |
1476 |
<tr><td> |
1477 |
<table border=0 bgcolor=FFFFFF cellpadding=5 cellspacing=0 width=100%> |
1478 |
<tr><td> |
1479 |
<font face=Arial,Helvetica size=4><b><?php echo translate("Add a New Topic"); ?></b><font size=2> |
1480 |
<br><br> |
1481 |
<form action="admin.php" method="post"><br> |
1482 |
<b><?php echo translate("Topic Name:"); ?></b> <?php echo translate("(just a name without spaces - max: 20 characters)"); ?><br> |
1483 |
<?php echo translate("for example: gamesandhobbies"); ?><br> |
1484 |
<input type="text" name="topicname" size=20 maxlength=20 value="<?php echo "$topicname"; ?>"><br><br> |
1485 |
<b><?php echo translate("Topic Text:"); ?></b> <?php echo translate("(the full topic text or description - max: 40 characters)"); ?><br> |
1486 |
<?php echo translate("for example: Games and Hobbies"); ?><br> |
1487 |
<input type="text" name="topictext" size=40 maxlength=40 value="<?php echo "$topictext"; ?>"><br><br> |
1488 |
<b><?php echo translate("Topic Image:"); ?></b> <?php echo translate("(image name + extension located in"); ?> <?php echo "$tipath"; ?>)<br> |
1489 |
<?php echo translate("for example: games.gif"); ?><br> |
1490 |
<input type="text" name="topicimage" size=20 maxlength=20 value="<?php echo "$topicimage"; ?>"><br><br> |
1491 |
<input type=hidden name=op value=topicmake> |
1492 |
<INPUT type="submit" value="<?php echo translate("Add Topic!"); ?>"> |
1493 |
</form> |
1494 |
</td></tr></table></td></tr></table> |
1495 |
<?php |
1496 |
mysql_free_result($result); |
1497 |
include("footer.php"); |
1498 |
} |
1499 |
|
1500 |
function topicedit($topicid) { |
1501 |
include("header.php"); |
1502 |
dbconnect(); |
1503 |
GraphicAdmin(); |
1504 |
$result = mysql_query("select topicid, topicname, topicimage, topictext from topics where topicid=$topicid"); |
1505 |
list($topicid, $topicname, $topicimage, $topictext) = mysql_fetch_array($result) |
1506 |
?> |
1507 |
<table border=0 bgcolor=000000 cellpadding=2 cellspacing=0 width=100%> |
1508 |
<tr><td> |
1509 |
<table border=0 bgcolor=FFFFFF cellpadding=5 cellspacing=0 width=100%> |
1510 |
<tr><td> |
1511 |
<img src=<?php echo "$tipath$topicimage"; ?> border=0 align=right> |
1512 |
<font face=Arial,Helvetica size=4><b><?php echo translate("Edit Topic:"); ?> <?php echo "$topictext"; ?></b><font size=2> |
1513 |
<br><br> |
1514 |
<form action="admin.php" method="post"><br> |
1515 |
<b><?php echo translate("Topic Name:"); ?></b> <?php echo translate("(just a name without spaces - max: 20 characters)"); ?><br> |
1516 |
<?php echo translate("for example: gamesandhobbies"); ?><br> |
1517 |
<input type="text" name="topicname" size=20 maxlength=20 value="<?php echo "$topicname"; ?>"><br><br> |
1518 |
<b><?php echo translate("Topic Text:"); ?></b> <?php echo translate("(the full topic text or description - max: 40 characters)"); ?><br> |
1519 |
<?php echo translate("for example: Games and Hobbies"); ?><br> |
1520 |
<input type="text" name="topictext" size=40 maxlength=40 value="<?php echo "$topictext"; ?>"><br><br> |
1521 |
<b><?php echo translate("Topic Image:"); ?></b> <?php echo translate("(image name + extension located in"); ?> <?php echo "$tipath"; ?>)<br> |
1522 |
<?php echo translate("for example: games.gif"); ?><br> |
1523 |
<input type="text" name="topicimage" size=20 maxlength=20 value="<?php echo "$topicimage"; ?>"><br><br> |
1524 |
<input type=hidden name=topicid value="<?php echo "$topicid"; ?>"> |
1525 |
<input type=hidden name=op value=topicchange> |
1526 |
<table border=0><tr><td> |
1527 |
<INPUT type="submit" value="<?php echo translate("Save Changes!"); ?>"> |
1528 |
</td><td></form> |
1529 |
<form action="admin.php" method="post"><br> |
1530 |
<input type=hidden name=topicid value="<?php echo "$topicid"; ?>"> |
1531 |
<input type=hidden name=op value=topicdelete> |
1532 |
<INPUT type="submit" value="<?php echo translate("Delete Topic!"); ?>"> |
1533 |
</form></td></tr></table> |
1534 |
</td></tr></table></td></tr></table> |
1535 |
<?php |
1536 |
include("footer.php"); |
1537 |
} |
1538 |
|
1539 |
function topicmake($topicname, $topicimage, $topictext) { |
1540 |
dbconnect(); |
1541 |
$topicname = stripslashes(FixQuotes($topicname)); |
1542 |
$topicimage = stripslashes(FixQuotes($topicimage)); |
1543 |
$topictext = stripslashes(FixQuotes($topictext)); |
1544 |
mysql_query("INSERT INTO topics VALUES (NULL,'$topicname','$topicimage','$topictext','0')"); |
1545 |
Header("Location: admin.php?op=topicsmanager#Add"); |
1546 |
} |
1547 |
|
1548 |
function topicchange($topicid, $topicname, $topicimage, $topictext) { |
1549 |
dbconnect(); |
1550 |
$topicname = stripslashes(FixQuotes($topicname)); |
1551 |
$topicimage = stripslashes(FixQuotes($topicimage)); |
1552 |
$topictext = stripslashes(FixQuotes($topictext)); |
1553 |
mysql_query("update topics set topicname='$topicname', topicimage='$topicimage', topictext='$topictext' where topicid=$topicid"); |
1554 |
Header("Location: admin.php?op=topicsmanager"); |
1555 |
} |
1556 |
|
1557 |
function topicdelete($topicid, $ok=0) { |
1558 |
if ($ok==1) { |
1559 |
dbconnect(); |
1560 |
$result=mysql_query("select sid from stories where topic='$topicid'"); |
1561 |
list($sid) = mysql_fetch_row($result); |
1562 |
mysql_query("delete from stories where topic='$topicid'"); |
1563 |
mysql_query("delete from topics where topicid='$topicid'"); |
1564 |
$result=mysql_query("select sid from comments where sid='$sid'"); |
1565 |
list($sid) = mysql_fetch_row($result); |
1566 |
mysql_query("delete from comments where sid='$sid'"); |
1567 |
Header("Location: admin.php?op=topicsmanager"); |
1568 |
} else { |
1569 |
include("header.php"); |
1570 |
dbconnect(); |
1571 |
GraphicAdmin(); |
1572 |
$result2=mysql_query("select topicimage, topictext from topics where topicid='$topicid'"); |
1573 |
list($topicimage, $topictext) = mysql_fetch_row($result2); |
1574 |
echo "<table border=0 bgcolor=000000 cellpadding=2 cellspacing=0 width=95%> |
1575 |
<tr><td> |
1576 |
<table border=0 bgcolor=FFFFFF cellpadding=1 cellspacing=0 width=100%> |
1577 |
<tr><td> |
1578 |
<center><img src=$tipath$topicimage border=0><br> |
1579 |
$font3<b>".translate("Delete Topic")." $topictext</b><br><br> |
1580 |
".translate("Are you sure you want to delete Topic")." $topictext?<br> |
1581 |
".translate("This will delete ALL it's stories and it's comments!")."<br><br> |
1582 |
[ <a href=\"admin.php?op=topicsmanager\">".translate("No")."</a> | <a href=\"admin.php?op=topicdelete&topicid=$topicid&ok=1\">".translate("Yes")."</a> ]</center><br><br> |
1583 |
</td></tr></table></td></tr></table>"; |
1584 |
include("footer.php"); |
1585 |
} |
1586 |
} |
1587 |
|
1588 |
/*********************************************************/ |
1589 |
/* MAIN Block Functions */ |
1590 |
/*********************************************************/ |
1591 |
|
1592 |
function mblock() { |
1593 |
include("header.php"); |
1594 |
dbconnect(); |
1595 |
GraphicAdmin(); |
1596 |
$result = mysql_query("select title, content from mainblock"); |
1597 |
if (mysql_num_rows($result) > 0) { |
1598 |
while(list($title, $content) = mysql_fetch_array($result)) { |
1599 |
echo "<center>$font4<b>".translate("Edit Main Block")."</center></b><br><br>$font3"; |
1600 |
?> |
1601 |
<table width=100% border=0 cellpadding=0 cellspacing=0 bgcolor=000000><tr><td> |
1602 |
<table width=100% border=0 cellpadding=8 cellspacing=1 bgcolor=FFFFFF><tr><td> |
1603 |
<form action="admin.php" method="post"> |
1604 |
<?php echo translate("Title:"); ?> |
1605 |
<input type="text" name="title" size="30" maxlength="60" value="<?php echo $title; ?>"><br> |
1606 |
<?php echo translate("Content:"); ?> |
1607 |
<br><textarea cols="50" rows="10" name="content"><?php echo $content; ?></textarea><br> |
1608 |
<input type="hidden" name="op" value="changemblock"> |
1609 |
<input type="submit" VALUE="<?php echo translate("Go!"); ?>"> |
1610 |
</td></tr></table></td></tr></table></form> |
1611 |
<br><br> |
1612 |
<?php |
1613 |
} |
1614 |
} ?> |
1615 |
<?php |
1616 |
include("footer.php"); |
1617 |
} |
1618 |
|
1619 |
function changemblock($title, $content) { |
1620 |
dbconnect(); |
1621 |
$title = stripslashes(FixQuotes($title)); |
1622 |
$content = stripslashes(FixQuotes($content)); |
1623 |
mysql_query("update mainblock set title='$title', content='$content'"); |
1624 |
Header("Location: admin.php?op=adminMain"); |
1625 |
} |
1626 |
|
1627 |
|
1628 |
/*********************************************************/ |
1629 |
/* RIGHT Blocks Functions */ |
1630 |
/*********************************************************/ |
1631 |
|
1632 |
function rblocks() { |
1633 |
include("header.php"); |
1634 |
dbconnect(); |
1635 |
GraphicAdmin(); |
1636 |
echo "$font4<b><center> |
1637 |
".translate("Edit Right Blocks")." |
1638 |
</b></center><br><br> |
1639 |
<table width=100% border=0 cellpadding=0 cellspacing=0 bgcolor=000000><tr><td> |
1640 |
<table width=100% border=0 cellpadding=8 cellspacing=1 bgcolor=FFFFFF><tr><td> |
1641 |
$font3"; |
1642 |
$result = mysql_query("select id, title, content from rblocks"); |
1643 |
if (mysql_num_rows($result) > 0) { |
1644 |
while(list($id, $title, $content) = mysql_fetch_array($result)) { |
1645 |
?> |
1646 |
<?php echo "$font3"; ?> |
1647 |
<form action="admin.php" method="post"> |
1648 |
<?php echo translate("Title:"); ?> |
1649 |
<input type="text" name="title" size="30" maxlength="60" value="<?php echo $title; ?>"><br> |
1650 |
<?php echo translate("Content:"); ?> |
1651 |
<br><textarea cols="50" rows="6" name="content"><?php echo $content; ?></textarea><br> |
1652 |
<input type="hidden" name="id" value="<?php echo $id; ?>"> |
1653 |
<select name="op"> |
1654 |
<option VALUE="changerblock" SELECTED><?php echo translate("changerblock"); ?></option> |
1655 |
<option VALUE="deleterblock"><?php echo translate("deleterblock"); ?></option> |
1656 |
</select> |
1657 |
<input type="submit" VALUE="<?php echo translate("Go!"); ?>"> |
1658 |
</form> |
1659 |
<br><br> |
1660 |
<?php |
1661 |
} |
1662 |
} |
1663 |
echo " |
1664 |
<hr noshade> |
1665 |
$font4<b><center> |
1666 |
".translate("Create New Right Block")." |
1667 |
</b></center><br><br>$font3"; |
1668 |
?> |
1669 |
<form action="admin.php" method="post"> |
1670 |
<?php echo translate("Title:"); ?><input type="text" name="title" size=30 maxlength=60><br> |
1671 |
<?php echo translate("Content:"); ?><br> |
1672 |
<textarea wrap=virtual cols=50 rows=6 name=content></textarea><br> |
1673 |
<input type="hidden" NAME="op" VALUE="makerblock"> |
1674 |
<input type="submit" VALUE="<?php echo translate("makerblock") ?>"> |
1675 |
</td></tr></table></td></tr></table></form> |
1676 |
<?php |
1677 |
include("footer.php"); |
1678 |
} |
1679 |
|
1680 |
function makerblock($title, $content) { |
1681 |
dbconnect(); |
1682 |
$title = stripslashes(FixQuotes($title)); |
1683 |
$content = stripslashes(FixQuotes($content)); |
1684 |
mysql_query("INSERT INTO rblocks VALUES (NULL,'$title','$content')"); |
1685 |
Header("Location: admin.php?op=rblocks"); |
1686 |
} |
1687 |
|
1688 |
function changerblock($id, $title, $content) { |
1689 |
dbconnect(); |
1690 |
$title = stripslashes(FixQuotes($title)); |
1691 |
$content = stripslashes(FixQuotes($content)); |
1692 |
mysql_query("update rblocks set title='$title', content='$content' where id=$id"); |
1693 |
Header("Location: admin.php?op=rblocks"); |
1694 |
} |
1695 |
|
1696 |
function deleterblock($id) { |
1697 |
dbconnect(); |
1698 |
mysql_query("delete from rblocks where id='$id'"); |
1699 |
Header("Location: admin.php?op=rblocks"); |
1700 |
} |
1701 |
|
1702 |
|
1703 |
/*********************************************************/ |
1704 |
/* LEFT Block Functions */ |
1705 |
/*********************************************************/ |
1706 |
|
1707 |
function lblocks() { |
1708 |
include("header.php"); |
1709 |
dbconnect(); |
1710 |
GraphicAdmin(); |
1711 |
echo "$font4<b><center> |
1712 |
".translate("Edit Left Blocks")." |
1713 |
</b></center><br><br> |
1714 |
<table width=100% border=0 cellpadding=0 cellspacing=0 bgcolor=000000><tr><td> |
1715 |
<table width=100% border=0 cellpadding=8 cellspacing=1 bgcolor=FFFFFF><tr><td> |
1716 |
$font3"; |
1717 |
$result = mysql_query("select id, title, content from lblocks"); |
1718 |
if (mysql_num_rows($result) > 0) { |
1719 |
while(list($id, $title, $content) = mysql_fetch_array($result)) { |
1720 |
?> |
1721 |
<form action="admin.php" method="post"> |
1722 |
<?php echo translate("Title:"); ?> |
1723 |
<input type="text" name="title" size="30" maxlength="60" value="<?php echo $title; ?>"><br> |
1724 |
<?php echo translate("Content:"); ?> |
1725 |
<br><textarea cols="50" rows="6" name="content"><?php echo $content; ?></textarea><br> |
1726 |
<input type="hidden" name="id" value="<?php echo $id; ?>"> |
1727 |
<select name="op"> |
1728 |
<option VALUE="changelblock" SELECTED><?php echo translate("changelblock"); ?></option> |
1729 |
<option VALUE="deletelblock"><?php echo translate("deletelblock"); ?></option> |
1730 |
</select> |
1731 |
<input type="submit" VALUE="<?php echo translate("Go!"); ?>"> |
1732 |
</form> |
1733 |
<br><br> |
1734 |
<?php |
1735 |
} |
1736 |
} |
1737 |
echo " |
1738 |
<hr noshade> |
1739 |
$font4<b><center> |
1740 |
".translate("Create New Left Block")." |
1741 |
</b></center><br><br>$font3"; |
1742 |
?> |
1743 |
<form action="admin.php" method="post"> |
1744 |
<?php echo translate("Title:"); ?><input type="text" name="title" size=30 maxlength=60><br> |
1745 |
<?php echo translate("Content:"); ?><br> |
1746 |
<textarea wrap=virtual cols=50 rows=6 name=content></textarea><br> |
1747 |
<input type="hidden" NAME="op" VALUE="makelblock"> |
1748 |
<input type="submit" VALUE="<?php echo translate("makelblock"); ?>"> |
1749 |
</td></tr></table></td></tr></table></form> |
1750 |
<?php |
1751 |
include("footer.php"); |
1752 |
} |
1753 |
|
1754 |
function makelblock($title, $content) { |
1755 |
dbconnect(); |
1756 |
$title = stripslashes(FixQuotes($title)); |
1757 |
$content = stripslashes(FixQuotes($content)); |
1758 |
mysql_query("INSERT INTO lblocks VALUES (NULL,'$title','$content')"); |
1759 |
Header("Location: admin.php?op=adminMain"); |
1760 |
} |
1761 |
|
1762 |
function changelblock($id, $title, $content) { |
1763 |
dbconnect(); |
1764 |
$title = stripslashes(FixQuotes($title)); |
1765 |
$content = stripslashes(FixQuotes($content)); |
1766 |
mysql_query("update lblocks set title='$title', content='$content' where id=$id"); |
1767 |
Header("Location: admin.php?op=adminMain"); |
1768 |
} |
1769 |
|
1770 |
function deletelblock($id) { |
1771 |
dbconnect(); |
1772 |
mysql_query("delete from lblocks where id='$id'"); |
1773 |
Header("Location: admin.php?op=adminMain"); |
1774 |
} |
1775 |
|
1776 |
|
1777 |
|
1778 |
/*********************************************************/ |
1779 |
/* ADMIN Block Functions */ |
1780 |
/*********************************************************/ |
1781 |
|
1782 |
function ablock() { |
1783 |
include("header.php"); |
1784 |
dbconnect(); |
1785 |
GraphicAdmin(); |
1786 |
echo "$font4<b><center> |
1787 |
".translate("Edit Admin Block")." |
1788 |
</b></center><br><br> |
1789 |
<table width=100% border=0 cellpadding=0 cellspacing=0 bgcolor=000000><tr><td> |
1790 |
<table width=100% border=0 cellpadding=8 cellspacing=1 bgcolor=FFFFFF><tr><td> |
1791 |
$font3"; |
1792 |
$result = mysql_query("select title, content from adminblock"); |
1793 |
if (mysql_num_rows($result) > 0) { |
1794 |
while(list($title, $content) = mysql_fetch_array($result)) { |
1795 |
?> |
1796 |
<form action="admin.php" method="post"> |
1797 |
<?php echo translate("Title:"); ?> |
1798 |
<input type="text" name="title" size="30" maxlength="60" value="<?php echo $title; ?>"><br> |
1799 |
<?php echo translate("Content:"); ?> |
1800 |
<br><textarea cols="50" rows="10" name="content"><?php echo $content; ?></textarea><br> |
1801 |
<input type="hidden" name="op" value="changeablock"> |
1802 |
<input type="submit" VALUE="<?php echo translate("Go!"); ?>"> |
1803 |
</td></tr></table></td></tr></table></form> |
1804 |
<br><br> |
1805 |
<?php |
1806 |
} |
1807 |
} ?> |
1808 |
<?php |
1809 |
include("footer.php"); |
1810 |
} |
1811 |
|
1812 |
function changeablock($title, $content) { |
1813 |
dbconnect(); |
1814 |
$title = stripslashes(FixQuotes($title)); |
1815 |
$content = stripslashes(FixQuotes($content)); |
1816 |
mysql_query("update adminblock set title='$title', content='$content'"); |
1817 |
Header("Location: admin.php?op=adminMain"); |
1818 |
} |
1819 |
|
1820 |
/*********************************************************/ |
1821 |
/* Story/News Functions */ |
1822 |
/*********************************************************/ |
1823 |
|
1824 |
function deleteStory($qid) { |
1825 |
dbconnect(); |
1826 |
$result = mysql_query("delete from queue where qid=$qid"); |
1827 |
if (!$result) |
1828 |
{ |
1829 |
echo mysql_errno(). ": ".mysql_error(). "<br>"; |
1830 |
return; |
1831 |
} Header("Location: admin.php?op=adminMain"); |
1832 |
} |
1833 |
|
1834 |
function displayStory ($qid) { |
1835 |
global $user, $subject, $story; |
1836 |
include ('config.php'); |
1837 |
include ('header.php'); |
1838 |
dbconnect(); |
1839 |
GraphicAdmin(); |
1840 |
$result = mysql_query("SELECT qid, uid, uname, subject, story, topic FROM queue where qid=$qid"); |
1841 |
list($qid, $uid, $uname, $subject, $story, $topic) = mysql_fetch_row($result); |
1842 |
mysql_free_result($result); |
1843 |
|
1844 |
$subject = stripslashes($subject); |
1845 |
$story = stripslashes($story); |
1846 |
?> |
1847 |
|
1848 |
<table width=100% bgcolor=000000 cellpadding=0 cellspacing=0 border=0><tr><td> |
1849 |
<table width=100% bgcolor=FFFFFF cellpadding=8 cellspacing=2 border=0><tr><td> |
1850 |
<font size=3 face=Arial,Helvetica> |
1851 |
|
1852 |
<form action="admin.php" method="post"> |
1853 |
<p><b><?php echo translate("Name"); ?></b><br> |
1854 |
<input type="text" NAME="author" SIZE=50 value="<?PHP echo "$uname"; ?>"> |
1855 |
|
1856 |
<p><b><?php echo translate("Subject"); ?></b><br> |
1857 |
<input type=text name=subject size=50 value="<?PHP echo"$subject"; ?>"> |
1858 |
<?PHP |
1859 |
if($topic=="") { |
1860 |
$topic = 1; |
1861 |
} |
1862 |
$result = mysql_query("select topicimage from topics where topicid=$topic"); |
1863 |
list($topicimage) = mysql_fetch_row($result); |
1864 |
echo "<br><br><center><table width=80% bgcolor=000000 cellpadding=0 cellspacing=0 border=0><tr><td>"; |
1865 |
echo "<table width=100% bgcolor=FFFFFF cellpadding=8 cellspacing=2 border=0><tr><td>"; |
1866 |
echo "<img src=$tipath$topicimage border=0 align=right>"; |
1867 |
themepreview($subject, $story); |
1868 |
echo "</td></tr></table></td></tr></table></center>"; |
1869 |
?> |
1870 |
<p><b>Topic</b> <select name=topic> |
1871 |
<?PHP |
1872 |
$toplist = mysql_query("select topicid, topictext from topics order by topictext"); |
1873 |
echo "<OPTION VALUE=\"\">".translate("Select Topic")."</option>\n"; |
1874 |
while(list($topicid, $topics) = mysql_fetch_row($toplist)) { |
1875 |
if ($topicid==$topic) { $sel = "selected "; } |
1876 |
echo "<option $sel value=\"$topicid\">$topics</option>\n"; |
1877 |
$sel = ""; |
1878 |
} |
1879 |
?> |
1880 |
</select> |
1881 |
<p><b><?php echo translate("Intro Text"); ?></b><br> |
1882 |
<textarea wrap=virtual cols=50 rows=7 name=hometext><?PHP echo "$story"; ?></textarea> |
1883 |
<p><b><?php echo translate("Full Text"); ?></b><br> |
1884 |
<textarea wrap=virtual cols=50 rows=8 name=bodytext></textarea><BR> |
1885 |
<FONT size=2><?php echo translate("(Did you check URLs?)"); ?></FONT><P> |
1886 |
|
1887 |
<p><b><?php echo translate("Notes"); ?></b><br> |
1888 |
<textarea wrap=virtual cols=50 rows=4 name=notes></textarea><br> |
1889 |
|
1890 |
<input type="hidden" NAME="qid" SIZE=50 value="<?PHP echo "$qid"; ?>"> |
1891 |
<input type="hidden" NAME="uid" SIZE=50 value="<?PHP echo "$uid"; ?>"> |
1892 |
<select name="op"> |
1893 |
<option value="DeleteStory"><?php echo translate("DeleteStory"); ?></option> |
1894 |
<option value="PreviewAgain" SELECTED><?php echo translate("PreviewAgain"); ?></option> |
1895 |
<option value="PostStory"><?php echo translate("PostStory"); ?></option> |
1896 |
</select> |
1897 |
<INPUT type="submit" value="<?php echo translate("Go!"); ?>"> |
1898 |
</td></tr></table></td></tr></table></form> |
1899 |
<?PHP |
1900 |
include ('footer.php'); |
1901 |
} |
1902 |
|
1903 |
function previewStory($qid, $uid, $author, $subject, $hometext, $bodytext, $topic, $notes) { |
1904 |
global $user, $boxstuff; |
1905 |
include ('config.php'); |
1906 |
include ('header.php'); |
1907 |
GraphicAdmin(); |
1908 |
$subject = stripslashes($subject); |
1909 |
$hometext = stripslashes($hometext); |
1910 |
$bodytext = stripslashes($bodytext); |
1911 |
$notes = stripslashes($notes); |
1912 |
?> |
1913 |
|
1914 |
<table width=100% bgcolor=000000 cellpadding=0 cellspacing=0 border=0><tr><td> |
1915 |
<table width=100% bgcolor=FFFFFF cellpadding=8 cellspacing=2 border=0><tr><td> |
1916 |
<font size=3 face=Arial,Helvetica> |
1917 |
|
1918 |
<form action="admin.php" method=post> |
1919 |
|
1920 |
<p><b><?php echo translate("Name"); ?></b><br> |
1921 |
<input type="text" NAME="author" SIZE=50 value="<?PHP echo"$author"; ?>"> |
1922 |
|
1923 |
<p><b><?php echo translate("Subject"); ?></b><br> |
1924 |
<input type=text name=subject size=50 value="<?PHP echo"$subject"; ?>"> |
1925 |
|
1926 |
<?PHP |
1927 |
$result = mysql_query("select topicimage from topics where topicid=$topic"); |
1928 |
list($topicimage) = mysql_fetch_row($result); |
1929 |
echo "<br><br><center><table width=80% bgcolor=000000 cellpadding=0 cellspacing=0 border=0><tr><td>"; |
1930 |
echo "<table width=100% bgcolor=FFFFFF cellpadding=8 cellspacing=2 border=0><tr><td>"; |
1931 |
echo "<img src=$tipath$topicimage border=0 align=right>"; |
1932 |
themepreview($subject, $hometext, $bodytext); |
1933 |
echo "</td></tr></table></td></tr></table></center>"; |
1934 |
|
1935 |
?> |
1936 |
<p><b><?php echo translate("Topic"); ?></b> <select name=topic> |
1937 |
<?PHP |
1938 |
$toplist = mysql_query("select topicid, topictext from topics order by topictext"); |
1939 |
echo "<OPTION VALUE=\"\">".translate("All Topics")."</option>\n"; |
1940 |
while(list($topicid, $topics) = mysql_fetch_row($toplist)) { |
1941 |
if ($topicid==$topic) { $sel = "selected "; } |
1942 |
echo "<option $sel value=\"$topicid\">$topics</option>\n"; |
1943 |
$sel = ""; |
1944 |
} |
1945 |
?> |
1946 |
</select> |
1947 |
<p><b><?php echo translate("Intro Text"); ?></b><br> |
1948 |
<textarea wrap=virtual cols=50 rows=7 name=hometext><?PHP echo"$hometext"; ?></textarea> |
1949 |
<p><b><?php echo translate("Full Text"); ?></b><br> |
1950 |
<textarea wrap=virtual cols=50 rows=10 name=bodytext><?PHP echo"$bodytext"; ?></textarea><BR> |
1951 |
<FONT size=2><?php echo translate("(Did you check URLs?)"); ?></FONT><P> |
1952 |
|
1953 |
<p><b><?php echo translate("Notes"); ?></b><br> |
1954 |
<textarea wrap=virtual cols=50 rows=4 name=notes><?PHP echo"$notes"; ?></textarea><br> |
1955 |
|
1956 |
<input type="hidden" NAME="qid" SIZE=50 value="<?PHP echo"$qid"; ?>"> |
1957 |
<input type="hidden" NAME="uid" SIZE=50 value="<?PHP echo "$uid"; ?>"> |
1958 |
<select name="op"> |
1959 |
<option value="DeleteStory"><?php echo translate("DeleteStory"); ?></option> |
1960 |
<option value="PreviewAgain" SELECTED><?php echo translate("PreviewAgain"); ?></option> |
1961 |
<option value="PostStory"><?php echo translate("PostStory"); ?></option> |
1962 |
</select> |
1963 |
<INPUT type="submit" value="<?php echo translate("Go!"); ?>"></FORM> |
1964 |
</td></tr></table></td></tr></table></form> |
1965 |
|
1966 |
<?PHP |
1967 |
include ('footer.php'); |
1968 |
} |
1969 |
|
1970 |
function postStory($qid, $uid, $author, $subject, $hometext, $bodytext, $topic, $notes) { |
1971 |
include("config.php"); |
1972 |
global $aid; |
1973 |
dbconnect(); |
1974 |
if ($uid == -1) $author = ""; |
1975 |
if ($hometext == $bodytext) $bodytext = ""; |
1976 |
$subject = stripslashes(FixQuotes($subject)); |
1977 |
$hometext = stripslashes(FixQuotes($hometext)); |
1978 |
$bodytext = stripslashes(FixQuotes($bodytext)); |
1979 |
$notes = stripslashes(FixQuotes($notes)); |
1980 |
$result = mysql_query("insert into stories values (NULL, '$aid', '$subject', now(), '$hometext', '$bodytext', '0', '0', '$topic','$author', '$notes')"); |
1981 |
if (!$result) { |
1982 |
echo mysql_errno(). ": ".mysql_error(). "<br>"; |
1983 |
return; |
1984 |
} |
1985 |
if ($uid == -1) { |
1986 |
} else { |
1987 |
mysql_query("update users set counter=counter+1 where uid='$uid'"); |
1988 |
} |
1989 |
mysql_query("update authors set counter=counter+1 where aid='$aid'"); |
1990 |
if ($ultramode) { |
1991 |
ultramode(); |
1992 |
} |
1993 |
deleteStory($qid); |
1994 |
} |
1995 |
|
1996 |
function editStory ($sid) { |
1997 |
global $user, $subject, $hometext, $bodytext, $notes, $topic; |
1998 |
include ('header.php'); |
1999 |
include ('config.php'); |
2000 |
dbconnect(); |
2001 |
GraphicAdmin(); |
2002 |
$result = mysql_query("SELECT title, hometext, bodytext, topic, notes FROM stories where sid=$sid"); |
2003 |
list($subject, $hometext, $bodytext, $topic, $notes) = mysql_fetch_row($result); |
2004 |
mysql_free_result($result); |
2005 |
|
2006 |
$hometext = stripslashes($hometext); |
2007 |
$bodytext = stripslashes($bodytext); |
2008 |
$notes = stripslashes($notes); |
2009 |
|
2010 |
$result=mysql_query("select topicimage from topics where topicid=$topic"); |
2011 |
list($topicimage) = mysql_fetch_row($result); |
2012 |
echo "<center><font size=4><b>".translate("Edit Article")."</b></center><br><br>"; |
2013 |
echo "<table width=100% border=0 cellpadding=0 cellspacing=0 bgcolor=000000><tr><td> |
2014 |
<table width=100% border=0 cellpadding=8 cellspacing=1 bgcolor=FFFFFF><tr><td>"; |
2015 |
echo "<br><center><table width=80% border=0 cellpadding=0 cellspacing=0 bgcolor=000000><tr><td> |
2016 |
<table width=100% border=0 cellpadding=8 cellspacing=1 bgcolor=FFFFFF><tr><td>"; |
2017 |
|
2018 |
echo "<img src=$tipath$topicimage border=0 align=right>"; |
2019 |
|
2020 |
themepreview($subject, $hometext, $bodytext); |
2021 |
echo "</td></tr></table></td></tr></table></center><br><br>"; |
2022 |
?> |
2023 |
|
2024 |
<form action="admin.php" method=post> |
2025 |
<P><B><?php echo translate("Subject"); ?></B><br> |
2026 |
<input type=text name=subject size=50 value="<?PHP echo"$subject"; ?>"><BR> |
2027 |
<p><b><?php echo translate("Topic"); ?></b> <select name=topic> |
2028 |
<?PHP |
2029 |
$toplist = mysql_query("select topicid, topictext from topics order by topictext"); |
2030 |
echo "<OPTION VALUE=\"\">".translate("All Topics")."</option>\n"; |
2031 |
while(list($topicid, $topics) = mysql_fetch_row($toplist)) { |
2032 |
if ($topicid==$topic) { $sel = "selected "; } |
2033 |
echo "<option $sel value=\"$topicid\">$topics</option>\n"; |
2034 |
$sel = ""; |
2035 |
} |
2036 |
?> |
2037 |
</select> |
2038 |
<P><B><?php echo translate("Intro Text"); ?></B><br> |
2039 |
<textarea wrap=virtual cols=50 rows=7 name=hometext><?PHP echo"$hometext"; ?></textarea> |
2040 |
<P><B><?php echo translate("Full Text"); ?></B><br> |
2041 |
<textarea wrap=virtual cols=50 rows=10 name=bodytext><?PHP echo"$bodytext"; ?></textarea><BR> |
2042 |
<FONT size=2><?php echo translate("(Did you check URLs?)"); ?></FONT><P> |
2043 |
|
2044 |
<P><B><?php echo translate("Notes"); ?></B><br> |
2045 |
<textarea wrap=virtual cols=50 rows=4 name=notes><?php echo "$notes"; ?></textarea><br> |
2046 |
|
2047 |
<input type="hidden" NAME="sid" SIZE=50 value="<?PHP echo"$sid"; ?>"> |
2048 |
<INPUT type="hidden" name="op" value="ChangeStory"> |
2049 |
<INPUT type="submit" value="<?php echo translate("ChangeStory"); ?>"> |
2050 |
</td></tr></table></td></tr></table></FORM> |
2051 |
<?PHP |
2052 |
include ('footer.php'); |
2053 |
} |
2054 |
|
2055 |
function removeStory ($sid, $ok=0) { |
2056 |
if($ok) { |
2057 |
dbconnect(); |
2058 |
mysql_query("DELETE FROM stories where sid=$sid"); |
2059 |
mysql_query("DELETE FROM comments where sid=$sid"); |
2060 |
Header("Location: admin.php"); |
2061 |
} else { |
2062 |
include("header.php"); |
2063 |
GraphicAdmin(); |
2064 |
echo "<center>".translate("Are you sure you want to remove Story ID #")." $sid ".translate("and all it's comments?").""; |
2065 |
echo "<br><br>[ <a href=\"admin.php\">".translate("No")."</a> | <a href=\"admin.php?op=RemoveStory&sid=$sid&ok=1\">".translate("Yes")."</a> ]</center>"; |
2066 |
include("footer.php"); |
2067 |
} |
2068 |
} |
2069 |
|
2070 |
|
2071 |
|
2072 |
function changeStory($sid, $subject, $hometext, $bodytext, $topic, $notes) { |
2073 |
global $aid; |
2074 |
dbconnect(); |
2075 |
$subject = stripslashes(FixQuotes($subject)); |
2076 |
$hometext = stripslashes(FixQuotes($hometext)); |
2077 |
$bodytext = stripslashes(FixQuotes($bodytext)); |
2078 |
$notes = stripslashes(FixQuotes($notes)); |
2079 |
mysql_query("update stories set title='$subject', hometext='$hometext', bodytext='$bodytext', topic='$topic', notes='$notes' where sid=$sid"); |
2080 |
Header("Location: admin.php?op=adminMain"); |
2081 |
} |
2082 |
|
2083 |
function adminStory() { |
2084 |
include ('header.php'); |
2085 |
include ('config.php'); |
2086 |
dbconnect(); |
2087 |
GraphicAdmin(); |
2088 |
echo " |
2089 |
<a name=new></a> |
2090 |
$font4<center><b>".translate("New Article")."</b></font></center><br><br>$font3"; ?> |
2091 |
<table border=0 width=100% cellpadding=0 cellspacing=0 bgcolor=000000><tr><td> |
2092 |
<table border=0 width=100% cellpadding=8 cellspacing=1 bgcolor=FFFFFF><tr><td> |
2093 |
<?php echo "$font3"; ?> |
2094 |
<form action="admin.php" method=post> |
2095 |
<p><b><?php echo translate("Title"); ?></b><br> |
2096 |
<input type=text name=subject size=50 value=""><BR> |
2097 |
<BR> |
2098 |
<p><b><?php echo translate("Topic"); ?></b> |
2099 |
<?php |
2100 |
$toplist = mysql_query("select topicid, topictext from topics order by topictext"); |
2101 |
echo "<SELECT NAME=\"topic\">"; |
2102 |
echo "<OPTION VALUE=\"\">".translate("Select Topic")."</option>\n"; |
2103 |
while(list($topicid, $topics) = mysql_fetch_row($toplist)) { |
2104 |
if ($topicid==$topic) { $sel = "selected "; } |
2105 |
echo "<option $sel value=\"$topicid\">$topics</option>\n"; |
2106 |
$sel = ""; |
2107 |
} |
2108 |
echo "</SELECT>"; |
2109 |
?> |
2110 |
<P><B><?php echo translate("The Story"); ?></B><br> |
2111 |
<textarea wrap=virtual cols=70 rows=12 name=hometext></textarea><BR> |
2112 |
<P><B><?php echo translate("Extended Text"); ?></B><br> |
2113 |
<textarea wrap=virtual cols=70 rows=12 name=bodytext></textarea><BR> |
2114 |
<FONT size=2><?php echo translate("(Are you sure you included a URL? Did ya test them for typos?)"); ?></FONT><P> |
2115 |
<select name="op"> |
2116 |
<option value="PreviewAdminStory" SELECTED><?php echo translate("PreviewAdminStory"); ?></option> |
2117 |
<option value="PostAdminStory"><?php echo translate("PostAdminStory"); ?></option> |
2118 |
</select> |
2119 |
<INPUT type="submit" value="<?php echo translate("Go!"); ?>"> |
2120 |
</td></tr></table></td></tr></table></form> |
2121 |
<?PHP |
2122 |
include ('footer.php'); |
2123 |
} |
2124 |
|
2125 |
function previewAdminStory($subject, $hometext, $bodytext, $topic) { |
2126 |
global $user; |
2127 |
include ('header.php'); |
2128 |
include ('config.php'); |
2129 |
GraphicAdmin(); |
2130 |
echo " |
2131 |
$font4<b><center>".translate("Preview Story")."</b><br><br><br> |
2132 |
<table border=0 width=100% cellpadding=0 cellspacing=0 bgcolor=000000><tr><td> |
2133 |
<table border=0 width=100% cellpadding=8 cellspacing=1 bgcolor=FFFFFF><tr><td> |
2134 |
<form action=\"admin.php\" method=post> |
2135 |
</b></center>$font3 |
2136 |
"; |
2137 |
$subject = stripslashes($subject); |
2138 |
$hometext = stripslashes($hometext); |
2139 |
$bodytext = stripslashes($bodytext); |
2140 |
$result=mysql_query("select topicimage from topics where topicid=$topic"); |
2141 |
list($topicimage) = mysql_fetch_row($result); |
2142 |
echo "<center><br><table border=0 width=80% cellpadding=0 cellspacing=0 bgcolor=000000><tr><td>"; |
2143 |
echo "<table border=0 width=100% cellpadding=8 cellspacing=1 bgcolor=FFFFFF><tr><td>"; |
2144 |
echo "$font3"; |
2145 |
echo "<img src=$tipath$topicimage border=0 align=right>"; |
2146 |
themepreview($subject, $hometext, $bodytext); |
2147 |
echo "</td></tr></table></td></tr></table></center>"; |
2148 |
?> |
2149 |
<p><b><?php echo translate("Title"); ?></b><br> |
2150 |
<input type=text name=subject size=50 value="<?PHP echo"$subject"; ?>"><BR> |
2151 |
<p><b><?php echo translate("Topic"); ?></b> <select name=topic> |
2152 |
<?PHP |
2153 |
$toplist = mysql_query("select topicid, topictext from topics order by topictext"); |
2154 |
echo "<OPTION VALUE=\"\">".translate("All Topics")."</option>\n"; |
2155 |
while(list($topicid, $topics) = mysql_fetch_row($toplist)) { |
2156 |
if ($topicid==$topic) { $sel = "selected "; } |
2157 |
echo "<option $sel value=\"$topicid\">$topics</option>\n"; |
2158 |
$sel = ""; |
2159 |
} |
2160 |
?> |
2161 |
</select> |
2162 |
<p><b><?php echo translate("The Story"); ?></b><br> |
2163 |
<textarea wrap=virtual cols=70 rows=12 name=hometext><?PHP echo "$hometext"; ?></textarea><BR> |
2164 |
<textarea wrap=virtual cols=70 rows=12 name=bodytext><?PHP echo "$bodytext"; ?></textarea><BR> |
2165 |
<select name="op"> |
2166 |
<option value="PreviewAdminStory" SELECTED><?php echo translate("PreviewAdminStory"); ?></option> |
2167 |
<option value="PostAdminStory"><?php echo translate("PostAdminStory"); ?></option> |
2168 |
</select> |
2169 |
<INPUT type="submit" value="<?php echo translate("Go!"); ?>"> |
2170 |
</td></tr></table></td></tr></table></form> |
2171 |
<?PHP |
2172 |
include ('footer.php'); |
2173 |
|
2174 |
} |
2175 |
|
2176 |
function postAdminStory($subject, $introstory, $fullstory, $topic) { |
2177 |
include("config.php"); |
2178 |
global $aid; |
2179 |
dbconnect(); |
2180 |
$subject = stripslashes(FixQuotes($subject)); |
2181 |
$introstory = stripslashes(FixQuotes($introstory)); |
2182 |
$fullstory = stripslashes(FixQuotes($fullstory)); |
2183 |
$result = mysql_query("insert into stories values (NULL, '$aid', '$subject', now(), '$introstory', '$fullstory', '0', '0', '$topic', '$aid', '$notes')"); |
2184 |
if (!$result) |
2185 |
{ |
2186 |
echo mysql_errno(). ": ".mysql_error(). "<br>"; |
2187 |
exit(); |
2188 |
} |
2189 |
$result = mysql_query("update authors set counter=counter+1 where aid='$aid'"); |
2190 |
if ($ultramode) { |
2191 |
ultramode(); |
2192 |
} |
2193 |
Header("Location: admin.php?op=adminMain"); |
2194 |
} |
2195 |
|
2196 |
/*********************************************************/ |
2197 |
/* Comments Delete Function */ |
2198 |
/*********************************************************/ |
2199 |
|
2200 |
// This function is a big crap. I need to delete all babies comments |
2201 |
// maybe by setting a unique number for each Parent comment? |
2202 |
// Anyone, please help me to do this! |
2203 |
|
2204 |
function removeComment ($tid, $sid) { |
2205 |
dbconnect(); |
2206 |
mysql_query("update stories set comments=comments-1 where sid='$sid'"); |
2207 |
mysql_query("DELETE FROM comments where tid=$tid"); |
2208 |
mysql_query("DELETE FROM comments where pid=$tid"); |
2209 |
|
2210 |
Header("Location: article.php?sid=$sid"); |
2211 |
} |
2212 |
|
2213 |
function RemovePollComment ($tid, $pollID) { |
2214 |
dbconnect(); |
2215 |
mysql_query("DELETE FROM pollcomments where tid=$tid and pollID=$pollID"); |
2216 |
mysql_query("DELETE FROM pollcomments where pid=$tid"); |
2217 |
Header("Location: pollBooth.php?op=results&pollID=$pollID"); |
2218 |
} |
2219 |
|
2220 |
/*********************************************************/ |
2221 |
/* Admin/Authors Functions */ |
2222 |
/*********************************************************/ |
2223 |
|
2224 |
function displayadmins() { |
2225 |
$titlebar = "<b>".translate("current authors")."</b>"; |
2226 |
include("header.php"); |
2227 |
dbconnect(); |
2228 |
GraphicAdmin(); |
2229 |
echo " |
2230 |
<center>$font4<b> |
2231 |
".translate("Edit Admins")." |
2232 |
<br><br></center></b> |
2233 |
<table width=100% border=0 cellpadding=0 cellspacing=0 bgcolor=000000><tr><td> |
2234 |
<table width=100% border=0 cellpadding=8 cellspacing=1 bgcolor=FFFFFF><tr><td> |
2235 |
"; |
2236 |
$result = mysql_query("select aid, name from authors"); |
2237 |
echo "<table border=1>"; |
2238 |
while(list($a_aid, $name) = mysql_fetch_row($result)) { |
2239 |
echo "<tr><td>$font3$a_aid</td>"; |
2240 |
echo "<td>$font3<a href=\"admin.php?op=modifyadmin&chng_aid=$a_aid\">".translate("Modify Info")."</a></td>"; |
2241 |
if($name=="God") { |
2242 |
} else { |
2243 |
echo "<td>$font3<a href=\"admin.php?op=deladmin&del_aid=$a_aid\">".translate("Delete Author")."</a></td></tr>"; |
2244 |
} |
2245 |
} |
2246 |
?> |
2247 |
</table> |
2248 |
<form action="admin.php" method="post"> |
2249 |
<table cols=2 border=0> |
2250 |
<tr><td width=100><?php echo "$font3"; ?><? echo translate("Handle");?>*</td> |
2251 |
<td><?php echo "$font3"; ?> <input type="text" name="add_aid" size=30 maxlength=30></td></tr> |
2252 |
<tr><td><?php echo "$font3"; ?><? echo translate("Name");?>*</td> |
2253 |
<td><?php echo "$font3"; ?><input type="text" name="add_name" size=30 maxlength=50></td></tr> |
2254 |
<tr><td><?php echo "$font3"; ?><? echo translate("Email");?>*</td> |
2255 |
<td><?php echo "$font3"; ?> <input type="text" name="add_email" size=30 maxlength=60></td></tr> |
2256 |
<tr><td><?php echo "$font3"; ?><? echo translate("URL");?></td> |
2257 |
<td><?php echo "$font3"; ?> <input type="text" name="add_url" size=30 maxlength=60></td></tr> |
2258 |
<tr><td><?php echo "$font3"; ?><? echo translate("Password");?>*</td> |
2259 |
<td><?php echo "$font3"; ?> <input type="text" name="add_pwd" size=12 maxlength=12></td></tr> |
2260 |
<input type="hidden" name="op" value="AddAuthor"> |
2261 |
<tr><td colspan=2><?php echo "$font3"; ?><input type=submit value="<?echo translate("Add Author");?>"></td></tr> |
2262 |
</table></form> |
2263 |
<?php echo translate("* indicates compulsory fields"); ?></font> |
2264 |
</td></tr></table></td></tr></table> |
2265 |
<? |
2266 |
|
2267 |
include("footer.php"); |
2268 |
} |
2269 |
|
2270 |
function modifyadmin($chng_aid) { |
2271 |
$titlebar = "<b>".translate("update")." $chng_aid</b>"; |
2272 |
include("header.php"); |
2273 |
dbconnect(); |
2274 |
GraphicAdmin(); |
2275 |
echo "<table width=100% border=0 cellpadding=0 cellspacing=0 bgcolor=000000><tr><td> |
2276 |
<table width=100% border=0 cellpadding=8 cellspacing=1 bgcolor=FFFFFF><tr><td>"; |
2277 |
$result = mysql_query("select aid, name, url, email, pwd from authors where aid='$chng_aid'"); |
2278 |
list($chng_aid, $chng_name, $chng_url, $chng_email, $chng_pwd) = mysql_fetch_row($result); |
2279 |
?> |
2280 |
<form action="admin.php" method="post"> |
2281 |
<table cols=2 border=0> |
2282 |
<tr><td width=100><?php echo "$font3"; ?><? echo translate("Name");?></td> |
2283 |
<td><?php echo "$font3"; ?> <?echo $chng_name ?><input type="hidden" name="chng_name" value="<? echo $chng_name ?>"></td></tr> |
2284 |
<tr><td><?php echo "$font3"; ?><? echo translate("Handle");?>*</td> |
2285 |
<td><?php echo "$font3"; ?> <input type="text" name="chng_aid" value="<? echo $chng_aid?>"></td></tr> |
2286 |
<tr><td><?php echo "$font3"; ?><? echo translate("Email");?>*</td> |
2287 |
<td><?php echo "$font3"; ?> <input type="text" name="chng_email" value="<? echo $chng_email?>" size=30 maxlength=60></td></tr> |
2288 |
<tr><td><?php echo "$font3"; ?><? echo translate("URL");?></td> |
2289 |
<td><?php echo "$font3"; ?> <input type="text" name="chng_url" value="<? echo $chng_url?>" size=30 maxlength=60></td></tr> |
2290 |
<tr><td><?php echo "$font3"; ?><? echo translate("Password")?></td> |
2291 |
<td><?php echo "$font3"; ?> <input type="password" name="chng_pwd" size=12 maxlength=12></td></tr> |
2292 |
<tr><td><?php echo "$font3"; ?><? echo translate("Retype Password");?></td> |
2293 |
<td><?php echo "$font3"; ?> <input type="password" name="chng_pwd2" size=12 maxlength=12> <? echo translate("(for changes only)");?></td></tr> |
2294 |
<input type="hidden" name="op" value="UpdateAuthor"> |
2295 |
<tr><td colspan=2><?php echo "$font3"; ?><input type="submit" value="<? echo translate("Update Author");?>"></td></tr> |
2296 |
</table></form> |
2297 |
<? echo translate("* indicates compulsory fields"); ?></font> |
2298 |
</td></tr></table></td></tr></table> |
2299 |
<? |
2300 |
include("footer.php"); |
2301 |
} |
2302 |
|
2303 |
function updateadmin($chng_aid, $chng_name, $chng_email, $chng_url, $chng_pwd, $chng_pwd2) { |
2304 |
if (!($chng_aid && $chng_name && $chng_email)) |
2305 |
Header("Location: admin.php?op=adminMain"); |
2306 |
|
2307 |
if ($chng_pwd2 != "") { |
2308 |
if($chng_pwd != $chng_pwd2) { |
2309 |
$titlebar = "<b>".translate("bad pass")."</b>"; |
2310 |
include("header.php"); |
2311 |
GraphicAdmin(); |
2312 |
echo translate("Sorry, the new passwords do not match. Click back and try again"); |
2313 |
include("footer.php"); |
2314 |
exit; |
2315 |
} |
2316 |
dbconnect(); |
2317 |
$result = mysql_query("update authors set aid='$chng_aid', email='$chng_email', url='$chng_url', pwd='$chng_pwd' where name='$chng_name'"); |
2318 |
Header("Location: admin.php?op=adminMain"); |
2319 |
} else { |
2320 |
dbconnect(); |
2321 |
$result = mysql_query("update authors set aid='$chng_aid', email='$chng_email', url='$chng_url' where name='$chng_name'"); |
2322 |
Header("Location: admin.php?op=adminMain"); |
2323 |
} |
2324 |
} |
2325 |
|
2326 |
/*********************************************************/ |
2327 |
/* Users Functions */ |
2328 |
/*********************************************************/ |
2329 |
|
2330 |
function displayUsers() { |
2331 |
include("header.php"); |
2332 |
GraphicAdmin(); |
2333 |
echo " |
2334 |
$font4<b><center> |
2335 |
".translate("Edit Users")." |
2336 |
<br><br></b></center> |
2337 |
<table border=0 width=100% cellpadding=0 cellspacing=0 bgcolor=000000><tr><td> |
2338 |
<table border=0 width=100% cellpadding=8 cellspacing=1 bgcolor=FFFFFF><tr><td>$font3"; |
2339 |
echo "<form method=post action=\"admin.php\">"; |
2340 |
echo "<b>".translate("Handle/UserID").": </b> <input type=text name=\"chng_uid\" size=10>\n"; |
2341 |
echo "<select name=\"op\">"; |
2342 |
echo "<option value=\"modifyUser\">".translate("Modify User")."</option>\n"; |
2343 |
echo "<option value=\"delUser\">".translate("Delete User")."</option></select>\n"; |
2344 |
echo "<input type=\"submit\" value=\"".translate("Go!")."\"></form>"; |
2345 |
?> |
2346 |
<form action="admin.php" method="post"> |
2347 |
<table cols=2 border=0 width=100%> |
2348 |
<tr><td width=100><?php echo "$font3"; ?><? echo translate("Handle");?>*</td> |
2349 |
<td><?php echo "$font3"; ?> <input type="text" name="add_uname" size=30 maxlength=25></td></tr> |
2350 |
<tr><td><?php echo "$font3"; ?><? echo translate("Name");?></td> |
2351 |
<td><?php echo "$font3"; ?><input type="text" name="add_name" size=30 maxlength=50></td></tr> |
2352 |
<tr><td><?php echo "$font3"; ?><? echo translate("Email");?>*</td> |
2353 |
<td><?php echo "$font3"; ?> <input type="text" name="add_email" size=30 maxlength=60></td></tr> |
2354 |
<tr><td><?php echo "$font3"; ?><? echo translate("Fake Email");?></td> |
2355 |
<td><?php echo "$font3"; ?> <input type="text" name="add_femail" size=30 maxlength=60></td></tr> |
2356 |
<tr><td><?php echo "$font3"; ?><? echo translate("URL");?></td> |
2357 |
<td><?php echo "$font3"; ?> <input type="text" name="add_url" size=30 maxlength=60></td></tr> |
2358 |
<tr><td><?php echo "$font3"; ?><? echo translate("Password");?>*</td> |
2359 |
<td><?php echo "$font3"; ?> <input type="text" name="add_pass" size=12 maxlength=12></td></tr> |
2360 |
<input type="hidden" name="op" value="addUser"> |
2361 |
<tr><td colspan=2><?php echo "$font3"; ?><input type=submit value="<?echo translate("Add User");?>"></td></tr> |
2362 |
</table></form> |
2363 |
<?php echo "<center>$font3<font color=Red> ".translate("* indicates compulsory fields")." "; ?></font> |
2364 |
</td></tr></table></td></tr></table> |
2365 |
<? |
2366 |
|
2367 |
include("footer.php"); |
2368 |
} |
2369 |
|
2370 |
function modifyUser($chng_user) { |
2371 |
include("header.php"); |
2372 |
dbconnect(); |
2373 |
GraphicAdmin(); |
2374 |
$result = mysql_query("select uid, uname, name, url, email, femail, pass from users where uid='$chng_user' or uname='$chng_user'"); |
2375 |
if(mysql_num_rows($result) > 0) { |
2376 |
while(list($chng_uid, $chng_uname, $chng_name, $chng_url, $chng_email, $chng_femail, $chng_pass) = mysql_fetch_row($result)) { |
2377 |
echo " |
2378 |
$font4<b><center> |
2379 |
".translate("Update User").": $chng_uname |
2380 |
<br><br></b></center>"; |
2381 |
?> |
2382 |
<table border=0 width=100% cellpadding=0 cellspacing=0 bgcolor=000000><tr><td> |
2383 |
<table border=0 width=100% cellpadding=8 cellspacing=1 bgcolor=FFFFFF><tr><td> |
2384 |
<form action="admin.php" method="get"> |
2385 |
<table border=0> |
2386 |
<tr><td><?php echo "$font3"; ?><? echo translate("User ID");?></td> |
2387 |
<td><?php echo "$font3"; ?><? echo $chng_uid ?></td></tr> |
2388 |
<tr><td><?php echo "$font3"; ?><? echo translate("Handle");?>*</td> |
2389 |
<td><?php echo "$font3"; ?><input type="text" name="chng_uname" value="<? echo $chng_uname ?>"></td></tr> |
2390 |
<tr><td width=100><?php echo "$font3"; ?><? echo translate("Name");?></td> |
2391 |
<td><?php echo "$font3"; ?><input type="text" name="chng_name" value="<? echo $chng_name ?>"></td></tr> |
2392 |
<tr><td><?php echo "$font3"; ?><? echo translate("URL");?></td> |
2393 |
<td><?php echo "$font3"; ?> <input type="text" name="chng_url" value="<? echo $chng_url ?>" size=30 maxlength=60></td></tr> |
2394 |
<tr><td><?php echo "$font3"; ?><? echo translate("Email");?>*</td> |
2395 |
<td><?php echo "$font3"; ?> <input type="text" name="chng_email" value="<? echo $chng_email ?>" size=30 maxlength=60></td></tr> |
2396 |
<tr><td><?php echo "$font3"; ?><? echo translate("Fake Email");?></td> |
2397 |
<td><?php echo "$font3"; ?> <input type="text" name="chng_femail" value="<? echo $chng_femail ?>" size=30 maxlength=60></td></tr> |
2398 |
<tr><td><?php echo "$font3"; ?><? echo translate("Password")?></td> |
2399 |
<td><?php echo "$font3"; ?> <input type="password" name="chng_pass" size=12 maxlength=12></td></tr> |
2400 |
<tr><td><?php echo "$font3"; ?><? echo translate("Retype Password");?></td> |
2401 |
<td><?php echo "$font3"; ?> <input type="password" name="chng_pass2" size=12 maxlength=12> <? echo translate("(for changes only)");?></td></tr> |
2402 |
<input type="hidden" name="chng_uid" value="<?php echo $chng_uid; ?>"> |
2403 |
<input type="hidden" name="op" value="updateUser"> |
2404 |
<tr><td colspan=2><?php echo "$font3"; ?><input type="submit" value="<? echo translate("Update User");?>"></td></tr> |
2405 |
</table></form> |
2406 |
<? |
2407 |
} |
2408 |
echo "<center>$font3<font color=Red>".translate("* indicates compulsory fields")."</font>"; |
2409 |
echo "</td></tr></table></td></tr></table>"; |
2410 |
} else { |
2411 |
echo "<center>"; |
2412 |
echo translate("User doesn't exist!"); |
2413 |
echo "</center>"; |
2414 |
} |
2415 |
include("footer.php"); |
2416 |
} |
2417 |
|
2418 |
function updateUser($chng_uid, $chng_uname, $chng_name, $chng_url, $chng_email, $chng_femail, $chng_pass, $chng_pass2) { |
2419 |
$tmp = 0; |
2420 |
if ($chng_pass2 != "") { |
2421 |
if($chng_pass != $chng_pass2) { |
2422 |
$titlebar = "<b>".translate("bad pass")."</b>"; |
2423 |
include("header.php"); |
2424 |
GraphicAdmin(); |
2425 |
echo " |
2426 |
<center>".translate("Sorry, the new passwords do not match. Click back and try again")."</center>"; |
2427 |
include("footer.php"); |
2428 |
exit; |
2429 |
} |
2430 |
$tmp = 1; |
2431 |
} |
2432 |
dbconnect(); |
2433 |
if ($tmp == 0) { |
2434 |
mysql_query("update users set uname='$chng_uname', name='$chng_name', email='$chng_email', femail='$chng_femail', url='$chng_url' where uid='$chng_uid'"); |
2435 |
} |
2436 |
if ($tmp == 1) { |
2437 |
$cpass = crypt($chng_pass); |
2438 |
mysql_query("update users set uname='$chng_uname', name='$chng_name', email='$chng_email', femail='$chng_femail', url='$chng_url', pass='$cpass' where uid='$chng_uid'"); |
2439 |
} |
2440 |
header("Location: admin.php?op=adminMain"); |
2441 |
} |
2442 |
|
2443 |
|
2444 |
/*********************************************************/ |
2445 |
/* Poll/Surveys Functions */ |
2446 |
/*********************************************************/ |
2447 |
|
2448 |
function poll_createPoll() { |
2449 |
include ('header.php'); |
2450 |
GraphicAdmin(); |
2451 |
?> |
2452 |
|
2453 |
<font size=4><b><center><?php echo translate("Create new poll"); ?><br> |
2454 |
<font size=2><a href=admin.php?op=remove><?php echo translate("Delete Polls"); ?></a><br><br></font></center> |
2455 |
<table width=100% border=0 cellpadding=0 cellspacing=0 bgcolor=000000><tr><td> |
2456 |
<table width=100% border=0 cellpadding=8 cellspacing=1 bgcolor=FFFFFF><tr><td> |
2457 |
<font face=Arial,Helvetica> |
2458 |
<form action="admin.php" method="post"> |
2459 |
<input type="hidden" name="op" value="createPosted"> |
2460 |
<p><?php echo translate("Polltitle"); ?>: <input type=text name="pollTitle" size=50 maxlength=100></p> |
2461 |
<p><?php echo translate("Please enter each available option into a single field"); ?></p> |
2462 |
|
2463 |
<table> |
2464 |
<?PHP |
2465 |
for($i = 1; $i <= $maxOptions; $i++) |
2466 |
{ |
2467 |
echo "<tr>"; |
2468 |
echo "<td><font face=Arial,Helvetica>".translate("Option")." $i:</td><td><input type=text name=\"optionText[$i]\" size=50 maxlength=50></td>"; |
2469 |
echo "</tr>"; |
2470 |
} |
2471 |
|
2472 |
echo "</tr></table>"; |
2473 |
echo "<input type=\"submit\" value=\"".translate("Create")."\">"; |
2474 |
echo "</td></tr></table></td></tr></table></form>"; |
2475 |
include ('footer.php'); |
2476 |
} |
2477 |
|
2478 |
function old_poll_createPosted() { |
2479 |
global $maxOptions, $pollTitle, $optionText; |
2480 |
dbconnect(); |
2481 |
$timeStamp = time(); |
2482 |
$result = mysql_query("INSERT INTO poll_desc VALUES (NULL, '$pollTitle', '$timeStamp')"); |
2483 |
if (!$result) { |
2484 |
echo mysql_errno(). ": ".mysql_error(). "<br>"; |
2485 |
return; |
2486 |
} |
2487 |
mysql_free_result($result); |
2488 |
|
2489 |
// create option records in data table |
2490 |
for($i = 1; $i <= $maxOptions; $i++) { |
2491 |
if($optionText[$i] != "") |
2492 |
$result = mysql_query("INSERT INTO poll_data VALUES ($id, '$optionText[$i]', 0, $i)"); |
2493 |
if (!result) { |
2494 |
echo mysql_errno(). ": ".mysql_error(). "<br>"; |
2495 |
return; |
2496 |
} |
2497 |
mysql_free_result($result); |
2498 |
} |
2499 |
Header("Location: admin.php?op=adminMain"); |
2500 |
} |
2501 |
|
2502 |
function poll_createPosted() { |
2503 |
global $maxOptions, $pollTitle, $optionText; |
2504 |
dbconnect(); |
2505 |
$timeStamp = time(); |
2506 |
$pollTitle = FixQuotes($pollTitle); |
2507 |
if(!mysql_query("INSERT INTO poll_desc VALUES (NULL, '$pollTitle', '$timeStamp', 0)")) { |
2508 |
echo mysql_errno(). ": ".mysql_error(). "<br>"; |
2509 |
return; |
2510 |
} |
2511 |
$object = mysql_fetch_object(mysql_query("SELECT pollID FROM poll_desc WHERE pollTitle='$pollTitle'")); |
2512 |
$id = $object->pollID; |
2513 |
|
2514 |
for($i = 1; $i <= sizeof($optionText); $i++) { |
2515 |
if($optionText[$i] != "") |
2516 |
$optionText[$i] = FixQuotes($optionText[$i]); |
2517 |
if(!mysql_query("INSERT INTO poll_data (pollID, optionText, optionCount, voteID) VALUES ($id, '$optionText[$i]', 0, $i)")) { |
2518 |
echo mysql_errno(). ": ".mysql_error(). "<br>"; |
2519 |
return; |
2520 |
} |
2521 |
} |
2522 |
Header("Location: admin.php?op=adminMain"); |
2523 |
} |
2524 |
|
2525 |
function poll_removePoll() { |
2526 |
include ('header.php'); |
2527 |
dbconnect(); |
2528 |
GraphicAdmin(); |
2529 |
?> |
2530 |
|
2531 |
<font size=4><b><center><?php echo translate("Remove an existing poll"); ?></b></center><br><br></font> |
2532 |
<table width=100% border=0 cellpadding=0 cellspacing=0 bgcolor=000000><tr><td> |
2533 |
<table width=100% border=0 cellpadding=8 cellspacing=1 bgcolor=FFFFFF><tr><td> |
2534 |
<h3><center><?php echo translate("WARNING: The chosen poll will be removed IMMEDIATELY from the database!"); ?></center></h3> |
2535 |
<p><?php echo translate("Please choose a poll from the list below."); ?></p> |
2536 |
<form action="admin.php" method="post"> |
2537 |
<input type="hidden" name="op" value="removePosted"> |
2538 |
<table> |
2539 |
|
2540 |
<?PHP |
2541 |
$result = mysql_query("SELECT pollID, pollTitle, timeStamp FROM poll_desc ORDER BY timeStamp"); |
2542 |
if(!$result) { |
2543 |
echo mysql_errno(). ": ".mysql_error(). "<br>"; |
2544 |
return; |
2545 |
} |
2546 |
|
2547 |
// cycle through the descriptions until everyone has been fetched |
2548 |
while($object = mysql_fetch_object($result)) { |
2549 |
$pollID = $object->pollID; |
2550 |
echo "<tr><td><input type=\"radio\" name=\"id\" value=\"".$object->pollID."\">".$object->pollTitle."</td></tr>"; |
2551 |
} |
2552 |
|
2553 |
echo "</table>"; |
2554 |
echo "<input type=\"submit\" value=\"".translate("Remove")."\">"; |
2555 |
echo "</td></tr></table></td></tr></table></form>"; |
2556 |
include ('footer.php'); |
2557 |
} |
2558 |
|
2559 |
function poll_removePosted() { |
2560 |
global $id; |
2561 |
dbconnect(); |
2562 |
mysql_query("DELETE FROM poll_desc WHERE pollID=$id"); |
2563 |
mysql_query("DELETE FROM poll_data WHERE pollID=$id"); |
2564 |
Header("Location: admin.php?op=adminMain"); |
2565 |
} |
2566 |
|
2567 |
function poll_viewPoll() { |
2568 |
include ('header.php'); |
2569 |
GraphicAdmin(); |
2570 |
echo "<font size=4>".translate("View poll results")."</font>"; |
2571 |
dbconnect(); |
2572 |
echo "<p>"; |
2573 |
|
2574 |
// select all descriptions |
2575 |
$result = mysql_query("SELECT pollID, pollTitle, timeStamp FROM poll_desc ORDER BY timeStamp"); |
2576 |
if(!$result) { |
2577 |
echo mysql_errno(). ": ".mysql_error(). "<br>"; |
2578 |
return; |
2579 |
} |
2580 |
|
2581 |
echo "<form action=\"".basename($GLOBALS[PHP_SELF])."\" method=\"post\">"; |
2582 |
echo "<input type=\"hidden\" name=\"op\" value=\"viewPosted\">"; |
2583 |
echo "<table>"; |
2584 |
|
2585 |
// cycle through the descriptions until everyone has been fetched |
2586 |
while($object = mysql_fetch_object($result)) { |
2587 |
echo "<tr><td><input type=\"radio\" name=\"id\" value=\"".$object->pollID."\">".$object->pollTitle."</td></tr>"; |
2588 |
} |
2589 |
echo "</table>"; |
2590 |
echo "<input type=\"submit\" value=\"".translate("View")."\">"; |
2591 |
echo "</form>"; |
2592 |
include ('footer.php'); |
2593 |
} |
2594 |
|
2595 |
function poll_viewPosted() { |
2596 |
include ('header.php'); |
2597 |
GraphicAdmin(); |
2598 |
global $id; |
2599 |
echo "<font size=4>".translate("View poll results")."</font><p>"; |
2600 |
pollResults($id); |
2601 |
include ('footer.php'); |
2602 |
} |
2603 |
|
2604 |
if($admintest) { |
2605 |
switch($op) { |
2606 |
|
2607 |
case "eventsedit": |
2608 |
eventsedit($eid, $did, $mid); |
2609 |
break; |
2610 |
|
2611 |
case "eventschange": |
2612 |
eventschange($eid, $did, $mid, $yid, $content); |
2613 |
break; |
2614 |
|
2615 |
case "eventsdel": |
2616 |
eventsdel($eid, $did, $mid); |
2617 |
break; |
2618 |
|
2619 |
case "eventsmaintenance": |
2620 |
eventsmaintenance($did, $mid); |
2621 |
break; |
2622 |
|
2623 |
case "eventsadd": |
2624 |
eventsadd($did, $mid, $yid, $content); |
2625 |
break; |
2626 |
|
2627 |
case "events": |
2628 |
events(); |
2629 |
break; |
2630 |
|
2631 |
case "links": |
2632 |
links(); |
2633 |
break; |
2634 |
|
2635 |
case "LinksDelNew": |
2636 |
LinksDelNew($lid); |
2637 |
break; |
2638 |
|
2639 |
case "LinksAddCat": |
2640 |
LinksAddCat($title); |
2641 |
break; |
2642 |
|
2643 |
case "LinksAddSubCat": |
2644 |
LinksAddSubCat($cid, $title); |
2645 |
break; |
2646 |
|
2647 |
case "LinksAddLink": |
2648 |
LinksAddLink($new, $lid, $title, $url, $cat, $description, $name, $email); |
2649 |
break; |
2650 |
|
2651 |
case "LinksDelCat": |
2652 |
LinksDelCat($cid, $sid, $sub, $ok); |
2653 |
break; |
2654 |
|
2655 |
case "LinksModCat": |
2656 |
LinksModCat($cat); |
2657 |
break; |
2658 |
|
2659 |
case "LinksModCatS": |
2660 |
LinksModCatS($cid, $sid, $sub, $title); |
2661 |
break; |
2662 |
|
2663 |
case "LinksModLink": |
2664 |
LinksModLink($lid); |
2665 |
break; |
2666 |
|
2667 |
case "LinksModLinkS": |
2668 |
LinksModLinkS($lid, $title, $url, $description, $name, $email, $hits, $cat); |
2669 |
break; |
2670 |
|
2671 |
case "LinksDelLink": |
2672 |
LinksDelLink($lid); |
2673 |
break; |
2674 |
|
2675 |
case "BannersAdmin": |
2676 |
BannersAdmin(); |
2677 |
break; |
2678 |
|
2679 |
case "BannersAdd": |
2680 |
BannersAdd($name, $cid, $imptotal, $imageurl, $clickurl); |
2681 |
break; |
2682 |
|
2683 |
case "BannerAddClient": |
2684 |
BannerAddClient($name, $contact, $email, $login, $passwd, $extrainfo); |
2685 |
break; |
2686 |
|
2687 |
case "BannerFinishDelete": |
2688 |
BannerFinishDelete($bid); |
2689 |
break; |
2690 |
|
2691 |
case "BannerDelete": |
2692 |
BannerDelete($bid, $ok); |
2693 |
break; |
2694 |
|
2695 |
case "BannerEdit": |
2696 |
BannerEdit($bid); |
2697 |
break; |
2698 |
|
2699 |
case "BannerChange": |
2700 |
BannerChange($bid, $cid, $imptotal, $impadded, $imageurl, $clickurl); |
2701 |
break; |
2702 |
|
2703 |
case "BannerClientDelete": |
2704 |
BannerClientDelete($cid, $ok); |
2705 |
break; |
2706 |
|
2707 |
case "BannerClientEdit": |
2708 |
BannerClientEdit($cid); |
2709 |
break; |
2710 |
|
2711 |
case "BannerClientChange": |
2712 |
BannerClientChange($cid, $name, $contact, $email, $extrainfo, $login, $passwd); |
2713 |
break; |
2714 |
|
2715 |
case "GraphicsAdmin": |
2716 |
GraphicAdmin(); |
2717 |
break; |
2718 |
|
2719 |
case "hreferer": |
2720 |
hreferer(); |
2721 |
break; |
2722 |
|
2723 |
case "delreferer": |
2724 |
delreferer(); |
2725 |
break; |
2726 |
|
2727 |
case "adminMain": |
2728 |
adminMain(); |
2729 |
break; |
2730 |
|
2731 |
case "topicsmanager": |
2732 |
topicsmanager(); |
2733 |
break; |
2734 |
|
2735 |
case "topicedit": |
2736 |
topicedit($topicid); |
2737 |
break; |
2738 |
|
2739 |
case "topicmake": |
2740 |
topicmake($topicname, $topicimage, $topictext); |
2741 |
break; |
2742 |
|
2743 |
case "topicdelete": |
2744 |
topicdelete($topicid, $ok); |
2745 |
break; |
2746 |
|
2747 |
case "topicchange": |
2748 |
topicchange($topicid, $topicname, $topicimage, $topictext); |
2749 |
break; |
2750 |
|
2751 |
case "sections": |
2752 |
sections(); |
2753 |
break; |
2754 |
|
2755 |
case "sectionedit": |
2756 |
sectionedit($secid); |
2757 |
break; |
2758 |
|
2759 |
case "sectionmake": |
2760 |
sectionmake($secname, $image); |
2761 |
break; |
2762 |
|
2763 |
case "sectiondelete": |
2764 |
sectiondelete($secid, $ok); |
2765 |
break; |
2766 |
|
2767 |
case "sectionchange": |
2768 |
sectionchange($secid, $secname, $image); |
2769 |
break; |
2770 |
|
2771 |
case "secarticleadd": |
2772 |
secarticleadd($secid, $title, $content); |
2773 |
break; |
2774 |
|
2775 |
case "secartedit": |
2776 |
secartedit($artid); |
2777 |
break; |
2778 |
|
2779 |
case "secartchange": |
2780 |
secartchange($artid, $secid, $title, $content); |
2781 |
break; |
2782 |
|
2783 |
case "secartdelete": |
2784 |
secartdelete($artid, $ok); |
2785 |
break; |
2786 |
|
2787 |
case "blocks": |
2788 |
blocks(); |
2789 |
break; |
2790 |
|
2791 |
case "makeblock": |
2792 |
makeblock($title, $content); |
2793 |
break; |
2794 |
|
2795 |
case "deleteblock": |
2796 |
deleteblock($id); |
2797 |
break; |
2798 |
|
2799 |
case "changeblock": |
2800 |
changeblock($id, $title, $content); |
2801 |
break; |
2802 |
|
2803 |
case "rblocks": |
2804 |
rblocks(); |
2805 |
break; |
2806 |
|
2807 |
case "makerblock": |
2808 |
makerblock($title, $content); |
2809 |
break; |
2810 |
|
2811 |
case "deleterblock": |
2812 |
deleterblock($id); |
2813 |
break; |
2814 |
|
2815 |
case "changerblock": |
2816 |
changerblock($id, $title, $content); |
2817 |
break; |
2818 |
|
2819 |
case "lblocks": |
2820 |
lblocks(); |
2821 |
break; |
2822 |
|
2823 |
case "makelblock": |
2824 |
makelblock($title, $content); |
2825 |
break; |
2826 |
|
2827 |
case "deletelblock": |
2828 |
deletelblock($id); |
2829 |
break; |
2830 |
|
2831 |
case "changelblock": |
2832 |
changelblock($id, $title, $content); |
2833 |
break; |
2834 |
|
2835 |
case "ablock": |
2836 |
ablock(); |
2837 |
break; |
2838 |
|
2839 |
case "changeablock": |
2840 |
changeablock($title, $content); |
2841 |
break; |
2842 |
|
2843 |
case "mblock": |
2844 |
mblock(); |
2845 |
break; |
2846 |
|
2847 |
case "changemblock": |
2848 |
changemblock($title, $content); |
2849 |
break; |
2850 |
|
2851 |
case "DisplayStory": |
2852 |
displayStory($qid); |
2853 |
break; |
2854 |
|
2855 |
case "PreviewAgain": |
2856 |
previewStory($qid, $uid, $author, $subject, $hometext, $bodytext, $topic, $notes); |
2857 |
break; |
2858 |
|
2859 |
case "PostStory": |
2860 |
postStory($qid, $uid, $author, $subject, $hometext, $bodytext, $topic, $notes); |
2861 |
break; |
2862 |
|
2863 |
case "EditStory": |
2864 |
editStory($sid); |
2865 |
break; |
2866 |
|
2867 |
case "RemoveStory": |
2868 |
removeStory($sid, $ok); |
2869 |
break; |
2870 |
|
2871 |
case "RemoveComment": |
2872 |
removeComment($tid, $sid); |
2873 |
break; |
2874 |
|
2875 |
case "RemovePollComment": |
2876 |
RemovePollComment($tid, $pollID); |
2877 |
break; |
2878 |
|
2879 |
case "ChangeStory": |
2880 |
changeStory($sid, $subject, $hometext, $bodytext, $topic, $notes); |
2881 |
break; |
2882 |
|
2883 |
case "DeleteStory": |
2884 |
deleteStory($qid); |
2885 |
break; |
2886 |
|
2887 |
case "adminStory": |
2888 |
adminStory($sid); |
2889 |
break; |
2890 |
|
2891 |
case "PreviewAdminStory": |
2892 |
previewAdminStory($subject, $hometext, $bodytext, $topic); |
2893 |
break; |
2894 |
|
2895 |
case "PostAdminStory": |
2896 |
postAdminStory($subject, $hometext, $bodytext, $topic); |
2897 |
break; |
2898 |
|
2899 |
case "mod_authors": |
2900 |
displayadmins(); |
2901 |
break; |
2902 |
|
2903 |
case "modifyadmin": |
2904 |
modifyadmin($chng_aid); |
2905 |
break; |
2906 |
|
2907 |
case "UpdateAuthor": |
2908 |
updateadmin($chng_aid, $chng_name, $chng_email, $chng_url, $chng_pwd, $chng_pwd2); |
2909 |
break; |
2910 |
|
2911 |
case "AddAuthor": |
2912 |
if (!($add_aid && $add_name && $add_email && $add_pwd)) { |
2913 |
echo translate("You must complete all compulsory fields"); |
2914 |
return; |
2915 |
} |
2916 |
dbconnect(); |
2917 |
$result = mysql_query("insert into authors values ('$add_aid','$add_name','$add_url','$add_email','$add_pwd','0')"); |
2918 |
if (!$result) { |
2919 |
echo mysql_errno(). ": ".mysql_error(). "<br>"; return; |
2920 |
} |
2921 |
Header("Location: admin.php?op=adminMain"); |
2922 |
break; |
2923 |
|
2924 |
case "deladmin": |
2925 |
$titlebar = "<b>".translate("delete")." $del_aid ".translate("- are you sure?")."</b>"; |
2926 |
include("header.php"); |
2927 |
echo "$font4<b> ".translate("Delete Author")."</b>$font3<br><br>"; |
2928 |
echo translate("Are you sure you want to delete")." $del_aid? "; |
2929 |
echo "[ <a href=\"admin.php?op=deladminconf&del_aid=$del_aid\">".translate("Yes")."</a> | <a href=\"admin.php?op=adminMain\">".translate("No")."</a> ]"; |
2930 |
include("footer.php"); |
2931 |
break; |
2932 |
|
2933 |
case "deladminconf": |
2934 |
dbconnect(); |
2935 |
mysql_query("delete from authors where aid='$del_aid'"); |
2936 |
Header("Location: admin.php?op=adminMain"); |
2937 |
echo mysql_error(); |
2938 |
break; |
2939 |
|
2940 |
case "mod_users": |
2941 |
displayUsers(); |
2942 |
break; |
2943 |
|
2944 |
case "modifyUser": |
2945 |
modifyUser($chng_uid); |
2946 |
break; |
2947 |
|
2948 |
case "updateUser": |
2949 |
updateUser($chng_uid, $chng_uname, $chng_name, $chng_url, $chng_email, $chng_femail, $chng_pass, $chng_pass2); |
2950 |
break; |
2951 |
|
2952 |
case "delUser": |
2953 |
include("header.php"); |
2954 |
$titlebar = "<h3>".translate("Delete User")."</h3>"; |
2955 |
echo $titlebar; |
2956 |
echo translate("Are you sure you want to delete") . " " . translate("user") . " $chng_uid? "; |
2957 |
echo "[ <a href=\"admin.php?op=delUserConf&del_uid=$chng_uid\">".translate("Yes")."</a> | <a href=\"admin.php?op=adminMain\">".translate("No")."</a> ]"; |
2958 |
include("footer.php"); |
2959 |
break; |
2960 |
|
2961 |
case "delUserConf": |
2962 |
dbconnect(); |
2963 |
mysql_query("delete from users where uid='$del_uid' or uname='$del_uid'"); |
2964 |
Header("Location: admin.php?op=adminMain"); |
2965 |
echo mysql_error(); |
2966 |
break; |
2967 |
|
2968 |
case "addUser": |
2969 |
if($crypt==1) $add_pwd=crypt($add_pwd); |
2970 |
elseif($crypt==2) $add_pwd=md5($add_pwd); |
2971 |
if (!($add_uname && $add_email && $add_pass)) { |
2972 |
echo translate("You must complete all compulsory fields"); |
2973 |
return; |
2974 |
} |
2975 |
dbconnect(); |
2976 |
$sql = "insert into users "; |
2977 |
$sql .= "(name,uname,email,femail,url,pass) "; |
2978 |
$sql .= "values ('$add_name','$add_uname','$add_email','$add_femail','$add_url','$add_pwd')"; |
2979 |
$result = mysql_query($sql); |
2980 |
if (!$result) { |
2981 |
echo mysql_errno(). ": ".mysql_error(). "<br>"; return; |
2982 |
} |
2983 |
Header("Location: admin.php?op=adminMain"); |
2984 |
break; |
2985 |
|
2986 |
case "create": |
2987 |
poll_createPoll(); |
2988 |
break; |
2989 |
|
2990 |
case "createPosted": |
2991 |
poll_createPosted(); |
2992 |
break; |
2993 |
|
2994 |
case "poll_editPoll": |
2995 |
poll_editPoll($pollID); |
2996 |
break; |
2997 |
|
2998 |
case "ChangePoll": |
2999 |
ChangePoll($pollID, $pollTitle, $optionText, $optionCount, $voteID); |
3000 |
break; |
3001 |
|
3002 |
case "remove": |
3003 |
poll_removePoll(); |
3004 |
break; |
3005 |
|
3006 |
case "removePosted": |
3007 |
poll_removePosted(); |
3008 |
break; |
3009 |
|
3010 |
case "view": |
3011 |
poll_viewPoll(); |
3012 |
break; |
3013 |
|
3014 |
case "viewPosted": |
3015 |
poll_viewPosted(); |
3016 |
break; |
3017 |
|
3018 |
case "logout": |
3019 |
setcookie("admin"); |
3020 |
$titlebar = translate("Logged out"); |
3021 |
include("header.php"); |
3022 |
echo "<center><font size=4 face=Arial,Helvetica>"; |
3023 |
echo translate("You are now logged out")."<br><br>"; |
3024 |
include("footer.php"); |
3025 |
break; |
3026 |
|
3027 |
default: |
3028 |
adminMain(); |
3029 |
break; |
3030 |
} |
3031 |
} else { |
3032 |
login(); |
3033 |
} |
3034 |
|
3035 |
?> |