Smarty Forum Index Smarty
WARNING: All discussion is moving to https://reddit.com/r/smarty, please go there! This forum will be closing soon.

Problem z index.php

 
This forum is locked: you cannot post, reply to, or edit topics.   This topic is locked: you cannot edit posts or make replies.    Smarty Forum Index -> Language: Polish
View previous topic :: View next topic  
Author Message
nobart
Smarty n00b


Joined: 19 Nov 2012
Posts: 1

PostPosted: Mon Nov 19, 2012 12:17 pm    Post subject: Problem z index.php Reply with quote

Witam.
Pracuje z bibl. smarty. Dotąd wszystko działało, lecz teraz nie wyświetla za pierwszym razem całego index.php.
Nie czyta elementów które są pobierane z bazy, reszta się wyświetla. Gdy odświerze stronę wczytuje się wszystko i juz tak do końca dopóki nie zamkne przeglądarki i nie otworze na nowo. Czy spotkaliście się z takim problemem. Tutaj link do strony: www.drabest.pl/test

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');

?>
Back to top
View user's profile Send private message
Display posts from previous:   
This forum is locked: you cannot post, reply to, or edit topics.   This topic is locked: you cannot edit posts or make replies.    Smarty Forum Index -> Language: Polish All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group
Protected by Anti-Spam ACP