diff options
Diffstat (limited to 'modules/admin')
-rw-r--r-- | modules/admin/blocks/functions.php | 12 | ||||
-rw-r--r-- | modules/admin/pages/functions.php | 19 |
2 files changed, 14 insertions, 17 deletions
diff --git a/modules/admin/blocks/functions.php b/modules/admin/blocks/functions.php index 660b8e7..0138839 100644 --- a/modules/admin/blocks/functions.php +++ b/modules/admin/blocks/functions.php @@ -21,10 +21,7 @@ function ListBlocks() {
global $db;
$result = $db->Query("SELECT * FROM bayonet_blocks");
- while(($rows = $db->fetch($result))!=false)
- {
- $blocks[] = $rows;
- }
+ $blocks = $db->Fetch();
echo "<table align=\"center\"><tr><th colspan=\"3\">Existing Blocks</th></tr>";
foreach($blocks as $block)
@@ -116,13 +113,16 @@ function EditBlock($block_id) }
//Grab the page from the database according to the $page_id passed to the function.
+ // {{{ XXX: FIXME -- Re-write this
+ /*
$result = $db->Query("SELECT weight,dir_name,position,active FROM bayonet_blocks WHERE block_id = '$block_id'");
while(($row = $db->Fetch($result))!=false)
{
//We only want one row, so we don't have to $block[]... No foreach necessary.
$block = $row;
}
-
+ */
+ // }}}
?>
<form action="<?php $_SERVER['PHP_SELF']?>" method="post">
<table align="center">
@@ -170,4 +170,4 @@ function DeleteBlock($block_id) <?php
}
-?>
\ No newline at end of file +?>
diff --git a/modules/admin/pages/functions.php b/modules/admin/pages/functions.php index 104a19a..fc97ffc 100644 --- a/modules/admin/pages/functions.php +++ b/modules/admin/pages/functions.php @@ -26,10 +26,7 @@ function ListArticles($pageid){ global $db;
$result = $db->Query("SELECT article_id,title FROM bayonet_articles WHERE `page_id` = $pageid ORDER BY `weight`");
- while(($row = $db->Fetch($result))!=false)
- {
- $articles[] = $row;
- }
+ $articles = $db->Fetch($result);
echo "<table class=\"cleartable\" width=\"100%\" cellspacing=\"0\">";
@@ -65,12 +62,16 @@ function EditArticle($article_id){ global $db;
//Grab the page from the database according to the $article_id passed to the function.
+ // {{{ XXX: FIXME -- Needs to be re-written
+ /*
$result = $db->Query("SELECT title,text FROM bayonet_articles WHERE article_id = '$article_id'");
while(($row = $db->Fetch($result))!=false)
{
//We only want one row, so we don't have to $article[]... No foreach necessary.
$article = $row;
- }
+ }
+ */
+ // }}}
?>
<form action="<?php $_SERVER['PHP_SELF'] ?>" method="post">
<table class="cleartable">
@@ -87,11 +88,7 @@ function EditArticle($article_id){ function ListPages($pid = NULL)
{
global $db;
- $result = $db->Query("SELECT page_id,title FROM bayonet_pages");
- while(($row = $db->Fetch($result))!=false)
- {
- $pages[] = $row;
- }
+ $pages = $db->Query("SELECT page_id,title FROM bayonet_pages");
echo 'Select page: <select id="pagenames" onchange="gotoEditPage(this.id)">';
echo '<option value="0">- - - - - - - -</option>';
@@ -227,4 +224,4 @@ function DeletePage($page_id) <?php
}
-?>
\ No newline at end of file +?>
|