Файл: adultscript-2.0.3-pro/files/admin/templates/default/extend/ajax/comment_load_photo.plugin.php
Строк: 20
<?php
defined('_VALID') or die('Restricted Access!');
function ajax_plugin_comment_load_photo()
{
$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'])) {
$photo_id = (int) $parts['0'];
$comment_id = (int) $parts['1'];
$db = &VF::factory('database');
$db->query("SELECT comment
FROM #__photo_comments
WHERE comment_id = ".$comment_id."
AND photo_id = ".$photo_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'];
}
?>