set_prefilter('index', 'GThumb_prefilter'); add_event_handler('loc_end_index_thumbnails', 'process_GThumb', 50, 2); $user['nb_image_page'] = $conf['GThumb']['nb_image_page']; $page['nb_image_page'] = $conf['GThumb']['nb_image_page']; } function process_GThumb($tpl_vars, $pictures) { global $template, $conf; $template->set_filename( 'index_thumbnails', realpath(GTHUMB_PATH.'template/gthumb.tpl')); $template->assign('GThumb', $conf['GThumb']); $template->assign('GThumb_derivative_params', ImageStdParams::get_custom(9999, $conf['GThumb']['height'])); if ($conf['GThumb']['big_thumb'] and !empty($tpl_vars[0])) { $derivative_params = ImageStdParams::get_custom(9999, 2 * $conf['GThumb']['height'] + $conf['GThumb']['margin']); $template->assign('GThumb_big', new DerivativeImage($derivative_params, $tpl_vars[0]['src_image'])); } return $tpl_vars; } function GThumb_prefilter($content, $smarty) { $pattern = '#\\{\$THUMBNAILS\}\#'; $replacement = ''; return preg_replace($pattern, $replacement, $content); } function GThumb_admin_menu($menu) { array_push($menu, array( 'NAME' => 'GThumb+', 'URL' => get_root_url().'admin.php?page=plugin-'.basename(dirname(__FILE__)), ) ); return $menu; } ?>