Location: PHPKode > projects > Exero CMS > upload/admin/installmodules.php
<?
/*========================================*\
| Exero CMS                                |
|==========================================|
|          http://ecms.getox.net           |
|https://sourceforge.net/projects/exerocms/|
|==========================================|
|     Exero CMS is released under the      |
|     GNU General Public License (GPL)     |
| opensource.org/licenses/gpl-license.php  |
\*========================================*/

require("global.php");
if(!checkadminsession()) {
	print_login();
	exit;
}

if(!adminpermissions("installmodules")) {
	print_no_permission();
	exit;
}

if($_REQUEST['do'] == "") {
	print_cp_header("Module Installer");
	
	print_table_header("Modules","4","0","1","100%","2");
	print_multicol_row(array("Module[align:left]"=>"","Version"=>"130","Author"=>"130","Options[align:right]"=>"130"),"optiontitle");
	$handle = opendir("installers/modules");
	$hidden = array(
		'.',
		'..',
		'example.php'
		);
	while(false !== ($filename = readdir($handle))) {
		if(!in_array($filename,$hidden)) {
			$file = str_replace(".php","",$filename);
			include("installers/modules/$filename");
			$module = new $file;
			$installedmodule = $db->query_first("SELECT * FROM installed_modules WHERE ident='".$module->ident."' LIMIT 1");
			if(!$module->version == $installedmodule['version']) {
				print_multicol_row(array($module->name."[align:left]"=>"",$module->version=>"130","<a href=\"".$module->authorurl."\" target=\"_blank\">".$module->author."</a>"=>"130","<a href=\"installmodules.php?do=install&module=$file\">Install</a>[align:right]"=>"130"));
			}
		}
	}
	print_table_footer();
		
	print_cp_footer();
} else if($_REQUEST['do'] == "install") {
	include("installers/modules/".$_REQUEST['module'].".php");
	$module = new $_REQUEST['module'];
	$module->_install();
	$db->query("INSERT INTO ".TABLE_PREFIX."installed_modules VALUES(
		'".$module->name."',
		'".$module->version."',
		'".$module->ident."',
		'".$module->author."',
		'".$_REQUEST['module']."'
		)");
	print_redirect("installmodules.php","Module Installed","Module Installed.");
}
?>
Return current item: Exero CMS