Ignore:
Timestamp:
Jan 29, 2014, 9:31:33 PM (10 years ago)
Author:
mistic100
Message:

update for Piwigo 2.6 + use underscore for admin

File:
1 edited

Legend:

Unmodified
Added
Removed
  • extensions/linked_pages/include/functions.inc.php

    r17925 r27042  
    2525  global $page, $user, $template, $conf;
    2626 
    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']))
    2828  {
    2929    $where_clauses = array('category_id = '.$page['category']['id']);
     
    5050  WHERE user_id = '.$user['id'].'
    5151;';
    52         $user_groups = array_from_query($query, 'group_id');
     52        $user_groups = query2array($query, null, 'group_id');
    5353      }
    5454    }
     
    7878    while ($row = pwg_db_fetch_assoc($result))
    7979    {
    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']))
    8181      {
    8282        $authorized = false;
     
    9191        if (!$authorized) continue;
    9292      }
    93        
    9493     
    9594      $row['U_PAGE'] = make_index_url(array('section'=>'page')).'/'.(isset($row['permalink']) ? $row['permalink'] : $row['page_id']);
     
    9998   
    10099    $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'));
    102102   
    103103  }
    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']))
    105105  {
    106106    $where_clauses = array('page_id = '.$page['additional_page']['id']);
     
    150150  }
    151151}
    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.