Ignore:
Timestamp:
Oct 22, 2010, 10:53:03 AM (14 years ago)
Author:
patdenice
Message:

Added feature: hide main block on home page.

Location:
extensions/PWG_Stuffs/include
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • extensions/PWG_Stuffs/include/class.inc.php

    r7336 r7340  
    7373      {
    7474                $this->pos = 'end';
     75        if (!empty($module['datas'])
     76          and $datas = unserialize($module['datas'])
     77          and $datas['hide'])
     78        {
     79          add_event_handler('loc_end_index', 'remove_main_block');
     80        }
    7581                continue;
    7682        }
  • extensions/PWG_Stuffs/include/functions.inc.php

    r6417 r7340  
    113113}
    114114
     115function remove_main_block()
     116{
     117  global $page, $template;
     118
     119  if (isset($page['section']) and $page['section'] == 'categories' and !isset($page['category']))
     120  {
     121    $template->set_prefilter('index', 'remove_main_block_prefilter');
     122  }
     123}
     124
     125function remove_main_block_prefilter($content, $smarty)
     126{
     127  return preg_replace('#<div id="content" class="content">.*</div> <!-- content -->#s', '', $content);
     128}
     129
    115130?>
Note: See TracChangeset for help on using the changeset viewer.