Poniżej kod z indexa.
Generalnie ja nie używam smarty. Dorwałem się do tego przy okazji strony którą robił ktoś inny, a ja musiałem ją trochę przerobić.
Jeśli coś jeszcze dorzucić to piszcie
CODE
<?php
include_once 'lib/lib.php';
//print_r($_SESSION);
$smarty=new SmartyWWW;
$p=new Content;
$lang=$p->getLang();
if(isset($_GET['a']))
{
switch($_GET['a'])
{
case 'category':
$_GET['category']=$p->getCategoryByLink($_GET['name'],$lang);
$_GET['menu_id']=2;
break;
case 'galery':
$_GET['category']=$p->getCategoryByLink($_GET['name'],$lang);
$_GET['menu_id']=5;
break;
case 'page':
$_GET['menu_id']=$p->getMenuByLink($_GET['name'],$lang);
break;
}
}
$smarty->assign('LangString',$p->getSmartyLang($lang));
$smarty->assign('Lang',$lang);
$config=$config=$p->getConfig($lang);
$smarty->assign('config',$config);
if(isset($_GET['mod']) && file_exists('lib/'.$_GET['mod']).'.php')
{
include 'lib/'.$_GET['mod'].'.php';
$smarty->assign('include',$_GET['mod'].'.tpl');
}
elseif (isset($_GET['menu_id']))
{
$content=$p->getMenuItem($_GET['menu_id'],$lang);
if(empty($content['right'])) $content['right']=$config['rekl_bot'];
switch ($_GET['menu_id'])
{
case 1:
$smarty->assign('content',$content);
$smarty->assign('top','top_dra.png');
$smarty->assign('include','page.tpl');
break;
case 2:
$smarty->assign('content',$content);
$smarty->assign('top','top_strip.png');
$smarty->assign('include','products.tpl');
include 'lib/products.php';
break;
case 3:
$smarty->assign('content',$content);
$smarty->assign('include','page.tpl');
$smarty->assign('top','top_dra.png');
break;
case 4:
$smarty->assign('content',$content);
$smarty->assign('include','page.tpl');
$smarty->assign('top','top_dra.png');
break;
case 5:
$smarty->assign('content',$content);
$smarty->assign('top','top_strip.png');
$smarty->assign('include','galery.tpl');
include 'lib/galery.php';
break;
case 6:
$smarty->assign('content',$content);
$smarty->assign('include','page.tpl');
$smarty->assign('top','top_dra.png');
break;
case 7:
$smarty->assign('include','page.tpl');
$smarty->assign('top','top_dra.png');
include 'lib/map.php';
break;
default:
$smarty->assign('include','page.tpl');
$smarty->assign('top','top_dra.png');
$smarty->assign('content',$content);
}
if (!empty($content['redirect'])) header('Location:'.$content['redirect']);
}
else
{
$content=$p->getMenuItem(8,$lang);
if(empty($content['right'])) $content['right']=$config['rekl_bot'];
$smarty->assign('content',$content);
$smarty->assign('include','page.tpl');
$smarty->assign('top','top_dra.png');
if (!empty($content['redirect'])) header('Location:'.$content['redirect']);
}
$smarty->assign('menu_items',$p->getMenu($lang,isset($_GET['menu_id']) ? $_GET['menu_id'] : 0));
$smarty->assign('footermap',$p->getFooterMap($lang));
$smarty->config_load('global.conf');
$smarty->config_load($lang.'.conf');
$smarty->display('index.tpl');
?>