Template Integration

This brief tutorial describes how you might integrate the FlashChat SWF with your website template. FlashChat comes with a file called sample.php which shows this integration in action. There are two parts to this file:

1) PHP file which gets the FlashChat tag, using the function flashChatTag(..)

2) Template file which displays the HTML. The template is stored in the /templates folder, and has the .tpl suffix.

The easy, "hack" method to integration is just to open /templates/sample.tpl and edit the HTML appropriately. Please be careful that you leave the {$data.flashChatTag} code intact, since this is where FlashChat will be displayed. You do NOT need to know PHP to do this, just HTML. In fact, you can even use popular HTML editors like Dreamweaver or FrontPage to edit the template code, since it is pure HTML.

If you do not want to use Smarty, you can also do the following: call the flashChatTag function and display the output of this function directly. For example, sample.php could be rewritten as:

<?php

// PHP code here from current sample.php

echo '<html><body>.... '; // your template header HTML

echo flashChatTag(...); // add options like width and height of the SWF area here

echo '</body></html>'; // your template footer HTML

?>

In this case you would delete the very important $smarty->display('sample.tpl'); line.