Вход Регистрация
Файл: siteadmin/modules/albums/spam.php
Строк: 65
<?php
defined
('_VALID') or die('Restricted Access!');
require 
$config['BASE_DIR']. '/classes/pagination.class.php';

Auth::checkAdmin();

$page   = (isset($_GET['page'])) ? intval($_GET['page']) : 1;
$remove         NULL;
if ( isset(
$_GET['a']) && $_GET['a'] != '' ) {
    
$action     trim($_GET['a']);
    
$CID        = ( isset($_GET['CID']) && is_numeric($_GET['CID']) ) ? intval(trim($_GET['CID'])) : NULL;
    
$SID        = ( isset($_GET['SID']) && is_numeric($_GET['SID']) ) ? intval(trim($_GET['SID'])) : NULL;
    switch ( 
$action ) {
        case 
'delete':
            
$sql    "DELETE FROM photo_comments WHERE CID = " .$CID" LIMIT 1";
            
$conn->execute($sql);
            if ( 
$conn->Affected_Rows() == ) {
                
$sql    "DELETE FROM spam WHERE type = 'photo' AND comment_id = " .$CID;
                
$conn->execute($sql);
                
$messages[] = 'Successfully deleted comment!';
            } else {
                
$errors[]   = 'Failed to delete comment! Are you sure this comment exists?!';
            }
            
$remove '&a=delete&CID=' .$CID;
            break;
        case 
'unspam':
            
$sql    "DELETE FROM spam WHERE type = 'photo' AND spam_id = " .$SID;
            
$conn->execute($sql);
            if ( 
$conn->Affected_Rows() > ) {
                
$messages[] = 'Successfully unspamed this comment!';
            } else {
                
$errors[]   = 'Failed to unspam comment! Are you sure this spam flag exists?!';
            }
            
$remove '&a=unspam&SID=' .$SID;        
            break;
    }
}

$sql            "SELECT COUNT(spam_id) AS total_spam FROM spam WHERE type = 'photo'";
$rs             $conn->execute($sql);
$total_spam     $rs->fields['total_spam'];
$pagination     = new Pagination(20);
$limit          $pagination->getLimit($total_spam);
$paging         $pagination->getAdminPagination($remove);
$sql            "SELECT s.spam_id, s.UID AS RID, s.addtime AS add_time, c.*, u.username
                   FROM spam AS s, photo_comments AS c, signup AS u
                   WHERE s.comment_id = c.CID AND s.parent_id = c.PID AND c.UID = u.UID
                   LIMIT " 
.$limit;
$rs             $conn->execute($sql);
$comments       $rs->getrows();

$smarty->assign('comments'$comments);
$smarty->assign('total_spam'$total_spam);
$smarty->assign('paging'$paging);
$smarty->assign('page'$page);
?>
Онлайн: 1
Реклама