From ad6ba256efd1a65fb1bb3951ae6b17b1593205b7 Mon Sep 17 00:00:00 2001 From: jhunkeler Date: Tue, 29 Dec 2009 05:36:23 +0000 Subject: (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 --- admin/blocks/functions.php | 50 +++++++++++++++++++++++++++++++++++----------- 1 file changed, 38 insertions(+), 12 deletions(-) (limited to 'admin/blocks/functions.php') diff --git a/admin/blocks/functions.php b/admin/blocks/functions.php index 5194357..fadf610 100644 --- a/admin/blocks/functions.php +++ b/admin/blocks/functions.php @@ -1,7 +1,7 @@ Query("SELECT * FROM `bayonet_blocks` ORDER BY `active` DESC, `weight` ASC, `position`"); + $result = $db->Query("SELECT * FROM `bayonet_blocks` ORDER BY `position`, `active` DESC, `weight` ASC"); $blocks = $db->Fetch($result); - echo ""; + echo "
Existing Blocks
+ "; + echo ""; foreach($blocks as $block) { - echo ""; + echo ""; } echo "
Existing Blocks
WeightPositionNameActive
{$block['weight']} : {$block['dir_name']}EditDelete
{$block['weight']}"; + if($block['position']) + echo "Right"; + else + echo "Left"; + echo "{$block['title']}{$block['active']}EditDelete
"; } @@ -57,18 +64,19 @@ function NewBlock() } ?> + You are currently adding a new block

- - - - + + + + - +
Title
Weight
Position
Directory Name
Title
Weight
Position
Directory Name
Active
', "?op=blocks"); ?>
Query("UPDATE bayonet_blocks SET weight = '$weight', dir_name = '$dir_name', position = '$position', active = '$active' WHERE block_id = '$block_id'"); //$isActive = $active ? "IS" : "IS NOT"; - echo "Block, '$dir_name', at position '$weight' has been edited.\n"; + echo "Block, '$dir_name', at position '$weight'(order) has been edited.\n"; PageRedirect(3, "?op=blocks"); //die, because we have completed what we wanted to do. return; @@ -122,11 +130,12 @@ function EditBlock($block_id) $block = $db->FetchRow($result); ?> + You are currently editing the '' block

- + - +
Title
Weight
Position
Position
Directory Name
Active
', "?op=blocks"); ?>
"; + if(!$value){ + echo ""; + echo ""; + }else{ + echo ""; + echo ""; + } + echo ""; +} + ?> \ No newline at end of file -- cgit