| Yazar GİRİŞİ |
3 KATMANLI MİMARİ VE PHPAna php dosyamız :
index.php
Ana template dosyamız :
templates/main/main.tpl
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-9" />
<title>3 katmanli mimari</title>
<link href="templates/css/stil.css" _fcksavedurl=""templates/css/stil.css"" _fcksavedurl=""templates/css/stil.css"" _fcksavedurl=""templates/css/stil.css"" _fcksavedurl=""templates/css/stil.css"" _fcksavedurl=""templates/css/stil.css"" _fcksavedurl=""templates/css/stil.css"" _fcksavedurl=""templates/css/stil.css"" _fcksavedurl=""templates/css/stil.css"" rel="stylesheet" type="text/css" />
</head>
<body>
<center>
<div id="main">
<table width="100%" bgcolor="#003366" cellpadding="0" cellspacing="0" align="center">
<tr>
<td><img src="templates/images/main/logo.gif" _fcksavedurl=""templates/images/main/logo.gif"" _fcksavedurl=""templates/images/main/logo.gif"" _fcksavedurl=""templates/images/main/logo.gif"" _fcksavedurl=""templates/images/main/logo.gif"" alt=""></td>
</tr>
<tr>
<td bgcolor="#003366" colspan="2">
<div id="nav">
<table width="100%" cellspacing="0" cellpadding="0">
<tr>
<td class="fize"><a href="index.php">Anasayfa</a></td>
<td class="fize"><a href="index.php?page=news&action=view_category&category=1">Sağlık</a></td>
<td class="fize"><a href="index.php?page=news&action=view_category&category=2">Ekonomi</a></td>
<td class="fize" width="400"></td>
</tr>
</table>
</div>
</td>
</tr>
<tr>
<td width="100%" bgcolor="#003366">
<div id="content">
<table width="100%" cellpadding="0" cellspacing="0">
<tr>
<td width="100%" valign="top">
<div id="beyaz">{$content}</div>
</td>
</tr>
</table>
</div>
</td>
</tr>
<tr>
<td>
<div id="footer">
<div id="first"><div class="yazilim">yazılım <br /> <a class="beyaz" href="mailto:info@internet.com.tr">Emre Çevik</a></div></div>
<div id="second">Copyright© 2007 Benim Şirketim</div>
</div>
</td>
</tr>
</table>
</div>
</center>
</body>
</html>
sistem/index.php
(index.php?page=index)
templates/home/index.tpl
(index.php?page=index)
<table width="100%" cellpadding="0" cellspacing="0" border="0">
<tr>
<td width="430" valign="top">
{foreach from=$items item=news}
<table width="100%" cellpadding="0" cellspacing="0">
<tr>
<td>
<div class="newsdiv">
<div class="titlediv"><a href="{$news->link}">{$news->title}</a></div>
{if $news->image}<div class="news_img"><img src="{$news->image}" /></div>{/if}
{$news->info}
<div style="clear:both;"></div>
</div>
</td>
</tr>
</table>
{/foreach}
</td>
<td valign="top">
{if $list}
<div class="newsdiv">
<div class="titlediv" style="margin-bottom:1px;">Diğer haberler</div>
{foreach from=$list item=ls}
<div class="listdiv"><a href="{$ls->link}">{$ls->title}</a></div>
{/foreach}
</div>
{/if}
</td>
</tr>
</table>
Haber dosyamız : (index.php?page=news)
sistem/news.php
Haber Temalarımız :
templates/news/news_archive.tpl
(index.php?page=news&action=view_category)
<table cellpadding="0" cellspacing="0">
<tr>
<td width="430" valign="top">
{foreach from=$items item=news}
<table width="100%" cellpadding="0" cellspacing="0">
<tr>
<td>
<div class="newsdiv">
<div class="titlediv"><a href="{$news->link}">{$news->title}</a></div>
{if $news->image}<div class="news_img"><img src="{$news->image}" /></div>{/if}
{$news->info}
<div style="clear:both;"></div>
</div>
</td>
</tr>
</table>
{/foreach}
{$pagination}
</td>
<td valign="top">
</td>
</tr>
</table>
templates/news/news_details.tpl
(index.php?page=news&action=view_news)
<table width="100%" cellpadding="0" cellspacing="0">
<tr>
<td width="100%" valign="top">
<div class="newsdiv">
<div class="titlediv">{$items->title}</div>
<div style="padding:5px">
{if $items->image}<div class="news_img"><img src="{$items->image}" /></div>{/if}
{$items->info}
<br />
{$items->more}
</div>
<div style="clear:both;"></div>
</div>
</td>
</tr>
</table>
Tüm dosyaları zip halinde indirmek için tıklayın.
Bu makaleye ilgi olması halinde makaleyi devam ettirmeye ve geliştirmeye çalışacağım. Makale ile her türlü soru, sorun ve önerinizi forumda yazabilirsiniz.
Kolay gelsin.
Emre Çevik - info@internet.com.tr
| Emre 20.05.2007 | |
| Rating : 10 üzerinden 9.43 |
Yorum ekle