Kod: Zaznacz cały
--------------------------
| header |
--------------------------
| menu: |
--------------------------
| b | main |
| l | |
| o | |
| k | |
--------------------------
| footer |
--------------------------
users.tpl
Kod: Zaznacz cały
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-2" />
<link rel="stylesheet" href="{$style}" type="text/css" />
<title>{$title}</title>
</head>
<body>
<div id="all">
<div id="header">{$header}</div>
<div id="menu">{$menu}</div>
<div id="menu_left">{$menu_left}</div>
<div id="main">{$main}</div>
</div>
<div id="footer">{$footer}</div>
</div>
</body>
</html>
Kod: Zaznacz cały
<?php
session_start();
if($_SESSION['authuser'] != 1) {
echo "<link rel='stylesheet' href='style.css' type='text/css' />";
echo "<center><table class='komunikat_wrong'><tr><td class='komunikat_wrong'>Przepraszamy, ale nie masz uprawnień do przeglądania tej strony!</td></tr></table></center>";
exit();
}
require('../smarty/Smarty.class.php');
$smarty = new Smarty();
$smarty->template_dir = '../smarty/templates';
$smarty->compile_dir = '../smarty/templates_c';
$smarty->cache_dir = '../smarty/cache';
$smarty->config_dir = '../smarty/configs';
$styl = "../smarty/templates/style.css";
$smarty->assign('style', $styl);
$title = "Panel administracyjny";
$header = "<center><h1>Panel administracyjny</h1></center><table width='980px'><tr><td width='80%'><b>Administrator:</b> ".$_SESSION['username']." <br><font size='1'>".$_SERVER['REMOTE_ADDR'].", " .gethostbyaddr($_SERVER['REMOTE_ADDR'])."</font></td><td width='20%' align='right'><a href='logout.php'>Wyloguj</a></td></tr></table>";
$menu_left = "<a href='users.php?page=1'>Dodaj</a>";
$menu = "<a href='users.php'>Użytkownicy</a>";
$smarty->assign('title', $title);
$smarty->assign('header', $header);
$smarty->assign('menu', $menu);
$smarty->assign('menu_left', $menu_left);
$smarty->assign('main', $main);
$smarty->assign('footer', 'footer');
$smarty->display('users.tpl');
?>
Teraz powinno być wszystko jasne. Proszę o pomoc:)