Location: PHPKode > projects > QuickTicket > quickticket/qti_p_header.php
<?php

// QuickTicket 2.5 build:20101222

ob_start();

// --------
// INITIALISE
// --------

// check LangMenu condition

$strLangMenu = '';
if ( $_SESSION[QT]['userlang']=='1' )
{
  if ( file_exists('bin/qti_lang.php') )
  {
    include('bin/qti_lang.php');
    $strURI = QTargimplode(QTarradd(QTargexplode(),'lx'));
    $strLangMenu = '';
    foreach($arrLang as $strKey=>$arrDef)
    {
    $strLangMenu .= '<a href="'.Href().'?'.$strURI.'&amp;lx='.$strKey.'" title="'.$arrDef[1].'" class="'.($_SESSION[QT]['show_banner']=='1' ? 'banner' : 'nobanner').'">'.$arrDef[0].'</a> &middot; ';
    }
  }
  else
  {
    $strLangMenu .= '<span class="small">missing file:bin/qti_lang.php</span>';
  }
}  

// Contrast

if ( QTI_SHOW_CONTRAST )
{
  if ( !isset($strHeadScript) ) $strHeadScript='';
  $oHtml->links[] = '<link rel="alternate stylesheet" type="text/css" href="bin/css/qti_contrast.css" title="cssalternate" /><link rel="alternate stylesheet" type="text/css" href="bin/css/qti_print.css" media="print" title="cssalternate" />';
  $oHtml->scripts[] = '<script type="text/javascript" src="bin/css/qti_contrast.js"></script>';
  $strLangMenu .= '<a class="css-default" href="javascript:chooseStyle(\'cssalternate\',60);"><img style="width:12px;height:12px;vertical-align:middle" src="bin/css/qti_contrast.gif" title="High contrast display" alt="Contrast" /></a><a class="css-alternate" href="javascript:chooseStyle(\'cssmain\',60);"><img style="width:12px;height:12px;border-width:0;vertical-align:middle" src="bin/css/qti_contrast.gif" title="Default display" alt="Contrast" /></a>';
}

// --------
// HTML START
// --------

global $oHtml;
  $oHtml->title = (empty($oVIP->selfname) ? '' : $oVIP->selfname.' - ').$oHtml->title;
  if ( !empty($strHeadScript) ) $oHtml->scripts[] = $strHeadScript;

echo $oHtml->Head();
echo $oHtml->Body(array('onload'=>(isset($strBodyAddOnload) ? $strBodyAddOnload : null),'onunload'=>(isset($strBodyAddOnunload) ? $strBodyAddOnunload : null)));

// PAGE

HtmlPageCtrl(0);

// BANNER

if ( $_SESSION[QT]['show_banner']=='1' )
{
  HtmlBanner(0,'','qti_logo.gif',$strLangMenu);
}
else
{
  if ( !empty($strLangMenu) )
  {
  HtmlBanner(1,'','',$strLangMenu);
  }
}

// MENU

$arrMenus = array(); // keys are: 'h' in header, 'f' in footer, 'n' name, 'u' url, 's' selected with url's, 'i' inactive with url's

