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

// QuickTicket 1.9.0.3 build:20081001

ob_start();

HtmlDtd();

// ========
if ( !isset($bToPrint) ) {
// ========

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

// check Welcome condition

$bWelcome = true;
if ( in_array($oVIP->selfurl,array('qti_usr_new.php','qti_form_reg.php','qti_cmd.php')) ) $bWelcome = false;
if ( $_SESSION[QT]['sys_welcome']=='0' ) $bWelcome = false;
if ( $_SESSION[QT]['sys_welcome']=='1' && $oVIP->auth ) $bWelcome = false;
if ( $_SESSION[QT]['board_offline']=='1' ) $bWelcome = false;
if ( !file_exists($_SESSION[QT]['language'].'/sys_welcome.txt') ) $bWelcome = false;

// check LangMenu condition

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

// check header content

$bLegend = true;
if ( $_SESSION[QT]['board_offline']=='1' ) $bLegend=false;
if ( $_SESSION[QT]['show_legend']!='1' ) $bLegend=false;
if ( !in_array($oVIP->selfurl,array('index.php','qti_index.php','qti_topics.php','qti_calendar.php','qti_topic.php','qti_s_search.php','qti_search_id.php','qti_search_ov.php','qti_search_kw.php','qti_search_st.php')) ) $bLegend=false;

if ( !isset($arrCss) ) $arrCss=array();
if ( $bLegend ) $arrCss[]='qti_legend.css';
if ( isset($strHeaderAddCss) ) $arrCss[]=$strHeaderAddCss;

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

HtmlHead('','',$arrCss,(isset($strHeaderAddScript) ? $strHeaderAddScript : ''),(isset($arrJava) ? $arrJava : null));

echo '
<body'.(isset($strBodyAddOnload) ? ' onload="'.$strBodyAddOnload.'"': '').(isset($strBodyAddOnunload) ? ' onunload="'.$strBodyAddOnunload.'"': '').'>
';

// PAGE

HtmlPageCtrl(0);

// BANNER

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

// MENU LINE

echo '
<!-- MENU LINE -->
<table class="ta_menu" cellspacing="0">
<tr class="tr_menu">
';

  // user icon
  echo '<td class="td_menu_ico">',($oVIP->role=='V' ? AsImg($_SESSION[QT]['skin_dir'].'/ico_user_p_0.gif','-',$L['Ico_user_p_0'],'ico ico_user') : AsImg($_SESSION[QT]['skin_dir'].'/ico_user_p_1.gif','-',$L['Ico_user_p_1'],'ico ico_user')),'</td>',N;
  echo '<td class="td_menu_sep"></td>',N;

  // user name
  echo '<td class="td_menu_usr">&nbsp;',($oVIP->role=='V' ? $L['Userrole']['V'] : $oVIP->username),'</td>',N;
  echo '<td class="td_menu_sep"></td>',N;

  // menu home
  if ( $_SESSION[QT]['home_menu']=='1' && !empty($_SESSION[QT]['home_url']) )
  {
  echo '<td class="td_menu"><a class="a_menu" href="',$_SESSION[QT]['home_url'], '">', ( empty($_SESSION[QT]['home_name']) ? "Home" : $_SESSION[QT]['home_name'] ),'</a></td>',N;
  echo '<td class="td_menu_sep"></td>',N;
  }

  // forum index
  $str = ''; if ( $oVIP->selfurl=='qti_index.php' || $oVIP->selfurl=='qti_topics.php' || $oVIP->selfurl=='qti_topic.php' || $oVIP->selfurl=='qti_calendar.php' || $oVIP->selfurl=='qti_form_edit.php' || $oVIP->selfurl=='qti_form_del.php' ) $str='id="zone_menu_actif"';
  echo '<td class="td_menu" ',$str,'><a class="a_menu" href="qti_index.php">',ObjectName('index','i',$_SESSION[QT]['index_name']),'</a></td>',N;
  echo '<td class="td_menu_sep"></td>',N;

  // menu faq
  if ( QTI_SHOW_FAQMENU )
  {
  echo '<td class="td_menu"',($oVIP->selfurl=='qti_faq.php' ? ' id="zone_menu_actif"' : ''),'>',($oVIP->selfurl=='qti_faq.php' ? '<span class="a_menu_off">'.$L['FAQ'].'</span>' : '<a class="a_menu" href="qti_faq.php">'.$L['FAQ'].'</a>'),'</td>',N;
  echo '<td class="td_menu_sep"></td>',N;
  }

  // menu memberlist
  if ( QTI_SHOW_MEMBERLIST )
  {
  $strMenu = '<a class="a_menu" href="qti_member.php">'.$L['Memberlist'].'</a>';
  $strMenuOff = '<span class="a_menu_off">'.$L['Memberlist'].'</span>';
  if ( $_SESSION[QT]['board_offline']=='1' ) $strMenu = $strMenuOff;
  if ( $oVIP->role=='V' && $_SESSION[QT]['visitor_right']<4 ) $strMenu = $strMenuOff;
  echo '<td class="td_menu"',($oVIP->selfurl=='qti_member.php' ? ' id="zone_menu_actif"' : ''),'>',$strMenu,'</td>',N;
  echo '<td class="td_menu_sep"></td>',N;
  }

  // menu search
  $str = ''; if ( substr($oVIP->selfurl,0,14)=='qti_search' ) $str = 'id="zone_menu_actif"';
  $strMenu = '<a class="a_menu" href="'.(QTI_SIMPLESEARCH ? 'qti_s_search.php' : 'qti_search.php' ).'">'.$L['Search'].'</a>';
  $strMenuOff = '<span class="a_menu_off">'.$L['Search'].'</span>';
  if ( $_SESSION[QT]['board_offline']=='1' ) $strMenu = $strMenuOff;
  if ( $oVIP->role=='V' && $_SESSION[QT]['visitor_right']<5 ) $strMenu = $strMenuOff;
  echo '<td class="td_menu" ',$str,'>',$strMenu,'</td>',N;
  echo '<td class="td_menu_sep"></td>',N;

  // menu profile/logout
  if ( !$oVIP->auth )
  {
  $str = ''; if ( $oVIP->selfurl=='qti_usr_new.php' || $oVIP->selfurl=='qti_form_reg.php' ) $str = 'id="zone_menu_actif"';
  echo '<td class="td_menu" ',$str,'>',($_SESSION[QT]['board_offline']=='1' ? '<span class="a_menu_off">'.$L['Register'].'</span>' : '<a class="a_menu" href="qti_usr_new.php">'.$L['Register'].'</a>'),'</td>',N;
  echo '<td class="td_menu_sep"></td>',N;
  $str = ''; if ( $oVIP->selfurl=='qti_usr_login.php' || $oVIP->selfurl=='qti_usr_pwd_for.php' ) $str = 'id="zone_menu_actif"';
  echo '<td class="td_menu" ',$str,'><a class="a_menu" href="qti_usr_login.php">'.$L['Login'].'</a></td>',N;
  }
  else
  {
  $str = ''; if ( substr($oVIP->selfurl,0,7)=='qti_usr' ) $str = 'id="zone_menu_actif"';
  echo '<td class="td_menu" ',$str,'>',($oVIP->selfurl=='qti_usr.php' || $_SESSION[QT]['board_offline']=='1' ? '<span class="a_menu_off">'.$L['Profile'].'</span>' : '<a class="a_menu" href="qti_usr.php?id='.$oVIP->id.'">'.$L['Profile'].'</a>'),'</td>',N;
  echo '<td class="td_menu_sep"></td>',N;
  echo '<td class="td_menu"',($oVIP->selfurl=='qti_usr_login.php?a=out' ? ' id="zone_menu_actif"' : ''),'><a class="a_menu" href="qti_usr_login.php?a=out">'.$L['Logout'].'</a></td>',N;
  }

echo '</tr>
</table>
<!-- END MENU LINE -->
';

// WELCOME

if ( $bWelcome )
{
echo '
<!-- welcome message -->
<div class="div_welcome">
<div class="div_welcome_in">
';
include($_SESSION[QT]['language'].'/sys_welcome.txt');
echo '
</div>
</div>
<!-- end welcome message -->
';
}

// LINE START

echo '
<!-- BODY -->
<div class="div_body"><div class="div_body_in">
<!-- BODY TOP -->
<table class="ta_body_hd" cellspacing="0">
<tr class="tr_body_hd">
<td class="td_body_hd_l"><img class="img_body_hd_l" src="',$_SESSION[QT]['skin_dir'],'/ico_hd_left.gif" alt=""/></td>
<td class="td_body_hd_c"><a class="a_body_hd" href="qti_index.php">',ObjectName('index','i',$_SESSION[QT]['index_name']),'</a>';

if (isset($oSEC))
{
  echo QTI_CRUMBTRAIL,'<a class="a_body_hd" href="qti_topics.php?s=',$oSEC->id,'">',(QTI_SHOW_DOMAIN ? $oSEC->domname.': ' : ''),$oSEC->name,'</a>';
  if ( isset($oTopic) )
  {
    if ( $oTopic->numid>=0 && $oSEC->numfield!='N' ) echo QTI_CRUMBTRAIL,sprintf($oSEC->numfield,$oTopic->numid);
  }
}

echo '</td>',N;

echo '<td class="td_body_hd_c" style="text-align:right">&nbsp;';

switch($oVIP->selfurl)
{
case 'qti_topics.php':
  $bShow = false;
  if ( $_SESSION[QT]['show_calendar']=='V' ) $bShow = true;
  if ( $_SESSION[QT]['show_calendar']=='U' && $oVIP->role!='V' ) $bShow = true;
  if ( $_SESSION[QT]['show_calendar']=='M' && $oVIP->role=='M' ) $bShow = true;
  if ( $oVIP->role=='A' ) $bShow = true;
  if ( $bShow )
  {
  echo '<a href="qti_calendar.php?s=',$s,'"><img class="ico_modes" src="',$_SESSION[QT]['skin_dir'],'/ico_view_f_c.gif" title="',$L['Ico_view_f_c'],'" alt="C"/></a>&nbsp;';
  }
  break;
case 'qti_calendar.php':
  echo '<img class="ico_modes" src="',$_SESSION[QT]['skin_dir'],'/ico_view_f_c.gif" title="',$L['Ico_view_f_c'],'" alt="C"/>&nbsp;';
  echo '<a href="qti_topics.php?s=',$s,'"><img class="ico_modes" src="',$_SESSION[QT]['skin_dir'],'/ico_view_f_n.gif" title="',$L['Ico_view_f_n'],'" alt="N"/></a>&nbsp;';
  break;
case 'qti_stats.php':
  $strURI = QTargimplode(QTargadd(QTargexplode(),'view'));
  break;
case 'qti_topic.php':
  $strURI = QTargimplode(QTargadd(QTargexplode(),'view'));

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

if ( QTI_SHOW_PRINT ) {
if ( file_exists(substr($oVIP->selfurl,0,'-4').'_prt.php') ) {
  echo '<a href="',substr($oVIP->selfurl,0,'-4'),'_prt.php',(isset($strURI) ? '?'.$strURI : ''),'"><img class="ico_modes" src="',$_SESSION[QT]['skin_dir'],'/ico_view_p.gif" title="',$L['Ico_view_p'],'" alt="P"/></a>&nbsp;';
}}
echo '</td>',N;

echo '<td class="td_body_hd_r"><img class="ico_body_hd_r" src="',$_SESSION[QT]['skin_dir'],'/ico_hd_right.gif" alt=""/></td>',N;
echo '</tr>
</table>
<!-- END BODY TOP -->
';

// BODY START

echo '
<!-- BODY MAIN -->
<table width="100%" cellspacing="0" class="ta_body"><tr class="tr_body"><td class="td_body">
<!-- BODY MAIN -->
';

// ========
} else {
// ========

echo '<head>
<title>',$_SESSION[QT]['site_name'],'</title>
<meta http-equiv="content-type" content="text/html; charset=',QTI_HTML_CHAR,'"/>
<link rel="shortcut icon" href="',$_SESSION[QT]['skin_dir'],'/qti_icon.ico"/>
<link rel="stylesheet" type="text/css" href="',$_SESSION[QT]['skin_dir'],'/qti_print.css"/>',N;
if ( isset($strHeaderAddScript) ) echo $strHeaderAddScript,N;
echo '</head>

<body'.(isset($strBodyAddOnload) ? ' onload="'.$strBodyAddOnload.'"': '').(isset($strBodyAddOnunload) ? ' onunload="'.$strBodyAddOnunload.'"': '').'>';

// BANNER

if ( $_SESSION[QT]['show_banner']=='1' ) Htmlbanner(2,$_SESSION[QT]['skin_dir'],'qti_logo_prt.gif');

// ========
}
// ========

?>
Return current item: QuickTicket