Page 1 of 1

A More Informative Title About A phpBB Admin Module Problem

Posted: Mon Nov 28, 2005 1:06 am
by Majoraslayer
I'm trying to create an administration page for my phpBB's administration panel, but for some reason my conditional statements are doing NOTHING. Since I know absolutely nothing about PHP, have at look at it and tell me whats wrong :(

Code: Select all

<?php
/***************************************************************************
File:			admin_mainsite.php
Created:		11/28/05
Description:	phpBB Integrated Site Administration
Notes:		[None as of yet ^_~]
 
 ***************************************************************************/

define('IN_PHPBB', 1); 
if( !empty($setmodules) ) 
{ 
$filename = basename(__FILE__); 

	$module['ZD Site']['Plesk CP'] = $file;
	$module['ZD Site']['File Manager'] = "$file?mode=fileman";
	$module['ZD Site']['phpMyAdmin'] = "$file?mode=phpMyAdmin";
	$module['ZD Site']['Edit Content'] = "$file?mode=contentedit";
	$module['ZD Site']['Edit Links'] = "$file?mode=linkedit";
	$module['ZD Site']['Admin Notepad'] = "$file?mode=notepad";
	$module['ZD Site']['Configuration'] = "$file?mode=baseconfig";
	$module['ZD Site']['Utilities'] = "$file?mode=utilitylist";

return; 
}


if( $mode == "fileman" )
{
echo 'This is the place for the file manager scripts.';
}

if( $mode == "phpMyAdmin")
{
echo 'This is the place for the phpMyAdmin redirection.';
}

if( $mode == "contentedit")
{
echo 'This is the place for the content editor script.';
}

if( $mode == "linkedit")
{
echo "This is where I figure out how the hell I'm going to do link administration.";
}

if( $mode == "notepad")
{
echo 'Just a simple script to write to a file for a notepad...also tests the editor script.';
}

if( $mode == "baseconfig")
{
echo 'Change basic configuration information for the site.';
}

if( $mode == "utilitylist")
{
echo 'Some basic utilities that will help with site administration.';
}

?>

Posted: Mon Nov 28, 2005 1:44 am
by Jenk
Where is $mode defined?

In any case, if $setmodules is not defined (and assigned a value) the no, your conditional statements will not do anything.

Posted: Mon Nov 28, 2005 8:56 am
by trukfixer

Code: Select all

$mode = $_GET['mode'];
//add the above line to set $mode from request_uri string 

define('IN_PHPBB', 1);
if( !empty($setmodules) )
{
$filename = basename(__FILE__);
probably have register_globals = off gotta be explicit.

Posted: Tue Nov 29, 2005 9:02 am
by Majoraslayer
Well, I finally got the script working, and I appreciate all the help. However, now I'm having a new problem. Does anyone know how to apply the template system to phpBB's ACP module pages? Any suggestions would be much appreciated :D