Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- if (!defined('XOOPS_ROOT_PATH')) exit();
- class htmlReplace extends XCube_ActionFilter
- {
- function preFilter()
- {
- $this->mRoot->mDelegateManager->add('XoopsTpl.New', array( &$this , 'xoopsTplHook' ) ) ;
- }
- function xoopsTplHook( &$xoopsTpl )
- {
- $xoopsTpl->register_outputfilter("htmlReplaceFilter");
- }
- }
- function htmlReplaceFilter($tpl_output, &$smarty)
- {
- $replaced = $tpl_output;
- if ($GLOBALS['xoopsConfig']['theme_set'] == 'smartphone'){
- // 4PCを削除
- $replaced = preg_replace('/<!--4PC-->.*?<!--\/4PC-->/s', '', $replaced);
- }else{
- // 4SMARTPHONEを削除
- $replaced = preg_replace('/<!--4SMARTPHONE-->.*?<!--\/4SMARTPHONE-->/s', '', $replaced);
- }
- return $replaced;
- }
Advertisement
Add Comment
Please, Sign In to add comment