Вход Регистрация
Файл: adultscript-2.0.3-pro/files/admin/templates/default/extend/ajax/comment_load.plugin.php
Строк: 21
<?php
defined
('_VALID') or die('Restricted Access!');
function 
ajax_plugin_comment_load()
{
    
$data = array('status' => 0'code' => '''msg' => '''debug' => '');
    if (isset(
$_GET['id'])) {
        
$filter        = &VF::factory('filter');
        
$id            $filter->get('id''STRING''GET');

        
$parts explode('_'$id);
        if (isset(
$parts['0']) && isset($parts['1'])) {
            
$type        $parts['0'];
            
$types        = array('video' => 1'photo' => 1'user' => 1'model' => 1);
            if (!isset(
$types[$type])) {
                
$data['msg'] = 'Invalid type!';
                return 
$data['msg'];
            }
            
            
$comment_id    = (int) $parts['1'];
                        
            
$db VF::factory('database');
            
$db->query("SELECT comment
                        FROM #__"
.$type."_comments
                        WHERE comment_id = "
.$comment_id."
                        LIMIT 1"
);
            if (
$db->affected_rows()) {
                return 
$db->fetch_field('comment');
            } else {
                return 
'';
            }
        } else {
            
$data['msg'] = 'Invalid comment id format!';
        }
    } else {
        
$data['msg'] = 'Invalid ajax request!';
    }
    
    return 
$data['msg'];
}
?>
Онлайн: 0
Реклама