Hey, ik gebruik template power en nu zit ik met een probleem. Ik wil alle gebruikers laten zien alleen laat hij er steeds maar 1 zien ik heb de volgende code:
PHP:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
| <? require_once("includes/template.inc.php"); $tpl = new TemplatePower("templates/opmaak.tpl"); $tpl->assignInclude("tabel", "templates/home.tpl"); $tpl->prepare(); $A = mysql_query("SELECT id FROM tabel WHERE id > 0"); while($AA = mysql_fetch_object($A)) { $B = mysql_query("SELECT id, gebruikersnaam FROM tabel WHERE id = '$AA->id'"); $BB = mysql_fetch_object($B); $tpl->newBlock("naam"); $tpl->assignGlobal("naam", $BB->gebruikersnaam); } $tpl->gotoBlock( "_ROOT" ); $tpl->printToScreen(); ?> // opmaak.tpl <html> <head> <title>Site</title> </head> <body> {tabel} </body> </html> // home.tpl <b>Home</b> <!-— START BLOCK : naam --> {naam} <!-— END BLOCK : naam --> <b>Einde home</b> |
[ Voor 17% gewijzigd door cverkooyen op 27-04-2003 21:53 ]