| Home | Hotscript | Downloads  
Text Link Ads

Tutorial - PHP
Categories
Blog [2]
Communication [1]
Site Stats [3]
Skin/Template [2]
Timer & Counter [1]
Tools [3]
Tutorial - Photoshop
Categories
Graphics [5]
Special Effects [2]
Text Effect [2]
Download - PHP Scripts
myBloggie - D/L
Advanced Blog System
myBloggie's Home
myBloggie's Demo
user: guest
pwd: pass
myEvent
Dynamic Calendar with Events
Bloggielite
New Generation Blog
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 !


myWebland © 2003, 2004 myWebland Group
myWebland | wahsei | Contact Us | Privacy Statement