@@ -45,6 +45,10 @@ public function adminhome()
45
45
<form class="link" method="post">
46
46
<input class="link" type="submit" value="Sticky Topics">
47
47
<input type="hidden" name="act" value="topicsticky">
48
+ </form><br>
49
+ <form class="link" method="post">
50
+ <input class="link" type="submit" value="Lock Topics">
51
+ <input type="hidden" name="act" value="topiclock">
48
52
</form><br><br>
49
53
<form class="link" method="post">
50
54
<input class="link" type="submit" value="Delete Post">
@@ -206,9 +210,11 @@ public function postdelete()
206
210
207
211
$ this ->pdo ->exec ("DELETE FROM posts WHERE pid= " .$ pid );
208
212
209
- $ sql = "SELECT pid, p_uid, p_uname, p_time FROM posts WHERE p_tid= $ tid ORDER BY p_time DESC LIMIT 1; " ;
213
+ $ sql = "SELECT pid, p_uid, p_uname, p_time FROM posts
214
+ WHERE p_tid= $ tid ORDER BY p_time DESC LIMIT 1; " ;
210
215
$ last = $ this ->pdo ->querySQL ($ sql )->fetch ();
211
- $ sql = "UPDATE topics SET t_lastpid= $ last ->pid , t_lastpuid= $ last ->p_uid , t_lastpuname=' $ last ->p_uname ', t_lastptime= $ last ->p_time WHERE tid= $ tid; " ;
216
+ $ sql = "UPDATE topics SET t_lastpid= $ last ->pid , t_lastpuid= $ last ->p_uid ,
217
+ t_lastpuname=' $ last ->p_uname ', t_lastptime= $ last ->p_time WHERE tid= $ tid; " ;
212
218
$ this ->pdo ->exec ($ sql );
213
219
}
214
220
@@ -233,7 +239,11 @@ public function postdelete()
233
239
foreach ($ ret as $ row ) {
234
240
?>
235
241
<tr class="frame"><td class="posttop" colspan="2"></td></tr>
236
- <tr class="frame"><td class="postleft"><?php echo utf8_encode (strftime ($ this ->datetime , $ row ->p_time )) ?> <br><?php echo $ row ->p_uname ?> <br>
242
+ <tr class="frame"><td class="postleft">
243
+ <?php
244
+ echo utf8_encode (strftime ($ this ->datetime , $ row ->p_time ));
245
+ ?>
246
+ <br><?php echo $ row ->p_uname ?> <br>
237
247
<?php
238
248
if ($ delflag ) {
239
249
?>
@@ -265,20 +275,32 @@ public function postdelete()
265
275
<tr><td class="tnewtop" colspan="3"></td></tr>
266
276
<?php
267
277
268
- $ sql = "SELECT tid, t_fid, t_subject, t_lastptime FROM topics
269
- ORDER BY t_lastptime DESC LIMIT 30; " ;
278
+ $ sql = "SELECT tid, t_fid, t_subject, t_lastptime, t_sticky, t_lock
279
+ FROM topics ORDER BY t_lastptime DESC LIMIT 30; " ;
270
280
$ ret = $ this ->pdo ->querySQL ($ sql );
271
281
foreach ($ ret as $ row ) {
272
282
$ sql = "SELECT f_name FROM forums WHERE fid= $ row ->t_fid ; " ;
273
283
$ fname = $ this ->pdo ->querySQL ($ sql )->fetchColumn ();
274
284
?>
275
285
<tr>
276
- <td class="tnewleft"><?php echo utf8_encode (strftime ($ this ->datetime , $ row ->t_lastptime )) ?> </td>
286
+ <td class="tnewleft">
287
+ <?php
288
+ echo utf8_encode (strftime ($ this ->datetime , $ row ->t_lastptime ));
289
+ ?>
290
+ </td>
277
291
<td class="tnewbody">
292
+ <?php
293
+ if ($ row ->t_sticky ) {
294
+ echo '<span class="sticky">Sticky</span> ' ;
295
+ }
296
+ if ($ row ->t_lock ) {
297
+ echo '<img class="locked" src="data/lock.png" title="Topic Locked"> ' ;
298
+ }
299
+ ?>
278
300
<form class="link" method="post">
279
- <input class="link left" type="submit" value="<?php echo $ row ->t_subject ?> ">
280
- <input type="hidden" name="act" value="postdelete">
281
- <input type="hidden" name="tid" value="<?php echo $ row ->tid ?> ">
301
+ <input class="link left" type="submit" value="<?php echo $ row ->t_subject ?> ">
302
+ <input type="hidden" name="act" value="postdelete">
303
+ <input type="hidden" name="tid" value="<?php echo $ row ->tid ?> ">
282
304
</form>
283
305
</td>
284
306
<td class="tnewright2"><span class="boldy"><?php echo $ fname ?> </span></td>
@@ -311,16 +333,28 @@ public function topicdelete()
311
333
<table id="topicsnew">
312
334
<tr><td class="tnewtop" colspan="3"></td></tr>
313
335
<?php
314
- $ sql = "SELECT tid, t_fid, t_subject, t_lastptime FROM topics
336
+ $ sql = "SELECT tid, t_fid, t_subject, t_lastptime, t_sticky, t_lock FROM topics
315
337
ORDER BY t_lastptime DESC LIMIT 30; " ;
316
338
$ ret = $ this ->pdo ->querySQL ($ sql );
317
339
foreach ($ ret as $ row ) {
318
340
$ sql = "SELECT f_name FROM forums WHERE fid= $ row ->t_fid ; " ;
319
341
$ fname = $ this ->pdo ->querySQL ($ sql )->fetchColumn ();
320
342
?>
321
343
<tr>
322
- <td class="tnewleft"><?php echo utf8_encode (strftime ($ this ->datetime , $ row ->t_lastptime )) ?> </td>
344
+ <td class="tnewleft">
345
+ <?php
346
+ echo utf8_encode (strftime ($ this ->datetime , $ row ->t_lastptime ));
347
+ ?>
348
+ </td>
323
349
<td class="tnewbody">
350
+ <?php
351
+ if ($ row ->t_sticky ) {
352
+ echo '<span class="sticky">Sticky</span> ' ;
353
+ }
354
+ if ($ row ->t_lock ) {
355
+ echo '<img class="locked" src="data/lock.png" title="Topic Locked"> ' ;
356
+ }
357
+ ?>
324
358
<form class="link" method="post">
325
359
<input class="link left" type="submit" value="<?php echo $ row ->t_subject ?> ">
326
360
<input type="hidden" name="act" value="topicdelete">
@@ -354,20 +388,27 @@ public function topicsticky()
354
388
<table id="topicsnew">
355
389
<tr><td class="tnewtop" colspan="3"></td></tr>
356
390
<?php
357
- $ sql = "SELECT tid, t_fid, t_subject, t_lastptime, t_sticky FROM topics
391
+ $ sql = "SELECT tid, t_fid, t_subject, t_lastptime, t_sticky, t_lock FROM topics
358
392
ORDER BY t_lastptime DESC LIMIT 30; " ;
359
393
$ ret = $ this ->pdo ->querySQL ($ sql );
360
394
foreach ($ ret as $ row ) {
361
395
$ sql = "SELECT f_name FROM forums WHERE fid= $ row ->t_fid ; " ;
362
396
$ fname = $ this ->pdo ->querySQL ($ sql )->fetchColumn ();
363
397
?>
364
398
<tr>
365
- <td class="tnewleft"><?php echo utf8_encode (strftime ($ this ->datetime , $ row ->t_lastptime )) ?> </td>
399
+ <td class="tnewleft">
400
+ <?php
401
+ echo utf8_encode (strftime ($ this ->datetime , $ row ->t_lastptime ));
402
+ ?>
403
+ </td>
366
404
<td class="tnewbody">
367
405
<?php
368
406
if ($ row ->t_sticky ) {
369
407
echo '<span class="sticky">Sticky</span> ' ;
370
408
}
409
+ if ($ row ->t_lock ) {
410
+ echo '<img class="locked" src="data/lock.png" title="Topic Locked"> ' ;
411
+ }
371
412
?>
372
413
<form class="link" method="post">
373
414
<input class="link left" type="submit" value="<?php echo $ row ->t_subject ?> ">
@@ -385,6 +426,61 @@ public function topicsticky()
385
426
<?php
386
427
}
387
428
429
+ public function topiclock ()
430
+ {
431
+ if (isset ($ _POST ['lockedtid ' ])) {
432
+
433
+ $ tid = $ _POST ['lockedtid ' ];
434
+ $ sql = "SELECT t_lock FROM topics WHERE tid= $ tid " ;
435
+ $ lock = $ this ->pdo ->querySQL ($ sql )->fetchColumn ();
436
+ if ($ lock ) $ new = '0 ' ;
437
+ else $ new = '1 ' ;
438
+ $ this ->pdo ->exec ("UPDATE topics SET t_lock= $ new WHERE tid= $ tid " );
439
+ }
440
+ ?>
441
+ <span class="boldy">Lock Topics</span><br>
442
+ Click topic to change <b>Lock</b>:
443
+ <table id="topicsnew">
444
+ <tr><td class="tnewtop" colspan="3"></td></tr>
445
+ <?php
446
+ $ sql = "SELECT tid, t_fid, t_subject, t_lastptime, t_sticky, t_lock FROM topics
447
+ ORDER BY t_lastptime DESC LIMIT 30; " ;
448
+ $ ret = $ this ->pdo ->querySQL ($ sql );
449
+ foreach ($ ret as $ row ) {
450
+ $ sql = "SELECT f_name FROM forums WHERE fid= $ row ->t_fid ; " ;
451
+ $ fname = $ this ->pdo ->querySQL ($ sql )->fetchColumn ();
452
+ ?>
453
+ <tr>
454
+ <td class="tnewleft">
455
+ <?php
456
+ echo utf8_encode (strftime ($ this ->datetime , $ row ->t_lastptime ));
457
+ ?>
458
+ </td>
459
+ <td class="tnewbody">
460
+ <?php
461
+ if ($ row ->t_sticky ) {
462
+ echo '<span class="sticky">Sticky</span> ' ;
463
+ }
464
+ if ($ row ->t_lock ) {
465
+ echo '<img class="locked" src="data/lock.png" title="Topic Locked"> ' ;
466
+ }
467
+ ?>
468
+ <form class="link" method="post">
469
+ <input class="link left" type="submit" value="<?php echo $ row ->t_subject ?> ">
470
+ <input type="hidden" name="act" value="topiclock">
471
+ <input type="hidden" name="lockedtid" value="<?php echo $ row ->tid ?> ">
472
+ </form>
473
+ </td>
474
+ <td class="tnewright2"><span class="boldy"><?php echo $ fname ?> </span></td>
475
+ </tr>
476
+ <?php
477
+ }
478
+ ?>
479
+ </table>
480
+ <div id="topicsspacer"></div>
481
+ <?php
482
+ }
483
+
388
484
public function forumdelete ()
389
485
{
390
486
if (isset ($ _POST ['delfid ' ])) {
@@ -415,11 +511,11 @@ public function forumdelete()
415
511
<tr><td class="forumtop" colspan="3"></td></tr>
416
512
<tr class="frame">
417
513
<td class="forumleft">
418
- <form class="link" method="post">
419
- <input class="link left" type="submit" value="<?php echo $ row ->f_name ?> ">
420
- <input type="hidden" name="act" value="forumdelete">
421
- <input type="hidden" name="delfid" value="<?php echo $ row ->fid ?> ">
422
- </form>
514
+ <form class="link" method="post">
515
+ <input class="link left" type="submit" value="<?php echo $ row ->f_name ?> ">
516
+ <input type="hidden" name="act" value="forumdelete">
517
+ <input type="hidden" name="delfid" value="<?php echo $ row ->fid ?> ">
518
+ </form>
423
519
</td>
424
520
<td class="forummiddle">
425
521
<?php echo $ row ->f_desc ?>
@@ -564,13 +660,13 @@ public function forumrename()
564
660
<tr><td class="forumtop" colspan="3"></td></tr>
565
661
<tr class="frame">
566
662
<td class="forumleft">
567
- <form class="link" method="post">
568
- <input class="link left" type="submit" value="<?php echo $ row ->f_name ?> ">
569
- <input type="hidden" name="act" value="forumrename">
570
- <input type="hidden" name="renfid" value="<?php echo $ row ->fid ?> ">
571
- <input type="hidden" name="fname" value="<?php echo $ row ->f_name ?> ">
572
- <input type="hidden" name="fdesc" value="<?php echo $ row ->f_desc ?> ">
573
- </form>
663
+ <form class="link" method="post">
664
+ <input class="link left" type="submit" value="<?php echo $ row ->f_name ?> ">
665
+ <input type="hidden" name="act" value="forumrename">
666
+ <input type="hidden" name="renfid" value="<?php echo $ row ->fid ?> ">
667
+ <input type="hidden" name="fname" value="<?php echo $ row ->f_name ?> ">
668
+ <input type="hidden" name="fdesc" value="<?php echo $ row ->f_desc ?> ">
669
+ </form>
574
670
</td>
575
671
<td class="forummiddle">
576
672
<?php echo $ row ->f_desc ?>
@@ -626,7 +722,8 @@ public function languages()
626
722
{
627
723
if (isset ($ _POST ['newlang ' ])) {
628
724
629
- $ sql = "UPDATE settings SET setvalue=' " .$ _POST ['newlang ' ]."' WHERE setkey='language'; " ;
725
+ $ sql = "UPDATE settings SET setvalue=' " .$ _POST ['newlang ' ].
726
+ "' WHERE setkey='language'; " ;
630
727
$ ret = $ this ->pdo ->querySQL ($ sql );
631
728
header ('location:./admin.php ' );
632
729
exit ();
@@ -662,7 +759,8 @@ public function timezones()
662
759
{
663
760
if (isset ($ _POST ['newtimezone ' ])) {
664
761
665
- $ sql = "UPDATE settings SET setvalue=' " .$ _POST ['newtimezone ' ]."' WHERE setkey='timezone'; " ;
762
+ $ sql = "UPDATE settings SET setvalue=' " .$ _POST ['newtimezone ' ]."'
763
+ WHERE setkey='timezone'; " ;
666
764
$ ret = $ this ->pdo ->querySQL ($ sql );
667
765
header ('location:./admin.php ' );
668
766
exit ();
0 commit comments