Update of /cvsroot/phpmp/phpMP
In directory usw-pr-cvs1:/tmp/cvs-serv22503
Added Files:
modules.php
Log Message:
Adding a little module support.
--- NEW FILE: modules.php ---
<?
/******************************************************************************
*******************************************************************************
phpMP - The World's Greatest Modular Portal
***********************************************
Are you MPowered?
Copyright (C) 2002 phpMP Development Group
All rights reserved.
Lead Programmer: Brian Rose
Lead Designer: Evan Weatherhead
Filename: /modules.php
Usage & Function: Puts together all module content.
Create Date: April 9, 2002
$Id: modules.php,v 1.1 2002/04/10 04:38:35 heimidal Exp $
*******************************************************************************
*******************************************************************************
This software is provided under the BSD software license. A copy of the
license should have been included with this software, located in the Docs
folder. Feel free to redistribute and/or modify it according to the
regulations stated in the license.
*******************************************************************************
******************************************************************************/
// Include The Main Configuration File
include("config.php");
if(!defined("PHPMP_INSTALLED")) {
die('You have not <a href="install.php">installed phpMP</a>. Please do so before attempting to use this software.');
}
// Include The Main Core File
include($MPCONF['GEN']['abs_path'] . "/includes/core.php");
global $PHPMP;
// Start phpMP
$PHPMP = new PHPMP();
$PHPMP->Init();
class ModClass {
var $modulename;
var $use_filename;
function Init() {
global $MPCONF, $DBA, $HTTP_GET_VARS;
$this->modulename = $HTTP_GET_VARS['module'];
$query = $DBA->query("SELECT * FROM " . $MPCONF['DB']['table_prefix'] . "modules WHERE unixname='" . $this->modulename . "' LIMIT 1");
if(@mysql_num_rows($query)) {
$MPCONF['MOD'] = @mysql_fetch_array($query);
} else {
die("Module requested but not found.");
}
}
}
$ModClass = new ModClass();
$ModClass->Init();
include($MPCONF['GEN']['abs_path'] . '/modules/' . $MPCONF['MOD']['filename']);
$Module->Init();
// Start The Page
$Template->PrintHeader( array(PAGETITLE => ".::" . $Module->pagetitle . "::.") );
// Display The Left Side
$Template->CreateSide('left');
// Start The Main Section
$Template->Blocking('BeginMain');
$Module->MakeContent();
// End The Main Section
$Template->Blocking('EndMain');
// Display The Right Side, If Wanted On Page
$Template->CreateSide('right');
$Template->PrintFooter( array() );
?>
|