Copyright (C) 2007 nso Copyright (C) 2007 Espen Volden Copyright (c) 2007 Victor Vikene This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. *********************************************************************************** */ // Set the correct templatefile for the templatesystem // and check if caching are enabled? if($tplcache) { $xtpl = new CachingXTemplate('header.xtpl', $tpldir, null, 'main', true, 0, $cacheuniqid, $cachedir, $cacheext); } else { $xtpl = new XTemplate('header.xtpl', $tpldir); } $xtpl->assign('URL', $url); $xtpl->assign('SITETITLE', $lang['sitetitle']); $xtpl->assign('TPLDIR', $tpldir); // Now it's time for the menu // We'll assign the hyperlink and description to an array $rows = array(); $rows[1]=array('MENU_ALT' => $lang['upload'], 'LINK' => MAINSITE ); $rows[2]=array('MENU_ALT' => $lang['faq'], 'LINK' => FAQSITE ); $rows[3]=array('MENU_ALT' => $lang['stats'], 'LINK' => STATSITE ); // Then we have to find out if the user are logged in or not // so we can decide if we want to use the menuset for logged in or logged out users if ($_SESSION['restricted']) { $rows[4]=array('MENU_ALT' => $lang['myuser'], 'LINK'=> SHOWUSERSPROFILE ); $rows[5]=array('MENU_ALT' => $lang['logout'], 'LINK'=> USERLOGOUT ); } else { $rows[4]=array('MENU_ALT' => $lang['login'], 'LINK'=> USERLOGIN ); } for ($i = 1; $i <= count($rows); $i++) { $xtpl->assign('TEXT', $rows[$i]); $xtpl->assign('ROW_NR', $i); $xtpl->parse('main.table.row'); } $xtpl->parse('main.table'); // Is caching enabled? if($tplcach) { $xtpl->parse('main.static', $cacheexpir); } else { $xtpl->parse('main.static'); } $xtpl->parse('main'); $xtpl->out('main'); ?>