function _load_more() { $id = $_REQUEST['id']; $page = (int) $_REQUEST['page']; $gallery = new ASG_Gallery($id); header('Content-type: text/json'); $images = $gallery->get_images($page); ob_start(); $gallery->render_images($images); $images = ob_get_clean(); echo json_encode(array('images' => $images, 'have_more' => $gallery->have_more($page))); exit; }
function asg_refresh_gallery($options = array()) { if (!isset($options['id'])) { return; } $id = $options['id']; $gallery = new ASG_Gallery($id, asg_get_gallery($id)); $gallery->get_images(1, true); $gallery->get_images(2, true); }