<?php

	if(!$dprotect) die ('Access Denied!');

        $config['currentTemplateDir'] = $config['templatesDir'] . $config['template'];
        $config['templateCSSDir'] = $config['url'] . $config['templatesDir'] . $config['template'] . '/' . 'css/';
        $config['templateJSDir'] = $config['url'] . $config['templatesDir'] . $config['template'] . '/' . 'js/';
        $config['templateImagesDir'] = $config['url'] . $config['templatesDir'] . $config['template'] . '/' . 'images/';
        $config['templateFlashDir'] = $config['url'] . $config['templatesDir'] . $config['template'] . '/' . 'flash/';
        $config['templateAppDir'] = $config['url'] . $config['templatesDir'] . $config['template'] . '/' . 'app/';
        
        $smarty->template_dir = $config['currentTemplateDir'];
        
        $smarty->assign('menuItems', $core->listPages());
        $smarty->assign('adv1', $core->advertDetailsForId(1));
        $smarty->assign('adv2', $core->advertDetailsForId(2));
        $smarty->assign('boxItems', $core->searchBoxes('', 1, 4));
        
	if($link[0] && file_exists('modules/'.$link[0].'.php')) {            
            include('modules/'.$link[0].'.php');
	} elseif($link[0]) {
            include('modules/displaypage.php');
	} 
	
?>