I've managed to get it working on a site I've been playing with. Here's how...
First I created a file called db.php that loads the punbb abstraction layer... (most of the code found in this file was posted in these forums earlier)
<?
// Database abstraction layer from Punbb
// We add the forums directory to the PHP path so that PHP can find the scripts we include later
set_include_path(get_include_path().':[b]./path/to/punbb[/b]');
@include_once 'config.php';
// If PUN isn't defined, config.php is missing or corrupt
if (!defined('PUN'))
exit('config.php doesn\'t exist or is corrupt. Please run install.php to install PunBB first.');
// The next line tells PunBB to not update the cookie of the visiting user
// A visit to the front page shouldn't affect stuff like new post indicators
define('PUN_DONT_UPDATE_COOKIE', 1);
include_once 'include/common.php';
?>
Next I inserted the following code into my index.php file.
<?php
include_once("db.php");
if (!isset($cur_user[id])) { // If the current user has not logged in already
echo "<form action=\"".$g_root."modules/forums/login.php?action=in\" method=\"post\">\n";
echo "<input type=\"hidden\" name=\"form_sent\" value=\"1\" />\n";
echo "username <input type=\"text\" name=\"req_username\" size=\"20\" />\n";
echo "<br />password <input type=\"password\" name=\"req_password\" size=\"20\" />\n";
echo "<input type=\"submit\" value=\"login\" />\n";
echo "</form>\n";
}
else { // Print greeting
echo "Hello $cur_user[username]";
}
?>
Hope that makes sense. I'm a complete novice when it comes to PHP and SQL, but I enjoy having a go at it.
grommet