Hey..
Jeg er ved at forberede et projekt. Jeg har fået lavet det færdige design som jeg vil have det, og er faktisk klar til at starte programmeringen, MEN.
Jeg har i den seneste tid læst flere artikler og forums hvor der bliver beskrevet OOP og at det er meget smartere at benytte dette, og opbygge sit site via classes.
Dette har jeg så også forstået nogenlunde men, jeg vil gerne have en class hvori mit design ligger. Og her kommer mit problem så: Hvordan får jeg lagt mit design ind i en class så jeg senere kan benytte det på index.php?..
Mit design er som følger:
<!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 name="Description" />
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<title>Felderbal</title>
<link href="style.css" rel="stylesheet" type="text/css" />
</head>
<body>
<table width="100%" border="0" cellpadding="0" cellspacing="0" id="content">
<tr>
<td><table width="750" border="0" cellspacing="0" cellpadding="0">
<tr>
<td width="30" background="images/header_left.gif"> </td>
<td><object classid="clsid
27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=7,0,19,0" width="690" height="269">
<param name="movie" value="flash/header.swf" />
<param name="quality" value="high" />
<embed src="flash/header.swf" quality="high" pluginspage="http://www.macromedia.com/go/getflashplayer" type="application/x-shockwave-flash" width="690" height="269"></embed>
</object></td>
<td width="30" background="images/header_right.gif"> </td>
</tr>
<tr>
<td colspan="3"><table width="750" border="0" cellpadding="0" cellspacing="0">
<tr>
<td width="134" background="images/menu_background.gif" class="table"><table width="179" height="346" border="0" cellpadding="0" cellspacing="0" id="left_menu">
<tr>
<td height="55" background="images/menu_top.gif"> </td>
</tr>
<tr>
<td width="185" height="94" background="images/menu_bg.gif" class="menu"><p><a href="#">Menu fsaf </a></p>
<p><a href="#">Menu 2</a>dsafasfas</p>
<p><a href="#">Menu 3</a>sfa</p>
<p> </p>
<p> </p>
<p> </p>
<p> </p>
<p> </p></td>
</tr>
<tr>
<td height="72" background="images/Menu_bottom.gif"> </td>
</tr>
<tr>
<td height="125" background="images/members_bg.gif" class="mem"><p align="center"> </p>
<p align="center">Klik på nedenstående link for at logge ind:</p>
<p align="center"><a href="admin/login.php">Login</a></p></td>
</tr>
</table> </td>
<td width="616" class="content_bg"><table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td height="55" background="images/content_top.jpg" class="overskrift">Nyheder</td>
</tr>
<tr>
<td background="images/content.gif"><table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td width="2"><img src="images/spacer.gif" width="2" height="123" /></td>
<td width="98%" class="content"><p><strong>Lorem Ipsum</strong> is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry's standard dummy text ever since the 1500s, when an unknown printer took a galley of type and scrambled it to make a type specimen book. It has survived not only five centuries, but also the leap into electronic typesetting, remaining essentially unchanged. It was popularised in the 1960s with the release of Letraset sheets containing Lorem Ipsum passages, and more recently with desktop publishing software like Aldus PageMaker including versions of Lorem Ipsu</p>
<p> </p>
<p> </p>
<p> </p>
<p> </p>
<p> </p>
<p> </p></td>
</tr>
</table> </td>
</tr>
<tr>
<td height="171" background="images/content_bottom.gif"><p> </p>
<p> </p>
<p> </p></td>
</tr>
</table> </td>
</tr>
</table></td>
</tr>
<tr>
<td colspan="3"><table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td width="37" height="70" background="images/bottom_left.gif"> </td>
<td height="70" background="images/bottom_bg.gif" class="footer"><p>Webmaster: Steffan LIldholdt :: <a href="mailto:steffan@lildholdt.dk?subject=Webdesign">steffan@lildholdt.dk</a></p></td>
<td width="38" height="70" background="images/bottom_right.gif"> </td>
</tr>
</table></td>
</tr>
</table>
</tr>
</table>
</body>
</html>
Der er kun 2 krav:
1. Dette stykke:
"<td width="185" height="94" background="images/menu_bg.gif" class="menu"><p><a href="#">Menu fsaf </a></p>
<p><a href="#">Menu 2</a>dsafasfas</p>
<p><a href="#">Menu 3</a>sfa</p>
<p> </p>
<p> </p>
<p> </p>
<p> </p>
<p> </p></td>"
Skal være variablet så man kan tilføje/fjerne/redigere de forskellige menu punkter.
2. Dette stykke:
"<td width="98%" class="content"><p><strong>Lorem Ipsum</strong> is... osv."
Skal være sådan at jeg kan bruge $_GET['page'] til at hente de forskellige sider ind på index.php.
Jeg håber ikke det var for svært at forstå, men ellers må i bare lige sige til