set_prefilter('index_thumbnails', 'DST_prefilter_thumbnails'); $template->set_filename('DST', realpath(DST_PATH.'dst.tpl')); $template->append('head_elements',$template->parse('DST',true)); // the content is different on collection edition page and no button on batch downloader set edition page if (empty($pictures)) { return $tpl_thumbnails_var; } $query = ' SELECT enabled_high FROM '.USER_INFOS_TABLE.' WHERE user_id = \''.$user['id'].'\' ;'; $result = pwg_query($query); $row = pwg_db_fetch_assoc($result); if($row['enabled_high']=='true'){ $template->assign('PLUG_DST', 'ok'); } foreach ($tpl_thumbnails_var as &$thumbnail) { $thumbnail['dowpic']=DST_PATH.'save.png'; } $template->func_combine_css(array('id'=>'dst','path'=>DST_PATH.'dst.css')); return $tpl_thumbnails_var; } function DST_prefilter_thumbnails($content, &$smarty) { global $template; $search = '#()#'; $replace = '$1 {strip}{if isset($PLUG_DST)}
{/if}{/strip} '; return preg_replace($search, $replace, $content); }