Dubluje mi zawartość include ...
plik php
<?php
require('libs/Smarty.class.php');
require('cfg.php');
$smarty = new Smarty;
$site = $_GET['id'];
if($site != "") {
switch($site) {
case $site:
require("$site.php");
break;
}
}
$smarty->assign("site", $site);
$smarty->display('index.tpl');
?>
index.tpl
<!doctype html public "-//w3c//dtd html 4.01 transitional//en">
<html>
<head>
<meta http-equiv="content-type" content="text/html; charset=utf-8">
<meta name="generator" content="pspad editor, www.pspad.com">
<link rel="stylesheet" type="text/css" href="templates/style.css" />
<title></title>
</head>
<body>
<div id="site">
<div id="head">
<div id="login">
{include_php
file="login.php"} </div>
</div>
<div id="menu">
<div style="padding-left: 35px;">
<table cellspacing="0" cellpadding="0"><tr>
<td><a href="index.php?id=news"><img border="0" src="templates/images/aktualnosci.jpg"></a></td><td><img border="0" src="templates/images/kreska.jpg"></td>
<td><a href="index.php?id=comments"><img border="0" src="templates/images/multimedia.jpg"></a></td><td><img border="0" src="templates/images/kreska.jpg"></td>
<td><a href="#"><img border="0" src="templates/images/download.jpg"></a></td><td><img border="0" src="templates/images/kreska.jpg"></td>
<td><a href="#"><img border="0" src="templates/images/artykuly.jpg"></a></td><td><img border="0" src="templates/images/kreska.jpg"></td>
<td><a href="#"><img border="0" src="templates/images/forum.jpg"></a></td><td><img border="0" src="templates/images/kreska.jpg"></td>
<td><a href="#"><img border="0" src="templates/images/faq.jpg"></a></td><td><img border="0" src="templates/images/kreska.jpg"></td>
<td><a href="#"><img border="0" src="templates/images/kontakt.jpg"></a></td>
</tr></table>
</div>
</div>
<div>
{if $site == ""}
{include_php
file="news.php"} {/if}
{if $site != ""}
{include file="`$site`.tpl"} {/if}
</div>
</div>
</body>
</html>
Ten post edytował krystian1991x 15.10.2010, 18:28:51