assign('VERSO_URL', $verso_dir.$verso_file); if (is_file($hd_dir.$verso_file)) { $template->assign('VERSO_HD', $hd_dir.$verso_file); } } /* useless section, just for retrocompatibility */ else if (is_file($verso_dir.$rotat_file)) { $template->assign('VERSO_URL', $verso_dir.$rotat_file); if (is_file($hd_dir.$rotat_file)) { $template->assign('VERSO_HD', $hd_dir.$rotat_file); } } /* otherwise */ else { return $content; } /* link name */ $conf['Front2Back'][7] = unserialize($conf['Front2Back'][7]); if (!empty($conf['Front2Back'][7][$user['language']])) { $conf['Front2Back'][7] = explode('|', $conf['Front2Back'][7][$user['language']]); } else if (!empty($conf['Front2Back'][7]['default'])) { $conf['Front2Back'][7] = explode('|', $conf['Front2Back'][7]['default']); } else { $conf['Front2Back'][7] = array(l10n('See back'), l10n('See front')); } $template->set_filenames(array('Front2Back' => dirname(__FILE__) . '/template/Front2Back.tpl') ); $template->assign(array( 'F2B_PATH' => F2B_PATH, 'F2B_position' => $conf['Front2Back'][4], 'F2B_switch_mode' => $conf['Front2Back'][5], 'F2B_transition' => $conf['Front2Back'][6], 'F2B_see_back' => $conf['Front2Back'][7][0], 'F2B_see_front' => $conf['Front2Back'][7][1], )); switch ($conf['Front2Back'][4]) { case 'toolbar': $template->set_prefilter('picture', 'Front2Back_toolbar_prefilter'); return $content; break; case 'top': return $template->parse('Front2Back', true)."\n".$content; break; case 'bottom': return $content."\n".$template->parse('Front2Back', true); break; } } function Front2Back_toolbar_prefilter($content, &$smarty) { $search = '{/if}{/strip}{*caddie management END*}'; $replacement = $search."\n".file_get_contents(F2B_PATH.'template/Front2Back.tpl'); return str_replace($search, $replacement, $content); } ?>