Very preliminary version of this code, but the problem is at the bottom with: 'includes/page_tail.php'
<?php
define('IN_PHPBB', true);
$phpbb_root_path = './';
include($phpbb_root_path . 'extension.inc');
include($phpbb_root_path . 'common.'.$phpEx);
include($phpbb_root_path . 'includes/page_header.'.$phpEx);
class Page {
var $content;
var $buttons = array( "Page1" => "page1.php",
"Page2" => "page2.php");
//------------------------------------------------------------------
function SetContent($newcontent){
$this->content = $newcontent;
}
//------------------------------------------------------------------
function Display(){
$this -> DisplayMenu($this->buttons);
echo $this->content;
}
//------------------------------------------------------------------
function SetButtons($newbuttons){
$this->buttons = $newbuttons;
}
//------------------------------------------------------------------
function DisplayMenu($buttons){
echo "<table width = \"100%\" bgcolor = #e1e1e1 cellpadding = 4 cellspacing = 4>\n";
echo " <tr>\n";
//calculate button size
$width = 100/count($buttons);
while (list($name, $url) = each($buttons)){
$this -> DisplayButton($width, $name, $url, !$this->IsURLCurrentPage($url));
}
echo " </tr>\n";
echo "</table>\n";
}
//------------------------------------------------------------------
function IsURLCurrentPage($url){
if(strpos( $GLOBALS["SCRIPT_NAME"], $url )==false){
return false;
}
else{
return true;
}
}
//------------------------------------------------------------------
function DisplayButton($width, $name, $url, $active = true){
if ($active){
echo "<td width = \"$width%\">
<a href = \"$url\">
inactive: <a href = \"$url\">
<span class=menu>$name</span></a>
</td>";
}
else{
echo "<td width = \"$width%\">
active:
<span class=menu>$name</span>
</td>";
}
}
} // end Page class
// include doesn't work here for some reason.
//include($phpbb_root_path . 'includes/page_tail.'.$phpEx);
?>