From be4f83cd2a17a0ec05f5bce50c91befaafaa6e0c Mon Sep 17 00:00:00 2001 From: jhunkeler Date: Sun, 20 Dec 2009 18:38:08 +0000 Subject: Test. git-svn-id: http://svn.3rd-infantry-division.org/testing/branches/Bayonet CMS v2@376 c5b2fb0a-d05d-0410-98c8-828840a80ff6 --- modules/page/index.php | 71 ++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 71 insertions(+) create mode 100644 modules/page/index.php (limited to 'modules/page') 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 @@ +. + */ + +define("MODULE_FAIL", "You cannot access this module directly.
\n",true); + +if(!defined("MODULE_FILE")) +{ + die(MODULE_FAIL); +} + +global $db; + + +if(!isset($_GET['id'])) +{ + //ReportError("No page has been requested.
\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 "
"; + $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 '

'.$articleTitle.'

'; + //echo "

".$article['title']."

"; + echo BBCode($article['text']); + } + echo "
"; + CloseTable(); + + } + ?> + + + \n"); +} + +?> \ No newline at end of file -- cgit