Location: PHPKode > projects > QuickTalk Forum > quicktalk/qtf_p_header.php
<?php

// QuickTalk 2.5 build:20100924

ob_start();

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

// check LangMenu condition

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

// Contrast

if ( QTF_SHOW_CONTRAST )
{
  if ( !isset($strHeadScript) ) $strHeadScript='';
  $oVIP->arrCss[]='qtf_contrast.css';
  $oVIP->arrJava[]='bin/css/qtf_contrast.js';
  $strLangMenu .= '<a class="css-default" href="javascript:chooseStyle(\'cssalternate\',60);"><img style="width:12px;height:12px;vertical-align:middle" src="bin/css/qtf_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/qtf_contrast.gif" title="Default display" alt="Contrast"/></a>';
}

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

HtmlHead('','',$oVIP->arrCss,$oVIP->arrJava,(isset($strHeadScript) ? $strHeadScript : ''),$oVIP->selfname);

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

// PAGE

HtmlPageCtrl(0);

// BANNER

if ( $_SESSION[QT]['show_banner']=='1' )
{
  HtmlBanner(0,'','qtf_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

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'=>'qtf_privacy.php');
$arrMenus[]=array('h'=>QTF_SHOW_FAQMENU,'f'=>true, 'n'=>L('FAQ'), 'u'=>'qtf_faq.php');
$arrMenus[]=array('h'=>true, 'f'=>false,'n'=>ObjTrans('index','i',$_SESSION[QT]['index_name']), 'u'=>'qtf_index.php', 's'=>'qtf_index.php qtf_topics.php qtf_topic.php qtf_calendar.php qtf_form_edit.php qtf_form_del.php');
$arrMenus[]=array('h'=>true, 'f'=>true, 'n'=>L('Search'), 'u'=>( $_SESSION[QT]['board_offline']=='1' || ($oVIP->role=='V' && $_SESSION[QT]['visitor_right']<5) ? '' : 'qtf_search.php'),'s'=>'qtf_s_search.php qtf_search.php qtf_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) ? '' : 'qtf_members.php'));
if ( CanPerform('show_stats',$oVIP->role) ) 
{
$arrMenus[]=array('h'=>false,'f'=>true,'n'=>L('Statistics'), 'u'=>($_SESSION[QT]['board_offline']=='1' ? '' : 'qtf_stats.php'));
}
if ( $oVIP->auth )
{
$arrMenus[]=array('h'=>true, 'f'=>true,'n'=>L('Profile'), 'u'=>($_SESSION[QT]['board_offline']=='1' ? '' : 'qtf_user.php?id='.$oVIP->id), 's'=>'qtf_user.php qtf_user_img.php.php qtf_user_sign.php qtf_user_pwd.php');
$arrMenus[]=array('h'=>true, 'f'=>true,'n'=>L('Logout'), 'u'=>'qtf_login.php?a=out');
}
else
{
$arrMenus[]=array('h'=>true, 'f'=>true,'n'=>L('Register'),'u'=>($_SESSION[QT]['board_offline']=='1' ? '' : 'qtf_user_new.php'));
$arrMenus[]=array('h'=>true, 'f'=>true,'n'=>L('Login'),'u'=>'qtf_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 ( empty($arrMenu['u']) )
  {
  echo '<li><span>',$arrMenu['n'],'</span></li>',N;
  }
  elseif ( strstr($arrMenu['s'],$oVIP->selfurl) )
  {
  echo '<li id="menuactif"><a href="',Href($arrMenu['u']),'" onclick="return false;">',$arrMenu['n'],'</a></li>',N;
  }
  else
  {
  echo '<li><a href="',Href($arrMenu['u']),'">',$arrMenu['n'],'</a></li>',N;
  }
}}
echo '</ul>
</div>
</div>
';

// WELCOME

$bWelcome = true;
if ( in_array($oVIP->selfurl,array('qtf_user_new.php','qtf_form_reg.php','qtf_change.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(Translate('sys_welcome.txt')) ) $bWelcome = false;
if ( $bWelcome )
{
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('qtf_index.php'),'"',($oVIP->selfurl=='qtf_index.php' ? ' onclick="return false;"' : ''),'>',ObjTrans('index','i',$_SESSION[QT]['index_name']),'</a>
';
if ( isset($s) ) {
if ( is_int($s) ) {
if ( $s>=0 ) {
  echo QTF_CRUMBTRAIL,'<a class="body_hd" href="',Href('qtf_topics.php'),'?s=',$s,'"',($oVIP->selfurl=='qtf_topics.php' ? ' onclick="return false;"' : ''),'>',ObjTrans('sec',"s$s",(isset($oSEC) ? $oSEC->name : $_SESSION[QT]['sys_sections'][$s])),'</a>';
  if ( isset($oTopic) && isset($oSEC) )
  {
    if ( $oTopic->numid>=0 && $oSEC->numfield!='N' ) echo QTF_CRUMBTRAIL,sprintf($oSEC->numfield,$oTopic->numid);
  }
}}}

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

switch($oVIP->selfurl)
{
case 'qtf_stats.php':
  $strURI = QTargimplode(QTarradd(QTargexplode(),'view'));
  break;
case 'qtf_topic.php':
  $strURI = QTargimplode(QTarradd(QTargexplode(),'view'));

  if ( $_SESSION[QT]['viewmode']=='C' )
  {
  echo '<a href="',Href($oVIP->selfurl),'?',$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>&nbsp;';
  echo '<img class="ico i_modes" src="',$_SESSION[QT]['skin_dir'],'/ico_view_c.gif" title="',$L['Ico_view_c'],'" alt="C"/>';
  }
  else
  {
  echo '<img class="ico i_modes" src="',$_SESSION[QT]['skin_dir'],'/ico_view_n.gif" title="',$L['Ico_view_n'],'" alt="N"/>&nbsp;';
  echo '<a href="',Href($oVIP->selfurl),'?',$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 'qtf_members.php':
  if ( !empty($_SESSION[QT]['avatar']) )
  {
    if ( $_SESSION[QT]['viewmode']=='C' )
    {
    echo '<a href="',Href('qtf_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>&nbsp;';
    echo '<img class="ico i_modes" src="',$_SESSION[QT]['skin_dir'],'/ico_view_c.gif" title="',$L['Ico_view_c'],'" alt="C"/>';
    }
    else
    {
    echo '<img class="ico i_modes" src="',$_SESSION[QT]['skin_dir'],'/ico_view_n.gif" title="',$L['Ico_view_n'],'" alt="N"/>&nbsp;';
    echo '<a href="',Href('qtf_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: QuickTalk Forum