'Image Preview', 'URL' => get_admin_plugin_menu_link(get_root_url().'plugins/'.IMGP_DIR.'/admin/admin.php') ) ); return $menu; } /** thumbnails.tpl **/ add_event_handler('loc_end_index_thumbnails', 'imgpreview_thumbnails'); function imgpreview_thumbnails($tpl_thumbnails_var) { global $template, $conf ; $conf_imgp = explode("#" , $conf['imgpreview']); $imgpreview=array( 'width' => $conf_imgp[0], 'height' => $conf_imgp[1] ); $template->assign(array( 'imgpreview' => $imgpreview )); $template->set_prefilter('index_thumbnails', 'imgpreview_prefilter_thumbnails'); $template->set_prefilter('stuffs', 'imgpreview_prefilter_thumbnails'); $dir=dirname(__FILE__).'/css_js.tpl'; $template->set_filenames(array( 'imgpreview_css_js' => realpath($dir), ) ); $template->assign_var_from_handle('IMGPREVIEW', 'imgpreview_css_js'); return $tpl_thumbnails_var; } function imgpreview_prefilter_thumbnails($content, &$smarty) { global $template; $search = 'href="{$thumbnail.URL}"'; $replacement = 'href="{$thumbnail.URL}" imgsrc="{$thumbnail.FILE_PATH}"'; $content= str_replace($search, $replacement, $content); $content='{$IMGPREVIEW}'.$content; return $content; } ?>