Roughly, it would be something like this (not tested):
function.gallery.php in your plugin folder
function smarty_function_gallery($params, $template)
{
if (empty($params['link'])) {
trigger_error("gallery: missing 'link' parameter",E_USER_WARNING);
return;
} else {
$link = $params['link'];
}
return '<a class="fancybox" rel="gallery1" href="'.$link.'"><img src="'.$link.'" alt="" width="200" height="200" /></a>';
}
although I think it's a too specific piece of html to make a plugin just for that