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/page/index.php | |
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/page/index.php')
-rw-r--r-- | modules/page/index.php | 37 |
1 files changed, 17 insertions, 20 deletions
diff --git a/modules/page/index.php b/modules/page/index.php index abf559f..1f72925 100644 --- a/modules/page/index.php +++ b/modules/page/index.php @@ -35,12 +35,8 @@ if(isset($_GET['list'])) { if($_GET['list'] == "true") { - $result = $db->Query("SELECT title, page_id FROM bayonet_articles"); - while(($row = $db->Fetch($result)) !== false) - { - $pages[] = $row; - } - mysql_free_result($result); + $results = $db->Query("SELECT title, page_id FROM bayonet_articles"); + $pages = $db->Fetch($results); OpenContent(); echo "<div class=\"contentHeading\">Page Map</div>"; @@ -68,28 +64,29 @@ if(!isset($_GET['id'])) $id = $_GET['id']; } +// {{{ XXX: FIXME -- Needs to be re-written + $result = $db->Query("SELECT u.username AS author, p.page_created, p.title, p.text FROM `bayonet_pages` AS p LEFT OUTER JOIN `bayonet_users` AS u ON u.user_id = p.author_id WHERE p.page_id = '$id'"); -$proceed = mysql_num_rows($result); +$proceed = $db->Rows($result); if($proceed > 0) { - while(($row = $db->Fetch($result))!==false) - { - $page = $row; + $pages = $db->Fetch($result); OpenContent(); echo "<div class=\"content\">"; - $aresult = $db->Query("SELECT * FROM `bayonet_articles` WHERE `page_id` = $id ORDER BY `weight` ASC"); - while(($article = $db->Fetch($aresult))!==false) - { - $articleTitle = $article['title']; - echo '<h2>'.$articleTitle.'</h2>'; + //$aresult = $db->Query("SELECT * FROM `bayonet_page` WHERE `page_id` = $id ORDER BY `weight` ASC"); + //$article = $db->Fetch($aresult); + foreach($pages as $page) + { + echo '<h2>'.$page['title'].'</h2>'; //echo "<h3>".$article['title']."</h3>"; - echo bbcode_format($article['text']); - } - echo "</div>"; + echo bbcode_format($page['text']); + echo "</div>"; + } + CloseContent(); - } + ?> <?php // echo bbcode_format($page['text']) ?> <!-- <tr><th><?php echo $page['author'] ?></th></tr> --> @@ -100,4 +97,4 @@ else ReportError("Page does not exist.<br>\n"); } -?>
\ No newline at end of file +?> |