Changeset 371


Ignore:
Timestamp:
Feb 23, 2004, 11:02:41 PM (20 years ago)
Author:
z0rglub
Message:

code refactoring

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/include/page_header.php

    r362 r371  
    3131$template->set_filenames(array('header'=>'header.tpl'));
    3232
     33$css = './template/'.$user['template'].'/'.$user['template'].'.css';
     34
    3335$template->assign_vars(array(
    34         'S_CONTENT_ENCODING' => $lang['charset'],
    35         'T_STYLE' =>  './template/'.$user['template'].'/'.$user['template'].'.css',
    36         'PAGE_TITLE' => $title)
    37         );
     36                         'S_CONTENT_ENCODING' => $lang['charset'],
     37                         'T_STYLE' => $css,
     38                         'PAGE_TITLE' => $title
     39                         ));
    3840
    3941// refresh
    4042if ( isset( $refresh ) && $refresh >0 && isset($url_link))
    41   {
    42     $url = $url_link.'&slideshow='.$refresh;
    43         $template->assign_vars(array(
    44         'S_REFRESH_TIME' => $refresh,
    45         'U_REFRESH' => add_session_id( $url )
    46         )
    47         );
    48         $template->assign_block_vars('refresh', array());
    49   }
     43{
     44  $url = $url_link.'&slideshow='.$refresh;
     45  $template->assign_vars(array(
     46                           'S_REFRESH_TIME' => $refresh,
     47                           'U_REFRESH' => add_session_id( $url )
     48                           ));
     49  $template->assign_block_vars('refresh', array());
     50}
    5051
    5152// Work around for "current" Apache 2 + PHP module which seems to not
    5253// cope with private cache control setting
    53 if (!empty($HTTP_SERVER_VARS['SERVER_SOFTWARE']) && strstr($HTTP_SERVER_VARS['SERVER_SOFTWARE'], 'Apache/2'))
     54if (!empty( $_SERVER['SERVER_SOFTWARE'] )
     55    and strstr( $_SERVER['SERVER_SOFTWARE'], 'Apache/2'))
    5456{
    55         header ('Cache-Control: no-cache, pre-check=0, post-check=0, max-age=0');
     57  header( 'Cache-Control: no-cache, pre-check=0, post-check=0, max-age=0' );
    5658}
    5759else
    5860{
    59         header ('Cache-Control: private, pre-check=0, post-check=0, max-age=0');
     61  header( 'Cache-Control: private, pre-check=0, post-check=0, max-age=0' );
    6062}
    61 header ('Expires: ' . gmdate('D, d M Y H:i:s', time()) . ' GMT');
    62 header ('Last-Modified: ' . gmdate('D, d M Y H:i:s') . ' GMT');
     63header( 'Expires: ' . gmdate('D, d M Y H:i:s', time()) . ' GMT' );
     64header( 'Last-Modified: ' . gmdate('D, d M Y H:i:s') . ' GMT' );
    6365
    6466$template->pparse('header');
Note: See TracChangeset for help on using the changeset viewer.