Pomoc - Szukaj - Użytkownicy - Kalendarz
Pełna wersja: [PHP][Smarty]Problem z index.php
Forum PHP.pl > Forum > PHP
Nobart
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

Jeśli nic to nikomu nie mówi mogę wkleić kod z poszczególnych plików.
Pozdro
Kshyhoo
W obliczu końca świata, wróżki mają w pip roboty, wiec może pokaż kod (chyba że się wstydzisz, albo boisz, że Ci go ktoś ukradnie - wtedy stań w kolejce do wróżek).
netflam
Ja ci radze nie używać Smarty. Daj kod a go przejże!
Nobart
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');

?>
To jest wersja lo-fi głównej zawartości. Aby zobaczyć pełną wersję z większą zawartością, obrazkami i formatowaniem proszę kliknij tutaj.
Invision Power Board © 2001-2025 Invision Power Services, Inc.