Basically, each PunBB file has hooks in key parts of the script, which allow you to modify how PunBB works. You start with a base 'manifest.xml' and just keep on adding hooks:
<?xml version="1.0" encoding="utf-8"?>
<!DOCTYPE extension SYSTEM "ext-1.0.dtd">
<extension engine="1.0">
<id></id>
<title></title>
<version>1.0.0</version>
<description></description>
<author></author>
<minversion>1.3</minversion>
<maxtestedon>1.3.2</maxtestedon>
<install>
<![CDATA[
if(!defined('EXT_CUR_VERSION'))
{
//Install code if extension is already installed (upgrading, etc.)
}
//Install code
]]>
</install>
<uninstall>
<![CDATA[
//Uninstall code
]]>
</uninstall>
<hooks>
<hook id="hook_name">
<![CDATA[
]]>
</hook>
</hooks>
</extension>
To know which hooks to use, just browse through the PunBB files. Once the script reaches the part where it calls your hook, it simply executes all the code you put inside the <hook> element (eval() function restrictions apply, though).
As for the extension ID, just make sure it matches the folder in which you are placing the extension. Also, when your hook is executed, the following variable is passed to you:
$ext_info = array(
'id' => $id,
'path' => FORUM_ROOT.'extensions/'.$id,
'url' => $base_url.'/extensions/'.$id,
'dependencies' => array()
);
basically, all you need.
I hope this helped... I might've left some things out, so feel free to post any questions you have (as long as their not stupid nooby questions, in which case all I'll do is post a link to a PHP tutorial)