Ignore:
Timestamp:
Dec 10, 2006, 11:48:32 PM (17 years ago)
Author:
rub
Message:

Feature Issue ID 0000601: Filter all public pages with only recent elements

It's a draft of the feature witch allows to show only recent elements.
Development are not finished.
Queries and special pages (best rates, tags, etc.) are not modified.
Only main php files about images and categories are ok.

Before to continue, I prefer to determinate a solution between modify cache implementation or hide counters.

Go to http://forum.phpwebgallery.net/viewtopic.php?pid=50015#p50015

File:
1 edited

Legend:

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

    r1641 r1648  
    6868  FROM '.CATEGORIES_TABLE.' INNER JOIN '.USER_CACHE_CATEGORIES_TABLE.'
    6969  ON id = cat_id and user_id = '.$user['id'];
    70   if (!$user['expand'])
     70  if ($page['filter_mode'])
    7171  {
    7272    $query.= '
    73     WHERE (id_uppercat is NULL';
    74     if (isset($page['category']))
    75     {
    76       $query.= ' OR id_uppercat IN ('.$page['uppercats'].')';
    77     }
    78     $query.= ')';
     73where max_date_last > SUBDATE(
     74  CURRENT_DATE,INTERVAL '.$user['recent_period'].' DAY)';
     75  }
     76  else
     77  {
     78    // Always expand when filter_mode is activated
     79    if (!$user['expand'])
     80    {
     81      $query.= '
     82      WHERE (id_uppercat is NULL';
     83      if (isset($page['category']))
     84      {
     85        $query.= ' OR id_uppercat IN ('.$page['uppercats'].')';
     86      }
     87      $query.= ')';
     88    }
    7989  }
    8090  $query.= '
Note: See TracChangeset for help on using the changeset viewer.