diff options
author | jhunkeler <jhunkeler@c5b2fb0a-d05d-0410-98c8-828840a80ff6> | 2009-12-27 10:44:57 -0500 |
---|---|---|
committer | jhunkeler <jhunkeler@c5b2fb0a-d05d-0410-98c8-828840a80ff6> | 2009-12-27 10:44:57 -0500 |
commit | d526decc4884710ae7fafe7aa5171e7f59b24292 (patch) | |
tree | 12c07f3ef6ab9bf5a4f278a7b00720996c41667d /modules/index | |
parent | 07253dc75c69cf585ad39a218f3f2cf97b773987 (diff) | |
download | bayonetcms-d526decc4884710ae7fafe7aa5171e7f59b24292.tar.gz |
MySQL -> MySQLi
Fixed memory leaks after Fetching arrays
Removed all while loops that interfaced with $db->Fetch()
Rewrote RSS module
Fixed syntax error in donations module
Fixed link structure for news module
Reverting to old page display method
git-svn-id: http://svn.3rd-infantry-division.org/testing/branches/Bayonet CMS v2@402 c5b2fb0a-d05d-0410-98c8-828840a80ff6
Diffstat (limited to 'modules/index')
-rw-r--r-- | modules/index/index.php | 43 |
1 files changed, 21 insertions, 22 deletions
diff --git a/modules/index/index.php b/modules/index/index.php index 7d23bc6..9847cb5 100644 --- a/modules/index/index.php +++ b/modules/index/index.php @@ -7,29 +7,28 @@ * 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) +$result = $db->Query("SELECT `dir_name` FROM `bayonet_modules` ORDER BY `weight` ASC"); +$modules = $db->Fetch($result); +foreach($modules as $module) +{ + $indexModules[] = $module['dir_name']; +} + +foreach($indexModules as $module) +{ + if(file_exists("modules/" . $module)) { - $indexModules[] = $row['dir_name']; + include 'modules/' . $module . '/index.php'; + decho("Index module loaded: '$module'"); } - - foreach($indexModules as $module) - { - if(file_exists("modules/" . $module)) - { - include 'modules/' . $module . '/index.php'; - } - else - { - OpenContent(); - ReportError("Cannot load module '{$module}' directory.<br>\n"); - CloseContent(); - } - echo "<br />"; + else + { + OpenContent(); + ReportError("Cannot load module '{$module}' directory.<br>\n"); + CloseContent(); } -?>
\ No newline at end of file + echo "<br />"; +} + +?> |