if ( $_SESSION[QT]['home_menu']=='1' && !empty($_SESSION[QT]['home_url']) )
{
$arrMenus[]=array('h'=>true, 'f'=>true, 'n'=>$_SESSION[QT]['home_name'], 'u'=>$_SESSION[QT]['home_url']);
}
$arrMenus[]=array('h'=>false,'f'=>true, 'n'=>L('Legal'), 'u'=>'qti_privacy.php');
$arrMenus[]=array('h'=>false,'f'=>true, 'n'=>L('FAQ'), 'u'=>'qti_faq.php');
$arrMenus[]=array('h'=>true, 'f'=>false,'n'=>ObjTrans('index','i',$_SESSION[QT]['index_name']), 'u'=>'qti_index.php', 's'=>'qti_index.php qti_calendar.php qti_topics.php qti_topic.php');
if ( QTI_SIMPLESEARCH )
{
$arrMenus[]=array('h'=>true, 'f'=>true, 'n'=>L('Search'), 'u'=>( $_SESSION[QT]['board_offline']=='1' || ($oVIP->role=='V' && $_SESSION[QT]['visitor_right']<5) ? '' : 'qti_s_search.php'),'s'=>'qti_s_search.php qti_search.php qti_find.php');
}
else
{
$arrMenus[]=array('h'=>true, 'f'=>true, 'n'=>L('Search'), 'u'=>( $_SESSION[QT]['board_offline']=='1' || ($oVIP->role=='V' && $_SESSION[QT]['visitor_right']<5) ? '' : 'qti_search.php'),'s'=>'qti_s_search.php qti_search.php qti_find.php');
}
$arrMenus[]=array('h'=>true, 'f'=>false,'n'=>L('Memberlist'), 'u'=>( $_SESSION[QT]['board_offline']=='1' || ($oVIP->role=='V' && $_SESSION[QT]['visitor_right']<4) ? '' : 'qti_members.php'));
if ( CanPerform('show_stats',$oVIP->role) ) 
{
$arrMenus[]=array('h'=>false,'f'=>true, 'n'=>L('Statistics'), 'u'=>($_SESSION[QT]['board_offline']=='1' ? '' : 'qti_stats.php'));
}
if ( $oVIP->auth )
{
$arrMenus[]=array('h'=>true, 'f'=>true, 'n'=>L('Profile'), 'u'=>($_SESSION[QT]['board_offline']=='1' ? '' : 'qti_user.php?id='.$oVIP->id), 's'=>'qti_user.php qti_user_img.php.php qti_user_sign.php qti_user_pwd.php qti_user_question.php qti_unregister.php qti_user_rename.php');
$arrMenus[]=array('h'=>true, 'f'=>true, 'n'=>L('Logout'), 'u'=>'qti_login.php?a=out');
}
else
{
$arrMenus[]=array('h'=>true, 'f'=>true, 'n'=>L('Register'), 'u'=>($_SESSION[QT]['board_offline']=='1' ? '' : 'qti_user_new.php'), 's'=>'qti_user_new.php qti_form_reg.php');
$arrMenus[]=array('h'=>true, 'f'=>true, 'n'=>L('Login'), 'u'=>'qti_login.php');
}

echo '
<!-- menu -->
<div class="menu">
<div class="menuleft">',($oVIP->role=='V' ? AsImg($_SESSION[QT]['skin_dir'].'/ico_user_p_0.gif','-',$L['Ico_user_pZ'],'ico i_user') : AsImg($_SESSION[QT]['skin_dir'].'/ico_user_p_1.gif','-',$L['Ico_user_p'],'ico i_user')),'&nbsp;',($oVIP->role=='V' ? $L['Userrole']['V'] : $oVIP->username),'</div>
<div class="menuright">
<ul>
';
foreach($arrMenus as $arrMenu) {
if ( $arrMenu['h'] ) {
  if ( !isset($arrMenu['s']) ) $arrMenu['s']=' '.$arrMenu['u'];
  if ( !isset($arrMenu['i']) ) $arrMenu['i']=' '.$arrMenu['u'];
  if ( empty($arrMenu['u']) )
  {
  echo '<li><span>',$arrMenu['n'],'</span></li>',N;
  }
  else
  {
  echo '<li'.(strstr($arrMenu['s'],$oVIP->selfurl) ? ' id="menuactif"' : '').'><a href="',Href($arrMenu['u']),'" '.(strstr($arrMenu['i'],$oVIP->selfurl) ? ' onclick="return false;"' : '').'>',$arrMenu['n'],'</a></li>',N;
  }
}}
echo '</ul>
</div>
</div>
';

// WELCOME

$b = true;
if ( in_array($oVIP->selfurl,array('qti_user_new.php','qti_form_reg.php','qti_change.php')) ) $b = false;
if ( $_SESSION[QT]['sys_welcome']=='0' ) $b = false;
if ( $_SESSION[QT]['sys_welcome']=='1' && $oVIP->auth) $b = false;
if ( $_SESSION[QT]['board_offline']=='1' ) $b = false;
if ( !file_exists(GetLang().'sys_welcome.txt') ) $b = false;
if ( $b )
{
echo '
<!-- welcome -->
<div class="welcome">';
include(Translate('sys_welcome.txt'));
echo '</div>
';
}

