Hallo,
Ik heb even een vraagje, ik ben bezig met een nieuws systeem en ben hem in de layout aan het bouwen ik stop hem in de while alleen dan wordt die anders want ik juist anders wil.
Zo wil ik het hebben:
Afbeelding niet beschikbaarDe bron kon niet worden geladen (i55.tinypic.com).Bron openen ↗ waar het rode vierkant is aangegeven moet je goed kijken naar de volgende afbeelding.
Zo heb ik het nu met de while alleen dat moet niet:
Afbeelding niet beschikbaarDe bron kon niet worden geladen (i56.tinypic.com).Bron openen ↗
Dit is het stukje waar het goed wordt weergegeven
en dit is het php stukje in de while:
Ik heb even een vraagje, ik ben bezig met een nieuws systeem en ben hem in de layout aan het bouwen ik stop hem in de while alleen dan wordt die anders want ik juist anders wil.
Zo wil ik het hebben:
Afbeelding niet beschikbaarDe bron kon niet worden geladen (i55.tinypic.com).Bron openen ↗Zo heb ik het nu met de while alleen dat moet niet:
Afbeelding niet beschikbaarDe bron kon niet worden geladen (i56.tinypic.com).Bron openen ↗Dit is het stukje waar het goed wordt weergegeven
<div class="content">
<div class="content-toporanje">Mijnstelling officeel geopend<div class="reactie-datum">11:03:43 18-12-2010</div></div>
<div class="content-midr">
<div class="reactie">
<div class="reactieitems-left">
<img src="images/avatar.png" alt="Avatar " /><br /><br />
Mike <img src="images/online.png" alt="Online" /></div>
<div class="reactiebericht">
Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur gravida nulla non lacus gravida ornare mattis ante dignissim. Etiam at ante vel arcu vehicula lacinia. Ut vitae ipsum risus, non adipiscing sapien. Donec sapien justo, suscipit et sagittis sed, venenatis vel tellus. Nunc eget sem orci. Duis vehicula pellentesque augue non convallis. Donec non lectus diam, et vehicula metus. Aliquam massa tellus, sollicitudin eget condimentum vitae, fringilla in metus. Sed a tortor arcu, in euismod metus. Vivamus in metus neque, a posuere metus. Suspendisse potenti. Cum sociis natoque penatibus et magnis dis parturient montes, nascetur ridiculus mus. </div>
</div></div><div class="content-bottom"></div></div> en dit is het php stukje in de while:
<div class="content">
<div class="content-midr">
[COLOR= #0000BB]<?php[/COLOR]
[COLOR= #FF8000]//controleren of er een id is meegegeven en controleren of het id een cijfer is[/COLOR]
[URL="http://www.php.net/if"]if[/URL] [COLOR= #007700]([/COLOR][URL="http://www.php.net/isset"]isset[/URL][COLOR= #007700]([/COLOR][COLOR= #0000BB]$_GET[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]id[/COLOR][COLOR= #007700]])) {[/COLOR]
[URL="http://www.php.net/if"]if[/URL] [COLOR= #007700](![/COLOR][URL="http://www.php.net/empty"]empty[/URL][COLOR= #007700]([/COLOR][COLOR= #0000BB]$_GET[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]id[/COLOR][COLOR= #007700]])) {[/COLOR]
[URL="http://www.php.net/if"]if[/URL] [COLOR= #007700]([/COLOR][URL="http://www.php.net/is_numeric"]is_numeric[/URL][COLOR= #007700]([/COLOR][COLOR= #0000BB]$_GET[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]id[/COLOR][COLOR= #007700]])) {[/COLOR]
[COLOR= #0000BB]$ID[/COLOR] [COLOR= #007700]=[/COLOR] Secure[COLOR= #007700]([/COLOR][COLOR= #0000BB]$_GET[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]id[/COLOR][COLOR= #007700]]);[/COLOR]
[URL="http://www.php.net/if"]if[/URL] [COLOR= #007700](![/COLOR][URL="http://www.php.net/isset"]isset[/URL][COLOR= #007700]([/COLOR][COLOR= #0000BB]$_GET[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]p[/COLOR][COLOR= #007700]])) {[/COLOR]
[COLOR= #0000BB]$page[/COLOR] [COLOR= #007700]=[/COLOR] [COLOR= #0000BB]0[/COLOR][COLOR= #007700];[/COLOR]
[COLOR= #0000BB]$limit[/COLOR] [COLOR= #007700]=[/COLOR] [COLOR= #DD0000]0, [/COLOR][COLOR= #007700].[/COLOR][COLOR= #0000BB]$aantal[/COLOR][COLOR= #007700];
}[/COLOR]
[URL="http://www.php.net/elseif"]elseif[/URL] [COLOR= #007700]([/COLOR][URL="http://www.php.net/is_numeric"]is_numeric[/URL][COLOR= #007700]([/COLOR][COLOR= #0000BB]$_GET[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]p[/COLOR][COLOR= #007700]])) {[/COLOR]
[COLOR= #0000BB]$page[/COLOR] [COLOR= #007700]=[/COLOR] secure[COLOR= #007700]([/COLOR][COLOR= #0000BB]$_GET[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]p[/COLOR][COLOR= #007700]]);[/COLOR]
[COLOR= #0000BB]$limit[/COLOR] [COLOR= #007700]=[/COLOR] [COLOR= #0000BB]$page[/COLOR][COLOR= #007700]*[/COLOR][COLOR= #0000BB]$aantal[/COLOR][COLOR= #007700];[/COLOR]
[COLOR= #0000BB]$limit[/COLOR] [COLOR= #007700]=[/COLOR] [COLOR= #0000BB]$limit[/COLOR][COLOR= #007700].[/COLOR][COLOR= #DD0000], [/COLOR][COLOR= #007700].[/COLOR][COLOR= #0000BB]$aantal[/COLOR][COLOR= #007700];
}[/COLOR]
[COLOR= #FF8000]//SQL uitvoeren voor reacties[/COLOR]
[COLOR= #0000BB]$sql[/COLOR] [COLOR= #007700]=[/COLOR] [URL="http://www.php.net/mysql_query"]mysql_query[/URL][COLOR= #007700]([/COLOR][COLOR= #DD0000]"SELECT `name`, `message`, `when` FROM `reacties` WHERE `stel_id` = $ID ORDER BY id DESC LIMIT $limit"[/COLOR][COLOR= #007700]);[/COLOR]
[URL="http://www.php.net/if"]if[/URL] [COLOR= #007700](@[/COLOR][URL="http://www.php.net/mysql_num_rows"]mysql_num_rows[/URL][COLOR= #007700]([/COLOR][COLOR= #0000BB]$sql[/COLOR][COLOR= #007700]) <[/COLOR] [COLOR= #0000BB]1[/COLOR] [COLOR= #007700]) {[/COLOR]
[URL="http://www.php.net/echo"]echo[/URL] [COLOR= #DD0000]Er zijn geen berichten gevonden
<a href="reageer.php?id=[/COLOR][COLOR= #007700].[/COLOR][COLOR= #0000BB]$ID[/COLOR][COLOR= #007700].[/COLOR][COLOR= #DD0000]">Reageer als eerste!</a>[/COLOR][COLOR= #007700];
}[/COLOR]
[URL="http://www.php.net/else"]else[/URL] [COLOR= #007700]{[/COLOR]
[COLOR= #0000BB]$num_sql[/COLOR] [COLOR= #007700]=[/COLOR] [COLOR= #DD0000]"SELECT COUNT(ID) AS aantal FROM `reacties` WHERE `stel_id` = $ID"[/COLOR][COLOR= #007700];[/COLOR]
[URL="http://www.php.net/while"]while[/URL][COLOR= #007700]([/COLOR][COLOR= #0000BB]$qres[/COLOR] [COLOR= #007700]=[/COLOR] [URL="http://www.php.net/mysql_fetch_assoc"]mysql_fetch_assoc[/URL][COLOR= #007700]([/COLOR][COLOR= #0000BB]$sql[/COLOR][COLOR= #007700])) {[/COLOR]
[COLOR= #0000BB]$name[/COLOR] [COLOR= #007700]=[/COLOR] Lees[COLOR= #007700]([/COLOR][COLOR= #0000BB]$qres[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]name[/COLOR][COLOR= #007700]]);[/COLOR]
[COLOR= #0000BB]$message[/COLOR] [COLOR= #007700]=[/COLOR] Lees[COLOR= #007700]([/COLOR][COLOR= #0000BB]$qres[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]message[/COLOR][COLOR= #007700]]);[/COLOR]
[COLOR= #0000BB]$when[/COLOR] [COLOR= #007700]=[/COLOR] MakeDate[COLOR= #007700]([/COLOR][COLOR= #0000BB]$qres[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]when[/COLOR][COLOR= #007700]]);[/COLOR]
[URL="http://www.php.net/echo"]echo[/URL] [COLOR= #DD0000]
<div class="reactie">
<div class="reactie-top">
Reactie op: Vrouw rijdt beter auto.
<div class="reactie-datum">
[/COLOR][COLOR= #007700].[/COLOR][COLOR= #0000BB]$when[/COLOR][COLOR= #007700].[/COLOR][COLOR= #DD0000]
</div>
</div>
<div class="reactieitems-left">
<img src="images/avatar.png" alt="Avatar" />
<br /><br />
[/COLOR][COLOR= #007700].[/COLOR][COLOR= #0000BB]$name[/COLOR][COLOR= #007700].[/COLOR][COLOR= #DD0000]
<img src="images/online.png" alt="online" />
</div>
<div class="reactiebericht">
[/COLOR][COLOR= #007700].[/COLOR]UBB[COLOR= #007700]([/COLOR][COLOR= #0000BB]$message[/COLOR][COLOR= #007700]).[/COLOR][COLOR= #DD0000]
</div>
</div>
<div class="content-bottom"></div>
[/COLOR][COLOR= #007700];
}[/COLOR] [COLOR= #FF8000]//End While[/COLOR]
[URL="http://www.php.net/echo"]echo[/URL] [COLOR= #DD0000]
<div class="reageer-scheiding"></div>
[/COLOR][COLOR= #007700];[/COLOR]
Page_Num[COLOR= #007700]([/COLOR][COLOR= #0000BB]$page[/COLOR][COLOR= #007700],[/COLOR] [COLOR= #0000BB]$num_sql[/COLOR][COLOR= #007700],[/COLOR] [COLOR= #0000BB]$ID[/COLOR][COLOR= #007700]);[/COLOR]
[URL="http://www.php.net/echo"]echo[/URL] [COLOR= #DD0000]<br /><br /><br />[/COLOR][COLOR= #007700];
}[/COLOR] [COLOR= #FF8000]// End Else[/COLOR]
[COLOR= #007700]}[/COLOR] [COLOR= #FF8000]//End is_numeric[/COLOR]
[URL="http://www.php.net/else"]else[/URL] [COLOR= #007700]{[/COLOR]
[URL="http://www.php.net/echo"]echo[/URL] [COLOR= #DD0000]Het ID dat is opgegeven is geen cijfer![/COLOR][COLOR= #007700];
}
}[/COLOR] [COLOR= #FF8000]//End !empty[/COLOR]
[URL="http://www.php.net/else"]else[/URL] [COLOR= #007700]{[/COLOR]
[URL="http://www.php.net/echo"]echo[/URL] [COLOR= #DD0000]Er is geen ID opgegeven![/COLOR][COLOR= #007700];
}
}[/COLOR] [COLOR= #FF8000]//End isset[/COLOR]
[URL="http://www.php.net/else"]else[/URL] [COLOR= #007700]{[/COLOR]
[URL="http://www.php.net/echo"]echo[/URL] [COLOR= #DD0000]Er is geen ID opgegeven![/COLOR][COLOR= #007700];
}[/COLOR]
[COLOR= #FF8000]// End if[/COLOR]
?>
</div>
<div class="content-bottom"></div> 

