ok no problem
this is the code that i am work on
<?php
$query=mysql_query("SELECT * FROM topics WHERE $topic=id");
while($result=mysql_fetch_array($query)){
?>
<table border="0" cellpadding="2" cellspacing="1" width="100%" bgcolor="#969696">
<tr>
<td align="center" width="100%" bgcolor="#969696">
<p align="center"><font color="#FFFFFF">
<?php echo $result[name] ?>
</font></p>
</td>
</tr>
<tr>
<td align="center" width="100%" bgcolor="#EBEBEB">
<p align="justify"><font color="#416496">
<?php echo $result[description] ?>
</font></p>
</td>
</tr>
</table>
<?php
}
$query=mysql_query("SELECT * FROM topics WHERE $topic=place ORDER BY id DESC");
while($result=mysql_fetch_array($query)){
?>
<br>
<table border="0" cellpadding="2" cellspacing="1" width="100%" bgcolor="#969696">
<tr>
<td align="center" width="100%" bgcolor="#EBEBEB">
<p align="center"><font color="#416496">
<a href="topic.php?topic=<?php echo $result[id] ?>"><?php echo $result[name] ?></a>
</font></p>
</td>
</tr>
</table>
<?php
}
?>
<br>
<table border="0" cellpadding="2" cellspacing="1" width="100%" bgcolor="#969696">
<tr>
<td align="center" bgcolor="#969696">
<p align="center"><font color="#FFFFFF">
title
</font></p>
</td>
<td align="center" width="100" bgcolor="#969696">
<p align="center"><font color="#FFFFFF">
writer
</font></p>
</td>
<td align="center" width="100" bgcolor="#969696">
<p align="center"><font color="#FFFFFF">
date of add
</font></p>
</td>
<td align="center" width="50" bgcolor="#969696">
<p align="center"><font color="#FFFFFF">
vist
</font></p>
</td>
</tr>
<?php
$numresults=mysql_query("SELECT * FROM articles WHERE topic=$topic ORDER BY id DESC");
$numrows=mysql_num_rows($numresults);
if(empty($page)){
$page=0;
}
$result=mysql_query("SELECT * FROM articles WHERE topic=$topic ORDER BY id DESC limit $page,$limit");
while($data=mysql_fetch_array($result)){
?>
<tr>
<td align="center" bgcolor="#EBEBEB">
<p align="justify"><font color="#416496">
<a href="topic.php?id=<?php echo $data[id] ?>"><?php echo $data[subject] ?></a>
</font></p>
</td>
<td align="center" width="100" bgcolor="#EBEBEB">
<p align="center"><font color="#416496">
<?php echo $data[writer] ?>
</font></p>
</td>
<td align="center" width="100" bgcolor="#EBEBEB">
<p align="center"><font color="#416496">
<?php echo $data[date] ?>
</font></p>
</td>
<td align="center" width="50" bgcolor="#EBEBEB">
<p align="center"><font color="#416496">
<?php echo $data[counter] ?>
</font></p>
</td>
</tr>
<?php
}
?>
</table><br> pages :
<?php
$pages=intval($numrows/$limit);
if($numrows%$limit){
$pages++;
}
for($i=1;$i<=$pages;$i++){
$newpage=$limit*($i-1);
echo"( <a href='topic.php?topic=$topic&page=$newpage'>$i</a> ) ";
}
?>
so as you see it is mix of php and templete and i want to make it part of my 4images
the first step is to splet the code into two parts
the templete part and that is easy
and the php & mysql part and that is also easy
but the problem is how to make it work by 4images rules