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
33 33

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

  

Also available in: Unified diff