echo json_encode($data); die; } if (!$xoopsSecurity->check()) { images_send_json(array('message' => _e('Sorry, unauthorized operation!', 'rmcommon'), 'error' => 1)); } $id = RMHttpRequest::post('id', 'integer', 0); if ($id <= 0) { images_send_json(array('message' => __('No image specified', 'rmcommon'), 'error' => 1, 'token' => $xoopsSecurity->createToken())); } $image = new RMImage($id); if ($image->isNew()) { images_send_json(array('message' => __('Specified image does not exists', 'rmcommon'), 'error' => 1, 'token' => $xoopsSecurity->createToken())); } $author = new RMUser($image->uid); $original = pathinfo($image->get_files_path() . '/' . $image->file); $dimensions = getimagesize($image->get_files_path() . '/' . $image->file); $mimes = (include XOOPS_ROOT_PATH . '/include/mimetypes.inc.php'); $category_sizes = $cat->getVar('sizes'); $sizes = array(); foreach ($category_sizes as $i => $size) { if ($size['width'] <= 0) { continue; } $tfile = $image->get_files_path() . '/sizes/' . $original['filename'] . '-' . $size['name'] . '.' . $original['extension']; if (!is_file($tfile)) { continue; } $t_dim = getimagesize($tfile); $sizes[] = array('width' => $t_dim[0], 'height' => $t_dim[1], 'url' => $image->get_files_url() . '/sizes/' . $original['filename'] . '-' . $size['name'] . '.' . $original['extension'], 'name' => $size['name']); }