aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorthirdid <thirdid@c5b2fb0a-d05d-0410-98c8-828840a80ff6>2010-01-26 22:43:13 -0500
committerthirdid <thirdid@c5b2fb0a-d05d-0410-98c8-828840a80ff6>2010-01-26 22:43:13 -0500
commit0f4a3b1b086b4bfc9217def70f8049f9eeb75672 (patch)
tree08b1fc4317e7fd2f14122b1cf4833bf14f420103
parent88d5d2af84cde0ce1107551fd2a61455e493b7c8 (diff)
downloadbayonetcms-0f4a3b1b086b4bfc9217def70f8049f9eeb75672.tar.gz
Directory structure changes (may continue for several revisions)
git-svn-id: http://svn.3rd-infantry-division.org/testing/branches/Bayonet CMS v2.1@466 c5b2fb0a-d05d-0410-98c8-828840a80ff6
-rw-r--r--index.php162
-rw-r--r--themes/default/footer.php53
-rw-r--r--themes/default/header.php55
-rw-r--r--themes/default/include/default.ini2
-rw-r--r--themes/default/include/style.css252
-rw-r--r--themes/default/include/style_bbcode.css71
-rw-r--r--themes/default/index.php61
-rw-r--r--themes/default/navigation.php24
8 files changed, 608 insertions, 72 deletions
diff --git a/index.php b/index.php
index 0cc230a..9d09f48 100644
--- a/index.php
+++ b/index.php
@@ -1,72 +1,90 @@
-<?php
-/**
- * Bayonet Conent Management System
- * Copyright (C) Joseph Hunkeler & Evan O'Connell
- *
- * Purpose of this software is to allow users to manage their website
- * with ease and without needing to have any coding knowledge in order
- * to maintain it. Visit [link] for any updates or feedback.
- */
-
-/* Begin try/catch block */
-try {
-
-include './includes/config.php';
-include './includes/debug.php';
-include './includes/sql.class.php';
-include './includes/functions.php';
-
-/* Setup error handing callbacks */
-ob_start("fatal_error_handler");
-set_error_handler("handle_error");
-
-$db = new Bayonet_SQL();
-$db->Connect(
- $config['sql']['hostname'],
- $config['sql']['username'],
- $config['sql']['password']
- );
-$db->Select_db($config['sql']['database']);
-
-include 'header.php';
-//session_start();
-?>
-
-<div class="container">
-
-<!-- banner -->
- <div class="banner"><a href="index.php"><img src="images/logo.jpg" alt="3rd Infantry Division - ArmAII Unit" /></a></div>
-<!-- navigation -->
- <div class="nav"><?php require_once 'navigation.php'; ?></div>
-
-<!-- content -->
-<table border="0" cellspacing="15px" cellpadding="0" class="main" width="100%">
- <tr>
- <td class="midcol">
- <?php require_once 'modules.php'; ?>
- </td>
-
- <!-- block area RIGHT -->
- <?php if(!defined('BLOCK_RIGHT_DISABLE')): ?>
- <td class="rightcol">
- <?php GetBlocks(BLOCK_RIGHT); ?>
- </td>
- <?php endif; ?>
-
- </tr>
-</table>
-
-</div>
-<?php include 'footer.php'; ?>
-<?php
-/* Flushing is needed by the error handler */
-ob_end_flush();
-
-} //try ^^
-catch(Exception $e)
-{
- ReportError(
- "<style>td.short{width:100%;}</style><table style=\"width:0;\"><tr><th>Code</th>" . "<td class=\"short\">" . $e->getCode() . "</td>" . "</tr><tr><th>In File</th>" . "<td class=\"short\">" . $e->getFile() . "</td>" . "</tr></table>" . $e->getLine() . " - " . $e->getMessage() . "<br/>"
- );
-}
-?>
+<?php
+
+define('BAYONET_ROOT', basename(dirname('.')));
+define('BAYONET_INCLUDE', BAYONET_ROOT . '/include');
+define('BAYONET_CONFIG', 'include/config.ini');
+
+require_once BAYONET_CONFIG;
+require BAYONET_INCLUDE . '/config.php';
+require BAYONET_INCLUDE . '/debug.php';
+require BAYONET_INCLUDE . '/sql.class.php';
+require BAYONET_INCLUDE . '/functions.php';
+
+$db = new Bayonet_SQL();
+$db->Connect(
+ $config['sql']['hostname'],
+ $config['sql']['username'],
+ $config['sql']['password']
+ );
+$db->Select_db($config['sql']['database']);
+
+class Bayonet_Theme
+{
+ static public $index;
+ static public $header;
+ static public $footer;
+
+ static public $name;
+ static public $root_path;
+ static public $include_path;
+ static public $image_path;
+ static public $config;
+ static public $primary_css;
+
+ static function init()
+ {
+ self::$name = Bayonet_Config::$ini['Theme']['name'];
+ decho('Initializing theme variables for \'' . self::$name . '\'');
+ self::$root_path = dirname(BAYONET_ROOT) . '/themes/' . self::$name;
+ self::$include_path = self::$root_path . '/include';
+ self::$image_path = self::$root_path . '/images';
+ self::$primary_css = self::$include_path . '/' . self::$name . '.css';
+ self::$config = parse_ini_file(self::$include_path . '/' . self::$name . '.ini', true);
+
+ self::$index = self::$root_path . '/index.php';
+ self::$header = self::$root_path . '/header.php';
+ self::$footer = self::$root_path . '/footer.php';
+
+ decho(get_class_vars(Bayonet_Theme));
+ self::load();
+ }
+
+ static function load()
+ {
+ global $db;
+ decho("Loading theme: '" . self::$name . "'");
+ require self::$index;
+ }
+}
+
+class Bayonet_Config
+{
+ static $ini;
+ static function init()
+ {
+ decho('Parsing configuration data');
+ if(file_exists(BAYONET_CONFIG))
+ {
+ self::$ini = parse_ini_file(BAYONET_CONFIG, true);
+ decho(self::$ini);
+ }
+ else
+ die(BAYONET_CONFIG . ' not found');
+ }
+}
+
+class Bayonet
+{
+ static function init()
+ {
+ decho('Initializing Bayonet');
+ Bayonet_Config::init();
+ Bayonet_Theme::init();
+ }
+}
+
+
+Bayonet::init();
+
+
+?> \ No newline at end of file
diff --git a/themes/default/footer.php b/themes/default/footer.php
new file mode 100644
index 0000000..cbbd2bd
--- /dev/null
+++ b/themes/default/footer.php
@@ -0,0 +1,53 @@
+<?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/>.
+ */
+
+$phpversion = preg_replace('/[a-z-]/', '', phpversion());
+$mtime = explode(' ', microtime());
+$totaltime = $mtime[0] + $mtime[1] - $starttime;
+$debug_output = sprintf("Page generated in %.3f seconds | Memory: real(%.3fmb) peak(%.3fmb) | PHP: %s<br/>Connections: %d | Queries: %d | Fetches: %d | Frees: %d<br/>\n",
+ $totaltime, ((float)memory_get_usage()/1024/1024), ((float)memory_get_peak_usage()/1024/1024), $phpversion, $db_connections, $db_queries, $db_fetches, $db_frees);
+?>
+
+<div class="footer">
+
+ <br />
+ <span class="footer-text">
+ All logos and trademarks on this site are property of their respective owner. The comments are property of their posters, all the rest &copy; 2001-<?php echo date('Y'); ?> 3rd Infantry Division.</span>
+
+ <br /><br />
+
+ <a href="admin/">Administrative Control Panel</a><br />
+<?php echo $config['product']['name'] . ' ' . $config['product']['version'] . ' ' . $config['product']['release'] ?><br />
+<?php echo $config['product']['copyright']; ?><br />
+<?php if($config['debug']['enabled']) echo $debug_output ?><br />
+
+<a href="http://www.dreamhost.com/r.cgi?145892" target="_blank"><img src="http://www.dreamhost.com/images/rewards/80x15-e.png" /></a><br /><br />
+
+</div>
+
+<?php
+ if($config['debug']['enabled']){
+ logQueueFlush();
+ }
+?>
+
+</body>
+</html>
+<?php ob_flush();?>
+ \ No newline at end of file
diff --git a/themes/default/header.php b/themes/default/header.php
new file mode 100644
index 0000000..b0dba31
--- /dev/null
+++ b/themes/default/header.php
@@ -0,0 +1,55 @@
+<?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/>.
+ */
+
+global $config;
+ob_start();
+$starttime = explode(' ', microtime());
+$starttime = $starttime[1] + $starttime[0];
+?>
+
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
+ "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en-US" lang="en-US" dir="ltr">
+
+<head>
+<title>3rd Infantry Division - 8 years strong - ArmaII Unit</title>
+<meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
+<?php if(isset($config['site']['favicon'])): ?>
+<!--<link rel="shortcut icon" href="<?php echo $config['site']['favicon']; ?>" type="image/x-icon" />-->
+<link rel="shortcut icon" href="<?php echo $config['site']['favicon']; ?>" type="image/png" />
+<?php endif; ?>
+<link rel="stylesheet" type="text/css" href="<?php echo self::$include_path . '/style.css'; ?>" media="screen"/>
+<link rel="stylesheet" type="text/css" href="<?php echo self::$include_path . '/style_bbcode.css'; ?>" media="screen"/>
+
+<script type="text/javascript" src="functions.js"></script>
+
+<!-- jQuery -->
+<script type="text/javascript" src="markitup/jquery.pack.js"></script>
+<!-- markItUp! -->
+<script type="text/javascript" src="markitup/markitup/jquery.markitup.pack.js"></script>
+<!-- markItUp! toolbar settings -->
+<script type="text/javascript" src="markitup/markitup/sets/bbcode/set.js"></script>
+<!-- markItUp! skin -->
+<link rel="stylesheet" type="text/css" href="markitup/markitup/skins/markitup/style.css" />
+<!-- markItUp! toolbar skin -->
+<link rel="stylesheet" type="text/css" href="markitup/markitup/sets/bbcode/style.css" />
+
+</head>
+
+<body> \ No newline at end of file
diff --git a/themes/default/include/default.ini b/themes/default/include/default.ini
new file mode 100644
index 0000000..223cd14
--- /dev/null
+++ b/themes/default/include/default.ini
@@ -0,0 +1,2 @@
+[author]
+name = "Joseph Hunkeler" \ No newline at end of file
diff --git a/themes/default/include/style.css b/themes/default/include/style.css
new file mode 100644
index 0000000..103c21b
--- /dev/null
+++ b/themes/default/include/style.css
@@ -0,0 +1,252 @@
+ /*********************************
+ ** Layout Styles **
+ *********************************/
+ div.container {
+ width: 990px;
+ /* width: 1000px; */
+ color: #000000;
+ margin: auto auto;
+ text-align: left; /* IE 5 fix */
+ }
+ div.banner {
+ /* width: 990px; */
+ text-align:center;
+ /* margin: auto auto; */
+ }
+ div.nav {
+ /*width: 990px; */
+ height: 28px;
+ background: #284c75;
+ background-image:url('images/navbackground.jpg');
+ color: #000000;
+ text-align:center;
+ /* margin: auto auto; */
+ font-size:14px;
+ }
+ table.main {
+ background-image:url('images/sandbackground.jpg');
+ padding: 0px;
+ color:#ffffff;
+ width:990px;
+ /*width: 1134px; */
+ /* width: 1234px; */
+ margin: auto auto;
+ background-color:#a3a2a0;
+ }
+
+ table.main td {
+ /* color:white; */
+ }
+ td.midcol {
+ width: 644px;
+ background-color:transparent;
+ vertical-align:top;
+ }
+ td.rightcol {
+ vertical-align:top;
+ }
+ td.leftcol {
+ width: 275px;
+ vertical-align:top;
+ }
+ div.footer {
+ text-align:center;
+ font-family:verdana;
+ font-size:10pt;
+ color:#5e5e5e;
+ background-color:#333333;
+ border-top: 1px solid #5e5e5e;
+ }
+
+ /*********************************
+ ** Content Styles **
+ *********************************/
+ div.contentBorder1 {
+ background-color:white;
+ border:1px solid #3666ba;
+ }
+ div.contentBorder2 {
+ background-color:white;
+ border:1px solid #333333;
+ }
+ div.contentHeading {
+ background-image:url(images/blockbackground.jpg);
+ background-repeat:repeat-x;
+ background-color:#112f50;
+ height:25px;
+ padding-left:10px;
+ padding-right:10px;
+ padding-top:5px;
+ color:white;
+ }
+ div.content {
+ padding:10px;
+ color:#333333;
+ /*background-color:#383838;
+ color:white; */
+ background-color:#f1f1f1;
+ }
+ div.content img {
+ padding:10px;
+ }
+ div.contentFooter {
+ border-top:1px solid #333333;
+ background-color:#a4a4a4;
+ color:white;
+ padding-left:5px;
+ padding-right:5px;
+ }
+ span.footer-text {
+ font-size: 10px;
+ }
+
+ /*********************************
+ ** Nav Links Styles **
+ *********************************/
+ table.navLinks a, table.navLinks a:visited, table.navLinks a:active {
+ background-color:transparent;
+ color:white;
+ font-family:verdana;
+ font-size:11px;
+ font-weight:bold;
+ text-decoration:none;
+ }
+
+ table.navLinks a:hover, table.navLinks a:visited:hover {
+ background-color:transparent;
+ color:#d2d2d2;
+ font-size:11px;
+ font-weight:bold;
+ text-decoration:none;
+ }
+
+ table.navLinks {
+ height:25px;
+ }
+
+ table.navLinks td {
+ border-right: 1px solid #213f61;
+ vertical-align:middle;
+ }
+
+ /*********************************
+ ** Misc. Styles **
+ *********************************/
+
+ h1, h2, h3, h4, h5, h6 {
+ font-family: Helvetica, Arial, sans-serif;
+ font-weight: normal;
+ }
+ table, tr, td {
+ padding:0px;
+ border:0px;
+ margin:0px
+ }
+ body, td, div {
+ font-size:10pt;
+ /* color:black; */
+ font-family:verdana;
+ font-weight:normal;
+ }
+ a, a:visited, a:active {
+ background-color:transparent;
+ color:#3666ba;
+ font-family:verdana;
+ font-size:12px;
+ text-decoration:none;
+ }
+
+ a:hover, a:visited:hover {
+ background-color:transparent;
+ color:#3666ba;
+ font-family:verdana;
+ font-size:12px;
+ text-decoration:underline;
+ }
+ a.rudi_roster, a.rudi_roster:visited, a.rudi_roster:active, a.rudi_roster:hover {
+ color:#2b5bae;
+ }
+ body {
+ background-color:#091a34;
+ margin:0;
+ padding:0;
+ text-align:left;
+ }
+ a img {
+ border:0px;
+ }
+ form {
+ margin:0;
+ }
+ tr.rownorm{
+ background-color:white;
+
+ }
+ tr.rowhigh{
+ background-color:#e0e0e0;
+ }
+ /* photo gallery styles */
+ .photoleft{
+ background-image:url("images/photoleft.png");
+ background-repeat:repeat-y;
+ text-align:center;
+ width:49px;
+ }
+ .photoright{
+ background-image:url("images/photoright.png");
+ background-repeat:repeat-y;
+ text-align:center;
+ width:49px;
+ }
+ /* end photo gallery styles */
+
+ /* stuff we might need in order to add drop shadows */
+
+ div.topbar {
+ height:25px;
+ text-align:center;
+ background-color:black;
+ font-family:verdana;
+ font-size:10pt;
+ color:#797e4f;
+ }
+ div.botbar {
+ height:50px;
+ padding:5px;
+ text-align:center;
+ background-color:black;
+ font-family:verdana;
+ font-size:10pt;
+ }
+ /* may need these two when we add the background images back */
+ .leftbar {
+ /* background-image:url("images/leftshadow.png"); */
+ background-repeat:
+ repeat-y;
+ width:50px;
+ }
+ .rightbar {
+ /* background-image:url("images/rightshadow.png"); */
+ background-repeat:
+ repeat-y;
+ width:15px;
+ }
+
+
+ .left{
+ text-align:left;
+ }
+ .right{
+ text-align:right;
+ }
+ .center{
+ text-align:center;
+ }
+ .title{
+ font-size:14px;
+ font-weight:bold;
+ font-family:arial;
+ }
+
+
+
diff --git a/themes/default/include/style_bbcode.css b/themes/default/include/style_bbcode.css
new file mode 100644
index 0000000..7299c06
--- /dev/null
+++ b/themes/default/include/style_bbcode.css
@@ -0,0 +1,71 @@
+.bold {
+ font-weight: bold;
+}
+
+.italics {
+ font-style: italic;
+}
+
+.underline {
+ text-decoration: underline;
+}
+
+.strikethrough {
+ text-decoration: line-through;
+}
+
+.overline {
+ text-decoration: overline;
+}
+
+.quotecodeheader {
+ font-family: Verdana, arial, helvetica, sans-serif;
+ font-size: 12px;
+ font-weight: bold;
+}
+
+.codebody {
+ background-color: #FFFFFF;
+ font-family: Courier new, courier, mono;
+ font-size: 12px;
+ color: #006600;
+ border: 1px solid #BFBFBF;
+}
+
+.quotebody {
+ background-color: #FFFFFF;
+ font-family: Courier new, courier, mono;
+ font-size: 12px;
+ color: #660002;
+ border: 1px solid #BFBFBF;
+}
+
+.listbullet {
+ list-style-type: disc;
+ list-style-position: inside;
+}
+
+.listdecimal {
+ list-style-type: decimal;
+ list-style-position: inside;
+}
+
+.listlowerroman {
+ list-style-type: lower-roman;
+ list-style-position: inside;
+}
+
+.listupperroman {
+ list-style-type: upper-roman;
+ list-style-position: inside;
+}
+
+.listloweralpha {
+ list-style-type: lower-alpha;
+ list-style-position: inside;
+}
+
+.listupperalpha {
+ list-style-type: upper-alpha;
+ list-style-position: inside;
+}
diff --git a/themes/default/index.php b/themes/default/index.php
new file mode 100644
index 0000000..1004e0a
--- /dev/null
+++ b/themes/default/index.php
@@ -0,0 +1,61 @@
+<?php
+/**
+ * Bayonet Conent Management System
+ * Copyright (C) Joseph Hunkeler & Evan O'Connell
+ *
+ * Purpose of this software is to allow users to manage their website
+ * with ease and without needing to have any coding knowledge in order
+ * to maintain it. Visit [link] for any updates or feedback.
+ */
+
+/* Begin try/catch block */
+try {
+
+/* Setup error handing callbacks */
+ob_start("fatal_error_handler");
+set_error_handler("handle_error");
+
+
+
+include self::$header;
+//session_start();
+?>
+
+<div class="container">
+
+<!-- banner -->
+ <div class="banner"><a href="index.php"><img src="<?php echo self::$image_path . '/logo.jpg'; ?>" alt="3rd Infantry Division - ArmAII Unit" /></a></div>
+<!-- navigation -->
+ <div class="nav"><?php require_once self::$root_path . '/navigation.php'; ?></div>
+
+<!-- content -->
+<table border="0" cellspacing="15px" cellpadding="0" class="main" width="100%">
+ <tr>
+ <td class="midcol">
+ <?php require_once 'modules.php'; ?>
+ </td>
+
+ <!-- block area RIGHT -->
+ <?php if(!defined('BLOCK_RIGHT_DISABLE')): ?>
+ <td class="rightcol">
+ <?php GetBlocks(BLOCK_RIGHT); ?>
+ </td>
+ <?php endif; ?>
+
+ </tr>
+</table>
+
+</div>
+<?php include self::$footer; ?>
+<?php
+/* Flushing is needed by the error handler */
+ob_end_flush();
+
+} //try ^^
+catch(Exception $e)
+{
+ ReportError(
+ "<style>td.short{width:100%;}</style><table style=\"width:0;\"><tr><th>Code</th>" . "<td class=\"short\">" . $e->getCode() . "</td>" . "</tr><tr><th>In File</th>" . "<td class=\"short\">" . $e->getFile() . "</td>" . "</tr></table>" . $e->getLine() . " - " . $e->getMessage() . "<br/>"
+ );
+}
+?>
diff --git a/themes/default/navigation.php b/themes/default/navigation.php
new file mode 100644
index 0000000..5765712
--- /dev/null
+++ b/themes/default/navigation.php
@@ -0,0 +1,24 @@
+<?php
+/**
+ * Bayonet Conent Management System
+ * Copyright (C) Joseph Hunkeler & Evan O'Connell
+ *
+ * Purpose of this software is to allow users to manage their website
+ * with ease and without needing to have any coding knowledge in order
+ * to maintain it. Visit www.eodesign.com/cms for any updates or feedback.
+ */
+ ?>
+<table border="0" cellspacing="0" class="navLinks">
+ <tr>
+ <td>&nbsp;&nbsp;<a href="index.php">HOME</a>&nbsp;&nbsp;</td>
+<?php
+
+ $result = $db->Query("SELECT * FROM `bayonet_navigation` ORDER BY `weight`");
+ $nav = $db->Fetch($result);
+
+ foreach ($nav as $link) {
+ echo '<td>&nbsp;&nbsp;<a href="' . str_replace('&', '&amp;', $link['link']) . '">' . strtoupper($link['title']) . '</a>&nbsp;&nbsp;</td>';
+ }
+ ?>
+ </tr>
+</table>