Вход Регистрация
Файл: sys/system.comments.php
Строк: 27
<?php

    
class Comments {
        
        function 
GetCommentsCount($db) {
            
$sql "SELECT * FROM comments";
            
$res $db->Query($sqlnull);
            
            return 
mysql_num_rows($res);
        }
        
        function 
GetFileComments($db$fileid) {
            
$db->Filter($fileid);
            
            
$cnt $this->GetCommentsCount($db);
            
            for(
$i 1$i $cnt 1$i++) {
                
$sql "SELECT * FROM comments WHERE fileid=$fileid AND id=$i";
                
$arr[$i] = $db->QueryAndFetch($sqlnull);
            }
            
            return 
$arr;
        }
        
        function 
SendComment($db$fileid$author$text) {
            
$sql "INSERT INTO `comments` (`author`, `fileid`, `text`, `date`, `id`) VALUES ('$author', '$fileid', '$text', '" date("d:m:Y:H:i") . "', NULL)";
            
$res $db->Query($sqlnull);
        }
        
    }

?>
Онлайн: 1
Реклама