Ignore:
Timestamp:
Sep 23, 2012, 1:19:26 PM (12 years ago)
Author:
mistic100
Message:

feature 2614: pagination on albums

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/include/category_cats.inc.php

    r12930 r18165  
    2323
    2424/**
    25  * This file is included by the main page to show thumbnails for a category
    26  * that have only subcategories or to show recent categories
     25 * This file is included by the main page to show subcategories of a category
     26 * or to show recent categories or main page categories list
    2727 *
    2828 */
     29
     30$selection = array_slice(
     31  $page['categories'],
     32  $page['starta'],
     33  $conf['nb_categories_page']
     34  );
     35
     36$selection = trigger_event('loc_index_categories_selection', $selection);
    2937
    3038// $user['forbidden_categories'] including with USER_CACHE_CATEGORIES_TABLE
     
    3947    count_categories
    4048  FROM '.CATEGORIES_TABLE.' c
    41     INNER JOIN '.USER_CACHE_CATEGORIES_TABLE.' ucc ON id = cat_id AND user_id = '.$user['id'];
    42 
    43 if ('recent_cats' == $page['section'])
    44 {
    45   $query.= '
    46   WHERE date_last >= '.pwg_db_get_recent_period_expression($user['recent_period']);
    47 }
    48 else
    49 {
    50   $query.= '
    51   WHERE id_uppercat '.(!isset($page['category']) ? 'is NULL' : '= '.$page['category']['id']);
    52 }
    53 
    54 $query.= '
    55     '.get_sql_condition_FandF(
    56   array(
    57     'visible_categories' => 'id',
    58     ),
    59   'AND'
    60   );
    61 
     49    INNER JOIN '.USER_CACHE_CATEGORIES_TABLE.' ucc
     50    ON id = cat_id
     51    AND user_id = '.$user['id'].'
     52  WHERE c.id IN('.implode(',', $selection).')';
     53 
    6254if ('recent_cats' != $page['section'])
    6355{
Note: See TracChangeset for help on using the changeset viewer.