Mam główny plik index.tpl w katalogu templates/Default/index.tpl, który zawiera główny szkielet strony, tzn wyglada tak
<?php
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8829-2" />
<meta name="Description" content="{$description}">
<meta name="Keywords" content="{$keywords}">
<link rel="stylesheet" href="templates/Default/style.css" type="text/css">
<title>{$SiteTitle}</title>
</head>
<body>
<table cellspacing="0" cellpadding="0" align="center" style="width: 780px; border: 1px solid #000000">
<tr><td colspan="2" class="header">{$SiteTitle}</td></tr>
<tr>
<td class="left_menu">Lewe Menu</td>
<td class="center_menu">{CZYTAJ NIŻEJ !}</td>
</tr>
<tr><td colspan="2" class="footer">Š Copyright 2006 by Lee</td></tr>
</table>
</body>
</html>
?>
no i w miejscu CZYTAJ NIŻEJ chcę aby includowało plik z danym modułem np. news.php (który jest w katalogu głównym) ale jak dam {include_php file="news.php"} to mi wywala bład
Cytat
Fatal error: Cannot redeclare class news in /home/lee/public_html/php/library/news.class.php on line 40
kod pliku news.php
<?php
require_once('config.php');
require('library/news.class.php');
if (empty($_GET['mod'])) { $News -> db_query = "SELECT * FROM news ORDER BY id DESC";
$News -> news();
$News -> category($news['id']);
foreach ($News -> row as $news) {
$News -> comments($news['id']);
if (!empty($news['long_text'])) { $read_more = '<a href="news.php?mod=more&id='.$news['id'].'">Czytaj Więcej</a> | ';
$smarty -> assign('read_more', $read_more);
} else {
$read_more = NULL;
$smarty -> assign('read_more', $read_more);
}
if (!empty($News -> image
)) { $image = '<img src='.$image.' border="0">';
$smarty -> assign('news_image', $image);
} else {
$image = NULL;
$smarty -> assign('news_image', $image);
}
$smarty -> assign('id', $news['id']);
$smarty -> assign('comment', $News -> comment);
$smarty -> assign('title', $news['title']);
$smarty -> assign('short_text', $news['short_text']);
$smarty -> assign('long_text', $news['long_text']);
$smarty -> assign('author', $news['author']);
$smarty -> assign('data', $news['data']);
$smarty -> display('Default/news.tpl');
}
} // end if (empty($_GET['mod']))
if ($_GET['mod'] == 'more') {
// kod - wyciąłem...
} // end else if ($_GET['mod'] == 'more')
$smarty -> assign('module', 'news.php');
$smarty -> display('Default/index.tpl');s
?>
jak coś jest niejasne to pytajcie bo w tym chaosie boje się, że coś pominąłem albo źle napisałem

aha zapomniałem dodać, że poboczny plik np news.tpl etc wyglądają mniej więcej tak
<table cellspacing="0" cellpadding="0" width="500" align="center">
<td colspan="2" style="background-color: {$color_1}"><b>{$title}
</b></td>
<td colspan="2" align="justify" style="background-color: {$color_2}; padding: 2px 2px 2px 2px;">{$news_image}{$short_text}
</td>
<td style="width: 250px; background-color: {$color_1}; padding-left: 2px;"><b>Autor:
</b> {$author} |
<b>Data:
</b> {$data}
</td>
<td align="right" style="width: 250px; background-color: {$color_1}; padding-right: 2px;">{$read_more}
<a href="news.php?mod=comment&id={$id}">Komentarzy[{$comment}]
</a></td>
Ten post edytował Lee 7.08.2006, 13:48:35