Changeset 442


Ignore:
Timestamp:
Jun 25, 2004, 10:31:48 PM (20 years ago)
Author:
z0rglub
Message:
  • code refactoring
  • for calendar category, adds the support of the day request (displays the list of category for this day)
File:
1 edited

Legend:

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

    r437 r442  
    556556        $page['cat_nb_images'] = 0;
    557557        $page['title'] = $lang['calendar'];
    558         if ( isset( $_GET['year'] )
    559              and preg_match( '/^\d+$/', $_GET['year'] ) )
     558        if (isset($_GET['year'])
     559            and preg_match('/^\d+$/', $_GET['year']))
    560560        {
    561561          $page['calendar_year'] = (int)$_GET['year'];
    562562        }
    563         if ( isset( $_GET['month'] )
    564              and preg_match( '/^(\d+)\.(\d{2})$/', $_GET['month'], $matches ) )
     563        if (isset($_GET['month'])
     564            and preg_match('/^(\d+)\.(\d{2})$/', $_GET['month'], $matches))
    565565        {
    566566          $page['calendar_year'] = (int)$matches[1];
    567567          $page['calendar_month'] = (int)$matches[2];
    568568        }
    569         if ( isset( $page['calendar_year'] )
    570              or isset( $page['calendar_month'] ) )
     569        if (isset($_GET['day'])
     570            and preg_match('/^(\d+)\.(\d{2})\.(\d{2})$/',
     571                           $_GET['day'],
     572                           $matches))
     573        {
     574          $page['calendar_year'] = (int)$matches[1];
     575          $page['calendar_month'] = (int)$matches[2];
     576          $page['calendar_day'] = (int)$matches[3];
     577        }
     578        if (isset($page['calendar_year']))
    571579        {
    572580          $page['title'] .= ' (';
    573           if ( isset( $page['calendar_month'] ) )
     581          if (isset($page['calendar_day']))
     582          {
     583            $unixdate = mktime(0,0,0,
     584                               $page['calendar_month'],
     585                               $page['calendar_day'],
     586                               $page['calendar_year']);
     587            $page['title'].= $lang['day'][date("w", $unixdate)];
     588            $page['title'].= ' '.$page['calendar_day'].', ';
     589          }
     590          if (isset($page['calendar_month']))
    574591          {
    575592            $page['title'] .= $lang['month'][$page['calendar_month']].' ';
     
    578595          $page['title'] .= ')';
    579596        }
    580         if ( isset( $forbidden ) )
    581         {
    582           $page['where'] = ' WHERE '.$forbidden;
     597        if (isset($forbidden))
     598        {
     599          $page['where'] = 'WHERE '.$forbidden;
    583600        }
    584601        else
    585602        {
    586           $page['where'] = ' WHERE 1=1';
    587         }
    588       }
    589 
    590       if ( isset($query))
     603          $page['where'] = 'WHERE 1=1';
     604        }
     605      }
     606
     607      if (isset($query))
    591608      {
    592609        $result = mysql_query( $query );
Note: See TracChangeset for help on using the changeset viewer.