
TNX?
Boat Lettering Inexpensive Furniture Market Umbrella pond lighting
|
| PHP/MySQL Tutorial |
| |
| Templating with phpBB template Engine Part 2 |
| Written by : Sean |
| Date : 2004-07-20 |
[Back]
[Home] |
|
|
|
|
create a tpl file & save under subSilver directory as above
Name : tableloop ( dont alter anything below )
| Code: |
<table>
<tr>
<!-- BEGIN cell -->
<td>{cell.NUMBER}</td>
<!-- END cell -->
<tr>
</table> |
Copy this to the root directory ( assumption same as above )
name : test.php
| Code: |
<?php
define('IN_PHPBB', true); // to ensure your script works ! //
$phpbb_root_path = './forums/';
include($phpbb_root_path . 'extension.inc');
include($phpbb_root_path . 'common.php');
init_userprefs($userdata);
$template->set_filenames(array(
'main_header' => 'tableloop.tpl')
);
// Try diffirent no other than 5 !
for($no = 0; $no < 5; $no++) {
$template->assign_block_vars('cell', array(
'NUMBER' => $no,
)
);
}
$template->pparse('main_header');
?> |
run it & you will get a dynamic table via template !
|
|
|