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

        
$parts explode('_'$id);
        if (isset(
$parts['0']) && isset($parts['1'])) {
            
$video_id    = (int) $parts['0'];
            
$comment_id    = (int) $parts['1'];
            
            
$db    = &VF::factory('database');
            
$db->query("SELECT comment_id
                        FROM #__video_comments
                        WHERE comment_id = "
.$comment_id."
                        AND video_id = "
.$video_id."
                        LIMIT 1"
);
            if (
$db->affected_rows()) {
                
$db->query("UPDATE #__video_comments
                            SET comment = '"
.$db->escape($comment)."'
                            WHERE comment_id = "
.$comment_id."
                            AND video_id = "
.$video_id."
                            LIMIT 1"
);
                return 
nl2br($comment);
            } else {
                
$data['msg'] = 'Invalid comment id! Are you sure this comment exists!';
            }
        } else {
            
$data['msg'] = 'Invalid comment id format!';
        }
    } else {
        
$data['msg'] = 'Invalid ajax request!';
    }
    
    return 
$data['msg'];
}
?>
Онлайн: 0
Реклама