lang = $ln; $site->section = $section; $site->subsection = $subsection; // autorun handler $dir = opendir('autorun'); while ($file = readdir($dir)) { @include('autorun/' . $file); } closedir($dir); // do page processing $site->tpl->assign('next_month', strtotime('+1 month')); switch($section) { case 'index': require_once('class/page-index.class.php'); $page = new pageIndex($site); $page->display(); break; case 'askexpert': switch($request[0]) { case 'thanks': $site->display('askexpert-thanks.html'); break; default: require_once('class/page-askexpert.class.php'); $page = new pageAskExpert($site); $page->display(); } break; case 'artykul': header('Location: /' . $ln . '/article/' .$subsection); break; case 'article': switch($request[0]) { case 'download': $file = isset($request[1]) ? $request[1] : 0; $query = array ( 'function' => 'download', 'id' => (int) $file ); $site->engine->call('files', $query); die(); break; default: require_once('class/page-article.class.php'); $page = new pageArticle($site); $page->display(); break; } break; case 'auction': switch($request[0]) { case 'download': $file = isset($request[1]) ? $request[1] : 0; $query = array ( 'function' => 'download', 'id' => $file ); $site->engine->call('auctions', $query); die(); break; default: require_once('class/page-auction.class.php'); $page = new pageAuction($site); $page->display(); break; } break; case 'auctions': require_once('class/page-auctions.class.php'); $page = new pageAuctions($site); $page->display(); break; case 'download': $file = isset($request[0]) ? $request[0] : 0; $query = array ( 'function' => 'download', 'id' => $file ); $site->engine->call('files', $query); die(); break; case 'polls': require_once('class/page-polls.class.php'); $page = new pagePolls($site); $page->display(); break; case 'tellafriend': switch($request[0]) { case 'thanks': require_once('class/page-article.class.php'); $site->subsection = '22'; $page = new pageArticle($site); $page->display(); break; default: header('Location: /' . $ln . '/index'); break; } break; case 'search': require_once('class/page-search.class.php'); $page = new pageSearch($site); $page->display(); break; case 'calculator': switch($request[0]) { case 'thanks': $site->display('calculator-thanks.html'); break; default: header('Location: /' . $ln . '/index'); break; } break; case 'reminder': switch($request[0]) { case 'thanks': require_once('class/page-reminder.class.php'); $page = new pageReminder($site); $page->display(); } break; case 'news': require_once('class/page-news.class.php'); $page = new pageNews($site); $page->display(); break; case 'archive': require_once('class/page-archive.class.php'); $page = new pageArchive($site); $page->display(); break; case 'contact': switch($request[0]) { case 'thanks': $site->display('contact-thanks.html'); break; default: require_once('class/page-contact.class.php'); $page = new pageContact($site); $page->display(); } break; case 'application': switch($request[0]) { case 'thanks': $site->display('application-thanks.html'); break; default: require_once('class/page-application.class.php'); $page = new pageApplication($site); $page->display(); } break; case 'message-sent': $site->display('message-sent.html'); break; case 'terms': $site->display('terms.html'); break; case 'about': $site->display('about.html'); break; case 'store': switch ($request[0]) { case 'cart': require_once('class/page-cart.class.php'); $page = new pageCart($site); $page->display(); break; case 'login': if (is_logged()) { header('Location: /' . $ln . '/store/cart'); die(); } switch ($request[2]) { case 'incorrect': $site->tpl->assign('error', tekst(119)); break; } $site->tpl->assign('login', $request[1]); $site->display('login.html'); break; case 'order': if (!is_logged()) { header('Location: /' . $ln . '/store/login'); die(); } require_once('class/page-order.class.php'); $page = new pageOrder($site); $page->display(); break; case 'register': if (is_logged()) { header('Location: /' . $ln . '/store/cart'); die(); } $site->display('register.html'); break; case 'thankyou': if (!is_logged()) { header('Location: /' . $ln . '/store/login'); die(); } require_once('class/page-thankyou.class.php'); $page = new pageThankyou($site); $page->display(); break; default: $site->display('not-found.html'); break; } break; case 'newsletter': switch ($request[0]) { case 'subscribed': $msg = tekst(113); break; case 'unsubscribed': $msg = tekst(114); break; case 'notfound': $msg = tekst(115); break; case 'inuse': $msg = tekst(117); break; default: $msg = tekst(116); break; } $site->tpl->assign('message', $msg); $site->display('newsletter.html'); break; case "": header('Location: /' . $ln . '/index'); die(); break; default: $site->display('not-found.html'); break; } ?>