Changeset 429 for trunk


Ignore:
Timestamp:
Jun 15, 2004, 10:02:03 PM (20 years ago)
Author:
z0rglub
Message:
  • adds calendar category
File:
1 edited

Legend:

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

    r423 r429  
    6060 *
    6161 *  - is numeric and corresponds to a category in the database
    62  *  - is equals 'fav' (for favorites)
    63  *  - is equals 'search' (when the result of a search is displayed)
    64  *  - is equals 'most_visited'
    65  *  - is equals 'best_rated'
    66  *  - is equals 'recent'
     62 *  - equals 'fav' (for favorites)
     63 *  - equals 'search' (when the result of a search is displayed)
     64 *  - equals 'most_visited'
     65 *  - equals 'best_rated'
     66 *  - equals 'recent'
     67 *  _ equals 'calendar'
    6768 *
    6869 * The function fills the global var $page['cat'] and returns nothing
     
    9697         or $cat == 'most_visited'
    9798         or $cat == 'best_rated'
    98          or $cat == 'recent' )
     99         or $cat == 'recent'
     100         or $cat == 'calendar' )
    99101    {
    100102      $page['cat'] = $cat;
     
    428430    else
    429431    {
    430       if ( $page['cat'] == 'search' or $page['cat'] == 'most_visited'
    431            or $page['cat'] == 'recent' or $page['cat'] == 'best_rated' )
     432      if ( $page['cat'] == 'search'
     433           or $page['cat'] == 'most_visited'
     434           or $page['cat'] == 'recent'
     435           or $page['cat'] == 'best_rated'
     436           or $page['cat'] == 'calendar' )
    432437      {
    433438        // we must not show pictures of a forbidden category
     
    538543        }
    539544      }
     545      else if ( $page['cat'] == 'calendar' )
     546      {
     547        $page['cat_nb_images'] = 0;
     548        $page['title'] = $lang['calendar'];
     549        if ( isset( $_GET['year'] )
     550             and preg_match( '/^\d+$/', $_GET['year'] ) )
     551        {
     552          $page['calendar_year'] = (int)$_GET['year'];
     553        }
     554        if ( isset( $_GET['month'] )
     555             and preg_match( '/^(\d+)\.(\d{2})$/', $_GET['month'], $matches ) )
     556        {
     557          $page['calendar_year'] = (int)$matches[1];
     558          $page['calendar_month'] = (int)$matches[2];
     559        }
     560        if ( isset( $page['calendar_year'] )
     561             or isset( $page['calendar_month'] ) )
     562        {
     563          $page['title'] .= ' (';
     564          if ( isset( $page['calendar_month'] ) )
     565          {
     566            $page['title'] .= $lang['month'][$page['calendar_month']].' ';
     567          }
     568          $page['title'] .= $page['calendar_year'];
     569          $page['title'] .= ')';
     570        }
     571        if ( isset( $forbidden ) )
     572        {
     573          $page['where'] = ' WHERE '.$forbidden;
     574        }
     575        else
     576        {
     577          $page['where'] = ' WHERE 1=1';
     578        }
     579      }
    540580
    541581      if ( isset($query))
Note: See TracChangeset for help on using the changeset viewer.