Changeset 27042 for extensions/linked_pages/include/functions.inc.php
- Timestamp:
- Jan 29, 2014, 9:31:33 PM (10 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
extensions/linked_pages/include/functions.inc.php
r17925 r27042 25 25 global $page, $user, $template, $conf; 26 26 27 if ( isset($page['section']) and $page['section']=='categories' and isset($page['category']))27 if (isset($page['section']) and $page['section']=='categories' and isset($page['category'])) 28 28 { 29 29 $where_clauses = array('category_id = '.$page['category']['id']); … … 50 50 WHERE user_id = '.$user['id'].' 51 51 ;'; 52 $user_groups = array_from_query($query, 'group_id');52 $user_groups = query2array($query, null, 'group_id'); 53 53 } 54 54 } … … 78 78 while ($row = pwg_db_fetch_assoc($result)) 79 79 { 80 if ( !is_admin() and $conf['AP']['group_perm'] and !empty($row['groups']))80 if (!is_admin() and $conf['AP']['group_perm'] and !empty($row['groups'])) 81 81 { 82 82 $authorized = false; … … 91 91 if (!$authorized) continue; 92 92 } 93 94 93 95 94 $row['U_PAGE'] = make_index_url(array('section'=>'page')).'/'.(isset($row['permalink']) ? $row['permalink'] : $row['page_id']); … … 99 98 100 99 $template->assign('LINKEDPAGES_PATH', LINKEDPAGES_PATH); 101 $template->set_prefilter('index', 'linked_pages_prefilter_index'); 100 $template->set_filename('linked_pages_content', realpath(LINKEDPAGES_PATH . 'template/index_menu.tpl')); 101 $template->assign('PLUGIN_INDEX_CONTENT_BEGIN', $template->parse('linked_pages_content',true).$template->get_template_vars('PLUGIN_INDEX_CONTENT_BEGIN')); 102 102 103 103 } 104 else if ( isset($page['section']) and $page['section']=='additional_page' and isset($page['additional_page']))104 else if (isset($page['section']) and $page['section']=='additional_page' and isset($page['additional_page'])) 105 105 { 106 106 $where_clauses = array('page_id = '.$page['additional_page']['id']); … … 150 150 } 151 151 } 152 153 function linked_pages_prefilter_index($content)154 {155 $search = '#(</div>{\* <!-- titrePage --> \*}|<div id="subcontent">|<div class="subcontent">)#';156 $replace = "$1\n".file_get_contents(LINKEDPAGES_PATH . 'template/index_menu.tpl');157 return preg_replace($search, $replace, $content);158 }159 160 161 ?>
Note: See TracChangeset
for help on using the changeset viewer.