Changeset 7402
- Timestamp:
- Oct 26, 2010, 4:37:22 PM (14 years ago)
- Location:
- extensions/PWG_Stuffs
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
extensions/PWG_Stuffs/include/class.inc.php
r7340 r7402 44 44 if ($script == 'index') 45 45 { 46 $query .= isset($page['category'])?46 $query .= !$page['is_homepage'] ? 47 47 'AND on_cats = "true"' : 48 48 'AND on_home = "true"' ; … … 77 77 and $datas['hide']) 78 78 { 79 add_event_handler('loc_end_index', ' remove_main_block');79 add_event_handler('loc_end_index', 'hide_main_block'); 80 80 } 81 81 continue; -
extensions/PWG_Stuffs/include/functions.inc.php
r7340 r7402 113 113 } 114 114 115 function remove_main_block()115 function hide_main_block() 116 116 { 117 117 global $page, $template; 118 118 119 if ( isset($page['section']) and $page['section'] == 'categories' and !isset($page['category']))119 if ($page['is_homepage']) 120 120 { 121 $template->set_prefilter('index', ' remove_main_block_prefilter');121 $template->set_prefilter('index', 'hide_main_block_prefilter'); 122 122 } 123 123 } 124 124 125 function remove_main_block_prefilter($content, $smarty)125 function hide_main_block_prefilter($content, $smarty) 126 126 { 127 127 return preg_replace('#<div id="content" class="content">.*</div> <!-- content -->#s', '', $content); -
extensions/PWG_Stuffs/main.inc.php
r3609 r7402 44 44 add_event_handler('loc_begin_picture', 'set_stuffs_on_picture'); 45 45 46 function set_is_homepage() 47 { 48 global $tokens, $page; 49 50 $next_token = 0; 51 $parsed_url = parse_section_url($tokens, $next_token); 52 if (!isset($parsed_url['section']) and !isset($page['chronology_field'])) 53 { 54 $page['is_homepage'] = true; 55 } 56 else 57 { 58 $page['is_homepage'] = false; 59 } 60 } 61 add_event_handler('loc_end_section_init', 'set_is_homepage'); 46 62 ?>
Note: See TracChangeset
for help on using the changeset viewer.