Changeset 1677 for trunk/comments.php


Ignore:
Timestamp:
Dec 21, 2006, 10:38:20 PM (17 years ago)
Author:
rub
Message:

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

It's a finalized version.
Obsolete code of draft are removed.

You can filter categories and images with recent date period on your screen selection.
In the future, filter could be easy done on other type data (plugin?)

You can flat categories and sub-categories with a recent date period of your choice.

Next, perhaps, a panel to choice recent date for the 2 features.

On draft, there have problem with MySql 5, be careful!

Css problem not resolved:

  • Menu "Categories" is bad centered
  • Icon on dark too on the top
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/comments.php

    r1647 r1677  
    217217$query = '
    218218SELECT id,name,uppercats,global_rank
    219   FROM '.CATEGORIES_TABLE;
    220 if ($user['forbidden_categories'] != '')
    221 {
    222   $query.= '
    223     WHERE id NOT IN ('.$user['forbidden_categories'].')';
    224 }
    225 $query.= '
     219  FROM '.CATEGORIES_TABLE.'
     220'.get_sql_condition_FandF
     221  (
     222    array
     223      (
     224        'forbidden_categories' => 'id',
     225        'visible_categories' => 'id'
     226      ),
     227    'WHERE'
     228  ).'
    226229;';
    227230display_select_cat_wrapper($query, array(@$_GET['cat']), $blockname, true);
     
    309312    AND '.$page['author_clause'].'
    310313    AND '.$page['keyword_clause'].'
    311     AND '.$page['status_clause'];
    312 if ($user['forbidden_categories'] != '')
    313 {
    314   $query.= '
    315     AND category_id NOT IN ('.$user['forbidden_categories'].')';
    316 }
    317 $query.= '
     314    AND '.$page['status_clause'].'
     315'.get_sql_condition_FandF
     316  (
     317    array
     318      (
     319        'forbidden_categories' => 'category_id',
     320        'visible_categories' => 'category_id',
     321        'visible_images' => 'ic.image_id'
     322      ),
     323    'AND'
     324  ).'
    318325;';
    319326list($counter) = mysql_fetch_row(pwg_query($query));
     
    355362    AND '.$page['author_clause'].'
    356363    AND '.$page['keyword_clause'].'
    357     AND '.$page['status_clause'];
    358 if ($user['forbidden_categories'] != '')
    359 {
    360   $query.= '
    361     AND category_id NOT IN ('.$user['forbidden_categories'].')';
    362 }
    363 $query.= '
     364    AND '.$page['status_clause'].'
     365'.get_sql_condition_FandF
     366  (
     367    array
     368      (
     369        'forbidden_categories' => 'category_id',
     370        'visible_categories' => 'category_id',
     371        'visible_images' => 'ic.image_id'
     372      ),
     373    'AND'
     374  ).'
    364375  GROUP BY comment_id
    365376  ORDER BY '.$page['sort_by'].' '.$page['sort_order'];
Note: See TracChangeset for help on using the changeset viewer.