// MAIN

echo '
<!-- MAIN CONTROL -->
<div class="body">
<div class="body_in">
';

echo '
<!-- top bar -->
<div class="bodyhd">
<div class="bodyhdleft">
<img class="bodyhdleft" src="',$_SESSION[QT]['skin_dir'],'/ico_hd_left.gif" alt="" />
<a class="body_hd" href="',Href('qti_index.php'),'"',($oVIP->selfurl=='qti_index.php' ? ' onclick="return false;"' : ''),'>',ObjTrans('index','i',$_SESSION[QT]['index_name']),'</a>
';
if ( isset($s) ) {
if ( is_int($s) ) {
if ( $s>=0 ) {
  echo QTI_CRUMBTRAIL,'<a class="body_hd" href="',Href('qti_topics.php'),'?s=',$s,'"',($oVIP->selfurl=='qti_topics.php' ? ' onclick="return false;"' : ''),'>',ObjTrans('sec',"s$s",(isset($oSEC) ? $oSEC->name : $oVIP->sections[$s])),'</a>';
  if ( isset($oTopic) && isset($oSEC) )
  {
    if ( $oTopic->numid>=0 && $oSEC->numfield!='N' ) echo QTI_CRUMBTRAIL,sprintf($oSEC->numfield,$oTopic->numid);
  }
  if ( $oVIP->selfurl=='qti_calendar.php' && isset($intYear) )
  {
  if ( !empty($intYear) ) echo QTI_CRUMBTRAIL,$intYear;
  }
}}}

echo '</div>
<div class="bodyhdright">
';

switch($oVIP->selfurl)
{
case 'qti_topics.php':
  if ( $oVIP->CanViewCalendar() )
  {
  echo '<a href="',Href('qti_calendar.php'),'?s=',$s,'"><img class="ico i_modes" src="',$_SESSION[QT]['skin_dir'],'/ico_view_f_c.gif" title="',$L['Ico_view_f_c'],'" alt="C" /></a>';
  }
  break;
case 'qti_calendar.php':
  echo '<a href="',Href('qti_topics.php'),'?s=',$s,'"><img class="ico i_modes" src="',$_SESSION[QT]['skin_dir'],'/ico_view_f_n.gif" title="',$L['Ico_view_f_n'],'" alt="N" /></a>';
  break;
case 'qti_stats.php':
  $strURI = QTargimplode(QTarradd(QTargexplode(),'view'));
  break;
case 'qti_topic.php':
  $strURI = QTargimplode(QTarradd(QTargexplode(),'view'));

  if ( $_SESSION[QT]['viewmode']=='C' )
  {
  echo '<a href="',Href(),'?',$strURI,'&amp;view=N"><img class="ico i_modes" src="',$_SESSION[QT]['skin_dir'],'/ico_view_n.gif" title="',$L['Ico_view_n'],'" alt="N" /></a>';
  }
  else
  {
  echo '<a href="',Href(),'?',$strURI,'&amp;view=C"><img class="ico i_modes" src="',$_SESSION[QT]['skin_dir'],'/ico_view_c.gif" title="',$L['Ico_view_c'],'" alt="C" /></a>';
  }
  break;
case 'qti_members.php':
  if ( !empty($_SESSION[QT]['avatar']) )
  {
    if ( $_SESSION[QT]['viewmode']=='C' )
    {
    echo '<a href="',Href('qti_members.php'),'?view=N"><img class="ico i_modes" src="',$_SESSION[QT]['skin_dir'],'/ico_view_n.gif" title="',$L['Ico_view_n'],'" alt="N" /></a>';
    }
    else
    {
    echo '<a href="',Href('qti_members.php'),'?view=C"><img class="ico i_modes" src="',$_SESSION[QT]['skin_dir'],'/ico_view_c.gif" title="',$L['Ico_view_c'],'" alt="C" /></a>';
    }
  }
  break;
}

echo '&nbsp;<img class="bodyhdright" src="',$_SESSION[QT]['skin_dir'],'/ico_hd_right.gif" alt="" />
</div>
</div>
';

// MAIN CONTENT

echo '
<!-- main content -->
<div class="bodyct">
';


?>
Return current item: QuickTicket