forked from 4ducky/4ducky
The PHP sources, templates and old jQuery-based scripts move unchanged into legacy/ for reference. Shared assets (media/, images/, favicon.ico, the default avatar) stay at the repository root. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
130 lines
3.7 KiB
PHP
130 lines
3.7 KiB
PHP
<?php
|
|
require_once( 'lib/config.php' );
|
|
require_once( 'lib/users.php' );
|
|
require_once( 'lib/db.php' );
|
|
|
|
header("Content-type: text/html; charset=UTF-8");
|
|
$user = new User();
|
|
$user->login();
|
|
|
|
if( !$user->admin ) {
|
|
echo "You need to be logged in as an admin user!";
|
|
exit();
|
|
}
|
|
|
|
$Spammer = DB::query("SELECT * from pl_users WHERE spamblocked=1");
|
|
$Abuses = DB::query("SELECT *
|
|
FROM `pl_abuse`
|
|
WHERE `read` =:1",0);
|
|
|
|
$newComments = DB::query(
|
|
'SELECT
|
|
c.id, c.content, u.name, u.avatar,
|
|
UNIX_TIMESTAMP(c.created) AS created,
|
|
i.keyword FROM '.TABLE_COMMENTS.' c
|
|
LEFT JOIN '.TABLE_USERS.' u
|
|
ON u.id = c.userId
|
|
LEFT JOIN '.TABLE_IMAGES.' i
|
|
ON i.id = c.imageId
|
|
ORDER BY c.created DESC LIMIT 100'
|
|
);
|
|
include( 'templates/header.tpl.php' );
|
|
?>
|
|
|
|
<table width="100%" border="0" cellspacing="0" cellpadding="0">
|
|
<tr>
|
|
<td width="50%" valign="top">
|
|
<h2>Newest Comments:</h2>
|
|
<div style="width:100%">
|
|
<?php foreach( $newComments as $c ) {?>
|
|
<div class="comment">
|
|
<div class="commentHead">
|
|
<img class="avatarSmall" width="16" height="16" src="<?php echo Config::$absolutePath.$c['avatar']; ?>"/>
|
|
<a href="<?php echo Config::$absolutePath.'user/'.$c['name']; ?>"><?php echo $c['name']; ?></a>
|
|
at <?php echo date('d. M Y H:i',$c['created']); ?>
|
|
[bild:<a href="<?php echo Config::$absolutePath.'all/view/'.$c['keyword']; ?>"><?php echo $c['keyword']; ?></a>]
|
|
<?php if($user->admin) { ?>
|
|
<div style="float:right;" id="del">
|
|
<a href="#" onclick="return delComment(<?php echo $c['id']; ?>, this)">[x]</a>
|
|
</div>
|
|
<?php } ?>
|
|
</div>
|
|
<?php echo $c['content']; ?>
|
|
</div>
|
|
<?php } ?>
|
|
</div></td>
|
|
|
|
<td width="50%" valign="top">
|
|
<?php
|
|
|
|
if((count($Spammer)) > 0){
|
|
echo '<h2 style="margin:5px;" >Newest Spammer:</h2>';
|
|
foreach( $Spammer as $u ) {?>
|
|
|
|
<div class="userInfo" style="margin:5px;">
|
|
<img class="avatar" width="40" height="40" src="<?php echo Config::$absolutePath.$u['avatar']; ?>"/>
|
|
<div class="name">
|
|
<strong>
|
|
<a href="<?php echo Config::$absolutePath.'user/'.$u['name']; ?>"><?php echo $u['name']; ?></a>
|
|
</strong>
|
|
</div>
|
|
<div class="info">
|
|
ID: <strong><?php echo $u['id']; ?></strong> /
|
|
Images: <strong><?php echo $u['images']; ?></strong>
|
|
<?php if( !empty($u['website'])) { ?>/
|
|
Website: <strong><a href="<?php echo htmlspecialchars($u['website']); ?>" target="_blank">
|
|
<?php echo htmlspecialchars($u['website']); ?>
|
|
</a></strong>
|
|
<?php } ?>
|
|
</div>
|
|
<div style="clear:both;"></div>
|
|
</div>
|
|
|
|
|
|
<?php } }else{echo '<h2 style="margin:5px;" >No Spammer</h2>'; }?>
|
|
|
|
<?php
|
|
if((count($Abuses)) > 0){
|
|
echo '<h2 style="margin:5px;" >Newest Abuses:</h2>';
|
|
foreach( $Abuses as $a ) {
|
|
|
|
$Image = DB::getRow("SELECT *,UNIX_TIMESTAMP(logged) AS loggedTS FROM pl_images WHERE id=:1",$a["imageid"]);
|
|
if ($Image){
|
|
?>
|
|
|
|
<div class="userInfo" style="margin:5px;">
|
|
<img style="float:left; margin:2px;" width="64" height="64" src="<?php echo Config::$absolutePath."data/thumbs/".date("Y/m",$Image["loggedTS"])."/128x128/".$Image["thumb"]; ?>"/>
|
|
|
|
<div class="info">
|
|
Reason: <strong><?php echo $a['reason']; ?></strong> /
|
|
Email: <strong><?php echo $a['email']; ?></strong>
|
|
</div>
|
|
<div class="info">
|
|
<strong><a href="<?php echo Config::$absolutePath."all/view/".$Image['keyword']; ?>" > >> Thread</a> </strong>
|
|
</div>
|
|
<div style="clear:both;"></div>
|
|
</div>
|
|
|
|
|
|
<?php
|
|
}else{
|
|
echo('<div class="userInfo" style="padding:5px;">');
|
|
echo('<a href="'.$a["imagelink"].'">'.$a["imagelink"].'</a><br>');
|
|
echo('Reason: <strong>'.$a['reason'].'</strong> /
|
|
Email: <strong>'.$a['email'].'</strong>');
|
|
echo('</div>');
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
}else{echo '<h2 style="margin:5px;" >No Abuses</h2>';}?>
|
|
</td>
|
|
</tr>
|
|
</table>
|
|
|
|
<?php
|
|
include( 'templates/footer.tpl.php' );
|
|
?>
|