diff options
author | jhunkeler <jhunkeler@c5b2fb0a-d05d-0410-98c8-828840a80ff6> | 2009-12-29 00:36:23 -0500 |
---|---|---|
committer | jhunkeler <jhunkeler@c5b2fb0a-d05d-0410-98c8-828840a80ff6> | 2009-12-29 00:36:23 -0500 |
commit | ad6ba256efd1a65fb1bb3951ae6b17b1593205b7 (patch) | |
tree | 19ffc9be7bbd6a542883a5e4dd889ed5c52e6b5e /includes | |
parent | 1b435e3b3a66d10b4dcc28d03e90b49d132ba7b5 (diff) | |
download | bayonetcms-ad6ba256efd1a65fb1bb3951ae6b17b1593205b7.tar.gz |
(OC)
Fixed includes/functions::GetBlocks() so that left and right are 0 and 1.
Also fixed the query so that it doesnt get every block, just the active blocks for the defined side.
Re-did some display on the admin side for blocks.
git-svn-id: http://svn.3rd-infantry-division.org/testing/branches/Bayonet CMS v2@408 c5b2fb0a-d05d-0410-98c8-828840a80ff6
Diffstat (limited to 'includes')
-rw-r--r-- | includes/functions.php | 24 |
1 files changed, 4 insertions, 20 deletions
diff --git a/includes/functions.php b/includes/functions.php index 05d6457..8a965c1 100644 --- a/includes/functions.php +++ b/includes/functions.php @@ -587,33 +587,18 @@ function UnderConstruction($message = NULL, $flag = BAYONET_SITE) */ define('BLOCK_LEFT',false); -define('BLOCK_RIGHT',false); +define('BLOCK_RIGHT',true); function GetBlocks($position = BLOCK_LEFT) { global $config; - /** - * I had to reconnect to the database for some fucking reason at this point. - * I have no idea why, but I was recieving errors telling me that $db was no longer - * an object. This is/was bullshit. - */ - $db = new Bayonet_SQL(); - $db->Connect( - $config['sql']['hostname'], - $config['sql']['username'], - $config['sql']['password'] - ); - $db->Select_db($config['sql']['database']); + global $db; - $result = $db->Query("SELECT * FROM `bayonet_blocks` ORDER BY weight, position"); - //$result = mysql_query("SELECT * FROM bayonet_blocks ORDER BY weight, position"); + $result = $db->Query("SELECT * FROM `bayonet_blocks` WHERE `position` = '$position' AND `active` = 1 ORDER BY weight"); $blocks = $db->Fetch($result); - $blocks[] = $row; - + decho($blocks); foreach($blocks as $block) { - if($block['position'] == $position && $block['active'] == true) - { $load = 'blocks/'.$block['dir_name'].'/index.php'; if(file_exists($load)) { @@ -627,7 +612,6 @@ function GetBlocks($position = BLOCK_LEFT) ReportError("Failed to load block, '{$block['dir_name']}'. Check block config."); } if($config['blocks']['spacer']) echo "<br />"; - } } } ?>
\ No newline at end of file |