diff options
author | jhunkeler <jhunkeler@c5b2fb0a-d05d-0410-98c8-828840a80ff6> | 2009-12-20 13:38:08 -0500 |
---|---|---|
committer | jhunkeler <jhunkeler@c5b2fb0a-d05d-0410-98c8-828840a80ff6> | 2009-12-20 13:38:08 -0500 |
commit | be4f83cd2a17a0ec05f5bce50c91befaafaa6e0c (patch) | |
tree | 6f20672cf5df66044b3fa9dd71fc3bcdc484abe6 /modules/page | |
parent | 1a619f2638a4f77fb8ea9557edeefb883d8c06f8 (diff) | |
download | bayonetcms-be4f83cd2a17a0ec05f5bce50c91befaafaa6e0c.tar.gz |
Test.
git-svn-id: http://svn.3rd-infantry-division.org/testing/branches/Bayonet CMS v2@376 c5b2fb0a-d05d-0410-98c8-828840a80ff6
Diffstat (limited to 'modules/page')
-rw-r--r-- | modules/page/index.php | 71 |
1 files changed, 71 insertions, 0 deletions
diff --git a/modules/page/index.php b/modules/page/index.php new file mode 100644 index 0000000..e5ac25e --- /dev/null +++ b/modules/page/index.php @@ -0,0 +1,71 @@ +<?php +/** + * Bayonet Content Management System + * Copyright (C) 2008 Joseph Hunkeler + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see <http://www.gnu.org/licenses/>. + */ + +define("MODULE_FAIL", "You cannot access this module directly.<br/>\n",true); + +if(!defined("MODULE_FILE")) +{ + die(MODULE_FAIL); +} + +global $db; + + +if(!isset($_GET['id'])) +{ + //ReportError("No page has been requested.<br>\n"); + // return 1; + $id = 1; //makes it so that the default page is the home page +}else{ + $id = $_GET['id']; +} + +$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); + +if($proceed > 0) +{ + while(($row = $db->Fetch($result))!==false) + { + $page = $row; + OpenTable(); + 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>'; + //echo "<h3>".$article['title']."</h3>"; + echo BBCode($article['text']); + } + echo "</div>"; + CloseTable(); + + } + ?> + <?php // echo bbcode_format($page['text']) ?> + <!-- <tr><th><?php echo $page['author'] ?></th></tr> --> + <?php +} +else +{ + ReportError("Page does not exist.<br>\n"); +} + +?>
\ No newline at end of file |