Project

General

Profile

« Previous | Next » 

Revision 169

Added by ryan about 19 years ago

Fixed addon listing in numerous places so it now use's DB for info

View differences:

index.php
1 1
<?php
2 2

  
3
// $Id: index.php,v 1.2 2005/04/02 06:25:37 rdjurovich Exp $
3
// $Id$
4 4

  
5 5
/*
6 6

  
......
35 35

  
36 36
// Insert values into module list
37 37
$template->set_block('main_block', 'module_list_block', 'module_list');
38
if($handle = opendir(WB_PATH.'/modules/')) {
39
	while (false !== ($file = readdir($handle))) {
40
		if($file != "." AND $file != ".." AND $file != ".svn" AND is_dir(WB_PATH."/modules/$file") AND file_exists(WB_PATH."/modules/$file/info.php")) {
41
			// Include the modules info file
42
			require(WB_PATH.'/modules/'.$file.'/info.php');
43
			$template->set_var('VALUE', $file);
44
			$template->set_var('NAME', $module_name);
45
			$template->parse('module_list', 'module_list_block', true);
46
		}
38
$result = $database->query("SELECT * FROM ".TABLE_PREFIX."addons WHERE type = 'module'");
39
if($result->numRows() > 0) {
40
	while ($addon = $result->fetchRow()) {
41
		$template->set_var('VALUE', $addon['directory']);
42
		$template->set_var('NAME', $addon['name']);
43
		$template->parse('module_list', 'module_list_block', true);
47 44
	}
48 45
}
49 46

  

Also available in: Unified diff