aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--admin/news/functions.php125
-rw-r--r--admin/news/index.php62
-rw-r--r--admin/newsreel/functions.php2
-rw-r--r--admin/newsreel/index.php1
-rw-r--r--admin/style.css2
-rw-r--r--includes/debug.php38
-rw-r--r--modules/newsreel/slides/arma2move.pngbin409510 -> 409863 bytes
-rw-r--r--modules/newsreel/slides/newsite.pngbin251196 -> 251441 bytes
8 files changed, 186 insertions, 44 deletions
diff --git a/admin/news/functions.php b/admin/news/functions.php
index 0e82bc0..a098e46 100644
--- a/admin/news/functions.php
+++ b/admin/news/functions.php
@@ -1,20 +1,107 @@
-<?php
-/**
- * Bayonet Content Management System
- * Copyright (C) 2008 Joseph Hunkeler & Evan O'Connell
- *
- * 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/>.
- */
-
+<?php
+/**
+ * Bayonet Content Management System
+ * Copyright (C) 2008 Joseph Hunkeler & Evan O'Connell
+ *
+ * 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/>.
+ */
+
+function EditNews($news_id){
+
+ global $db;
+
+ if(isset($_POST['processed'])){
+
+
+ return;
+ }
+
+ $result = $db->Query("SELECT `author_id`, `title`, `message`, `date`, `category_id` FROM `bayonet_news` WHERE `news_id` = '$news_id' LIMIT 1");
+ $row = $db->Fetch($result);
+
+ ?>
+ <h3>Edit Event</h3>
+ <form action="<?php $_SERVER['PHP_SELF']?>" method="post">
+ <table>
+ <tr><th>Author</th><td><?php SelectAuthor($row['author_id']); ?></td></tr>
+ <tr><th>Title</th><td><input type="text" name="title" value="<?php echo $row['title']; ?>" /></td></tr>
+ <tr><th>Date</th><td><?php SelectDate($row['date']); ?></td></tr>
+ <tr><th>Time</th><td><input type="text" name="time" value="<?php echo substr($row['time'],0,-3); ?>" maxlength="5" size="5" /></td></tr>
+ <tr><th>Text</th><td><textarea id="markItUp" rows="30" cols="80" name="text"><?php echo $row['message']; ?></textarea></td>
+ <tr><th colspan="2"><input type="submit" name="processed" value="Submit" /></th></tr>
+ </table>
+ </form>
+ <?php
+}
+
+ /**
+ * SelectDate($date)
+ * Function for outputing an html form for selecting a month day and year
+ * @param date - formatted date string yyyy-mm-dd (optional)
+ */
+ function SelectDate($date = NULL){
+
+ $date_arr = date_parse($date); //returns an associative array $array['year']
+
+ //List Months
+ echo '<select name="month">';
+ for($m = 1;$m <= 12; $m++){
+ $month = date("F", mktime(0, 0, 0, $m));
+ if($date_arr['month'] == $m)
+ echo "<option value='$m' selected=\"selected\">$month</option>";
+ else
+ echo "<option value='$m'>$month</option>";
+ }
+ echo "</select>";
+
+ //List Days
+ echo '<select name="day">';
+ for($d = 1;$d <= 31; $d++){
+ if($date_arr['day'] == $d)
+ echo "<option value='$d' selected=\"selected\">$d</option>";
+ else
+ echo "<option value='$d'>$d</option>";
+ }
+ echo "</select>";
+
+ //List Years [CurYear, CurYear+5]
+ echo '<select name="year">';
+ $y = date('Y', time());
+ $max = $y+5;
+ for(;$y<$max; $y++){
+ if($date_arr['year'] == $y)
+ echo "<option value='$y' selected=\"selected\">$y</option>";
+ else
+ echo "<option value='$y'>$y</option>";
+ }
+ echo "</select>";
+
+ }
+
+ function SelectAuthor($author_id){
+
+ global $db;
+
+ echo "<select name=\"author\">";
+ $result = $db->Query("SELECT `user_id`, `lastname` FROM `bayonet_users` WHERE `active` = 1 ORDER BY `username` ASC");
+ while(($row = $db->Fetch($result))!= false){
+ if($author_id == $row['user_id'])
+ echo "<option value=\"{$row['user_id']}\" selected>{$row['lastname']}</option>";
+ else
+ echo "<option value=\"{$row['user_id']}\">{$row['lastname']}</option>";
+ }
+ echo "</select>";
+ }
+
?> \ No newline at end of file
diff --git a/admin/news/index.php b/admin/news/index.php
index 6448e4b..2b7dca1 100644
--- a/admin/news/index.php
+++ b/admin/news/index.php
@@ -1,24 +1,38 @@
-<?php
-/**
- * Bayonet Content Management System
- * Copyright (C) 2008 Joseph Hunkeler & Evan O'Connell
- *
- * 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/>.
- */
-
-if(!defined("ADMIN_FILE"))
-{
- die("Access denied.");
-}
- ?> \ No newline at end of file
+<?php
+/**
+ * Bayonet Content Management System
+ * Copyright (C) 2008 Joseph Hunkeler & Evan O'Connell
+ *
+ * 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/>.
+ */
+
+if(!defined("ADMIN_FILE"))
+{
+ die("Access denied.");
+}
+
+include $basedir.'news/functions.php';
+
+echo "<table class=\"panel\" width=\"100%\">
+ <tr><td class=\"panel\">";
+
+if(isset($_GET['edit'])){
+ $news_id = $_GET['edit'];
+ EditNews($news_id);
+ return;
+}
+
+
+?>
+ </td></tr></table> \ No newline at end of file
diff --git a/admin/newsreel/functions.php b/admin/newsreel/functions.php
index 583e719..8423b9b 100644
--- a/admin/newsreel/functions.php
+++ b/admin/newsreel/functions.php
@@ -16,6 +16,7 @@ ul {
border: #CCCCCC solid 1px;
color:#fff;
text-align:center;
+ cursor:move;
}
</style>
@@ -105,6 +106,7 @@ $(document).ready(function(){
function ListInactive(){
global $db;
+ echo "<h3>Disabled Slides</h3>";
$result = $db->query("SELECT `slide_id`, `title`, `src` FROM `bayonet_newsreel` WHERE `visible` = 0 ORDER BY `slide_id` DESC");
while(($row = $db->fetch($result))!= false){
diff --git a/admin/newsreel/index.php b/admin/newsreel/index.php
index a12eed2..35bed28 100644
--- a/admin/newsreel/index.php
+++ b/admin/newsreel/index.php
@@ -24,6 +24,7 @@ if(!defined("ADMIN_FILE"))
include $basedir.'newsreel/functions.php';
?>
+ <div style="text-align:left;"><h2>- Manage News Reel</h2></div>
<table class="panel" width="100%">
<tr>
<td class="panel"><?php EditOrder(); ?></td>
diff --git a/admin/style.css b/admin/style.css
index 19ad293..f81da65 100644
--- a/admin/style.css
+++ b/admin/style.css
@@ -24,7 +24,7 @@ a:hover {
}
h1, h2, h3, h4, h5, h6 {
- font-family: 'Century Gothic';
+ /* font-family: 'Century Gothic'; */
font-weight: normal;
}
h2 {
diff --git a/includes/debug.php b/includes/debug.php
index abafd2d..6ed4ad4 100644
--- a/includes/debug.php
+++ b/includes/debug.php
@@ -25,6 +25,44 @@ define('REPEAT','repeat');
static $last_message = NULL;
static $last_message_count = 0;
+static $log_message_last = 0;
+static $log_message_queue = array();
+static $log_message_pos = 0;
+function decho2($message)
+{
+ global $log_message_last, $log_message_queue;
+ $log_message_last_count = 0;
+
+ if($log_message_queue[$log_message_pos] !== $log_message_last)
+ {
+ array_push($log_message_queue, $message);
+ $log_message_pos++;
+ }
+ else
+ {
+ $log_message_last_count++;
+ if($log_message_last_count > 3)
+ {
+ echo "Previous message recieved $log_message_last_count times<br/>\n";
+ $log_message_last_count = 0;
+ }
+ }
+}
+
+function logQueueFlush()
+{
+ global $log_message_queue;
+ $messageCount = 0;
+ echo "<div class=\"contentHeading\">Bayonet Debug Messages</div>";
+ echo "<div class=\"content\">";
+ foreach($log_message_queue as $message)
+ {
+ echo "{$messageCount}: $message<br/>\n";
+ $messageCount++;
+ }
+ echo "</div>";
+}
+
function decho($message, $flag = REPEAT)
{
global $last_message, $last_message_count;
diff --git a/modules/newsreel/slides/arma2move.png b/modules/newsreel/slides/arma2move.png
index 7c7c419..6bffbae 100644
--- a/modules/newsreel/slides/arma2move.png
+++ b/modules/newsreel/slides/arma2move.png
Binary files differ
diff --git a/modules/newsreel/slides/newsite.png b/modules/newsreel/slides/newsite.png
index 88a28e8..b2d2b69 100644
--- a/modules/newsreel/slides/newsite.png
+++ b/modules/newsreel/slides/newsite.png
Binary files differ