aboutsummaryrefslogtreecommitdiff
path: root/modules/index/index.php
blob: b7554b7cd70c1a1f8f371bbffbe0bc14a58351a2 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
<?php
/**
 * MODULE - INDEX >>
 * This page is a module that displays multiple modules
 * Database should store a list of module names in the order they are to be displayed
 * This should be fairly simple to produce -- Dont forget to set this as the default
 * in the config.php array
 * 
 */
?>

<?php
  
  
   	$result = $db->Query("SELECT `dir_name` FROM `bayonet_modules` ORDER BY `weight` ASC");
 	while(($row = $db->Fetch($result))!==false)
	{
		$indexModules[] = $row['dir_name'];
	}
	
	foreach($indexModules as $module)
	{ 
		  if(file_exists("modules/" . $module))
		  {
		    include 'modules/' . $module . '/index.php';
		  }
		  else
		  {
		    OpenTable();
		    ReportError("Cannot load module '{$module}' directory.<br>\n");
		    CloseTable();    
		  }
		  echo "<br />";
	}
?>