aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--admin/admin_functions.php164
-rw-r--r--admin/admins/functions.php147
-rw-r--r--admin/admins/index.php53
-rw-r--r--admin/announcements/functions.php70
-rw-r--r--admin/announcements/index.php35
-rw-r--r--admin/blocks/functions.php177
-rw-r--r--admin/blocks/index.php59
-rw-r--r--admin/calendar/functions.php426
-rw-r--r--admin/calendar/index.php91
-rw-r--r--admin/functions.php568
-rw-r--r--admin/header.php85
-rw-r--r--admin/images/add.gifbin0 -> 59 bytes
-rw-r--r--admin/images/add.pngbin0 -> 3302 bytes
-rw-r--r--admin/images/addnewarticle.pngbin0 -> 6420 bytes
-rw-r--r--admin/images/addnewpage.pngbin0 -> 7511 bytes
-rw-r--r--admin/images/announcement.pngbin0 -> 2361 bytes
-rw-r--r--admin/images/bayonet_logo.jpgbin0 -> 36192 bytes
-rw-r--r--admin/images/blocks.pngbin0 -> 2534 bytes
-rw-r--r--admin/images/box.pngbin0 -> 5299 bytes
-rw-r--r--admin/images/box_download.pngbin0 -> 5888 bytes
-rw-r--r--admin/images/box_upload.pngbin0 -> 5895 bytes
-rw-r--r--admin/images/calendar.pngbin0 -> 4825 bytes
-rw-r--r--admin/images/cancel.pngbin0 -> 3327 bytes
-rw-r--r--admin/images/cmsadminlogo.pngbin0 -> 8718 bytes
-rw-r--r--admin/images/cmsadminlogo2.pngbin0 -> 11469 bytes
-rw-r--r--admin/images/delete.gifbin0 -> 60 bytes
-rw-r--r--admin/images/editfiles.pngbin0 -> 7336 bytes
-rw-r--r--admin/images/editpage.pngbin0 -> 5125 bytes
-rw-r--r--admin/images/file_doc.pngbin0 -> 6993 bytes
-rw-r--r--admin/images/file_pdf.pngbin0 -> 7336 bytes
-rw-r--r--admin/images/file_rtf.pngbin0 -> 6958 bytes
-rw-r--r--admin/images/file_word.pngbin0 -> 9196 bytes
-rw-r--r--admin/images/modules.pngbin0 -> 4319 bytes
-rw-r--r--admin/images/navigation.pngbin0 -> 3382 bytes
-rw-r--r--admin/images/news.pngbin0 -> 5401 bytes
-rw-r--r--admin/images/options.pngbin0 -> 3989 bytes
-rw-r--r--admin/images/photogallery.pngbin0 -> 9687 bytes
-rw-r--r--admin/images/user.pngbin0 -> 4942 bytes
-rw-r--r--admin/images/user_add.pngbin0 -> 5265 bytes
-rw-r--r--admin/images/user_delete.pngbin0 -> 5270 bytes
-rw-r--r--admin/images/user_two_delete.pngbin0 -> 6207 bytes
-rw-r--r--admin/images/user_warning.pngbin0 -> 5317 bytes
-rw-r--r--admin/images/users_two.pngbin0 -> 5927 bytes
-rw-r--r--admin/images/users_two_add.pngbin0 -> 6164 bytes
-rw-r--r--admin/images/users_two_warning.pngbin0 -> 6206 bytes
-rw-r--r--admin/images/view.gifbin0 -> 61 bytes
-rw-r--r--admin/index.php130
-rw-r--r--admin/modules/functions.php0
-rw-r--r--admin/modules/index.php0
-rw-r--r--admin/navigation/functions.php42
-rw-r--r--admin/navigation/index.php54
-rw-r--r--admin/news/functions.php0
-rw-r--r--admin/news/index.php0
-rw-r--r--admin/operation.php53
-rw-r--r--admin/pages/functions.php387
-rw-r--r--admin/pages/index.php78
-rw-r--r--admin/scripts/jquery.js19
-rw-r--r--admin/scripts/mocha.js156
-rw-r--r--admin/settings/functions.php77
-rw-r--r--admin/settings/index.php53
-rw-r--r--admin/style.css272
-rw-r--r--ajax/database/New Text Document.txt0
-rw-r--r--ajax/database/getuser.php38
-rw-r--r--ajax/database/index.htm20
-rw-r--r--ajax/database/selectuser.js40
-rw-r--r--ajax/form_suggestions/clienthint.js45
-rw-r--r--ajax/form_suggestions/gethint.php71
-rw-r--r--ajax/form_suggestions/index.htm14
-rw-r--r--ajax/simple_form/index.htm36
-rw-r--r--ajax/simple_form/time.php6
-rw-r--r--blocks/donations/index.php13
-rw-r--r--blocks/mini_calendar/functions.php301
-rw-r--r--blocks/mini_calendar/index.php3
-rw-r--r--blocks/mini_calendar/scripts.js0
-rw-r--r--blocks/mini_calendar/style.css96
-rw-r--r--blocks/rss_agw/index.php29
-rw-r--r--blocks/rss_agw/rssreader.php161
-rw-r--r--blocks/rss_agw/style.css17
-rw-r--r--blocks/server_monitor/index.php16
-rw-r--r--blocks/soldier_info/index.php25
-rw-r--r--blocks/tsviewer/index.php18
-rw-r--r--footer.php46
-rw-r--r--functions.js8
-rw-r--r--header.php50
-rw-r--r--images/add.gifbin0 -> 59 bytes
-rw-r--r--images/addnewarticle.pngbin0 -> 6420 bytes
-rw-r--r--images/addnewpage.pngbin0 -> 7511 bytes
-rw-r--r--images/annoucement.pngbin0 -> 9409 bytes
-rw-r--r--images/announcement.pngbin0 -> 9409 bytes
-rw-r--r--images/arrowleft.pngbin0 -> 2861 bytes
-rw-r--r--images/arrowright.pngbin0 -> 2867 bytes
-rw-r--r--images/bayonetLogo.pngbin0 -> 15516 bytes
-rw-r--r--images/blockbackground.jpgbin0 -> 12055 bytes
-rw-r--r--images/calendar.pngbin0 -> 10174 bytes
-rw-r--r--images/delete.gifbin0 -> 60 bytes
-rw-r--r--images/dicon.pngbin0 -> 3431 bytes
-rw-r--r--images/dlaxlogo.pngbin0 -> 34718 bytes
-rw-r--r--images/editfiles.pngbin0 -> 7336 bytes
-rw-r--r--images/editpage.pngbin0 -> 7775 bytes
-rw-r--r--images/error.gifbin0 -> 1083 bytes
-rw-r--r--images/error.pngbin0 -> 3746 bytes
-rw-r--r--images/file_doc.pngbin0 -> 6993 bytes
-rw-r--r--images/file_pdf.pngbin0 -> 7336 bytes
-rw-r--r--images/file_rtf.pngbin0 -> 6958 bytes
-rw-r--r--images/file_word.pngbin0 -> 9196 bytes
-rw-r--r--images/hgrad.pngbin0 -> 109 bytes
-rw-r--r--images/larrow.pngbin0 -> 3596 bytes
-rw-r--r--images/leftshadow.pngbin0 -> 3146 bytes
-rw-r--r--images/limericklax.pngbin0 -> 5497 bytes
-rw-r--r--images/logo.jpgbin0 -> 83085 bytes
-rw-r--r--images/lvgrad.pngbin0 -> 627 bytes
-rw-r--r--images/navbackground.jpgbin0 -> 11901 bytes
-rw-r--r--images/navbg.pngbin0 -> 2880 bytes
-rw-r--r--images/navigation.pngbin0 -> 11330 bytes
-rw-r--r--images/navspacer.pngbin0 -> 2810 bytes
-rw-r--r--images/news_header.pngbin0 -> 3558 bytes
-rw-r--r--images/nvgrad.pngbin0 -> 860 bytes
-rw-r--r--images/photogallery.pngbin0 -> 9687 bytes
-rw-r--r--images/photoleft.pngbin0 -> 2917 bytes
-rw-r--r--images/photoright.pngbin0 -> 2918 bytes
-rw-r--r--images/rarrow.pngbin0 -> 3581 bytes
-rw-r--r--images/rightshadow.pngbin0 -> 3155 bytes
-rw-r--r--images/sandbackground.jpgbin0 -> 523597 bytes
-rw-r--r--images/spacer.pngbin0 -> 2904 bytes
-rw-r--r--images/vgrad.pngbin0 -> 110 bytes
-rw-r--r--images/view.gifbin0 -> 61 bytes
-rw-r--r--images/xoma_logo.jpgbin0 -> 33996 bytes
-rw-r--r--includes/debug.php77
-rw-r--r--includes/functions.php559
-rw-r--r--includes/sql.class.php115
-rw-r--r--index.php65
-rw-r--r--logs/error.log0
-rw-r--r--logs/hacks.log0
-rw-r--r--logs/info.log0
-rw-r--r--markitup/images/body.pngbin0 -> 29187 bytes
-rw-r--r--markitup/images/jaysalvat.pngbin0 -> 27603 bytes
-rw-r--r--markitup/images/markitup.pngbin0 -> 11751 bytes
-rw-r--r--markitup/images/style.css27
-rw-r--r--markitup/index.html65
-rw-r--r--markitup/jquery.pack.js11
-rw-r--r--markitup/markitup/jquery.markitup.js553
-rw-r--r--markitup/markitup/jquery.markitup.pack.js9
-rw-r--r--markitup/markitup/readme.txt62
-rw-r--r--markitup/markitup/sets/bbcode/images/bold.pngbin0 -> 304 bytes
-rw-r--r--markitup/markitup/sets/bbcode/images/clean.pngbin0 -> 667 bytes
-rw-r--r--markitup/markitup/sets/bbcode/images/code.pngbin0 -> 859 bytes
-rw-r--r--markitup/markitup/sets/bbcode/images/fonts.pngbin0 -> 567 bytes
-rw-r--r--markitup/markitup/sets/bbcode/images/italic.pngbin0 -> 223 bytes
-rw-r--r--markitup/markitup/sets/bbcode/images/link.pngbin0 -> 343 bytes
-rw-r--r--markitup/markitup/sets/bbcode/images/list-bullet.pngbin0 -> 344 bytes
-rw-r--r--markitup/markitup/sets/bbcode/images/list-item.pngbin0 -> 248 bytes
-rw-r--r--markitup/markitup/sets/bbcode/images/list-numeric.pngbin0 -> 357 bytes
-rw-r--r--markitup/markitup/sets/bbcode/images/picture.pngbin0 -> 606 bytes
-rw-r--r--markitup/markitup/sets/bbcode/images/preview.pngbin0 -> 537 bytes
-rw-r--r--markitup/markitup/sets/bbcode/images/quotes.pngbin0 -> 743 bytes
-rw-r--r--markitup/markitup/sets/bbcode/images/stroke.pngbin0 -> 269 bytes
-rw-r--r--markitup/markitup/sets/bbcode/images/underline.pngbin0 -> 273 bytes
-rw-r--r--markitup/markitup/sets/bbcode/readme.txt11
-rw-r--r--markitup/markitup/sets/bbcode/set.js39
-rw-r--r--markitup/markitup/sets/bbcode/style.css47
-rw-r--r--markitup/markitup/sets/default/images/bold.pngbin0 -> 304 bytes
-rw-r--r--markitup/markitup/sets/default/images/clean.pngbin0 -> 667 bytes
-rw-r--r--markitup/markitup/sets/default/images/image.pngbin0 -> 516 bytes
-rw-r--r--markitup/markitup/sets/default/images/italic.pngbin0 -> 223 bytes
-rw-r--r--markitup/markitup/sets/default/images/link.pngbin0 -> 343 bytes
-rw-r--r--markitup/markitup/sets/default/images/picture.pngbin0 -> 606 bytes
-rw-r--r--markitup/markitup/sets/default/images/preview.pngbin0 -> 537 bytes
-rw-r--r--markitup/markitup/sets/default/images/stroke.pngbin0 -> 269 bytes
-rw-r--r--markitup/markitup/sets/default/set.js27
-rw-r--r--markitup/markitup/sets/default/style.css27
-rw-r--r--markitup/markitup/skins/markitup/images/bg-container.pngbin0 -> 28455 bytes
-rw-r--r--markitup/markitup/skins/markitup/images/bg-editor-bbcode.pngbin0 -> 1642 bytes
-rw-r--r--markitup/markitup/skins/markitup/images/bg-editor-dotclear.pngbin0 -> 1682 bytes
-rw-r--r--markitup/markitup/skins/markitup/images/bg-editor-html.pngbin0 -> 1534 bytes
-rw-r--r--markitup/markitup/skins/markitup/images/bg-editor-json.pngbin0 -> 1529 bytes
-rw-r--r--markitup/markitup/skins/markitup/images/bg-editor-markdown.pngbin0 -> 1783 bytes
-rw-r--r--markitup/markitup/skins/markitup/images/bg-editor-textile.pngbin0 -> 1659 bytes
-rw-r--r--markitup/markitup/skins/markitup/images/bg-editor-wiki.pngbin0 -> 1488 bytes
-rw-r--r--markitup/markitup/skins/markitup/images/bg-editor-xml.pngbin0 -> 1495 bytes
-rw-r--r--markitup/markitup/skins/markitup/images/bg-editor.pngbin0 -> 1745 bytes
-rw-r--r--markitup/markitup/skins/markitup/images/handle.pngbin0 -> 258 bytes
-rw-r--r--markitup/markitup/skins/markitup/images/menu.pngbin0 -> 27151 bytes
-rw-r--r--markitup/markitup/skins/markitup/images/submenu.pngbin0 -> 240 bytes
-rw-r--r--markitup/markitup/skins/markitup/style.css148
-rw-r--r--markitup/markitup/skins/simple/images/handle.pngbin0 -> 258 bytes
-rw-r--r--markitup/markitup/skins/simple/images/menu.pngbin0 -> 27151 bytes
-rw-r--r--markitup/markitup/skins/simple/images/submenu.pngbin0 -> 240 bytes
-rw-r--r--markitup/markitup/skins/simple/style.css118
-rw-r--r--markitup/markitup/templates/preview.css5
-rw-r--r--markitup/markitup/templates/preview.html11
-rw-r--r--modules.php94
-rw-r--r--modules/admin/admin_functions.php151
-rw-r--r--modules/admin/blocks/functions.php173
-rw-r--r--modules/admin/blocks/index.php59
-rw-r--r--modules/admin/images/addnewarticle.pngbin0 -> 6420 bytes
-rw-r--r--modules/admin/images/addnewpage.pngbin0 -> 7511 bytes
-rw-r--r--modules/admin/images/announcement.pngbin0 -> 9409 bytes
-rw-r--r--modules/admin/images/calendar.pngbin0 -> 10174 bytes
-rw-r--r--modules/admin/images/editfiles.pngbin0 -> 7336 bytes
-rw-r--r--modules/admin/images/editpage.pngbin0 -> 7775 bytes
-rw-r--r--modules/admin/images/file_doc.pngbin0 -> 6993 bytes
-rw-r--r--modules/admin/images/file_pdf.pngbin0 -> 7336 bytes
-rw-r--r--modules/admin/images/file_rtf.pngbin0 -> 6958 bytes
-rw-r--r--modules/admin/images/file_word.pngbin0 -> 9196 bytes
-rw-r--r--modules/admin/images/photogallery.pngbin0 -> 9687 bytes
-rw-r--r--modules/admin/index.php73
-rw-r--r--modules/admin/operation.php53
-rw-r--r--modules/admin/pages/functions.php230
-rw-r--r--modules/admin/pages/index.php68
-rw-r--r--modules/gallery/dynamitelax/100_2867.JPGbin0 -> 151469 bytes
-rw-r--r--modules/gallery/dynamitelax/100_2889.JPGbin0 -> 127396 bytes
-rw-r--r--modules/gallery/dynamitelax/100_2901.JPGbin0 -> 162137 bytes
-rw-r--r--modules/gallery/dynamitelax/100_3042.JPGbin0 -> 167177 bytes
-rw-r--r--modules/gallery/dynamitelax/100_3047.JPGbin0 -> 197658 bytes
-rw-r--r--modules/gallery/dynamitelax/100_3050.JPGbin0 -> 216410 bytes
-rw-r--r--modules/gallery/dynamitelax/100_3051.JPGbin0 -> 120926 bytes
-rw-r--r--modules/gallery/dynamitelax/100_3883.jpgbin0 -> 254283 bytes
-rw-r--r--modules/gallery/index.php0
-rw-r--r--modules/gallery/testphotos/dlogo.pngbin0 -> 64089 bytes
-rw-r--r--modules/gallery/testphotos/logo.pngbin0 -> 30041 bytes
-rw-r--r--modules/gallery/testphotos/player.jpgbin0 -> 68566 bytes
-rw-r--r--modules/gallery/testphotos/team.jpgbin0 -> 1201503 bytes
-rw-r--r--modules/index/index.php36
-rw-r--r--modules/news/categories/3rdIDnews.pngbin0 -> 50631 bytes
-rw-r--r--modules/news/categories/marnemessenger.pngbin0 -> 20793 bytes
-rw-r--r--modules/news/functions.php260
-rw-r--r--modules/news/images/avatar.pngbin0 -> 6617 bytes
-rw-r--r--modules/news/images/comment_arrow.pngbin0 -> 264 bytes
-rw-r--r--modules/news/index.php44
-rw-r--r--modules/news/style.css234
-rw-r--r--modules/newsreel/images/slidenavbg.pngbin0 -> 3152 bytes
-rw-r--r--modules/newsreel/images/slidenavbg2.pngbin0 -> 2898 bytes
-rw-r--r--modules/newsreel/images/slidenavbg3.pngbin0 -> 2885 bytes
-rw-r--r--modules/newsreel/index.php113
-rw-r--r--modules/newsreel/slides/arma2move.pngbin0 -> 409510 bytes
-rw-r--r--modules/newsreel/slides/newsite.pngbin0 -> 251196 bytes
-rw-r--r--modules/newsreel/slides/recruitmentGT.pngbin0 -> 277092 bytes
-rw-r--r--modules/newsreel/slides/teamwork.pngbin0 -> 83906 bytes
-rw-r--r--modules/page/index.php71
-rw-r--r--modules/tsviewer/index.php43
-rw-r--r--navigation.php23
-rw-r--r--style.css389
-rw-r--r--style_bbcode.css71
243 files changed, 8410 insertions, 0 deletions
diff --git a/admin/admin_functions.php b/admin/admin_functions.php
new file mode 100644
index 0000000..83392a1
--- /dev/null
+++ b/admin/admin_functions.php
@@ -0,0 +1,164 @@
+<?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/>.
+ */
+
+if(!defined("ADMIN_FILE"))
+{
+ die("Access denied.");
+ return;
+}
+
+function is_loggedin()
+{
+ $id = session_id();
+ if($id == "")
+ {
+ header("location: index.php");
+ return false;
+ }
+ return true;
+}
+
+function login()
+{
+ global $db;
+
+ if(isset($_SESSION['username']) || isset($_SESSION['password']))
+ {
+ return true;
+ }
+
+ if(isset($_POST['processed']))
+ {
+ $username = addslashes($_POST['username']);
+ $password = addslashes($_POST['password']);
+ $password = crypt(md5($password),'iamnotadirtywhorebitch');
+ $result = $db->Query("SELECT * FROM bayonet_users WHERE username = '$username' AND password = '$password' LIMIT 1");
+ $rows = $db->Rows($result);
+ $row = $db->Fetch($result);
+
+ if($rows > 0)
+ {
+ $_SESSION['username'] = stripslashes($username);
+ $_SESSION['password'] = stripslashes($password);
+ $_SESSION['level'] = $row['level'];
+ return true;
+ }
+ else
+ {
+ ReportError("Login incorrect.");
+
+ //NOT CORRECT LOGIN, DEFAULT TO LOGIN PAGE
+ echo "<meta http-equiv=\"Refresh\" content=\"1;url=index.php\">";
+
+ return false;
+ }
+
+ }
+ else
+ {
+ echo "<form action=\"\" method=\"post\">\n";
+ //OpenTable();
+ echo "<table style=\"width:100%; height:600px;\">";
+ echo "<tr><td><table width=\"450px\" style=\"background-color:white;\" align=\"center\">\n
+ <tr><td colspan=\"2\" style=\"text-align:center;\"><img src=\"images/bayonet_logo.jpg\" /></td></tr>\n
+ <tr><th colspan=\"2\">Administrative Login</th></tr>\n
+ <tr><th style=\"text-align:right;\">Username</th><td><input size=\"20\" type=\"text\" name=\"username\"></td></tr>\n
+ <tr><th style=\"text-align:right;\">Password</th><td><input size=\"20\" type=\"password\" name=\"password\"></td></tr>\n
+ <tr><th colspan=\"2\" align=\"center\"><input type=\"Submit\" name=\"processed\" value=\"Login\"></th></tr></td></tr>\n
+ </table>\n";
+ //CloseTable();
+ echo "</table>";
+ echo "</form>\n";
+ return false;
+ }
+}
+
+function logout()
+{
+ session_unset();
+ session_destroy();
+
+ echo "<script>location.href=\"index.php\";</script>";
+}
+
+/**
+ * CompileAdmin()
+ *
+ * because we want to have a horizontal display of options, we need to have
+ * the data separated by arrays. the data is processed into single tables, and is
+ * echoed in realtime. we checked to make sure they were arrays, but there is no
+ * checking to make sure the data passed is not malicious in nature.
+ *
+ * @param mixed $head
+ * @param mixed $body
+ * @return
+ */
+function CompileAdmin($head,$body)
+{
+ /*if we were not passed arrays, then say goodbye*/
+ if(!is_array($head) || !is_array($body))
+ {
+ echo "must be array\n";
+ return;
+ }
+
+ echo "<table class=\"cleartable\" width=\"100%\">";
+
+$num = 1;
+ foreach($body as $td)
+ {
+ if($num==1){
+ echo "<tr style=\"text-align:center; height:90px;\">";
+ }
+ echo "<td class=\"center\" style=\"width:16%;\">$td</td>\n";
+ if($num%6 == 0){
+ echo "</tr>";
+ $num=0;
+ }
+ $num++;
+ }
+ echo "</tr></table>\n";
+}
+
+/**
+ * OpenTable()
+ *
+ * The administration OpenTable() function requires an argument to define
+ * the header title. It may be wise to replace the standard OpenTable() function
+ * with this one... that's alot of code to unfuck though.
+ *
+ * @param mixed $title
+ * @return
+ */
+function OpenTable_Ex($title)
+{
+ echo "<table align=\"center\"><tr><th>{$title}</th></tr><tr><td>";
+}
+
+/**
+ * CloseTable()
+ *
+ * @return
+ */
+function CloseTable_Ex()
+{
+ echo "</td></tr></table>";
+}
+
+?> \ No newline at end of file
diff --git a/admin/admins/functions.php b/admin/admins/functions.php
new file mode 100644
index 0000000..031bd05
--- /dev/null
+++ b/admin/admins/functions.php
@@ -0,0 +1,147 @@
+<?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/>.
+ */
+
+ function ListAdmins()
+ {
+ global $db;
+ $result = $db->Query("SELECT `user_id`, `username`, `level` FROM `bayonet_users` ORDER BY `level` DESC");
+ while(($rows = $db->fetch($result))!=false)
+ {
+ $admins[] = $rows;
+ }
+
+ $num = 1;
+ OpenTable("300px");
+ echo "<tr><th></th><th>Username</th><th>Level</th></tr>";
+ foreach($admins as $admin)
+ {
+ echo "<tr><td>{$num}.</td><td><a href=\"?op=admins&edit={$admin['user_id']}\">{$admin['username']}</a></td><td>{$admin['level']}</td></tr>";
+ $num++;
+ }
+ CloseTable();
+ }
+
+ function NewAdmin()
+ {
+ $maxLevel = $_SESSION['level'];
+ }
+
+ function EditAdmin($user_id)
+ {
+ global $db;
+ $maxLevel = $_SESSION['level'];
+
+ if(isset($_POST['processed']))
+ {
+ $username = addslashes($_POST['username']);
+ $level = addslashes($_POST['level']);
+
+ if(empty($username))
+ {
+ echo "You must fill everything out before proceeding.";
+ return;
+ }
+
+ $db->Query("UPDATE `bayonet_users` SET `username` = '$username', `level` = '$level' WHERE `user_id` = '$user_id' LIMIT 1");
+
+ echo "Admin, '$username' level '$level' has been edited.\n <br /><br />
+ Please wait while you are redirected. <br /><br />
+ <a href=\"?op=admins\">Click here if you don't feel like waiting.</a>";
+
+ // 3 second redirect to go back to the edit page
+ PageRedirect(3, "?op=admins");
+ return;
+ }
+
+ $result = $db->Query("SELECT * FROM `bayonet_users` WHERE `user_id` = '$user_id' LIMIT 1");
+ while(($rows = $db->fetch($result))!=false)
+ {
+ $admin = $rows;
+ }
+
+ if($maxLevel < $admin['level']){
+ ReportError("You do not have permission to access this user.");
+ return;
+ }
+?>
+<center>
+ Edit the attributes of this administrator.<br />
+ <form method="POST" action="<?php $_SERVER['PHP_SELF']?>">
+ <table>
+ <tr><th>Username:</th><td><input type="text" value="<?php echo $admin['username']; ?>" name="username" /></td></tr>
+ <tr>
+ <th>Level:</th>
+ <td>
+ <select name="level">
+ <?php
+ for($x=$maxLevel; $x>0;$x--){
+ if($admin['level'] == $x)
+ echo "<option value=\"{$x}\" selected>{$x}</option>";
+ else
+ echo "<option value=\"{$x}\">{$x}</option>";
+ }
+ ?>
+ </select>
+ </td>
+ </tr>
+ <tr>
+ <td colspan="2" style="text-align:center;">
+ <input type="submit" name="processed" value="Submit" />
+ <a href="?op=admins&delete=<?php echo $user_id; ?>"><input type="button" value="Delete Admin" /></a>
+ </td>
+ </tr>
+ </table>
+ </form>
+</center>
+<?php
+ }
+
+ function DeleteAdmin($user_id)
+ {
+ global $db;
+ $maxLevel = $_SESSION['level'];
+
+ $result = $db->Query("SELECT `username` FROM `bayonet_users` WHERE `user_id` = '$user_id'");
+ $admin = $db->Fetch($result);
+
+ if(isset($_POST['proceed']))
+ {
+ echo "Admin '{$admin['username']}', was deleted.";
+ $db->Query("DELETE FROM `bayonet_users` WHERE `user_id` = '$user_id' LIMIT 1");
+ PageRedirect(3,"?op=admins");
+ return;
+ }
+ if(isset($_POST['cancel']))
+ {
+ echo "User cancelled deletion of admin: '{$admin['username']}'";
+ PageRedirect(3,"?op=admins");
+ return;
+ }
+ ?>
+ <center>
+ <form action="<?php $_SERVER['PHP_SELF'] ?>" method="post">
+ <table>
+ <th>Are you SURE you want to delete the administrative user: '<?php echo $admin['username']?>'?</th>
+ <tr><th><button name="proceed">Yes</button>&nbsp;&nbsp;&nbsp;<button name="cancel">No</button></th></tr>
+ </table>
+ </form>
+ </center>
+ <?php
+ }
+ ?> \ No newline at end of file
diff --git a/admin/admins/index.php b/admin/admins/index.php
new file mode 100644
index 0000000..b000111
--- /dev/null
+++ b/admin/admins/index.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/>.
+ */
+?>
+ <div style="text-align:left;"><h2>- Edit Admins</h2></div>
+<?php
+if(!defined("ADMIN_FILE"))
+{
+ die("Access denied.");
+}
+
+include $basedir.'admins/functions.php';
+
+if(isset($_GET['edit']))
+{
+ $user_id = $_GET['edit'];
+ EditAdmin($user_id);
+ return;
+}
+
+if(isset($_GET['delete']))
+{
+ $user_id = $_GET['delete'];
+ DeleteAdmin($user_id);
+ return;
+}
+
+if(isset($_GET['create']))
+{
+ NewAdmin();
+ return;
+}
+
+echo "<table align=\"center\" width=\"200px\"><tr><th>".LinkInternal('<img src="images/add.png" />Add New Admin','?op=admins&create=true')."</th></tr></table>";
+
+ListAdmins();
+
+?> \ No newline at end of file
diff --git a/admin/announcements/functions.php b/admin/announcements/functions.php
new file mode 100644
index 0000000..2e55125
--- /dev/null
+++ b/admin/announcements/functions.php
@@ -0,0 +1,70 @@
+<?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/>.
+ */
+
+/**
+ * Note to anyone feeling the need to edit this file...
+ * You MUST declare $db as global inside your functions in order access MySQL from here.
+ */
+
+function EditAnnouncements()
+{
+ global $db;
+
+ if(isset($_POST['announcementprocessed']))
+ {
+ //Secure our data to prevent injection attacks.
+ $title = addslashes($_POST['title']);
+ $text = addslashes($_POST['text']);
+ if(empty($title) || empty($text))
+ {
+ echo "You must fill everything out before proceeding.";
+ return;
+ }
+
+ //Update the database with the new data.
+ $db->Query("UPDATE bayonet_announcements SET title = '$title', text = '$text' WHERE announcement_id = 0");
+ echo "Announcement, '$title', has been edited.\n <br /><br /> Please wait while you are redirected. <br /><br />
+ <a href=\"?op=announcements\">Click here if you don't feel like waiting.</a>";
+
+ // 3 second redirect to go back to the edit page
+ echo "<meta http-equiv=\"Refresh\" content=\"3;url=?op=announcements\">";
+
+ //die, because we have completed what we wanted to do.
+ return;
+ }
+
+
+ //Grab the page from the database according to the $article_id passed to the function.
+ $result = $db->Query("SELECT title,text FROM bayonet_announcements WHERE announcement_id = 0");
+ while(($row = $db->Fetch($result))!=false)
+ {
+ //We only want one row, so we don't have to $article[]... No foreach necessary.
+ $announcement = $row;
+ }
+ ?>
+ <form action="<?php $_SERVER['PHP_SELF'] ?>" method="post">
+ <table>
+ <tr><td>Announcement Title: <input type="text" name="title" value="<?php echo $announcement['title'] ?>" maxlength="50" size="30" /> </td></tr>
+ <tr><td> <textarea id="markItUp" rows="30" cols="80" name="text"><?php echo $announcement['text'] ?></textarea> </td></tr>
+ <tr><td> <input type="submit" name="announcementprocessed" value="Submit Changes" /> </td></tr>
+ </table>
+ </form>
+ <?php
+}
+?> \ No newline at end of file
diff --git a/admin/announcements/index.php b/admin/announcements/index.php
new file mode 100644
index 0000000..17b6003
--- /dev/null
+++ b/admin/announcements/index.php
@@ -0,0 +1,35 @@
+<?php
+/**
+ * Xoma 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/>.
+ */
+ ?>
+
+ <div style="text-align:left;"><h2>- Edit Announcements</h2></div>
+ -Maybe see if this can go into more depth (ie. selecting whether to display announcements or not and on what pages)<br /><br />
+
+ <?php
+
+if(!defined("ADMIN_FILE"))
+{
+ die("Access denied.");
+}
+
+include $basedir.'announcements/functions.php';
+?>
+<table class="panel" width="100%">
+ <tr><td><?php EditAnnouncements(); ?></td></tr>
+</table> \ No newline at end of file
diff --git a/admin/blocks/functions.php b/admin/blocks/functions.php
new file mode 100644
index 0000000..2ef951c
--- /dev/null
+++ b/admin/blocks/functions.php
@@ -0,0 +1,177 @@
+<?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/>.
+ */
+
+function ListBlocks()
+{
+ global $db;
+ $result = $db->Query("SELECT * FROM `bayonet_blocks` ORDER BY `active` DESC, `weight` ASC, `position`");
+ while(($rows = $db->fetch($result))!=false)
+ {
+ $blocks[] = $rows;
+ }
+
+ echo "<table align=\"center\"><tr><th colspan=\"3\">Existing Blocks</th></tr>";
+ foreach($blocks as $block)
+ {
+ echo "<tr><td>{$block['weight']} : {$block['dir_name']}</td><td><a href=\"?load=admin&op=blocks&edit={$block['block_id']}\">Edit</a></td><td><a href=\"?load=admin&op=blocks&delete={$block['block_id']}\">Delete</a></td></tr>";
+ }
+ echo "</table>";
+}
+
+function NewBlock()
+{
+ global $db;
+ if(isset($_POST['processed']))
+ {
+ //Secure our data to prevent injection attacks.
+ $weight = addslashes($_POST['weight']);
+ $dir_name = addslashes($_POST['dir_name']);
+ $position = addslashes($_POST['position']);
+ $active = addslashes($_POST['active']);
+ $title = addslashes($_POST['title']);
+
+ if(!is_int($weight) || empty($dir_name) || empty($title) || !is_int($position))
+ {
+ echo "You must fill everything out before proceeding.";
+ return;
+ }
+ //Update the database with the new data.
+ $db->Query("INSERT INTO `bayonet_blocks` SET `weight` = '$weight', `dir_name` = '$dir_name', `title` = '$title', `position` = '$position', `active` = '$active'");
+ //die, because we have completed what we wanted to do.
+ echo "New block, '$dir_name', at position '$weight' added.\n";
+ return;
+ }
+
+ ?>
+ <form action="<?php $_SERVER['PHP_SELF']?>" method="post">
+ <table align="center">
+ <tr><th>Title</th><td><input type="text" name="title" value="<?php echo $block['title'] ?>"></td></tr>
+ <tr><th>Weight</th><td><input type="text" name="weight" value="<?php echo $block['weight'] ?>"></td></tr>
+ <tr><th>Position</th><td><input type="text" name="position" value="<?php echo $block['position'] ?>"></td></tr>
+ <tr><th>Directory Name</th><td><input type="text" name="dir_name" value="<?php echo $block['dir_name'] ?>"></td>
+ <tr><th>Active</th><td>
+ <select name="active">
+ <option value="1">Yes</option>
+ <option value="0">No</option>
+ </select></td>
+ <tr><th colspan="2"><input type="submit" name="processed" value="Submit"></th></tr>
+ </table>
+ </form>
+ <?php
+}
+
+function GetActive($block_id, &$active)
+{
+ $options = array(1 => 'Yes',0 => 'No');
+ foreach($options as $option => $value)
+ {
+ $selected = NULL;
+ if($active == $option)
+ {
+ $selected = "selected";
+ }
+ echo "<option " . $selected . " value=\"". $option ."\">" . $value . "</option>\n";
+ }
+
+
+}
+
+function EditBlock($block_id)
+{
+ global $db;
+ if(isset($_POST['processed']))
+ {
+ //Secure our data to prevent injection attacks.
+ $weight = (int) addslashes($_POST['weight']);
+ $dir_name = addslashes($_POST['dir_name']);
+ $position = (int) addslashes($_POST['position']);
+ $active = addslashes($_POST['active']);
+
+ if(!is_int($weight) || empty($dir_name) || empty($title) || !is_int($position))
+ {
+ echo "You must fill everything out before proceeding.";
+ return;
+ }
+
+ //Update the database with the new data.
+ $db->Query("UPDATE bayonet_blocks SET weight = '$weight', dir_name = '$dir_name', position = '$position', active = '$active' WHERE block_id = '$block_id'");
+ //$isActive = $active ? "IS" : "IS NOT";
+ echo "Block, '$dir_name', at position '$weight' has been edited.\n";
+ PageRedirect(3, "?op=blocks");
+ //die, because we have completed what we wanted to do.
+ return;
+ }
+
+ //Grab the page from the database according to the $page_id passed to the function.
+ $result = $db->Query("SELECT weight,dir_name,position,active,title FROM bayonet_blocks WHERE block_id = '$block_id'");
+ while(($row = $db->Fetch($result))!=false)
+ {
+ //We only want one row, so we don't have to $block[]... No foreach necessary.
+ $block = $row;
+ }
+
+ ?>
+ <form action="<?php $_SERVER['PHP_SELF']?>" method="post">
+ <table align="center">
+ <tr><th>Title</th><td><input type="text" name="title" value="<?php echo $block['title'] ?>" /></td></tr>
+ <tr><th>Weight</th><td><input type="text" name="weight" value="<?php echo $block['weight'] ?>" /></td></tr>
+ <tr><th>Position</th><td><input type="text" name="position" value="<?php echo $block['position'] ?>" /></td></tr>
+ <tr><th>Directory Name</th><td><input type="text" name="dir_name" value="<?php echo $block['dir_name'] ?>" /></td>
+ <tr><th>Active</th><td>
+ <select name="active">
+ <?php GetActive($block_id, $block['active']) ?>
+ </select>
+ </td>
+
+ <tr><th colspan="2"><input type="submit" name="processed" value="Submit"></th></tr>
+ </table>
+ </form>
+ <?php
+}
+
+function DeleteBlock($block_id)
+{
+ global $db;
+
+ $result = $db->Query("SELECT dir_name FROM bayonet_blocks WHERE block_id = '$block_id'");
+ $block = $db->Fetch($result);
+
+ if(isset($_POST['proceed']))
+ {
+ echo "Block '{$block['dir_name']}', was deleted.";
+ $db->Query("DELETE FROM bayonet_blocks WHERE block_id = '$block_id' LIMIT 1");
+ return;
+ }
+ if(isset($_POST['cancel']))
+ {
+ echo "User cancelled deletion of page: '{$block['dir_name']}'";
+ return;
+ }
+
+ ?>
+ <form action="<?php $_SERVER['PHP_SELF'] ?>" method="post">
+ <table align="center">
+ <th>Are you SURE you want to delete the block titled: '<?php echo $block['dir_name']?>'?</th>
+ <tr><th><button name="proceed">Yes</button>&nbsp;&nbsp;&nbsp;<button name="cancel">No</button></th></tr>
+ </table>
+ </form>
+ <?php
+}
+
+?> \ No newline at end of file
diff --git a/admin/blocks/index.php b/admin/blocks/index.php
new file mode 100644
index 0000000..8d63b6d
--- /dev/null
+++ b/admin/blocks/index.php
@@ -0,0 +1,59 @@
+<?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/>.
+ */
+
+/**
+ * This file administers the site blocks.
+ *
+ * -weight
+ * -directory name
+ */
+
+if(!defined("ADMIN_FILE"))
+{
+ die("Access denied.");
+}
+
+
+include $basedir.'blocks/functions.php';
+
+if(isset($_GET['edit']))
+{
+ $block_id = $_GET['edit'];
+ EditBlock($block_id);
+ return;
+}
+
+if(isset($_GET['delete']))
+{
+ $block_id = $_GET['delete'];
+ DeleteBlock($block_id);
+ return;
+}
+
+if(isset($_GET['create']))
+{
+ NewBlock();
+ return;
+}
+
+echo "<table align=\"center\" width=\"200px\"><tr><th>".LinkInternal('Create a Block','?load=admin&op=blocks&create=true')."</th></tr></table>";
+
+ListBlocks();
+
+?> \ No newline at end of file
diff --git a/admin/calendar/functions.php b/admin/calendar/functions.php
new file mode 100644
index 0000000..d0c13ec
--- /dev/null
+++ b/admin/calendar/functions.php
@@ -0,0 +1,426 @@
+<?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/>.
+ */
+
+/**
+ * Note to anyone feeling the need to edit this file...
+ * You MUST declare $db as global inside your functions in order access MySQL from here.
+ */
+
+ /**
+ * 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){
+
+ //function for adding to the db in sql 'datetime' format
+ //$date = date("Y-m-d h:i:s", mktime(8, 30, 0, 10, 26, 2009));
+ //$date = "2009-11-2";
+ //echo $date."<br />";
+ //function for parsing our date format into an array
+ //echo "<pre>";
+ $date_arr = date_parse($date); //returns an associative array $array['year']
+ //print_r($date_arr);
+ //echo "</pre>";
+ //echo $date_arr['year']." ".$date_arr['month']." ".$date_arr['day']."<br />";;
+
+ //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 ListEvents($date){
+
+ global $db;
+
+?>
+ <table width="100%"><tr><td>
+ <h3>Events for: <?php echo date_format(date_create($date),'F jS, Y'); ?></h3>
+ </td><td align="right">
+ <a href="?op=calendar&create=true&date=<?php echo $date; ?>"><img src="images/add.gif" /> Add New Event</a>
+ </td></tr></table>
+<?php
+
+ echo "<table width=\"100%\">";
+
+ $result = $db->Query("SELECT * FROM bayonet_events WHERE `date` = '$date' ORDER BY `time`");
+ while(($row = $db->Fetch($result))!=false)
+ {
+ $tmp = true;
+
+ $datetime = date_create($date.' '.$row['time']);
+ $time = date_format($datetime, 'g:ia'); //gets time in hour:minutes am|pm
+?>
+
+<tr>
+ <td><strong><?php echo $time." - ".$row['title']; ?></strong></td>
+ <td><span style="border:1px solid black;background-color:#<?php echo $row['color'];?>;">&nbsp;&nbsp;&nbsp;&nbsp;</span></td>
+ <td>
+ <a href="?op=calendar&month=<?php echo $_GET['month']; ?>&year=<?php echo $_GET['year']; ?>&edit=<?php echo $row['event_id'];?>">Edit</a>
+ &nbsp;|&nbsp;
+ <a href="?op=calendar&delete=<?php echo $row['event_id']; ?>">Delete</a>
+ </td>
+</tr>
+<tr>
+ <td><?php echo BBCode($row['text']); ?><br /><br /></td>
+</tr>
+
+<tr>
+ <td colspan="2" style="border-top:1px solid black;"><br /></td>
+</tr>
+<?php
+ }
+
+ if(!isset($tmp))
+ echo "<tr><td>There are no events posted for this day.</td></tr>";
+
+ echo "</table>";
+
+ }
+
+ function EditEvent($event_id){
+
+ //function for adding to the db in sql 'datetime' format
+ //$date = date("Y-m-d h:i:s", mktime(8, 30, 0, 10, 26, 2009));
+ /*
+ echo $date."<br />";
+
+ //function for parsing our date format into an array
+ echo "<pre>";
+ $date_arr = date_parse($date); //returns an associative array $array['year']
+ print_r($date_arr);
+ echo "</pre>";
+
+ echo $date_arr['year']; */
+
+ global $db;
+ $result = $db->Query("SELECT * FROM `bayonet_events` WHERE `event_id` = $event_id LIMIT 1");
+ while(($row = $db->Fetch($result))!=false)
+ {
+ $event = $row;
+ }
+ ?>
+ <h3>Edit Event</h3>
+ <form action="<?php $_SERVER['PHP_SELF']?>" method="post">
+ <table>
+ <tr><th>Title</th><td><input type="text" name="title" value="<?php echo $event['title']; ?>" /></td></tr>
+ <tr><th>Color</th><td><input type="text" name="color" value="<?php echo $event['color']; ?>" /></td></tr>
+ <tr><th>Date</th><td><?php SelectDate($event['date']); ?></td></tr>
+ <tr><th>Text</th><td><textarea id="markItUp" rows="30" cols="80" name="text"><?php echo $event['text']; ?></textarea></td>
+ <tr><th colspan="2"><input type="submit" name="processed" value="Submit" /></th></tr>
+ </table>
+ </form>
+ <?php
+ }
+
+ function NewEvent(){
+
+ global $db;
+ if(isset($_POST['processed']))
+ {
+ //Secure our data to prevent injection attacks.
+ $title = addslashes($_POST['title']);
+ $text = addslashes($_POST['text']);
+ $year = addslashes($_POST['year']);
+ $month = addslashes($_POST['month']);
+ $day = addslashes($_POST['day']);
+ $time = addslashes($_POST['time']);
+ $color = addslashes($_POST['color']);
+
+ $date = date("Y-m-d", mktime(0, 0, 0, $month, $day, $year));
+
+ if(empty($title) || empty($text))
+ {
+ echo "You must fill everything out before proceeding.";
+ return;
+ }
+ $sent = false;
+
+ //Update the database with the new data.
+ if(!$sent){
+ $sent = true;
+ $db->Query("INSERT INTO `bayonet_events` (`event_id` ,`date` ,`time` ,`title` ,`text` ,`color`)VALUES (NULL , '$date', '$time', '$title', '$text', '$color')");
+
+ //echo '<script>location.href="?op=calendar&list='.$date.'";</script>';
+ }
+
+
+ echo "New event, '$title', has been added.\n";
+ //die, because we have completed what we wanted to do.
+ return;
+ }
+
+ ?>
+ <h3>Add New Event</h3>
+ <form action="<?php $_SERVER['PHP_SELF']?>" method="post">
+ <table>
+ <tr><th>Title</th><td><input type="text" name="title" value="" /></td></tr>
+ <tr><th>Color</th><td><input type="text" name="color" value="" /></td></tr>
+ <tr><th>Date</th><td><?php SelectDate($_GET['date']); ?></td></tr>
+ <tr><th>Time</th><td><input type="text" name="time" value="12:00" maxlength="5" size="5" /></td></tr>
+ <tr><th>Text</th><td><textarea id="markItUp" rows="30" cols="80" name="text"></textarea></td>
+ <tr><th colspan="2"><input type="submit" name="processed" value="Submit" /></th></tr>
+ </table>
+ </form>
+ <?php
+ }
+
+ function DeleteEvent($event_id = 0){
+
+ global $db;
+
+ $result = $db->Query("SELECT title FROM bayonet_events WHERE event_id = '$event_id'");
+ $event = $db->Fetch($result);
+
+ if(isset($_POST['proceed']))
+ {
+ echo "Event '{$event['title']}', was deleted.";
+ $db->Query("DELETE FROM bayonet_events WHERE event_id = '$event_id' LIMIT 1");
+ return;
+ }
+ if(isset($_POST['cancel']))
+ {
+ echo "User cancelled deletion of event: '{$event['title']}'";
+ return;
+ }
+ if($event_id <= 0 || !is_numeric($event_id)) {
+ echo "Invalid request to delete this event.";
+ return;
+ }
+ ?>
+
+ <form action="<?php $_SERVER['PHP_SELF'] ?>" method="post">
+ <table>
+ <th>Are you SURE you want to delete the event titled: '<?php echo $event['title']?>'?</th>
+ <tr><th><button name="proceed">Yes</button>&nbsp;&nbsp;&nbsp;<button name="cancel">No</button></th></tr>
+ </table>
+ </form>
+ <?php
+ }
+
+ /**
+ * PrintCalendar() - prints the calendar with events
+ */
+ function PrintCalendar(){
+
+ $date = time();
+ date_default_timezone_set("America/New_York"); //EASTERN TIME ZONE
+
+ //GET values for month and year
+ $month = $_GET['month'];
+ $year = $_GET['year'];
+
+ $useCurDate = true;
+
+ //check to makes sure month and year are in the desired ranges
+ if(!empty($month) && !empty($year) && $month > 0 && $month < 13 && $year > 1990){
+ $useCurDate = false;
+ }
+ //check to see if the get variables are for todays month
+ if($month == date('n', $date) && $year == date('Y', $date)){
+ $useCurDate = true;
+ }
+
+ //use current date unless GET values are set
+ if($useCurDate)
+ {
+ $day = date('d', $date);
+ $today = date('j', $date);
+ $month = date('m', $date);
+ $monthNum = date('n', $date);
+ $year = date('Y', $date);
+ }
+ else
+ {
+ $monthNum = $month;
+ //if GET values are equal to curdate, set $today
+ if($year == date('Y', $date) && $monthNum == date('n', $date))
+ $today = date('j', $date);
+ else
+ $today = 0;
+ }
+
+ /* Accounts for the last couple days from the previous months */
+ $first_day = mktime(0,0,0,$monthNum, 1, $year);
+
+ $title = date('F', $first_day);
+
+ $day_of_week = date('D', $first_day);
+
+ switch($day_of_week){
+ case "Sun": $blank = 0; break;
+ case "Mon": $blank = 1; break;
+ case "Tue": $blank = 2; break;
+ case "Wed": $blank = 3; break;
+ case "Thu": $blank = 4; break;
+ case "Fri": $blank = 5; break;
+ case "Sat": $blank = 6; break;
+ }
+
+ /* calculates the days in the current month */
+ $days_in_month = cal_days_in_month(0, $monthNum, $year);
+
+ //makes sure that previous year is not year 0
+ if($monthNum == 1){
+ $previous_month = 12;
+ $previous_year = $year-1;
+ }else{
+ $previous_month = $monthNum-1;
+ $previous_year = $year;
+ }
+ //makes sure the next year is not year 13
+ if($monthNum == 12){
+ $next_month = 1;
+ $next_year = $year+1;
+ }else{
+ $next_month = $monthNum+1;
+ $next_year = $year;
+ }
+ ?>
+ <center>
+ <table class="calendar" style="background-color:white;" cellspacing="1" cellpadding="0">
+ <tr style="background-color:#999999; height:27px;">
+ <td colspan="50" style="vertical-align:middle; text-align:center;">
+ <a href="?op=calendar&month=<?php echo $previous_month.'&year='.$previous_year; ?>"><<</a>
+ <!-- Month Name and Year -->
+ &nbsp;&nbsp;<span class="monthTitle"><?php echo strtoupper($title).' '.$year; ?></span>&nbsp;&nbsp;
+ <a href="?op=calendar&month=<?php echo $next_month.'&year='.$next_year; ?>">>></a>
+ </td>
+ </tr>
+
+ <tr>
+ <th class="weekday">Sun</th><th class="weekday">Mon</th><th class="weekday">Tue</th><th class="weekday">Wed</th>
+ <th class="weekday">Thu</th><th class="weekday">Fri</th><th class="weekday">Sat</th>
+ </tr>
+
+ <tr>
+ <?php
+
+ $day_count = 1; //holds the current day of the week 1-7
+ $day_num = 1; //holds the current day of the month 1-31
+
+ $days_monthbefore = cal_days_in_month(0, $previous_month, $year);
+ //prints the numbers of days for the previous month
+ while($blank > 0){
+ $blank = $blank-1;
+ $days_before = $days_monthbefore-$blank;
+ echo '<td class="cal_notmonth">'.$days_before.'</td>'; //'.$days_before.'</td>';
+ $day_count++;
+ }
+
+ //loop printing each day of the CURRENT month ONLY
+ while($day_num <= $days_in_month){
+
+ if($day_count==1 || $day_count==7){
+ echo '<td class="cal_weekend">'; //weekends
+ }else{
+ echo '<td class="cal_weekday">'; //weekdays
+ }
+
+ $sqlDate = $year.'-'.$monthNum.'-'.$day_num; //old way NOT unix
+
+ //checks to see if the current day has events
+ $isEvent=false;
+ /* $get_events = mysql_query("SELECT * FROM `mybb_events` WHERE `starttime` = $checkUnixTime ");
+ while($echo_events = mysql_fetch_array($get_events)){
+ $isEvent=true;
+ } */
+ global $db;
+ $result = $db->Query("SELECT title,color FROM bayonet_events WHERE `date` = '$sqlDate' LIMIT 1");
+ while(($row = $db->Fetch($result))!=false)
+ {
+ $isEvent = true;
+ }
+ if($useCurDate)
+ echo "<a href=\"?op=calendar&list={$year}-{$monthNum}-{$day_num}\">";
+ else
+ echo "<a href=\"?op=calendar&month={$monthNum}&year={$year}&list={$year}-{$monthNum}-{$day_num}\">";
+
+ if($day_num == $today && $isEvent==true){
+ echo '<div class="eventtoday">'.$day_num.'</div>';
+ }else if($day_num == $today && $isEvent==false){
+ echo '<div class="monthtoday">'.$day_num.'</div>';
+ }else if($day_num != $today && $isEvent==true){
+ echo '<div class="event" id="event'.$day_num.'" onmouseover="highlightEvent(this.id)" onmouseout="normEvent(this.id)">';
+ echo $day_num;
+ echo '</div>';
+ }else{
+ echo $day_num;
+ }
+ echo "</a>";
+
+ echo '</td>';
+
+ $day_num++;
+ $day_count++;
+
+ if($day_count > 7){
+ echo '</tr><tr>';
+ $day_count = 1;
+ }
+ }
+
+ $days_after = 1;
+ //loop for printing the days for the next month
+ while($day_count > 1 && $day_count <=7){
+ echo '<td class="cal_notmonth">'.$days_after.'</td>'; //'.$days_after.'</td>';
+ $days_after++;
+ $day_count++;
+ }
+
+ ?>
+
+ </tr>
+ </table>
+ </center>
+<?php
+
+ }
+
+ ?> \ No newline at end of file
diff --git a/admin/calendar/index.php b/admin/calendar/index.php
new file mode 100644
index 0000000..64798e3
--- /dev/null
+++ b/admin/calendar/index.php
@@ -0,0 +1,91 @@
+<?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/>.
+ */
+ ?>
+
+ <div style="text-align:left;"><h2>- Manage Calendar & Events</h2></div>
+ -Edit events needs to be completed.
+<?php
+
+if(!defined("ADMIN_FILE"))
+{
+ die("Access denied.");
+}
+
+include $basedir.'calendar/functions.php';
+
+
+?>
+
+<!--
+<hr />
+ <table width="100%" style="text-align:center;">
+ <tr>
+ <td>
+ <?php echo LinkInternal('Add Events','?op=calendar&create=true'); ?>
+ </td>
+ <td>
+ <?php echo LinkInternal('Edit Events','?op=calendar&edit='); ?>
+ </td>
+ <td>
+ <?php echo LinkInternal('Delete Events','?op=calendar&delete='); ?>
+ </td>
+ </tr>
+ </table> -->
+
+ <table class="panel" width="100%">
+ <tr>
+ <td style="width:325px; vertical-align:top; text-align:center;">
+ <a href="?op=calendar&create=true"><img src="images/add.gif" /> Add New Event</a><br /><br />
+ <?php PrintCalendar(); ?>
+ Click on a day to add/edit/delete events
+ </td>
+ <td class="panel-box">
+ <?php
+ if(isset($_GET['list']))
+ {
+ $eventDate = $_GET['list'];
+ ListEvents($eventDate);
+ //return;
+ }
+ else if(isset($_GET['edit']))
+ {
+ $event_id = $_GET['edit'];
+ EditEvent($event_id);
+ //return;
+ }
+ else if(isset($_GET['delete']))
+ {
+ $event_id = $_GET['delete'];
+ DeleteEvent($event_id);
+ //return;
+ }
+ else if(isset($_GET['create']))
+ {
+ $create = $_GET['create'];
+ if($create)
+ {
+ NewEvent();
+ //return;
+ }
+ }
+ ?>
+ </td>
+ </tr>
+ </table>
+
diff --git a/admin/functions.php b/admin/functions.php
new file mode 100644
index 0000000..07bc20b
--- /dev/null
+++ b/admin/functions.php
@@ -0,0 +1,568 @@
+<?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/>.
+ */
+
+/**
+ * bbcode_format()
+ *
+ * Modified public domain code from www.phpit.net
+ *
+ * @param mixed $str
+ * @return
+ */
+function bbcode_format ($str)
+{
+ $str = htmlentities($str);
+ $str = strip_tags($str);
+ $str = wordwrap($str,100,"\n",true);
+
+ $simple_search = array(
+ '/\[b\](.*?)\[\/b\]/is',
+ '/\[i\](.*?)\[\/i\]/is',
+ '/\[u\](.*?)\[\/u\]/is',
+ '/\[hr\]/is',
+ '/\[pi\](.*?)\[\/pi\]/is',
+ '/\[center\](.*?)\[\/center\]/is',
+ '/\[title\](.*?)\[\/title\]/is',
+ '/\[article\](.*?)\[\/article\]/is',
+ '/\[section\](.*?)\[\/section\]/is',
+ '/\[code\](.*?)\[\/code\]/is',
+ '/\[quote\](.*?)\[\/quote\]/is',
+ '/\[quote\=(.*?)\](.*?)\[\/quote\]/is',
+ '/\[url\=(.*?)\](.*?)\[\/url\]/is',
+ '/\[align\=(.*?)\](.*?)\[\/align\]/is',
+ '/\[size\=(.*?)\](.*?)\[\/size\]/is',
+ '/\[img\=(.*?)\](.*?)\[\/img\]/is'
+ );
+
+ $simple_replace = array(
+ '<strong>$1</strong>',
+ '<em>$1</em>',
+ '<u>$1</u>',
+ '<hr>',
+ '<p style="text-indent:3em;">$1</p>',
+ '<center>$1</center>',
+ '<h2>$1</h2>',
+ '<h3>$1</h3>',
+ '<h4>$1</h4>',
+ '<blockquote><pre>$1</pre></blockquote>',
+ '<blockquote>$1</blockquote>',
+ '<i>$1 wrote:</i><br/><blockquote>$2</blockquote>',
+ '<a href="$1">$2</a>',
+ '<align="$1">$2</align>',
+ '<font style="font-size:$1px;">$2</font>',
+ '<img src="$1" alt="$2"/>'
+ );
+
+ $order = array("\r\n", "\n", "\r");
+ $replace = "\n<br/>";
+
+ $str = preg_replace ($simple_search, $simple_replace, $str);
+ $str = str_ireplace($order,$replace,$str);
+ return $str;
+}
+
+ //BBcode 2 HTML was written by WAY2WEB.net
+
+ function BBCode($Text)
+ {
+ // Replace any html brackets with HTML Entities to prevent executing HTML or script
+ // Don't use strip_tags here because it breaks [url] search by replacing & with amp
+ $Text = str_replace("<", "&lt;", $Text);
+ $Text = str_replace(">", "&gt;", $Text);
+
+ // Convert new line chars to html <br /> tags
+ $Text = nl2br($Text);
+
+ // Set up the parameters for a URL search string
+ $URLSearchString = " a-zA-Z0-9\:\/\-\?\&\.\=\_\~\#\'";
+ // Set up the parameters for a MAIL search string
+ $MAILSearchString = $URLSearchString . " a-zA-Z0-9\.@";
+
+ // Perform URL Search
+ $Text = preg_replace("/\[url\]([$URLSearchString]*)\[\/url\]/", '<a href="$1" target="_blank">$1</a>', $Text);
+ $Text = preg_replace("(\[url\=([$URLSearchString]*)\](.+?)\[/url\])", '<a href="$1" target="_blank">$2</a>', $Text);
+ //$Text = preg_replace("(\[url\=([$URLSearchString]*)\]([$URLSearchString]*)\[/url\])", '<a href="$1" target="_blank">$2</a>', $Text);
+
+ // Perform MAIL Search
+ $Text = preg_replace("(\[mail\]([$MAILSearchString]*)\[/mail\])", '<a href="mailto:$1">$1</a>', $Text);
+ $Text = preg_replace("/\[mail\=([$MAILSearchString]*)\](.+?)\[\/mail\]/", '<a href="mailto:$1">$2</a>', $Text);
+
+ // Check for bold text
+ $Text = preg_replace("(\[b\](.+?)\[\/b])is",'<span class="bold">$1</span>',$Text);
+
+ // Check for Italics text
+ $Text = preg_replace("(\[i\](.+?)\[\/i\])is",'<span class="italics">$1</span>',$Text);
+
+ // Check for Underline text
+ $Text = preg_replace("(\[u\](.+?)\[\/u\])is",'<span class="underline">$1</span>',$Text);
+
+ // Check for strike-through text
+ $Text = preg_replace("(\[s\](.+?)\[\/s\])is",'<span class="strikethrough">$1</span>',$Text);
+
+ // Check for over-line text
+ $Text = preg_replace("(\[o\](.+?)\[\/o\])is",'<span class="overline">$1</span>',$Text);
+
+ // Check for colored text
+ $Text = preg_replace("(\[color=(.+?)\](.+?)\[\/color\])is","<span style=\"color: $1\">$2</span>",$Text);
+
+ // Check for sized text
+ $Text = preg_replace("(\[size=(.+?)\](.+?)\[\/size\])is","<span style=\"font-size: $1px\">$2</span>",$Text);
+
+ // Check for list text
+ $Text = preg_replace("/\[list\](.+?)\[\/list\]/is", '<ul class="listbullet">$1</ul>' ,$Text);
+ $Text = preg_replace("/\[list=1\](.+?)\[\/list\]/is", '<ul class="listdecimal">$1</ul>' ,$Text);
+ $Text = preg_replace("/\[list=i\](.+?)\[\/list\]/s", '<ul class="listlowerroman">$1</ul>' ,$Text);
+ $Text = preg_replace("/\[list=I\](.+?)\[\/list\]/s", '<ul class="listupperroman">$1</ul>' ,$Text);
+ $Text = preg_replace("/\[list=a\](.+?)\[\/list\]/s", '<ul class="listloweralpha">$1</ul>' ,$Text);
+ $Text = preg_replace("/\[list=A\](.+?)\[\/list\]/s", '<ul class="listupperalpha">$1</ul>' ,$Text);
+ $Text = str_replace("[*]", "<li>", $Text);
+
+ // Check for font change text
+ $Text = preg_replace("(\[font=(.+?)\](.+?)\[\/font\])","<span style=\"font-family: $1;\">$2</span>",$Text);
+
+ // Declare the format for [code] layout
+ $CodeLayout = '<table width="90%" border="0" align="center" cellpadding="0" cellspacing="0">
+ <tr>
+ <td class="quotecodeheader"> Code:</td>
+ </tr>
+ <tr>
+ <td class="codebody">$1</td>
+ </tr>
+ </table>';
+ // Check for [code] text
+ $Text = preg_replace("/\[code\](.+?)\[\/code\]/is","$CodeLayout", $Text);
+ // Declare the format for [php] layout
+ $phpLayout = '<table width="90%" border="0" align="center" cellpadding="0" cellspacing="0">
+ <tr>
+ <td class="quotecodeheader"> Code:</td>
+ </tr>
+ <tr>
+ <td class="codebody">$1</td>
+ </tr>
+ </table>';
+ // Check for [php] text
+ $Text = preg_replace("/\[php\](.+?)\[\/php\]/is",$phpLayout, $Text);
+
+ // Declare the format for [quote] layout
+ $QuoteLayout = '<table width="90%" border="0" align="center" cellpadding="0" cellspacing="0">
+ <tr>
+ <td class="quotecodeheader"> Quote:</td>
+ </tr>
+ <tr>
+ <td class="quotebody">$1</td>
+ </tr>
+ </table>';
+
+ // Check for [quote] text
+ $Text = preg_replace("/\[quote\](.+?)\[\/quote\]/is","$QuoteLayout", $Text);
+
+ // Images
+ // [img]pathtoimage[/img]
+ $Text = preg_replace("/\[img\](.+?)\[\/img\]/", '<img src="$1">', $Text);
+
+ //[img=align]image source[/img]
+ $Text = preg_replace("(\[img align\=(.+?)\](.+?)\[\/img\])is","<img src=\"$2\" align=\"$1\" />",$Text);
+
+ // [img=widthxheight]image source[/img]
+ $Text = preg_replace("/\[img\=([0-9]*)x([0-9]*)\](.+?)\[\/img\]/", '<img src="$3" height="$2" width="$1">', $Text);
+
+ // Alignment
+ // [align=type]text[/align]
+ $Text = preg_replace("(\[align=(.+?)\](.+?)\[\/align\])is","<div style=\"text-align: $1\">$2</div>",$Text);
+
+ return $Text;
+ }
+
+function articleHeading($text){
+
+ // Set the content-type
+ header('Content-type: image/png');
+
+ //$text = $_GET['text'];
+
+ $im = imagecreatefrompng('images/news_header.png'); // open image
+ imagealphablending($im, true); // setting alpha blending on
+ imagesavealpha($im, true); // save alphablending setting (important)
+
+ // Create some colors
+ $black = imagecolorallocate($im, 0, 0, 0);
+
+
+ // Replace path by your own font path
+ //$font = 'TrajanPro-Regular.otf';
+ //$font = 'TrajanPro-Bold.otf';
+ $font = 'BrushScriptStd.otf';
+ //$font = 'TRATS__.TTF';
+ //$text = strtoupper($text);
+
+ // Add the text
+ imagettftext($im, 18, 0, 0, 17, $black, $font, $text);
+
+ // Using imagepng() results in clearer text compared with imagejpeg()
+ imagepng($im);
+ imagedestroy($im);
+}
+
+function LinkList($array)
+{
+ if(!is_array($array))
+ {
+ ReportError("List was not an array");
+ return;
+ }
+
+ echo "<ul class=\"block\">";
+ foreach($array as $text => $link)
+ {
+ echo "<li><a href=\"$link\">$text</a></li>";
+ }
+ echo "</ul>";
+}
+
+/**
+ * LinkModule()
+ *
+ * Helper function to link to Bayonet modules.
+ *
+ * @param mixed $module_name
+ * @param mixed $link_name
+ * @return
+ */
+function LinkModule($module_name,$args = NULL,$link_name)
+{
+ return "<a href=\"?load={$module_name}{$args}\">{$link_name}</a>";
+}
+
+/**
+ * LinkPage()
+ *
+ * Helper function to link to Bayonet pages.
+ *
+ * @param mixed $page_id
+ * @param mixed $page_name
+ * @return
+ */
+function LinkPage($page_id,$page_name)
+{
+ return "<a href=\"?load=page&amp;id={$page_id}\">{$page_name}</a>";
+}
+
+/**
+ * LinkInternal()
+ *
+ * Helper function to link to a relative Bayonet path.
+ *
+ * @param mixed $name
+ * @param string $rel_path
+ * @param string $file
+ * @return
+ */
+function LinkInternal($name,$file,$rel_path = "./")
+{
+ return "<a href=\"{$rel_path}{$file}\">{$name}</a>";
+}
+
+if(!defined("CALLED_FROM_ADMIN"))
+{
+ /**
+ * OpenTable()
+ *
+ * Begins a Bayonet site table.
+ *
+ * @return
+ */
+ function OpenTable($width = "100%")
+ {
+ //width="100%" is important. Otherwise all of our tables will be text width.
+ echo "<table width=\"{$width}\" align=\"center\" class=\"cleartable\">\n";
+ }
+
+ /**
+ * CloseTable()
+ *
+ * Closes a Bayonet site table.
+ *
+ * @return
+ */
+ function CloseTable()
+ {
+ echo "</table>";
+ }
+}
+
+function OpenBlock($title = 'New Block')
+{
+ OpenTable();
+ echo "<div class=\"contentHeading\">{$title}</div>";
+ echo "<div class=\"content\">";
+}
+
+function CloseBlock()
+{
+ echo "</div>";
+ CloseTable();
+}
+/**
+ * ReportError()
+ *
+ * This function should be called in the event that an error has occured.
+ *
+ * @param mixed $message - automatically logged
+ * @return
+ */
+function ReportError($message)
+{
+ //WriteLog($message,BAYONET_LOG_ERROR);
+ OpenTable();
+ echo "<tr><th>Error Message</th></tr><tr><td style=\"text-align:center;\">{$message}</td></tr>";
+ CloseTable();
+}
+
+/**
+ * ReportHack()
+ *
+ * This function should be called in the event that we are confirming
+ * a hacking attempt.
+ *
+ * @param mixed $message - automatically logged
+ * @return void
+ */
+function ReportHack($message)
+{
+ //WriteLog($message,BAYONET_LOG_HACK);
+ OpenTable();
+ echo "<tr><th>Hack Attempt</th></tr><tr><td style=\"text-align:center;\">{$message}</td></tr>";
+ CloseTable();
+}
+
+
+/**
+ * array_dump()
+ *
+ * Useful against $_POST and $_GET variables, for dumping data to
+ * a log file, or to stdout. The return value is a single string,
+ * with each array key => value pair delimited by a character.
+ * The default character is a pipe -> '|'. It is assumed that if
+ * wanted to have a newline character inserted, just replace $spacer
+ * with '\n'.
+ *
+ * @param mixed $array
+ * @param string $spacer
+ * @return
+ */
+function array_dump($array, $spacer = '|')
+{
+ $retval = NULL;
+ foreach($array as $challenge => $answer)
+ {
+ $retval .= " $challenge => $answer " . $spacer;
+ }
+
+ return $retval;
+}
+
+/**
+ * WriteLog()
+ *
+ * This function can be accessed directly, however, anything that is
+ * passed to ReportError() or ReportHack(), or decho() will be logged in their
+ * appropriate log file.
+ *
+ * Change made: added checks to see if the log files exist before opening
+ *
+ * @param mixed $message
+ * @param mixed $flag
+ * @return
+ */
+define('BAYONET_LOG_HACK','bayonet_log_hack');
+define('BAYONET_LOG_ERROR','bayonet_log_error');
+define('BAYONET_LOG_WARN','bayonet_log_warn');
+define('BAYONET_LOG_INFO','bayonet_log_info');
+
+function WriteLog($message,$flag)
+{
+ global $config;
+ $enabled = $config['logs']['enabled'];
+
+ if(!$enabled)
+ {
+ return false;
+ }
+
+ $dir = $config['logs']['dir'];
+ date_default_timezone_set($config['logs']['timezone']);
+ $varstr = array_dump($_GET);
+ $type = NULL;
+ $ip = $_SERVER['REMOTE_ADDR'];
+ $hostname = gethostbyaddr($ip);
+ $executed = $_SERVER['PHP_SELF'];
+ $timestamp = date('Y-M-d H:i:s T');
+
+
+ $message = str_replace("\n",'',$message);
+ $message = str_replace("<br>",'',$message);
+
+ switch($flag)
+ {
+ case BAYONET_LOG_HACK:
+ if(!file_exists($dir.'hacks.log')){
+ break;
+ }
+ $fp = fopen($dir.'hacks.log','a');
+ $type = 'HACK';
+ $full_message = "TIMESTAMP: {$timestamp}\n\t\tIP: {$ip}\n\t\tHOSTNAME: {$hostname}\n\t\tACTION: {$type} of {$executed}\n\t\tDEFERRAL: {$message}\n\t\tVAR: ({$varstr})\n\n";
+ break;
+ case BAYONET_LOG_ERROR:
+ if(!file_exists($dir.'error.log')){
+ break;
+ }
+ $fp = fopen($dir.'error.log','a');
+ $type = 'ERROR';
+ $full_message = "({$timestamp}) - {$type} - {$message} - ({$varstr})\n";
+ break;
+ case BAYONET_LOG_WARN:
+ if(!file_exists($dir.'warn.log')){
+ break;
+ }
+ $fp = fopen($dir.'warn.log','a');
+ $type = 'WARN';
+ $full_message = "({$timestamp}) - {$type} - {$message} - ({$varstr})\n";
+ break;
+ case BAYONET_LOG_INFO:
+ if(!file_exists($dir.'info.log')){
+ break;
+ }
+ $fp = fopen($dir.'info.log','a');
+ $type = 'INFO';
+ $full_message = "({$timestamp}) - {$type} - {$message}\n";
+ break;
+ default:
+ echo 'To log something, you need to define a log to write to.<br>';
+ return;
+ }
+ if(file_exists($fp)){
+ fwrite($fp,$full_message);
+ fclose($fp);
+ }else{
+ //echo "could not write to file because file does not exist.<br />";
+ }
+}
+
+/**
+ * UnderConstruction()
+ *
+ * Displays a site-wide message across the page header.
+ *
+ * @param mixed $message
+ * @param mixed $flag Acceptable flags are BAYONET_SITE, and BAYONET_SECTION
+ * @return
+ */
+define('BAYONET_SITE','bayonet_site');
+define('BAYONET_SECTION','bayonet_section');
+function UnderConstruction($message = NULL, $flag = BAYONET_SITE)
+{
+ $timestamp = date("Y-M-d h:m:s");
+ OpenTable();
+ switch($flag)
+ {
+ case BAYONET_SITE:
+ echo "<tr><th>Site is currently under construction : $timestamp</th></tr>";
+ break;
+ case BAYONET_SECTION:
+ echo "<tr><th>Section currently under construction : $timestamp</th></tr>";
+ }
+
+ if(!is_null($message))
+ {
+ echo "<tr><td><i>$message</i></td></tr>";
+ }
+
+ CloseTable();
+ echo "<br>";
+}
+
+/**
+ * GetBlocks()
+ *
+ * Includes all directories listed in blocks/ and uses the bayonet_blocks
+ * MySQL table to determine the order of the blocks displayed.
+ *
+ * @return
+ */
+
+define('BLOCK_LEFT',false);
+define('BLOCK_RIGHT',false);
+
+function GetBlocks($position = BLOCK_LEFT)
+{
+ global $config;
+ /**
+ * I had to reconnect to the database for some fucking reason at this point.
+ * I have no idea why, but I was recieving errors telling me that $db was no longer
+ * an object. This is/was bullshit.
+ */
+ $db = new Bayonet_SQL();
+ $db->Connect(
+ $config['sql']['hostname'],
+ $config['sql']['username'],
+ $config['sql']['password']
+ );
+ $db->Select_db($config['sql']['database']);
+
+ $result = $db->Query("SELECT * FROM `bayonet_blocks` ORDER BY weight, position");
+ //$result = mysql_query("SELECT * FROM bayonet_blocks ORDER BY weight, position");
+ while(($row = $db->Fetch($result))!==false)
+ {
+ $blocks[] = $row;
+ }
+ $db->Free($result);
+
+ foreach($blocks as $block)
+ {
+ if($block['position'] == $position && $block['active'] == true)
+ {
+ $load = 'blocks/'.$block['dir_name'].'/index.php';
+ if(file_exists($load))
+ {
+ OpenBlock($block['title']);
+ include $load;
+ CloseBlock();
+ }
+ else
+ {
+ ReportError("Failed to load block, '{$block['dir_name']}'. Check block config.");
+ }
+ if($config['blocks']['spacer']) echo "<br />";
+ }
+ }
+}
+
+/**
+ * PageRedirect()
+ *
+ * performs an http redirect
+ *
+ * @param $delay
+ * @param $link
+ */
+function PageRedirect($delay, $link)
+{
+ echo "<meta http-equiv=\"Refresh\" content=\"{$delay};url={$link}\">";
+}
+?> \ No newline at end of file
diff --git a/admin/header.php b/admin/header.php
new file mode 100644
index 0000000..fae70b8
--- /dev/null
+++ b/admin/header.php
@@ -0,0 +1,85 @@
+<?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/>.
+ */
+
+ob_start();
+$starttime = explode(' ', microtime());
+$starttime = $starttime[1] + $starttime[0];
+?>
+
+<html>
+
+<head>
+<title>Bayonet CMS Admin Tools</title>
+<meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
+<link rel="stylesheet" type="text/css" href="style.css" media="screen"/>
+<link rel="stylesheet" type="text/css" href="../style_bbcode.css" media="screen"/>
+
+<!-- PASSWORD CHECK -->
+<script type="text/javascript" src="scripts/jquery.js"></script>
+<script type="text/javascript" src="scripts/mocha.js"></script>
+<!-- PASSWORD CHECK -->
+
+<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" />
+<script type="text/javascript">
+<!--
+$(document).ready(function() {
+ // Add markItUp! to your textarea in one line
+ // $('textarea').markItUp( { Settings }, { OptionalExtraSettings } );
+ $('#markItUp').markItUp(mySettings);
+
+ // You can add content from anywhere in your page
+ // $.markItUp( { Settings } );
+ $('.add').click(function() {
+ $.markItUp( { openWith:'<opening tag>',
+ closeWith:'<\/closing tag>',
+ placeHolder:"New content"
+ }
+ );
+ return false;
+ });
+
+ // And you can add/remove markItUp! whenever you want
+ // $(textarea).markItUpRemove();
+ $('.toggle').click(function() {
+ if ($("#markItUp.markItUpEditor").length === 1) {
+ $("#markItUp").markItUpRemove();
+ $("span", this).text("get markItUp! back");
+ } else {
+ $('#markItUp').markItUp(mySettings);
+ $("span", this).text("remove markItUp!");
+ }
+ return false;
+ });
+});
+-->
+</script>
+</head>
+
+<body> \ No newline at end of file
diff --git a/admin/images/add.gif b/admin/images/add.gif
new file mode 100644
index 0000000..e665474
--- /dev/null
+++ b/admin/images/add.gif
Binary files differ
diff --git a/admin/images/add.png b/admin/images/add.png
new file mode 100644
index 0000000..249350d
--- /dev/null
+++ b/admin/images/add.png
Binary files differ
diff --git a/admin/images/addnewarticle.png b/admin/images/addnewarticle.png
new file mode 100644
index 0000000..0e29960
--- /dev/null
+++ b/admin/images/addnewarticle.png
Binary files differ
diff --git a/admin/images/addnewpage.png b/admin/images/addnewpage.png
new file mode 100644
index 0000000..c60c68c
--- /dev/null
+++ b/admin/images/addnewpage.png
Binary files differ
diff --git a/admin/images/announcement.png b/admin/images/announcement.png
new file mode 100644
index 0000000..4521309
--- /dev/null
+++ b/admin/images/announcement.png
Binary files differ
diff --git a/admin/images/bayonet_logo.jpg b/admin/images/bayonet_logo.jpg
new file mode 100644
index 0000000..d957c7d
--- /dev/null
+++ b/admin/images/bayonet_logo.jpg
Binary files differ
diff --git a/admin/images/blocks.png b/admin/images/blocks.png
new file mode 100644
index 0000000..628eba2
--- /dev/null
+++ b/admin/images/blocks.png
Binary files differ
diff --git a/admin/images/box.png b/admin/images/box.png
new file mode 100644
index 0000000..4c4bf0f
--- /dev/null
+++ b/admin/images/box.png
Binary files differ
diff --git a/admin/images/box_download.png b/admin/images/box_download.png
new file mode 100644
index 0000000..d1bcb2f
--- /dev/null
+++ b/admin/images/box_download.png
Binary files differ
diff --git a/admin/images/box_upload.png b/admin/images/box_upload.png
new file mode 100644
index 0000000..8a453c2
--- /dev/null
+++ b/admin/images/box_upload.png
Binary files differ
diff --git a/admin/images/calendar.png b/admin/images/calendar.png
new file mode 100644
index 0000000..6e7de1c
--- /dev/null
+++ b/admin/images/calendar.png
Binary files differ
diff --git a/admin/images/cancel.png b/admin/images/cancel.png
new file mode 100644
index 0000000..c2c7c10
--- /dev/null
+++ b/admin/images/cancel.png
Binary files differ
diff --git a/admin/images/cmsadminlogo.png b/admin/images/cmsadminlogo.png
new file mode 100644
index 0000000..23ee961
--- /dev/null
+++ b/admin/images/cmsadminlogo.png
Binary files differ
diff --git a/admin/images/cmsadminlogo2.png b/admin/images/cmsadminlogo2.png
new file mode 100644
index 0000000..ad54960
--- /dev/null
+++ b/admin/images/cmsadminlogo2.png
Binary files differ
diff --git a/admin/images/delete.gif b/admin/images/delete.gif
new file mode 100644
index 0000000..2095ca8
--- /dev/null
+++ b/admin/images/delete.gif
Binary files differ
diff --git a/admin/images/editfiles.png b/admin/images/editfiles.png
new file mode 100644
index 0000000..500e206
--- /dev/null
+++ b/admin/images/editfiles.png
Binary files differ
diff --git a/admin/images/editpage.png b/admin/images/editpage.png
new file mode 100644
index 0000000..42b2728
--- /dev/null
+++ b/admin/images/editpage.png
Binary files differ
diff --git a/admin/images/file_doc.png b/admin/images/file_doc.png
new file mode 100644
index 0000000..b1da1ef
--- /dev/null
+++ b/admin/images/file_doc.png
Binary files differ
diff --git a/admin/images/file_pdf.png b/admin/images/file_pdf.png
new file mode 100644
index 0000000..500e206
--- /dev/null
+++ b/admin/images/file_pdf.png
Binary files differ
diff --git a/admin/images/file_rtf.png b/admin/images/file_rtf.png
new file mode 100644
index 0000000..39304c1
--- /dev/null
+++ b/admin/images/file_rtf.png
Binary files differ
diff --git a/admin/images/file_word.png b/admin/images/file_word.png
new file mode 100644
index 0000000..3011f00
--- /dev/null
+++ b/admin/images/file_word.png
Binary files differ
diff --git a/admin/images/modules.png b/admin/images/modules.png
new file mode 100644
index 0000000..fd9c45d
--- /dev/null
+++ b/admin/images/modules.png
Binary files differ
diff --git a/admin/images/navigation.png b/admin/images/navigation.png
new file mode 100644
index 0000000..f4a64ed
--- /dev/null
+++ b/admin/images/navigation.png
Binary files differ
diff --git a/admin/images/news.png b/admin/images/news.png
new file mode 100644
index 0000000..4955c3a
--- /dev/null
+++ b/admin/images/news.png
Binary files differ
diff --git a/admin/images/options.png b/admin/images/options.png
new file mode 100644
index 0000000..b561965
--- /dev/null
+++ b/admin/images/options.png
Binary files differ
diff --git a/admin/images/photogallery.png b/admin/images/photogallery.png
new file mode 100644
index 0000000..a161a55
--- /dev/null
+++ b/admin/images/photogallery.png
Binary files differ
diff --git a/admin/images/user.png b/admin/images/user.png
new file mode 100644
index 0000000..55bf586
--- /dev/null
+++ b/admin/images/user.png
Binary files differ
diff --git a/admin/images/user_add.png b/admin/images/user_add.png
new file mode 100644
index 0000000..534ced9
--- /dev/null
+++ b/admin/images/user_add.png
Binary files differ
diff --git a/admin/images/user_delete.png b/admin/images/user_delete.png
new file mode 100644
index 0000000..4fa8551
--- /dev/null
+++ b/admin/images/user_delete.png
Binary files differ
diff --git a/admin/images/user_two_delete.png b/admin/images/user_two_delete.png
new file mode 100644
index 0000000..36d61a0
--- /dev/null
+++ b/admin/images/user_two_delete.png
Binary files differ
diff --git a/admin/images/user_warning.png b/admin/images/user_warning.png
new file mode 100644
index 0000000..334bdbf
--- /dev/null
+++ b/admin/images/user_warning.png
Binary files differ
diff --git a/admin/images/users_two.png b/admin/images/users_two.png
new file mode 100644
index 0000000..b5cbbd3
--- /dev/null
+++ b/admin/images/users_two.png
Binary files differ
diff --git a/admin/images/users_two_add.png b/admin/images/users_two_add.png
new file mode 100644
index 0000000..a211177
--- /dev/null
+++ b/admin/images/users_two_add.png
Binary files differ
diff --git a/admin/images/users_two_warning.png b/admin/images/users_two_warning.png
new file mode 100644
index 0000000..f7cc071
--- /dev/null
+++ b/admin/images/users_two_warning.png
Binary files differ
diff --git a/admin/images/view.gif b/admin/images/view.gif
new file mode 100644
index 0000000..52cbddb
--- /dev/null
+++ b/admin/images/view.gif
Binary files differ
diff --git a/admin/index.php b/admin/index.php
new file mode 100644
index 0000000..665f125
--- /dev/null
+++ b/admin/index.php
@@ -0,0 +1,130 @@
+<?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/>.
+ */
+
+ session_start();
+
+include '../includes/debug.php';
+include '../includes/config.php';
+include '../includes/sql.class.php';
+include 'functions.php';
+
+$db = new Bayonet_SQL();
+$db->Connect(
+ $config['sql']['hostname'],
+ $config['sql']['username'],
+ $config['sql']['password']
+ );
+$db->Select_db($config['sql']['database']);
+//$config['logs']['dir'] = "../logs/";
+
+include 'header.php';
+
+
+ if(!defined("MODULE_FILE"))
+ {
+ //die("Access denied.");
+ }
+
+ define("ADMIN_FILE",'admin_file');
+ include 'admin_functions.php';
+
+ if(isset($_GET['op']) && $_GET['op'] == 'logout')
+ {
+ logout();
+ }
+
+ if(login())
+ {
+ //this is so dirty... sigh.
+ if(is_loggedin())
+ {
+ ?>
+
+ <center>
+ <div class="content">
+
+<table width="100%">
+ <tr>
+ <td><a href="index.php"><img src="images/bayonet_logo.jpg" alt="bayonet online web admin" /></a></td>
+ <td style="text-align:right">
+ <a href="?op=settings">Account Settings</a> &nbsp;|&nbsp;
+ <a href="?op=logout">Logout, <?php echo $_SESSION['username']; ?></a>
+ </td>
+ </tr>
+</table>
+
+<br />
+
+ <fieldset>
+ <legend>Administration Menu:</legend>
+ <?php
+ $th = array('Administration Menu','');
+ $td = array(
+ LinkInternal('<img src="images/modules.png" /><br />Modules','?op=modules'),
+ LinkInternal('<img src="images/blocks.png" /><br />Blocks','?op=blocks'),
+ LinkInternal('<img src="images/navigation.png" /><br />Navigation','?op=navigation'),
+ LinkInternal('<img src="images/users_two.png" /><br />Edit Admins','?op=admins')
+ );
+
+ //render administration table
+ CompileAdmin($th,$td);
+ ?>
+ </fieldset>
+<br />
+ <fieldset>
+ <legend>Module Administration:</legend>
+ <?php
+ $th = array('Module Administration','');
+ $td = array(
+ LinkInternal('<img src="images/editpage.png" /><br />Pages','?op=pages'),
+ LinkInternal('<img src="images/news.png" /><br />News','?op=news'),
+ LinkInternal('<img src="images/calendar.png" /><br />Calendar','?op=calendar'),
+ LinkInternal('<img src="images/box_download.png" /><br />Downloads', '?op=downloads'),
+ LinkInternal('<img src="images/announcement.png" /><br />Announcements','?op=announcements')
+ );
+
+ //render administration table
+ CompileAdmin($th,$td);
+ ?>
+ </fieldset>
+
+<br />
+<div style="text-align:center"><?php include 'operation.php' ?></div>
+
+
+ </div>
+ <?php
+$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/>Queries: %d | Fetches: %d<br/>\n",
+ $totaltime, ((float)memory_get_usage()/1024/1024), ((float)memory_get_peak_usage()/1024/1024), $phpversion, $db_queries, $db_fetches);
+ ?>
+ </center>
+
+<br />
+<?php echo $config['product']['name'] . ' ' . $config['product']['version'] . ' ' . $config['product']['release'] ?><br />
+<?php echo $config['product']['copyright']; ?><br />
+<?php if($config['debug']) echo $debug_output ?><br />
+
+ <?php
+ }
+ }
+
+?> \ No newline at end of file
diff --git a/admin/modules/functions.php b/admin/modules/functions.php
new file mode 100644
index 0000000..e69de29
--- /dev/null
+++ b/admin/modules/functions.php
diff --git a/admin/modules/index.php b/admin/modules/index.php
new file mode 100644
index 0000000..e69de29
--- /dev/null
+++ b/admin/modules/index.php
diff --git a/admin/navigation/functions.php b/admin/navigation/functions.php
new file mode 100644
index 0000000..29aa10f
--- /dev/null
+++ b/admin/navigation/functions.php
@@ -0,0 +1,42 @@
+<?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/>.
+ */
+
+/**
+ * Note to anyone feeling the need to edit this file...
+ * You MUST declare $db as global inside your functions in order access MySQL from here.
+ */
+
+function ListNavigation(){
+
+ global $db;
+ $result = $db->Query("SELECT `nav_id`, `title`, `weight` FROM `bayonet_navigation` ORDER BY `weight`");
+ while(($row = $db->Fetch($result))!=false)
+ {
+ $data[] = $row;
+ }
+
+ echo "|0|Home|0|<br />";
+
+ foreach($data as $nav){
+
+ echo "|{$nav['nav_id']}|{$nav['title']}|{$nav['weight']}|<br />";
+ }
+
+}
+?> \ No newline at end of file
diff --git a/admin/navigation/index.php b/admin/navigation/index.php
new file mode 100644
index 0000000..f50ef55
--- /dev/null
+++ b/admin/navigation/index.php
@@ -0,0 +1,54 @@
+<?php
+/**
+ * Xoma 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/>.
+ */
+ ?>
+
+ <div style="text-align:left;"><h2>- Navigation Links</h2></div>
+ -Edit Order, Edit Page, Delete Pages, Add Pages<br />
+
+<?php
+if(!defined("ADMIN_FILE"))
+{
+ die("Access denied.");
+}
+
+
+include $basedir.'navigation/functions.php';
+
+if(isset($_GET['edit']))
+{
+ $block_id = $_GET['edit'];
+ EditBlock($block_id);
+ return;
+}
+
+if(isset($_GET['delete']))
+{
+ $block_id = $_GET['delete'];
+ DeleteBlock($block_id);
+ return;
+}
+
+if(isset($_GET['create']))
+{
+ NewBlock();
+ return;
+}
+
+ ListNavigation();
+?> \ No newline at end of file
diff --git a/admin/news/functions.php b/admin/news/functions.php
new file mode 100644
index 0000000..e69de29
--- /dev/null
+++ b/admin/news/functions.php
diff --git a/admin/news/index.php b/admin/news/index.php
new file mode 100644
index 0000000..e69de29
--- /dev/null
+++ b/admin/news/index.php
diff --git a/admin/operation.php b/admin/operation.php
new file mode 100644
index 0000000..4ba80e4
--- /dev/null
+++ b/admin/operation.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/>.
+ */
+
+if(!defined("ADMIN_FILE"))
+{
+ die("Access denied.");
+ return;
+}
+
+if(!isset($_GET['op']))
+{
+ echo "<center>No operation selected</center>\n";
+ return;
+}
+
+$op = $_GET['op'];
+$basedir = './';
+
+if(file_exists($basedir))
+{
+ if(file_exists($basedir . $op))
+ {
+ include $basedir . $op . '/index.php';
+ }
+ else
+ {
+ ReportError("Administrative operation '$op' does not exist.");
+ }
+}
+else
+{
+ ReportError("Administrative base directory path does not exist.");
+}
+
+
+
+?> \ No newline at end of file
diff --git a/admin/pages/functions.php b/admin/pages/functions.php
new file mode 100644
index 0000000..5dd1d91
--- /dev/null
+++ b/admin/pages/functions.php
@@ -0,0 +1,387 @@
+<?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/>.
+ */
+
+/**
+ * Note to anyone feeling the need to edit this file...
+ * You MUST declare $db as global inside your functions in order access MySQL from here.
+ */
+
+function ListArticles($pageid){
+
+ global $db;
+ $result = $db->Query("SELECT article_id,title FROM bayonet_articles WHERE `page_id` = $pageid ORDER BY `weight`");
+ while(($row = $db->Fetch($result))!=false)
+ {
+ $articles[] = $row;
+ }
+
+ echo "<table class=\"panelitems\" width=\"100%\" cellspacing=\"0\">";
+
+ ?>
+ <tr>
+ <td colspan="3" style="text-align:center; text-overflow:ellipsis; overflow:hidden; background-color:#dfe4df; border-bottom: 1px solid #848484;">
+ <?php echo LinkInternal('<img src="images/add.png" />&nbsp;Add New Article','?op=pages&edit='.$pageid.'&newarticle=true'); ?>
+ </td>
+ </tr>
+
+ <?php
+
+ if(count($articles)==0){
+ echo "<tr><td>No Articles Found.<br /></td></tr></table>";
+ return;
+ }
+ foreach($articles as $article)
+ {
+ if($_GET['aid'] == $article['article_id'])
+ echo '<tr class="highlight">';
+ else
+ echo '<tr>';
+ ?>
+
+ <td>^</td>
+ <td style="text-align:center; text-overflow:ellipsis; overflow:hidden;">
+ <a href="?op=pages&edit=<?php echo $pageid; ?>&aid=<?php echo $article['article_id']?>"><?php echo $article['title']; ?></a>
+ </td>
+ <td>v</td>
+ </tr>
+
+ <?php
+ }
+
+ echo "</table>";
+
+
+
+}
+
+function NewArticle($page_id)
+{
+ global $db;
+ if(isset($_POST['newarticleprocessed']))
+ {
+ //Secure our data to prevent injection attacks.
+ $title = addslashes($_POST['title']);
+ $text = addslashes($_POST['text']);
+ if(empty($title) || empty($text))
+ {
+ echo "You must fill everything out before proceeding.";
+ return;
+ }
+ $weight = 0;
+ $result = $db->Query("SELECT * FROM `bayonet_articles` WHERE `page_id` = $page_id ORDER BY `weight` DESC LIMIT 1");
+ while(($row = $db->Fetch($result))!=false)
+ {
+ $weight = $row['weight'];
+ }
+ $weight++;
+
+ //Update the database with the new data.
+ $db->Query("INSERT INTO `bayonet_articles` (`article_id` ,`page_id` ,`title` ,`text`, `weight`)VALUES (NULL , $page_id, '$title', '$text', '$weight')");
+ echo "New article, '$title', has been added.\n";
+ //die, because we have completed what we wanted to do.
+ return;
+ }
+
+ ?>
+ <h3>Add New Article</h3>
+ <form action="<?php $_SERVER['PHP_SELF']?>" method="post">
+ <table>
+ <tr><td>Title: </td><td><input type="text" name="title" value="" /></td></tr>
+ <tr><td colspan="2"><textarea id="markItUp" rows="30" cols="80" name="text"></textarea></td>
+ <tr><th colspan="2"><input type="submit" name="newarticleprocessed" value="Submit" /></th></tr>
+ </table>
+ </form>
+ <?php
+}
+
+function EditArticle($article_id){
+
+ global $db;
+
+ if(isset($_POST['articleprocessed']))
+ {
+ //Secure our data to prevent injection attacks.
+ $title = addslashes($_POST['title']);
+ $text = addslashes($_POST['text']);
+ if(empty($title) || empty($text))
+ {
+ echo "You must fill everything out before proceeding.";
+ return;
+ }
+
+ //Update the database with the new data.
+ $db->Query("UPDATE bayonet_articles SET title = '$title', text = '$text' WHERE article_id = '$article_id'");
+ echo "Article, '$title', has been edited.\n <br /><br /> Please wait while you are redirected. <br /><br />
+ <a href=\"?op=pages&edit=".$_GET['edit']."&aid=".$article_id."\">Click here if you don't feel like waiting.</a>";
+
+ // 3 second redirect to go back to the edit page
+ //echo "<meta http-equiv=\"Refresh\" content=\"3;url=?op=pages&edit=".$_GET['edit']."&aid=".$article_id."\">";
+ PageRedirect(3,"?op=pages&edit={$_GET['edit']}&aid={$article_id}");
+
+ //die, because we have completed what we wanted to do.
+ return;
+ }
+
+
+ //Grab the page from the database according to the $article_id passed to the function.
+ $result = $db->Query("SELECT title,text FROM bayonet_articles WHERE article_id = '$article_id'");
+ while(($row = $db->Fetch($result))!=false)
+ {
+ //We only want one row, so we don't have to $article[]... No foreach necessary.
+ $article = $row;
+ }
+
+
+ ?>
+ <form action="<?php $_SERVER['PHP_SELF'] ?>" method="post">
+ <table>
+ <tr><td>
+ <input type="text" name="title" value="<?php echo $article['title'] ?>" maxlength="50" size="30" />
+ <input type="submit" name="articleprocessed" value="Submit Changes" />
+ <a href="?op=pages&edit=<?php echo $_GET['edit']; ?>&delarticle=<?php echo $article_id; ?>"><img src="images/cancel.png" /> Delete This Article</a>
+ </td></tr>
+ <tr><td><textarea id="markItUp" rows="30" cols="80" name="text"><?php echo $article['text'] ?></textarea></td></tr>
+ </table>
+ </form>
+ <?php
+}
+
+function DeleteArticle($article_id)
+{
+ global $db;
+
+ $result = $db->Query("SELECT title FROM bayonet_articles WHERE article_id = '$article_id'");
+ $article = $db->Fetch($result);
+
+ if(isset($_POST['proceed']))
+ {
+ echo "Article '{$article['title']}', was deleted.";
+ $db->Query("DELETE FROM bayonet_articles WHERE article_id = '$article_id' LIMIT 1");
+ return;
+ }
+ if(isset($_POST['cancel']))
+ {
+ echo "User cancelled deletion of article: '{$article['title']}'";
+ return;
+ }
+ ?>
+ <form action="<?php $_SERVER['PHP_SELF'] ?>" method="post">
+ <table>
+ <th>Are you SURE you want to delete the article titled: '<?php echo $article['title']?>'?</th>
+ <tr><th><button name="proceed">Yes</button>&nbsp;&nbsp;&nbsp;<button name="cancel">No</button></th></tr>
+ </table>
+ </form>
+ <?php
+}
+
+function ListPages($pid = NULL)
+{
+ global $db;
+ $result = $db->Query("SELECT page_id,title FROM bayonet_pages");
+ while(($row = $db->Fetch($result))!=false)
+ {
+ $pages[] = $row;
+ }
+
+ echo "<table class=\"panelitems\" width=\"100%\" cellspacing=\"0\">";
+
+ ?>
+ <tr>
+ <td style="text-align:center; text-overflow:ellipsis; overflow:hidden; background-color:#dfe4df; border-bottom: 1px solid #848484;">
+ <?php echo LinkInternal('<img src="images/add.png" />&nbsp;Create New Page','?op=pages&create=true'); ?>
+ </td>
+ </tr>
+
+ <?php
+
+ if(count($pages)==0){
+ echo "<tr><td>No Pages Found.<br /></td></tr></table>";
+ return;
+ }
+
+ foreach($pages as $page)
+ {
+ if($pid == $page['page_id'])
+ echo '<tr class="highlight">';
+ else
+ echo '<tr>';
+ ?>
+
+ <td style="text-align:center; text-overflow:ellipsis; overflow:hidden;">
+ <a href="?op=pages&edit=<?php echo $page['page_id']?>"><?php echo $page['title']; ?></a>
+ </td>
+ </tr>
+
+ <?php
+ }
+
+ ?>
+<!--
+ <tr style="vertical-align:bottom; background-color:green; text-overflow:ellipsis; overflow:hidden;">
+ <td>
+ <table class="panelitems">
+ <tr><td>
+ <?php echo LinkInternal('<img src="images/add.png" />&nbsp;Create New Page','?op=pages&create=true'); ?> <br />
+ <?php echo LinkInternal('<img src="images/view.gif" />&nbsp;View this Page','../index.php?load=page&id='.$page_id); ?> <br />
+ <?php echo LinkInternal('<img src="images/cancel.png" />&nbsp;Delete this Page','?op=pages&delete='.$page_id); ?> <br />
+ </td></tr>
+ </table>
+ <td>
+ </tr> -->
+
+
+ <tr>
+ <td style="text-align:center; text-overflow:ellipsis; overflow:hidden;">
+ <?php echo LinkInternal('<img src="images/view.gif" />&nbsp;View this Page','../index.php?load=page&id='.$pid); ?>
+ </td>
+ </tr>
+ <tr>
+ <td style="text-align:center; text-overflow:ellipsis; overflow:hidden;">
+ <?php echo LinkInternal('<img src="images/cancel.png" />&nbsp;Delete this Page','?op=pages&delete='.$pid); ?>
+ </td>
+ </tr>
+ <?php
+
+ echo "</table>";
+
+}
+
+function NewPage()
+{
+ global $db;
+ if(isset($_POST['newpageprocessed']))
+ {
+ //Secure our data to prevent injection attacks.
+ $title = addslashes($_POST['title']);
+ if(empty($title))
+ {
+ echo "You must fill everything out before proceeding.";
+ return;
+ }
+
+ //Update the database with the new data.
+ $db->Query("INSERT INTO `bayonet_pages` (`page_id` ,`author_id` ,`page_created` ,`title` ,`text`)VALUES (NULL , '0',CURRENT_TIMESTAMP , '$title', '$text')");
+
+ echo "New page, '$title', has been added.\n";
+ //die, because we have completed what we wanted to do.
+ return;
+ }
+
+ ?>
+ <h3>Add New Page</h3>
+ <form action="<?php $_SERVER['PHP_SELF']?>" method="post">
+ <table>
+ <tr><th>Title</th><td><input type="text" name="title" value="" /></td></tr>
+ <tr><th colspan="2"><input type="submit" name="newpageprocessed" value="Submit" /></th></tr>
+ </table>
+ </form>
+ <?php
+}
+
+function EditPage($page_id)
+{
+ global $db;
+ $page_id = addslashes($page_id);
+
+ // If the user has submitted, then process their request.
+ if(isset($_POST['processed']))
+ {
+ //Secure our data to prevent injection attacks.
+ $title = addslashes($_POST['title']);
+ if(empty($title))
+ {
+ echo "You must fill everything out before proceeding.";
+ return;
+ }
+
+ //Update the database with the new data.
+ $db->Query("UPDATE bayonet_pages SET title = '$title' WHERE page_id = '$page_id'");
+ echo "Page, '$title', has been edited.\n";
+ //die, because we have completed what we wanted to do.
+ return;
+ }
+
+?>
+
+ <table class="panel" width="100%" cellspacing="0">
+ <tr>
+ <td class="panel-none">
+ <?php ListPages($page_id); ?>
+ </td>
+ <td class="panel-shadow">
+ <?php ListArticles($page_id); ?>
+ </td>
+ <td class="panel-box">
+<?php
+ //if article is set then EditArticle();
+ $aid = $_GET['aid'];
+
+ if($_GET['newarticle']){
+ NewArticle($page_id);
+ }
+ else if(isset($_GET['delarticle'])){
+ $article_id = $_GET['delarticle'];
+ DeleteArticle($article_id);
+ }
+ else if($aid > 0){
+ EditArticle($aid);
+ }
+ ?>
+ </td>
+
+ </tr>
+ </table>
+ <?php
+}
+
+function DeletePage($page_id)
+{
+ global $db;
+
+ $result = $db->Query("SELECT title FROM bayonet_pages WHERE page_id = '$page_id'");
+ $page = $db->Fetch($result);
+
+ if(isset($_POST['proceed']))
+ {
+ echo "Page '{$page['title']}', was deleted.";
+ $db->Query("DELETE FROM bayonet_pages WHERE page_id = '$page_id' LIMIT 1");
+ return;
+ }
+ if(isset($_POST['cancel']))
+ {
+ echo "User cancelled deletion of page: '{$page['title']}'";
+ return;
+ }
+ if($page_id == 1){
+ echo "You can not delete the home page.";
+ return;
+ }
+
+ ?>
+
+ <form action="<?php $_SERVER['PHP_SELF'] ?>" method="post">
+ <table>
+ <th>Are you <u>SURE</u> you want to delete the page titled: '<?php echo $page['title']?>'?<br />All articles attached to this page will be deleted as well.</th>
+ <tr><th><button name="proceed">Yes</button>&nbsp;&nbsp;&nbsp;<button name="cancel">No</button></th></tr>
+ </table>
+ </form>
+ <?php
+}
+
+?> \ No newline at end of file
diff --git a/admin/pages/index.php b/admin/pages/index.php
new file mode 100644
index 0000000..ce3ec74
--- /dev/null
+++ b/admin/pages/index.php
@@ -0,0 +1,78 @@
+<?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/>.
+ */
+ ?>
+
+ <div style="text-align:left;"><h2>- Manage Pages</h2></div>
+ -Order articles needs to be completed.
+<?php
+
+if(!defined("ADMIN_FILE"))
+{
+ die("Access denied.");
+}
+
+include $basedir.'pages/functions.php';
+
+if(isset($_GET['edit']))
+{
+ $page_id = $_GET['edit'];
+ EditPage($page_id);
+ return;
+}
+
+?>
+
+ <table class="panel" width="100%" cellspacing="0">
+ <tr>
+ <td class="panel-none">
+ <?php ListPages(0); ?>
+ </td>
+<?php
+ if(isset($_GET['delete']))
+ {
+ $page_id = $_GET['delete'];
+ echo "<td class=\"panel-box\">";
+ DeletePage($page_id);
+ echo "</td>";
+ //return;
+ }
+ else if(isset($_GET['create']))
+ {
+ $create = $_GET['create'];
+ if($create)
+ {
+ echo "<td class=\"panel-box\">";
+ NewPage();
+ echo "</td>";
+ //return;
+ }
+ }
+ else
+ {
+ echo "<td class=\"panel-shadow\">
+ </td>
+ <td class=\"panel-box\">
+ </td>";
+ }
+
+?>
+
+ </tr>
+ </table>
+
diff --git a/admin/scripts/jquery.js b/admin/scripts/jquery.js
new file mode 100644
index 0000000..b1ae21d
--- /dev/null
+++ b/admin/scripts/jquery.js
@@ -0,0 +1,19 @@
+/*
+ * jQuery JavaScript Library v1.3.2
+ * http://jquery.com/
+ *
+ * Copyright (c) 2009 John Resig
+ * Dual licensed under the MIT and GPL licenses.
+ * http://docs.jquery.com/License
+ *
+ * Date: 2009-02-19 17:34:21 -0500 (Thu, 19 Feb 2009)
+ * Revision: 6246
+ */
+(function(){var l=this,g,y=l.jQuery,p=l.$,o=l.jQuery=l.$=function(E,F){return new o.fn.init(E,F)},D=/^[^<]*(<(.|\s)+>)[^>]*$|^#([\w-]+)$/,f=/^.[^:#\[\.,]*$/;o.fn=o.prototype={init:function(E,H){E=E||document;if(E.nodeType){this[0]=E;this.length=1;this.context=E;return this}if(typeof E==="string"){var G=D.exec(E);if(G&&(G[1]||!H)){if(G[1]){E=o.clean([G[1]],H)}else{var I=document.getElementById(G[3]);if(I&&I.id!=G[3]){return o().find(E)}var F=o(I||[]);F.context=document;F.selector=E;return F}}else{return o(H).find(E)}}else{if(o.isFunction(E)){return o(document).ready(E)}}if(E.selector&&E.context){this.selector=E.selector;this.context=E.context}return this.setArray(o.isArray(E)?E:o.makeArray(E))},selector:"",jquery:"1.3.2",size:function(){return this.length},get:function(E){return E===g?Array.prototype.slice.call(this):this[E]},pushStack:function(F,H,E){var G=o(F);G.prevObject=this;G.context=this.context;if(H==="find"){G.selector=this.selector+(this.selector?" ":"")+E}else{if(H){G.selector=this.selector+"."+H+"("+E+")"}}return G},setArray:function(E){this.length=0;Array.prototype.push.apply(this,E);return this},each:function(F,E){return o.each(this,F,E)},index:function(E){return o.inArray(E&&E.jquery?E[0]:E,this)},attr:function(F,H,G){var E=F;if(typeof F==="string"){if(H===g){return this[0]&&o[G||"attr"](this[0],F)}else{E={};E[F]=H}}return this.each(function(I){for(F in E){o.attr(G?this.style:this,F,o.prop(this,E[F],G,I,F))}})},css:function(E,F){if((E=="width"||E=="height")&&parseFloat(F)<0){F=g}return this.attr(E,F,"curCSS")},text:function(F){if(typeof F!=="object"&&F!=null){return this.empty().append((this[0]&&this[0].ownerDocument||document).createTextNode(F))}var E="";o.each(F||this,function(){o.each(this.childNodes,function(){if(this.nodeType!=8){E+=this.nodeType!=1?this.nodeValue:o.fn.text([this])}})});return E},wrapAll:function(E){if(this[0]){var F=o(E,this[0].ownerDocument).clone();if(this[0].parentNode){F.insertBefore(this[0])}F.map(function(){var G=this;while(G.firstChild){G=G.firstChild}return G}).append(this)}return this},wrapInner:function(E){return this.each(function(){o(this).contents().wrapAll(E)})},wrap:function(E){return this.each(function(){o(this).wrapAll(E)})},append:function(){return this.domManip(arguments,true,function(E){if(this.nodeType==1){this.appendChild(E)}})},prepend:function(){return this.domManip(arguments,true,function(E){if(this.nodeType==1){this.insertBefore(E,this.firstChild)}})},before:function(){return this.domManip(arguments,false,function(E){this.parentNode.insertBefore(E,this)})},after:function(){return this.domManip(arguments,false,function(E){this.parentNode.insertBefore(E,this.nextSibling)})},end:function(){return this.prevObject||o([])},push:[].push,sort:[].sort,splice:[].splice,find:function(E){if(this.length===1){var F=this.pushStack([],"find",E);F.length=0;o.find(E,this[0],F);return F}else{return this.pushStack(o.unique(o.map(this,function(G){return o.find(E,G)})),"find",E)}},clone:function(G){var E=this.map(function(){if(!o.support.noCloneEvent&&!o.isXMLDoc(this)){var I=this.outerHTML;if(!I){var J=this.ownerDocument.createElement("div");J.appendChild(this.cloneNode(true));I=J.innerHTML}return o.clean([I.replace(/ jQuery\d+="(?:\d+|null)"/g,"").replace(/^\s*/,"")])[0]}else{return this.cloneNode(true)}});if(G===true){var H=this.find("*").andSelf(),F=0;E.find("*").andSelf().each(function(){if(this.nodeName!==H[F].nodeName){return}var I=o.data(H[F],"events");for(var K in I){for(var J in I[K]){o.event.add(this,K,I[K][J],I[K][J].data)}}F++})}return E},filter:function(E){return this.pushStack(o.isFunction(E)&&o.grep(this,function(G,F){return E.call(G,F)})||o.multiFilter(E,o.grep(this,function(F){return F.nodeType===1})),"filter",E)},closest:function(E){var G=o.expr.match.POS.test(E)?o(E):null,F=0;return this.map(function(){var H=this;while(H&&H.ownerDocument){if(G?G.index(H)>-1:o(H).is(E)){o.data(H,"closest",F);return H}H=H.parentNode;F++}})},not:function(E){if(typeof E==="string"){if(f.test(E)){return this.pushStack(o.multiFilter(E,this,true),"not",E)}else{E=o.multiFilter(E,this)}}var F=E.length&&E[E.length-1]!==g&&!E.nodeType;return this.filter(function(){return F?o.inArray(this,E)<0:this!=E})},add:function(E){return this.pushStack(o.unique(o.merge(this.get(),typeof E==="string"?o(E):o.makeArray(E))))},is:function(E){return !!E&&o.multiFilter(E,this).length>0},hasClass:function(E){return !!E&&this.is("."+E)},val:function(K){if(K===g){var E=this[0];if(E){if(o.nodeName(E,"option")){return(E.attributes.value||{}).specified?E.value:E.text}if(o.nodeName(E,"select")){var I=E.selectedIndex,L=[],M=E.options,H=E.type=="select-one";if(I<0){return null}for(var F=H?I:0,J=H?I+1:M.length;F<J;F++){var G=M[F];if(G.selected){K=o(G).val();if(H){return K}L.push(K)}}return L}return(E.value||"").replace(/\r/g,"")}return g}if(typeof K==="number"){K+=""}return this.each(function(){if(this.nodeType!=1){return}if(o.isArray(K)&&/radio|checkbox/.test(this.type)){this.checked=(o.inArray(this.value,K)>=0||o.inArray(this.name,K)>=0)}else{if(o.nodeName(this,"select")){var N=o.makeArray(K);o("option",this).each(function(){this.selected=(o.inArray(this.value,N)>=0||o.inArray(this.text,N)>=0)});if(!N.length){this.selectedIndex=-1}}else{this.value=K}}})},html:function(E){return E===g?(this[0]?this[0].innerHTML.replace(/ jQuery\d+="(?:\d+|null)"/g,""):null):this.empty().append(E)},replaceWith:function(E){return this.after(E).remove()},eq:function(E){return this.slice(E,+E+1)},slice:function(){return this.pushStack(Array.prototype.slice.apply(this,arguments),"slice",Array.prototype.slice.call(arguments).join(","))},map:function(E){return this.pushStack(o.map(this,function(G,F){return E.call(G,F,G)}))},andSelf:function(){return this.add(this.prevObject)},domManip:function(J,M,L){if(this[0]){var I=(this[0].ownerDocument||this[0]).createDocumentFragment(),F=o.clean(J,(this[0].ownerDocument||this[0]),I),H=I.firstChild;if(H){for(var G=0,E=this.length;G<E;G++){L.call(K(this[G],H),this.length>1||G>0?I.cloneNode(true):I)}}if(F){o.each(F,z)}}return this;function K(N,O){return M&&o.nodeName(N,"table")&&o.nodeName(O,"tr")?(N.getElementsByTagName("tbody")[0]||N.appendChild(N.ownerDocument.createElement("tbody"))):N}}};o.fn.init.prototype=o.fn;function z(E,F){if(F.src){o.ajax({url:F.src,async:false,dataType:"script"})}else{o.globalEval(F.text||F.textContent||F.innerHTML||"")}if(F.parentNode){F.parentNode.removeChild(F)}}function e(){return +new Date}o.extend=o.fn.extend=function(){var J=arguments[0]||{},H=1,I=arguments.length,E=false,G;if(typeof J==="boolean"){E=J;J=arguments[1]||{};H=2}if(typeof J!=="object"&&!o.isFunction(J)){J={}}if(I==H){J=this;--H}for(;H<I;H++){if((G=arguments[H])!=null){for(var F in G){var K=J[F],L=G[F];if(J===L){continue}if(E&&L&&typeof L==="object"&&!L.nodeType){J[F]=o.extend(E,K||(L.length!=null?[]:{}),L)}else{if(L!==g){J[F]=L}}}}}return J};var b=/z-?index|font-?weight|opacity|zoom|line-?height/i,q=document.defaultView||{},s=Object.prototype.toString;o.extend({noConflict:function(E){l.$=p;if(E){l.jQuery=y}return o},isFunction:function(E){return s.call(E)==="[object Function]"},isArray:function(E){return s.call(E)==="[object Array]"},isXMLDoc:function(E){return E.nodeType===9&&E.documentElement.nodeName!=="HTML"||!!E.ownerDocument&&o.isXMLDoc(E.ownerDocument)},globalEval:function(G){if(G&&/\S/.test(G)){var F=document.getElementsByTagName("head")[0]||document.documentElement,E=document.createElement("script");E.type="text/javascript";if(o.support.scriptEval){E.appendChild(document.createTextNode(G))}else{E.text=G}F.insertBefore(E,F.firstChild);F.removeChild(E)}},nodeName:function(F,E){return F.nodeName&&F.nodeName.toUpperCase()==E.toUpperCase()},each:function(G,K,F){var E,H=0,I=G.length;if(F){if(I===g){for(E in G){if(K.apply(G[E],F)===false){break}}}else{for(;H<I;){if(K.apply(G[H++],F)===false){break}}}}else{if(I===g){for(E in G){if(K.call(G[E],E,G[E])===false){break}}}else{for(var J=G[0];H<I&&K.call(J,H,J)!==false;J=G[++H]){}}}return G},prop:function(H,I,G,F,E){if(o.isFunction(I)){I=I.call(H,F)}return typeof I==="number"&&G=="curCSS"&&!b.test(E)?I+"px":I},className:{add:function(E,F){o.each((F||"").split(/\s+/),function(G,H){if(E.nodeType==1&&!o.className.has(E.className,H)){E.className+=(E.className?" ":"")+H}})},remove:function(E,F){if(E.nodeType==1){E.className=F!==g?o.grep(E.className.split(/\s+/),function(G){return !o.className.has(F,G)}).join(" "):""}},has:function(F,E){return F&&o.inArray(E,(F.className||F).toString().split(/\s+/))>-1}},swap:function(H,G,I){var E={};for(var F in G){E[F]=H.style[F];H.style[F]=G[F]}I.call(H);for(var F in G){H.style[F]=E[F]}},css:function(H,F,J,E){if(F=="width"||F=="height"){var L,G={position:"absolute",visibility:"hidden",display:"block"},K=F=="width"?["Left","Right"]:["Top","Bottom"];function I(){L=F=="width"?H.offsetWidth:H.offsetHeight;if(E==="border"){return}o.each(K,function(){if(!E){L-=parseFloat(o.curCSS(H,"padding"+this,true))||0}if(E==="margin"){L+=parseFloat(o.curCSS(H,"margin"+this,true))||0}else{L-=parseFloat(o.curCSS(H,"border"+this+"Width",true))||0}})}if(H.offsetWidth!==0){I()}else{o.swap(H,G,I)}return Math.max(0,Math.round(L))}return o.curCSS(H,F,J)},curCSS:function(I,F,G){var L,E=I.style;if(F=="opacity"&&!o.support.opacity){L=o.attr(E,"opacity");return L==""?"1":L}if(F.match(/float/i)){F=w}if(!G&&E&&E[F]){L=E[F]}else{if(q.getComputedStyle){if(F.match(/float/i)){F="float"}F=F.replace(/([A-Z])/g,"-$1").toLowerCase();var M=q.getComputedStyle(I,null);if(M){L=M.getPropertyValue(F)}if(F=="opacity"&&L==""){L="1"}}else{if(I.currentStyle){var J=F.replace(/\-(\w)/g,function(N,O){return O.toUpperCase()});L=I.currentStyle[F]||I.currentStyle[J];if(!/^\d+(px)?$/i.test(L)&&/^\d/.test(L)){var H=E.left,K=I.runtimeStyle.left;I.runtimeStyle.left=I.currentStyle.left;E.left=L||0;L=E.pixelLeft+"px";E.left=H;I.runtimeStyle.left=K}}}}return L},clean:function(F,K,I){K=K||document;if(typeof K.createElement==="undefined"){K=K.ownerDocument||K[0]&&K[0].ownerDocument||document}if(!I&&F.length===1&&typeof F[0]==="string"){var H=/^<(\w+)\s*\/?>$/.exec(F[0]);if(H){return[K.createElement(H[1])]}}var G=[],E=[],L=K.createElement("div");o.each(F,function(P,S){if(typeof S==="number"){S+=""}if(!S){return}if(typeof S==="string"){S=S.replace(/(<(\w+)[^>]*?)\/>/g,function(U,V,T){return T.match(/^(abbr|br|col|img|input|link|meta|param|hr|area|embed)$/i)?U:V+"></"+T+">"});var O=S.replace(/^\s+/,"").substring(0,10).toLowerCase();var Q=!O.indexOf("<opt")&&[1,"<select multiple='multiple'>","</select>"]||!O.indexOf("<leg")&&[1,"<fieldset>","</fieldset>"]||O.match(/^<(thead|tbody|tfoot|colg|cap)/)&&[1,"<table>","</table>"]||!O.indexOf("<tr")&&[2,"<table><tbody>","</tbody></table>"]||(!O.indexOf("<td")||!O.indexOf("<th"))&&[3,"<table><tbody><tr>","</tr></tbody></table>"]||!O.indexOf("<col")&&[2,"<table><tbody></tbody><colgroup>","</colgroup></table>"]||!o.support.htmlSerialize&&[1,"div<div>","</div>"]||[0,"",""];L.innerHTML=Q[1]+S+Q[2];while(Q[0]--){L=L.lastChild}if(!o.support.tbody){var R=/<tbody/i.test(S),N=!O.indexOf("<table")&&!R?L.firstChild&&L.firstChild.childNodes:Q[1]=="<table>"&&!R?L.childNodes:[];for(var M=N.length-1;M>=0;--M){if(o.nodeName(N[M],"tbody")&&!N[M].childNodes.length){N[M].parentNode.removeChild(N[M])}}}if(!o.support.leadingWhitespace&&/^\s/.test(S)){L.insertBefore(K.createTextNode(S.match(/^\s*/)[0]),L.firstChild)}S=o.makeArray(L.childNodes)}if(S.nodeType){G.push(S)}else{G=o.merge(G,S)}});if(I){for(var J=0;G[J];J++){if(o.nodeName(G[J],"script")&&(!G[J].type||G[J].type.toLowerCase()==="text/javascript")){E.push(G[J].parentNode?G[J].parentNode.removeChild(G[J]):G[J])}else{if(G[J].nodeType===1){G.splice.apply(G,[J+1,0].concat(o.makeArray(G[J].getElementsByTagName("script"))))}I.appendChild(G[J])}}return E}return G},attr:function(J,G,K){if(!J||J.nodeType==3||J.nodeType==8){return g}var H=!o.isXMLDoc(J),L=K!==g;G=H&&o.props[G]||G;if(J.tagName){var F=/href|src|style/.test(G);if(G=="selected"&&J.parentNode){J.parentNode.selectedIndex}if(G in J&&H&&!F){if(L){if(G=="type"&&o.nodeName(J,"input")&&J.parentNode){throw"type property can't be changed"}J[G]=K}if(o.nodeName(J,"form")&&J.getAttributeNode(G)){return J.getAttributeNode(G).nodeValue}if(G=="tabIndex"){var I=J.getAttributeNode("tabIndex");return I&&I.specified?I.value:J.nodeName.match(/(button|input|object|select|textarea)/i)?0:J.nodeName.match(/^(a|area)$/i)&&J.href?0:g}return J[G]}if(!o.support.style&&H&&G=="style"){return o.attr(J.style,"cssText",K)}if(L){J.setAttribute(G,""+K)}var E=!o.support.hrefNormalized&&H&&F?J.getAttribute(G,2):J.getAttribute(G);return E===null?g:E}if(!o.support.opacity&&G=="opacity"){if(L){J.zoom=1;J.filter=(J.filter||"").replace(/alpha\([^)]*\)/,"")+(parseInt(K)+""=="NaN"?"":"alpha(opacity="+K*100+")")}return J.filter&&J.filter.indexOf("opacity=")>=0?(parseFloat(J.filter.match(/opacity=([^)]*)/)[1])/100)+"":""}G=G.replace(/-([a-z])/ig,function(M,N){return N.toUpperCase()});if(L){J[G]=K}return J[G]},trim:function(E){return(E||"").replace(/^\s+|\s+$/g,"")},makeArray:function(G){var E=[];if(G!=null){var F=G.length;if(F==null||typeof G==="string"||o.isFunction(G)||G.setInterval){E[0]=G}else{while(F){E[--F]=G[F]}}}return E},inArray:function(G,H){for(var E=0,F=H.length;E<F;E++){if(H[E]===G){return E}}return -1},merge:function(H,E){var F=0,G,I=H.length;if(!o.support.getAll){while((G=E[F++])!=null){if(G.nodeType!=8){H[I++]=G}}}else{while((G=E[F++])!=null){H[I++]=G}}return H},unique:function(K){var F=[],E={};try{for(var G=0,H=K.length;G<H;G++){var J=o.data(K[G]);if(!E[J]){E[J]=true;F.push(K[G])}}}catch(I){F=K}return F},grep:function(F,J,E){var G=[];for(var H=0,I=F.length;H<I;H++){if(!E!=!J(F[H],H)){G.push(F[H])}}return G},map:function(E,J){var F=[];for(var G=0,H=E.length;G<H;G++){var I=J(E[G],G);if(I!=null){F[F.length]=I}}return F.concat.apply([],F)}});var C=navigator.userAgent.toLowerCase();o.browser={version:(C.match(/.+(?:rv|it|ra|ie)[\/: ]([\d.]+)/)||[0,"0"])[1],safari:/webkit/.test(C),opera:/opera/.test(C),msie:/msie/.test(C)&&!/opera/.test(C),mozilla:/mozilla/.test(C)&&!/(compatible|webkit)/.test(C)};o.each({parent:function(E){return E.parentNode},parents:function(E){return o.dir(E,"parentNode")},next:function(E){return o.nth(E,2,"nextSibling")},prev:function(E){return o.nth(E,2,"previousSibling")},nextAll:function(E){return o.dir(E,"nextSibling")},prevAll:function(E){return o.dir(E,"previousSibling")},siblings:function(E){return o.sibling(E.parentNode.firstChild,E)},children:function(E){return o.sibling(E.firstChild)},contents:function(E){return o.nodeName(E,"iframe")?E.contentDocument||E.contentWindow.document:o.makeArray(E.childNodes)}},function(E,F){o.fn[E]=function(G){var H=o.map(this,F);if(G&&typeof G=="string"){H=o.multiFilter(G,H)}return this.pushStack(o.unique(H),E,G)}});o.each({appendTo:"append",prependTo:"prepend",insertBefore:"before",insertAfter:"after",replaceAll:"replaceWith"},function(E,F){o.fn[E]=function(G){var J=[],L=o(G);for(var K=0,H=L.length;K<H;K++){var I=(K>0?this.clone(true):this).get();o.fn[F].apply(o(L[K]),I);J=J.concat(I)}return this.pushStack(J,E,G)}});o.each({removeAttr:function(E){o.attr(this,E,"");if(this.nodeType==1){this.removeAttribute(E)}},addClass:function(E){o.className.add(this,E)},removeClass:function(E){o.className.remove(this,E)},toggleClass:function(F,E){if(typeof E!=="boolean"){E=!o.className.has(this,F)}o.className[E?"add":"remove"](this,F)},remove:function(E){if(!E||o.filter(E,[this]).length){o("*",this).add([this]).each(function(){o.event.remove(this);o.removeData(this)});if(this.parentNode){this.parentNode.removeChild(this)}}},empty:function(){o(this).children().remove();while(this.firstChild){this.removeChild(this.firstChild)}}},function(E,F){o.fn[E]=function(){return this.each(F,arguments)}});function j(E,F){return E[0]&&parseInt(o.curCSS(E[0],F,true),10)||0}var h="jQuery"+e(),v=0,A={};o.extend({cache:{},data:function(F,E,G){F=F==l?A:F;var H=F[h];if(!H){H=F[h]=++v}if(E&&!o.cache[H]){o.cache[H]={}}if(G!==g){o.cache[H][E]=G}return E?o.cache[H][E]:H},removeData:function(F,E){F=F==l?A:F;var H=F[h];if(E){if(o.cache[H]){delete o.cache[H][E];E="";for(E in o.cache[H]){break}if(!E){o.removeData(F)}}}else{try{delete F[h]}catch(G){if(F.removeAttribute){F.removeAttribute(h)}}delete o.cache[H]}},queue:function(F,E,H){if(F){E=(E||"fx")+"queue";var G=o.data(F,E);if(!G||o.isArray(H)){G=o.data(F,E,o.makeArray(H))}else{if(H){G.push(H)}}}return G},dequeue:function(H,G){var E=o.queue(H,G),F=E.shift();if(!G||G==="fx"){F=E[0]}if(F!==g){F.call(H)}}});o.fn.extend({data:function(E,G){var H=E.split(".");H[1]=H[1]?"."+H[1]:"";if(G===g){var F=this.triggerHandler("getData"+H[1]+"!",[H[0]]);if(F===g&&this.length){F=o.data(this[0],E)}return F===g&&H[1]?this.data(H[0]):F}else{return this.trigger("setData"+H[1]+"!",[H[0],G]).each(function(){o.data(this,E,G)})}},removeData:function(E){return this.each(function(){o.removeData(this,E)})},queue:function(E,F){if(typeof E!=="string"){F=E;E="fx"}if(F===g){return o.queue(this[0],E)}return this.each(function(){var G=o.queue(this,E,F);if(E=="fx"&&G.length==1){G[0].call(this)}})},dequeue:function(E){return this.each(function(){o.dequeue(this,E)})}});
+/*
+ * Sizzle CSS Selector Engine - v0.9.3
+ * Copyright 2009, The Dojo Foundation
+ * Released under the MIT, BSD, and GPL Licenses.
+ * More information: http://sizzlejs.com/
+ */
+(function(){var R=/((?:\((?:\([^()]+\)|[^()]+)+\)|\[(?:\[[^[\]]*\]|['"][^'"]*['"]|[^[\]'"]+)+\]|\\.|[^ >+~,(\[\\]+)+|[>+~])(\s*,\s*)?/g,L=0,H=Object.prototype.toString;var F=function(Y,U,ab,ac){ab=ab||[];U=U||document;if(U.nodeType!==1&&U.nodeType!==9){return[]}if(!Y||typeof Y!=="string"){return ab}var Z=[],W,af,ai,T,ad,V,X=true;R.lastIndex=0;while((W=R.exec(Y))!==null){Z.push(W[1]);if(W[2]){V=RegExp.rightContext;break}}if(Z.length>1&&M.exec(Y)){if(Z.length===2&&I.relative[Z[0]]){af=J(Z[0]+Z[1],U)}else{af=I.relative[Z[0]]?[U]:F(Z.shift(),U);while(Z.length){Y=Z.shift();if(I.relative[Y]){Y+=Z.shift()}af=J(Y,af)}}}else{var ae=ac?{expr:Z.pop(),set:E(ac)}:F.find(Z.pop(),Z.length===1&&U.parentNode?U.parentNode:U,Q(U));af=F.filter(ae.expr,ae.set);if(Z.length>0){ai=E(af)}else{X=false}while(Z.length){var ah=Z.pop(),ag=ah;if(!I.relative[ah]){ah=""}else{ag=Z.pop()}if(ag==null){ag=U}I.relative[ah](ai,ag,Q(U))}}if(!ai){ai=af}if(!ai){throw"Syntax error, unrecognized expression: "+(ah||Y)}if(H.call(ai)==="[object Array]"){if(!X){ab.push.apply(ab,ai)}else{if(U.nodeType===1){for(var aa=0;ai[aa]!=null;aa++){if(ai[aa]&&(ai[aa]===true||ai[aa].nodeType===1&&K(U,ai[aa]))){ab.push(af[aa])}}}else{for(var aa=0;ai[aa]!=null;aa++){if(ai[aa]&&ai[aa].nodeType===1){ab.push(af[aa])}}}}}else{E(ai,ab)}if(V){F(V,U,ab,ac);if(G){hasDuplicate=false;ab.sort(G);if(hasDuplicate){for(var aa=1;aa<ab.length;aa++){if(ab[aa]===ab[aa-1]){ab.splice(aa--,1)}}}}}return ab};F.matches=function(T,U){return F(T,null,null,U)};F.find=function(aa,T,ab){var Z,X;if(!aa){return[]}for(var W=0,V=I.order.length;W<V;W++){var Y=I.order[W],X;if((X=I.match[Y].exec(aa))){var U=RegExp.leftContext;if(U.substr(U.length-1)!=="\\"){X[1]=(X[1]||"").replace(/\\/g,"");Z=I.find[Y](X,T,ab);if(Z!=null){aa=aa.replace(I.match[Y],"");break}}}}if(!Z){Z=T.getElementsByTagName("*")}return{set:Z,expr:aa}};F.filter=function(ad,ac,ag,W){var V=ad,ai=[],aa=ac,Y,T,Z=ac&&ac[0]&&Q(ac[0]);while(ad&&ac.length){for(var ab in I.filter){if((Y=I.match[ab].exec(ad))!=null){var U=I.filter[ab],ah,af;T=false;if(aa==ai){ai=[]}if(I.preFilter[ab]){Y=I.preFilter[ab](Y,aa,ag,ai,W,Z);if(!Y){T=ah=true}else{if(Y===true){continue}}}if(Y){for(var X=0;(af=aa[X])!=null;X++){if(af){ah=U(af,Y,X,aa);var ae=W^!!ah;if(ag&&ah!=null){if(ae){T=true}else{aa[X]=false}}else{if(ae){ai.push(af);T=true}}}}}if(ah!==g){if(!ag){aa=ai}ad=ad.replace(I.match[ab],"");if(!T){return[]}break}}}if(ad==V){if(T==null){throw"Syntax error, unrecognized expression: "+ad}else{break}}V=ad}return aa};var I=F.selectors={order:["ID","NAME","TAG"],match:{ID:/#((?:[\w\u00c0-\uFFFF_-]|\\.)+)/,CLASS:/\.((?:[\w\u00c0-\uFFFF_-]|\\.)+)/,NAME:/\[name=['"]*((?:[\w\u00c0-\uFFFF_-]|\\.)+)['"]*\]/,ATTR:/\[\s*((?:[\w\u00c0-\uFFFF_-]|\\.)+)\s*(?:(\S?=)\s*(['"]*)(.*?)\3|)\s*\]/,TAG:/^((?:[\w\u00c0-\uFFFF\*_-]|\\.)+)/,CHILD:/:(only|nth|last|first)-child(?:\((even|odd|[\dn+-]*)\))?/,POS:/:(nth|eq|gt|lt|first|last|even|odd)(?:\((\d*)\))?(?=[^-]|$)/,PSEUDO:/:((?:[\w\u00c0-\uFFFF_-]|\\.)+)(?:\((['"]*)((?:\([^\)]+\)|[^\2\(\)]*)+)\2\))?/},attrMap:{"class":"className","for":"htmlFor"},attrHandle:{href:function(T){return T.getAttribute("href")}},relative:{"+":function(aa,T,Z){var X=typeof T==="string",ab=X&&!/\W/.test(T),Y=X&&!ab;if(ab&&!Z){T=T.toUpperCase()}for(var W=0,V=aa.length,U;W<V;W++){if((U=aa[W])){while((U=U.previousSibling)&&U.nodeType!==1){}aa[W]=Y||U&&U.nodeName===T?U||false:U===T}}if(Y){F.filter(T,aa,true)}},">":function(Z,U,aa){var X=typeof U==="string";if(X&&!/\W/.test(U)){U=aa?U:U.toUpperCase();for(var V=0,T=Z.length;V<T;V++){var Y=Z[V];if(Y){var W=Y.parentNode;Z[V]=W.nodeName===U?W:false}}}else{for(var V=0,T=Z.length;V<T;V++){var Y=Z[V];if(Y){Z[V]=X?Y.parentNode:Y.parentNode===U}}if(X){F.filter(U,Z,true)}}},"":function(W,U,Y){var V=L++,T=S;if(!U.match(/\W/)){var X=U=Y?U:U.toUpperCase();T=P}T("parentNode",U,V,W,X,Y)},"~":function(W,U,Y){var V=L++,T=S;if(typeof U==="string"&&!U.match(/\W/)){var X=U=Y?U:U.toUpperCase();T=P}T("previousSibling",U,V,W,X,Y)}},find:{ID:function(U,V,W){if(typeof V.getElementById!=="undefined"&&!W){var T=V.getElementById(U[1]);return T?[T]:[]}},NAME:function(V,Y,Z){if(typeof Y.getElementsByName!=="undefined"){var U=[],X=Y.getElementsByName(V[1]);for(var W=0,T=X.length;W<T;W++){if(X[W].getAttribute("name")===V[1]){U.push(X[W])}}return U.length===0?null:U}},TAG:function(T,U){return U.getElementsByTagName(T[1])}},preFilter:{CLASS:function(W,U,V,T,Z,aa){W=" "+W[1].replace(/\\/g,"")+" ";if(aa){return W}for(var X=0,Y;(Y=U[X])!=null;X++){if(Y){if(Z^(Y.className&&(" "+Y.className+" ").indexOf(W)>=0)){if(!V){T.push(Y)}}else{if(V){U[X]=false}}}}return false},ID:function(T){return T[1].replace(/\\/g,"")},TAG:function(U,T){for(var V=0;T[V]===false;V++){}return T[V]&&Q(T[V])?U[1]:U[1].toUpperCase()},CHILD:function(T){if(T[1]=="nth"){var U=/(-?)(\d*)n((?:\+|-)?\d*)/.exec(T[2]=="even"&&"2n"||T[2]=="odd"&&"2n+1"||!/\D/.test(T[2])&&"0n+"+T[2]||T[2]);T[2]=(U[1]+(U[2]||1))-0;T[3]=U[3]-0}T[0]=L++;return T},ATTR:function(X,U,V,T,Y,Z){var W=X[1].replace(/\\/g,"");if(!Z&&I.attrMap[W]){X[1]=I.attrMap[W]}if(X[2]==="~="){X[4]=" "+X[4]+" "}return X},PSEUDO:function(X,U,V,T,Y){if(X[1]==="not"){if(X[3].match(R).length>1||/^\w/.test(X[3])){X[3]=F(X[3],null,null,U)}else{var W=F.filter(X[3],U,V,true^Y);if(!V){T.push.apply(T,W)}return false}}else{if(I.match.POS.test(X[0])||I.match.CHILD.test(X[0])){return true}}return X},POS:function(T){T.unshift(true);return T}},filters:{enabled:function(T){return T.disabled===false&&T.type!=="hidden"},disabled:function(T){return T.disabled===true},checked:function(T){return T.checked===true},selected:function(T){T.parentNode.selectedIndex;return T.selected===true},parent:function(T){return !!T.firstChild},empty:function(T){return !T.firstChild},has:function(V,U,T){return !!F(T[3],V).length},header:function(T){return/h\d/i.test(T.nodeName)},text:function(T){return"text"===T.type},radio:function(T){return"radio"===T.type},checkbox:function(T){return"checkbox"===T.type},file:function(T){return"file"===T.type},password:function(T){return"password"===T.type},submit:function(T){return"submit"===T.type},image:function(T){return"image"===T.type},reset:function(T){return"reset"===T.type},button:function(T){return"button"===T.type||T.nodeName.toUpperCase()==="BUTTON"},input:function(T){return/input|select|textarea|button/i.test(T.nodeName)}},setFilters:{first:function(U,T){return T===0},last:function(V,U,T,W){return U===W.length-1},even:function(U,T){return T%2===0},odd:function(U,T){return T%2===1},lt:function(V,U,T){return U<T[3]-0},gt:function(V,U,T){return U>T[3]-0},nth:function(V,U,T){return T[3]-0==U},eq:function(V,U,T){return T[3]-0==U}},filter:{PSEUDO:function(Z,V,W,aa){var U=V[1],X=I.filters[U];if(X){return X(Z,W,V,aa)}else{if(U==="contains"){return(Z.textContent||Z.innerText||"").indexOf(V[3])>=0}else{if(U==="not"){var Y=V[3];for(var W=0,T=Y.length;W<T;W++){if(Y[W]===Z){return false}}return true}}}},CHILD:function(T,W){var Z=W[1],U=T;switch(Z){case"only":case"first":while(U=U.previousSibling){if(U.nodeType===1){return false}}if(Z=="first"){return true}U=T;case"last":while(U=U.nextSibling){if(U.nodeType===1){return false}}return true;case"nth":var V=W[2],ac=W[3];if(V==1&&ac==0){return true}var Y=W[0],ab=T.parentNode;if(ab&&(ab.sizcache!==Y||!T.nodeIndex)){var X=0;for(U=ab.firstChild;U;U=U.nextSibling){if(U.nodeType===1){U.nodeIndex=++X}}ab.sizcache=Y}var aa=T.nodeIndex-ac;if(V==0){return aa==0}else{return(aa%V==0&&aa/V>=0)}}},ID:function(U,T){return U.nodeType===1&&U.getAttribute("id")===T},TAG:function(U,T){return(T==="*"&&U.nodeType===1)||U.nodeName===T},CLASS:function(U,T){return(" "+(U.className||U.getAttribute("class"))+" ").indexOf(T)>-1},ATTR:function(Y,W){var V=W[1],T=I.attrHandle[V]?I.attrHandle[V](Y):Y[V]!=null?Y[V]:Y.getAttribute(V),Z=T+"",X=W[2],U=W[4];return T==null?X==="!=":X==="="?Z===U:X==="*="?Z.indexOf(U)>=0:X==="~="?(" "+Z+" ").indexOf(U)>=0:!U?Z&&T!==false:X==="!="?Z!=U:X==="^="?Z.indexOf(U)===0:X==="$="?Z.substr(Z.length-U.length)===U:X==="|="?Z===U||Z.substr(0,U.length+1)===U+"-":false},POS:function(X,U,V,Y){var T=U[2],W=I.setFilters[T];if(W){return W(X,V,U,Y)}}}};var M=I.match.POS;for(var O in I.match){I.match[O]=RegExp(I.match[O].source+/(?![^\[]*\])(?![^\(]*\))/.source)}var E=function(U,T){U=Array.prototype.slice.call(U);if(T){T.push.apply(T,U);return T}return U};try{Array.prototype.slice.call(document.documentElement.childNodes)}catch(N){E=function(X,W){var U=W||[];if(H.call(X)==="[object Array]"){Array.prototype.push.apply(U,X)}else{if(typeof X.length==="number"){for(var V=0,T=X.length;V<T;V++){U.push(X[V])}}else{for(var V=0;X[V];V++){U.push(X[V])}}}return U}}var G;if(document.documentElement.compareDocumentPosition){G=function(U,T){var V=U.compareDocumentPosition(T)&4?-1:U===T?0:1;if(V===0){hasDuplicate=true}return V}}else{if("sourceIndex" in document.documentElement){G=function(U,T){var V=U.sourceIndex-T.sourceIndex;if(V===0){hasDuplicate=true}return V}}else{if(document.createRange){G=function(W,U){var V=W.ownerDocument.createRange(),T=U.ownerDocument.createRange();V.selectNode(W);V.collapse(true);T.selectNode(U);T.collapse(true);var X=V.compareBoundaryPoints(Range.START_TO_END,T);if(X===0){hasDuplicate=true}return X}}}}(function(){var U=document.createElement("form"),V="script"+(new Date).getTime();U.innerHTML="<input name='"+V+"'/>";var T=document.documentElement;T.insertBefore(U,T.firstChild);if(!!document.getElementById(V)){I.find.ID=function(X,Y,Z){if(typeof Y.getElementById!=="undefined"&&!Z){var W=Y.getElementById(X[1]);return W?W.id===X[1]||typeof W.getAttributeNode!=="undefined"&&W.getAttributeNode("id").nodeValue===X[1]?[W]:g:[]}};I.filter.ID=function(Y,W){var X=typeof Y.getAttributeNode!=="undefined"&&Y.getAttributeNode("id");return Y.nodeType===1&&X&&X.nodeValue===W}}T.removeChild(U)})();(function(){var T=document.createElement("div");T.appendChild(document.createComment(""));if(T.getElementsByTagName("*").length>0){I.find.TAG=function(U,Y){var X=Y.getElementsByTagName(U[1]);if(U[1]==="*"){var W=[];for(var V=0;X[V];V++){if(X[V].nodeType===1){W.push(X[V])}}X=W}return X}}T.innerHTML="<a href='#'></a>";if(T.firstChild&&typeof T.firstChild.getAttribute!=="undefined"&&T.firstChild.getAttribute("href")!=="#"){I.attrHandle.href=function(U){return U.getAttribute("href",2)}}})();if(document.querySelectorAll){(function(){var T=F,U=document.createElement("div");U.innerHTML="<p class='TEST'></p>";if(U.querySelectorAll&&U.querySelectorAll(".TEST").length===0){return}F=function(Y,X,V,W){X=X||document;if(!W&&X.nodeType===9&&!Q(X)){try{return E(X.querySelectorAll(Y),V)}catch(Z){}}return T(Y,X,V,W)};F.find=T.find;F.filter=T.filter;F.selectors=T.selectors;F.matches=T.matches})()}if(document.getElementsByClassName&&document.documentElement.getElementsByClassName){(function(){var T=document.createElement("div");T.innerHTML="<div class='test e'></div><div class='test'></div>";if(T.getElementsByClassName("e").length===0){return}T.lastChild.className="e";if(T.getElementsByClassName("e").length===1){return}I.order.splice(1,0,"CLASS");I.find.CLASS=function(U,V,W){if(typeof V.getElementsByClassName!=="undefined"&&!W){return V.getElementsByClassName(U[1])}}})()}function P(U,Z,Y,ad,aa,ac){var ab=U=="previousSibling"&&!ac;for(var W=0,V=ad.length;W<V;W++){var T=ad[W];if(T){if(ab&&T.nodeType===1){T.sizcache=Y;T.sizset=W}T=T[U];var X=false;while(T){if(T.sizcache===Y){X=ad[T.sizset];break}if(T.nodeType===1&&!ac){T.sizcache=Y;T.sizset=W}if(T.nodeName===Z){X=T;break}T=T[U]}ad[W]=X}}}function S(U,Z,Y,ad,aa,ac){var ab=U=="previousSibling"&&!ac;for(var W=0,V=ad.length;W<V;W++){var T=ad[W];if(T){if(ab&&T.nodeType===1){T.sizcache=Y;T.sizset=W}T=T[U];var X=false;while(T){if(T.sizcache===Y){X=ad[T.sizset];break}if(T.nodeType===1){if(!ac){T.sizcache=Y;T.sizset=W}if(typeof Z!=="string"){if(T===Z){X=true;break}}else{if(F.filter(Z,[T]).length>0){X=T;break}}}T=T[U]}ad[W]=X}}}var K=document.compareDocumentPosition?function(U,T){return U.compareDocumentPosition(T)&16}:function(U,T){return U!==T&&(U.contains?U.contains(T):true)};var Q=function(T){return T.nodeType===9&&T.documentElement.nodeName!=="HTML"||!!T.ownerDocument&&Q(T.ownerDocument)};var J=function(T,aa){var W=[],X="",Y,V=aa.nodeType?[aa]:aa;while((Y=I.match.PSEUDO.exec(T))){X+=Y[0];T=T.replace(I.match.PSEUDO,"")}T=I.relative[T]?T+"*":T;for(var Z=0,U=V.length;Z<U;Z++){F(T,V[Z],W)}return F.filter(X,W)};o.find=F;o.filter=F.filter;o.expr=F.selectors;o.expr[":"]=o.expr.filters;F.selectors.filters.hidden=function(T){return T.offsetWidth===0||T.offsetHeight===0};F.selectors.filters.visible=function(T){return T.offsetWidth>0||T.offsetHeight>0};F.selectors.filters.animated=function(T){return o.grep(o.timers,function(U){return T===U.elem}).length};o.multiFilter=function(V,T,U){if(U){V=":not("+V+")"}return F.matches(V,T)};o.dir=function(V,U){var T=[],W=V[U];while(W&&W!=document){if(W.nodeType==1){T.push(W)}W=W[U]}return T};o.nth=function(X,T,V,W){T=T||1;var U=0;for(;X;X=X[V]){if(X.nodeType==1&&++U==T){break}}return X};o.sibling=function(V,U){var T=[];for(;V;V=V.nextSibling){if(V.nodeType==1&&V!=U){T.push(V)}}return T};return;l.Sizzle=F})();o.event={add:function(I,F,H,K){if(I.nodeType==3||I.nodeType==8){return}if(I.setInterval&&I!=l){I=l}if(!H.guid){H.guid=this.guid++}if(K!==g){var G=H;H=this.proxy(G);H.data=K}var E=o.data(I,"events")||o.data(I,"events",{}),J=o.data(I,"handle")||o.data(I,"handle",function(){return typeof o!=="undefined"&&!o.event.triggered?o.event.handle.apply(arguments.callee.elem,arguments):g});J.elem=I;o.each(F.split(/\s+/),function(M,N){var O=N.split(".");N=O.shift();H.type=O.slice().sort().join(".");var L=E[N];if(o.event.specialAll[N]){o.event.specialAll[N].setup.call(I,K,O)}if(!L){L=E[N]={};if(!o.event.special[N]||o.event.special[N].setup.call(I,K,O)===false){if(I.addEventListener){I.addEventListener(N,J,false)}else{if(I.attachEvent){I.attachEvent("on"+N,J)}}}}L[H.guid]=H;o.event.global[N]=true});I=null},guid:1,global:{},remove:function(K,H,J){if(K.nodeType==3||K.nodeType==8){return}var G=o.data(K,"events"),F,E;if(G){if(H===g||(typeof H==="string"&&H.charAt(0)==".")){for(var I in G){this.remove(K,I+(H||""))}}else{if(H.type){J=H.handler;H=H.type}o.each(H.split(/\s+/),function(M,O){var Q=O.split(".");O=Q.shift();var N=RegExp("(^|\\.)"+Q.slice().sort().join(".*\\.")+"(\\.|$)");if(G[O]){if(J){delete G[O][J.guid]}else{for(var P in G[O]){if(N.test(G[O][P].type)){delete G[O][P]}}}if(o.event.specialAll[O]){o.event.specialAll[O].teardown.call(K,Q)}for(F in G[O]){break}if(!F){if(!o.event.special[O]||o.event.special[O].teardown.call(K,Q)===false){if(K.removeEventListener){K.removeEventListener(O,o.data(K,"handle"),false)}else{if(K.detachEvent){K.detachEvent("on"+O,o.data(K,"handle"))}}}F=null;delete G[O]}}})}for(F in G){break}if(!F){var L=o.data(K,"handle");if(L){L.elem=null}o.removeData(K,"events");o.removeData(K,"handle")}}},trigger:function(I,K,H,E){var G=I.type||I;if(!E){I=typeof I==="object"?I[h]?I:o.extend(o.Event(G),I):o.Event(G);if(G.indexOf("!")>=0){I.type=G=G.slice(0,-1);I.exclusive=true}if(!H){I.stopPropagation();if(this.global[G]){o.each(o.cache,function(){if(this.events&&this.events[G]){o.event.trigger(I,K,this.handle.elem)}})}}if(!H||H.nodeType==3||H.nodeType==8){return g}I.result=g;I.target=H;K=o.makeArray(K);K.unshift(I)}I.currentTarget=H;var J=o.data(H,"handle");if(J){J.apply(H,K)}if((!H[G]||(o.nodeName(H,"a")&&G=="click"))&&H["on"+G]&&H["on"+G].apply(H,K)===false){I.result=false}if(!E&&H[G]&&!I.isDefaultPrevented()&&!(o.nodeName(H,"a")&&G=="click")){this.triggered=true;try{H[G]()}catch(L){}}this.triggered=false;if(!I.isPropagationStopped()){var F=H.parentNode||H.ownerDocument;if(F){o.event.trigger(I,K,F,true)}}},handle:function(K){var J,E;K=arguments[0]=o.event.fix(K||l.event);K.currentTarget=this;var L=K.type.split(".");K.type=L.shift();J=!L.length&&!K.exclusive;var I=RegExp("(^|\\.)"+L.slice().sort().join(".*\\.")+"(\\.|$)");E=(o.data(this,"events")||{})[K.type];for(var G in E){var H=E[G];if(J||I.test(H.type)){K.handler=H;K.data=H.data;var F=H.apply(this,arguments);if(F!==g){K.result=F;if(F===false){K.preventDefault();K.stopPropagation()}}if(K.isImmediatePropagationStopped()){break}}}},props:"altKey attrChange attrName bubbles button cancelable charCode clientX clientY ctrlKey currentTarget data detail eventPhase fromElement handler keyCode metaKey newValue originalTarget pageX pageY prevValue relatedNode relatedTarget screenX screenY shiftKey srcElement target toElement view wheelDelta which".split(" "),fix:function(H){if(H[h]){return H}var F=H;H=o.Event(F);for(var G=this.props.length,J;G;){J=this.props[--G];H[J]=F[J]}if(!H.target){H.target=H.srcElement||document}if(H.target.nodeType==3){H.target=H.target.parentNode}if(!H.relatedTarget&&H.fromElement){H.relatedTarget=H.fromElement==H.target?H.toElement:H.fromElement}if(H.pageX==null&&H.clientX!=null){var I=document.documentElement,E=document.body;H.pageX=H.clientX+(I&&I.scrollLeft||E&&E.scrollLeft||0)-(I.clientLeft||0);H.pageY=H.clientY+(I&&I.scrollTop||E&&E.scrollTop||0)-(I.clientTop||0)}if(!H.which&&((H.charCode||H.charCode===0)?H.charCode:H.keyCode)){H.which=H.charCode||H.keyCode}if(!H.metaKey&&H.ctrlKey){H.metaKey=H.ctrlKey}if(!H.which&&H.button){H.which=(H.button&1?1:(H.button&2?3:(H.button&4?2:0)))}return H},proxy:function(F,E){E=E||function(){return F.apply(this,arguments)};E.guid=F.guid=F.guid||E.guid||this.guid++;return E},special:{ready:{setup:B,teardown:function(){}}},specialAll:{live:{setup:function(E,F){o.event.add(this,F[0],c)},teardown:function(G){if(G.length){var E=0,F=RegExp("(^|\\.)"+G[0]+"(\\.|$)");o.each((o.data(this,"events").live||{}),function(){if(F.test(this.type)){E++}});if(E<1){o.event.remove(this,G[0],c)}}}}}};o.Event=function(E){if(!this.preventDefault){return new o.Event(E)}if(E&&E.type){this.originalEvent=E;this.type=E.type}else{this.type=E}this.timeStamp=e();this[h]=true};function k(){return false}function u(){return true}o.Event.prototype={preventDefault:function(){this.isDefaultPrevented=u;var E=this.originalEvent;if(!E){return}if(E.preventDefault){E.preventDefault()}E.returnValue=false},stopPropagation:function(){this.isPropagationStopped=u;var E=this.originalEvent;if(!E){return}if(E.stopPropagation){E.stopPropagation()}E.cancelBubble=true},stopImmediatePropagation:function(){this.isImmediatePropagationStopped=u;this.stopPropagation()},isDefaultPrevented:k,isPropagationStopped:k,isImmediatePropagationStopped:k};var a=function(F){var E=F.relatedTarget;while(E&&E!=this){try{E=E.parentNode}catch(G){E=this}}if(E!=this){F.type=F.data;o.event.handle.apply(this,arguments)}};o.each({mouseover:"mouseenter",mouseout:"mouseleave"},function(F,E){o.event.special[E]={setup:function(){o.event.add(this,F,a,E)},teardown:function(){o.event.remove(this,F,a)}}});o.fn.extend({bind:function(F,G,E){return F=="unload"?this.one(F,G,E):this.each(function(){o.event.add(this,F,E||G,E&&G)})},one:function(G,H,F){var E=o.event.proxy(F||H,function(I){o(this).unbind(I,E);return(F||H).apply(this,arguments)});return this.each(function(){o.event.add(this,G,E,F&&H)})},unbind:function(F,E){return this.each(function(){o.event.remove(this,F,E)})},trigger:function(E,F){return this.each(function(){o.event.trigger(E,F,this)})},triggerHandler:function(E,G){if(this[0]){var F=o.Event(E);F.preventDefault();F.stopPropagation();o.event.trigger(F,G,this[0]);return F.result}},toggle:function(G){var E=arguments,F=1;while(F<E.length){o.event.proxy(G,E[F++])}return this.click(o.event.proxy(G,function(H){this.lastToggle=(this.lastToggle||0)%F;H.preventDefault();return E[this.lastToggle++].apply(this,arguments)||false}))},hover:function(E,F){return this.mouseenter(E).mouseleave(F)},ready:function(E){B();if(o.isReady){E.call(document,o)}else{o.readyList.push(E)}return this},live:function(G,F){var E=o.event.proxy(F);E.guid+=this.selector+G;o(document).bind(i(G,this.selector),this.selector,E);return this},die:function(F,E){o(document).unbind(i(F,this.selector),E?{guid:E.guid+this.selector+F}:null);return this}});function c(H){var E=RegExp("(^|\\.)"+H.type+"(\\.|$)"),G=true,F=[];o.each(o.data(this,"events").live||[],function(I,J){if(E.test(J.type)){var K=o(H.target).closest(J.data)[0];if(K){F.push({elem:K,fn:J})}}});F.sort(function(J,I){return o.data(J.elem,"closest")-o.data(I.elem,"closest")});o.each(F,function(){if(this.fn.call(this.elem,H,this.fn.data)===false){return(G=false)}});return G}function i(F,E){return["live",F,E.replace(/\./g,"`").replace(/ /g,"|")].join(".")}o.extend({isReady:false,readyList:[],ready:function(){if(!o.isReady){o.isReady=true;if(o.readyList){o.each(o.readyList,function(){this.call(document,o)});o.readyList=null}o(document).triggerHandler("ready")}}});var x=false;function B(){if(x){return}x=true;if(document.addEventListener){document.addEventListener("DOMContentLoaded",function(){document.removeEventListener("DOMContentLoaded",arguments.callee,false);o.ready()},false)}else{if(document.attachEvent){document.attachEvent("onreadystatechange",function(){if(document.readyState==="complete"){document.detachEvent("onreadystatechange",arguments.callee);o.ready()}});if(document.documentElement.doScroll&&l==l.top){(function(){if(o.isReady){return}try{document.documentElement.doScroll("left")}catch(E){setTimeout(arguments.callee,0);return}o.ready()})()}}}o.event.add(l,"load",o.ready)}o.each(("blur,focus,load,resize,scroll,unload,click,dblclick,mousedown,mouseup,mousemove,mouseover,mouseout,mouseenter,mouseleave,change,select,submit,keydown,keypress,keyup,error").split(","),function(F,E){o.fn[E]=function(G){return G?this.bind(E,G):this.trigger(E)}});o(l).bind("unload",function(){for(var E in o.cache){if(E!=1&&o.cache[E].handle){o.event.remove(o.cache[E].handle.elem)}}});(function(){o.support={};var F=document.documentElement,G=document.createElement("script"),K=document.createElement("div"),J="script"+(new Date).getTime();K.style.display="none";K.innerHTML=' <link/><table></table><a href="/a" style="color:red;float:left;opacity:.5;">a</a><select><option>text</option></select><object><param/></object>';var H=K.getElementsByTagName("*"),E=K.getElementsByTagName("a")[0];if(!H||!H.length||!E){return}o.support={leadingWhitespace:K.firstChild.nodeType==3,tbody:!K.getElementsByTagName("tbody").length,objectAll:!!K.getElementsByTagName("object")[0].getElementsByTagName("*").length,htmlSerialize:!!K.getElementsByTagName("link").length,style:/red/.test(E.getAttribute("style")),hrefNormalized:E.getAttribute("href")==="/a",opacity:E.style.opacity==="0.5",cssFloat:!!E.style.cssFloat,scriptEval:false,noCloneEvent:true,boxModel:null};G.type="text/javascript";try{G.appendChild(document.createTextNode("window."+J+"=1;"))}catch(I){}F.insertBefore(G,F.firstChild);if(l[J]){o.support.scriptEval=true;delete l[J]}F.removeChild(G);if(K.attachEvent&&K.fireEvent){K.attachEvent("onclick",function(){o.support.noCloneEvent=false;K.detachEvent("onclick",arguments.callee)});K.cloneNode(true).fireEvent("onclick")}o(function(){var L=document.createElement("div");L.style.width=L.style.paddingLeft="1px";document.body.appendChild(L);o.boxModel=o.support.boxModel=L.offsetWidth===2;document.body.removeChild(L).style.display="none"})})();var w=o.support.cssFloat?"cssFloat":"styleFloat";o.props={"for":"htmlFor","class":"className","float":w,cssFloat:w,styleFloat:w,readonly:"readOnly",maxlength:"maxLength",cellspacing:"cellSpacing",rowspan:"rowSpan",tabindex:"tabIndex"};o.fn.extend({_load:o.fn.load,load:function(G,J,K){if(typeof G!=="string"){return this._load(G)}var I=G.indexOf(" ");if(I>=0){var E=G.slice(I,G.length);G=G.slice(0,I)}var H="GET";if(J){if(o.isFunction(J)){K=J;J=null}else{if(typeof J==="object"){J=o.param(J);H="POST"}}}var F=this;o.ajax({url:G,type:H,dataType:"html",data:J,complete:function(M,L){if(L=="success"||L=="notmodified"){F.html(E?o("<div/>").append(M.responseText.replace(/<script(.|\s)*?\/script>/g,"")).find(E):M.responseText)}if(K){F.each(K,[M.responseText,L,M])}}});return this},serialize:function(){return o.param(this.serializeArray())},serializeArray:function(){return this.map(function(){return this.elements?o.makeArray(this.elements):this}).filter(function(){return this.name&&!this.disabled&&(this.checked||/select|textarea/i.test(this.nodeName)||/text|hidden|password|search/i.test(this.type))}).map(function(E,F){var G=o(this).val();return G==null?null:o.isArray(G)?o.map(G,function(I,H){return{name:F.name,value:I}}):{name:F.name,value:G}}).get()}});o.each("ajaxStart,ajaxStop,ajaxComplete,ajaxError,ajaxSuccess,ajaxSend".split(","),function(E,F){o.fn[F]=function(G){return this.bind(F,G)}});var r=e();o.extend({get:function(E,G,H,F){if(o.isFunction(G)){H=G;G=null}return o.ajax({type:"GET",url:E,data:G,success:H,dataType:F})},getScript:function(E,F){return o.get(E,null,F,"script")},getJSON:function(E,F,G){return o.get(E,F,G,"json")},post:function(E,G,H,F){if(o.isFunction(G)){H=G;G={}}return o.ajax({type:"POST",url:E,data:G,success:H,dataType:F})},ajaxSetup:function(E){o.extend(o.ajaxSettings,E)},ajaxSettings:{url:location.href,global:true,type:"GET",contentType:"application/x-www-form-urlencoded",processData:true,async:true,xhr:function(){return l.ActiveXObject?new ActiveXObject("Microsoft.XMLHTTP"):new XMLHttpRequest()},accepts:{xml:"application/xml, text/xml",html:"text/html",script:"text/javascript, application/javascript",json:"application/json, text/javascript",text:"text/plain",_default:"*/*"}},lastModified:{},ajax:function(M){M=o.extend(true,M,o.extend(true,{},o.ajaxSettings,M));var W,F=/=\?(&|$)/g,R,V,G=M.type.toUpperCase();if(M.data&&M.processData&&typeof M.data!=="string"){M.data=o.param(M.data)}if(M.dataType=="jsonp"){if(G=="GET"){if(!M.url.match(F)){M.url+=(M.url.match(/\?/)?"&":"?")+(M.jsonp||"callback")+"=?"}}else{if(!M.data||!M.data.match(F)){M.data=(M.data?M.data+"&":"")+(M.jsonp||"callback")+"=?"}}M.dataType="json"}if(M.dataType=="json"&&(M.data&&M.data.match(F)||M.url.match(F))){W="jsonp"+r++;if(M.data){M.data=(M.data+"").replace(F,"="+W+"$1")}M.url=M.url.replace(F,"="+W+"$1");M.dataType="script";l[W]=function(X){V=X;I();L();l[W]=g;try{delete l[W]}catch(Y){}if(H){H.removeChild(T)}}}if(M.dataType=="script"&&M.cache==null){M.cache=false}if(M.cache===false&&G=="GET"){var E=e();var U=M.url.replace(/(\?|&)_=.*?(&|$)/,"$1_="+E+"$2");M.url=U+((U==M.url)?(M.url.match(/\?/)?"&":"?")+"_="+E:"")}if(M.data&&G=="GET"){M.url+=(M.url.match(/\?/)?"&":"?")+M.data;M.data=null}if(M.global&&!o.active++){o.event.trigger("ajaxStart")}var Q=/^(\w+:)?\/\/([^\/?#]+)/.exec(M.url);if(M.dataType=="script"&&G=="GET"&&Q&&(Q[1]&&Q[1]!=location.protocol||Q[2]!=location.host)){var H=document.getElementsByTagName("head")[0];var T=document.createElement("script");T.src=M.url;if(M.scriptCharset){T.charset=M.scriptCharset}if(!W){var O=false;T.onload=T.onreadystatechange=function(){if(!O&&(!this.readyState||this.readyState=="loaded"||this.readyState=="complete")){O=true;I();L();T.onload=T.onreadystatechange=null;H.removeChild(T)}}}H.appendChild(T);return g}var K=false;var J=M.xhr();if(M.username){J.open(G,M.url,M.async,M.username,M.password)}else{J.open(G,M.url,M.async)}try{if(M.data){J.setRequestHeader("Content-Type",M.contentType)}if(M.ifModified){J.setRequestHeader("If-Modified-Since",o.lastModified[M.url]||"Thu, 01 Jan 1970 00:00:00 GMT")}J.setRequestHeader("X-Requested-With","XMLHttpRequest");J.setRequestHeader("Accept",M.dataType&&M.accepts[M.dataType]?M.accepts[M.dataType]+", */*":M.accepts._default)}catch(S){}if(M.beforeSend&&M.beforeSend(J,M)===false){if(M.global&&!--o.active){o.event.trigger("ajaxStop")}J.abort();return false}if(M.global){o.event.trigger("ajaxSend",[J,M])}var N=function(X){if(J.readyState==0){if(P){clearInterval(P);P=null;if(M.global&&!--o.active){o.event.trigger("ajaxStop")}}}else{if(!K&&J&&(J.readyState==4||X=="timeout")){K=true;if(P){clearInterval(P);P=null}R=X=="timeout"?"timeout":!o.httpSuccess(J)?"error":M.ifModified&&o.httpNotModified(J,M.url)?"notmodified":"success";if(R=="success"){try{V=o.httpData(J,M.dataType,M)}catch(Z){R="parsererror"}}if(R=="success"){var Y;try{Y=J.getResponseHeader("Last-Modified")}catch(Z){}if(M.ifModified&&Y){o.lastModified[M.url]=Y}if(!W){I()}}else{o.handleError(M,J,R)}L();if(X){J.abort()}if(M.async){J=null}}}};if(M.async){var P=setInterval(N,13);if(M.timeout>0){setTimeout(function(){if(J&&!K){N("timeout")}},M.timeout)}}try{J.send(M.data)}catch(S){o.handleError(M,J,null,S)}if(!M.async){N()}function I(){if(M.success){M.success(V,R)}if(M.global){o.event.trigger("ajaxSuccess",[J,M])}}function L(){if(M.complete){M.complete(J,R)}if(M.global){o.event.trigger("ajaxComplete",[J,M])}if(M.global&&!--o.active){o.event.trigger("ajaxStop")}}return J},handleError:function(F,H,E,G){if(F.error){F.error(H,E,G)}if(F.global){o.event.trigger("ajaxError",[H,F,G])}},active:0,httpSuccess:function(F){try{return !F.status&&location.protocol=="file:"||(F.status>=200&&F.status<300)||F.status==304||F.status==1223}catch(E){}return false},httpNotModified:function(G,E){try{var H=G.getResponseHeader("Last-Modified");return G.status==304||H==o.lastModified[E]}catch(F){}return false},httpData:function(J,H,G){var F=J.getResponseHeader("content-type"),E=H=="xml"||!H&&F&&F.indexOf("xml")>=0,I=E?J.responseXML:J.responseText;if(E&&I.documentElement.tagName=="parsererror"){throw"parsererror"}if(G&&G.dataFilter){I=G.dataFilter(I,H)}if(typeof I==="string"){if(H=="script"){o.globalEval(I)}if(H=="json"){I=l["eval"]("("+I+")")}}return I},param:function(E){var G=[];function H(I,J){G[G.length]=encodeURIComponent(I)+"="+encodeURIComponent(J)}if(o.isArray(E)||E.jquery){o.each(E,function(){H(this.name,this.value)})}else{for(var F in E){if(o.isArray(E[F])){o.each(E[F],function(){H(F,this)})}else{H(F,o.isFunction(E[F])?E[F]():E[F])}}}return G.join("&").replace(/%20/g,"+")}});var m={},n,d=[["height","marginTop","marginBottom","paddingTop","paddingBottom"],["width","marginLeft","marginRight","paddingLeft","paddingRight"],["opacity"]];function t(F,E){var G={};o.each(d.concat.apply([],d.slice(0,E)),function(){G[this]=F});return G}o.fn.extend({show:function(J,L){if(J){return this.animate(t("show",3),J,L)}else{for(var H=0,F=this.length;H<F;H++){var E=o.data(this[H],"olddisplay");this[H].style.display=E||"";if(o.css(this[H],"display")==="none"){var G=this[H].tagName,K;if(m[G]){K=m[G]}else{var I=o("<"+G+" />").appendTo("body");K=I.css("display");if(K==="none"){K="block"}I.remove();m[G]=K}o.data(this[H],"olddisplay",K)}}for(var H=0,F=this.length;H<F;H++){this[H].style.display=o.data(this[H],"olddisplay")||""}return this}},hide:function(H,I){if(H){return this.animate(t("hide",3),H,I)}else{for(var G=0,F=this.length;G<F;G++){var E=o.data(this[G],"olddisplay");if(!E&&E!=="none"){o.data(this[G],"olddisplay",o.css(this[G],"display"))}}for(var G=0,F=this.length;G<F;G++){this[G].style.display="none"}return this}},_toggle:o.fn.toggle,toggle:function(G,F){var E=typeof G==="boolean";return o.isFunction(G)&&o.isFunction(F)?this._toggle.apply(this,arguments):G==null||E?this.each(function(){var H=E?G:o(this).is(":hidden");o(this)[H?"show":"hide"]()}):this.animate(t("toggle",3),G,F)},fadeTo:function(E,G,F){return this.animate({opacity:G},E,F)},animate:function(I,F,H,G){var E=o.speed(F,H,G);return this[E.queue===false?"each":"queue"](function(){var K=o.extend({},E),M,L=this.nodeType==1&&o(this).is(":hidden"),J=this;for(M in I){if(I[M]=="hide"&&L||I[M]=="show"&&!L){return K.complete.call(this)}if((M=="height"||M=="width")&&this.style){K.display=o.css(this,"display");K.overflow=this.style.overflow}}if(K.overflow!=null){this.style.overflow="hidden"}K.curAnim=o.extend({},I);o.each(I,function(O,S){var R=new o.fx(J,K,O);if(/toggle|show|hide/.test(S)){R[S=="toggle"?L?"show":"hide":S](I)}else{var Q=S.toString().match(/^([+-]=)?([\d+-.]+)(.*)$/),T=R.cur(true)||0;if(Q){var N=parseFloat(Q[2]),P=Q[3]||"px";if(P!="px"){J.style[O]=(N||1)+P;T=((N||1)/R.cur(true))*T;J.style[O]=T+P}if(Q[1]){N=((Q[1]=="-="?-1:1)*N)+T}R.custom(T,N,P)}else{R.custom(T,S,"")}}});return true})},stop:function(F,E){var G=o.timers;if(F){this.queue([])}this.each(function(){for(var H=G.length-1;H>=0;H--){if(G[H].elem==this){if(E){G[H](true)}G.splice(H,1)}}});if(!E){this.dequeue()}return this}});o.each({slideDown:t("show",1),slideUp:t("hide",1),slideToggle:t("toggle",1),fadeIn:{opacity:"show"},fadeOut:{opacity:"hide"}},function(E,F){o.fn[E]=function(G,H){return this.animate(F,G,H)}});o.extend({speed:function(G,H,F){var E=typeof G==="object"?G:{complete:F||!F&&H||o.isFunction(G)&&G,duration:G,easing:F&&H||H&&!o.isFunction(H)&&H};E.duration=o.fx.off?0:typeof E.duration==="number"?E.duration:o.fx.speeds[E.duration]||o.fx.speeds._default;E.old=E.complete;E.complete=function(){if(E.queue!==false){o(this).dequeue()}if(o.isFunction(E.old)){E.old.call(this)}};return E},easing:{linear:function(G,H,E,F){return E+F*G},swing:function(G,H,E,F){return((-Math.cos(G*Math.PI)/2)+0.5)*F+E}},timers:[],fx:function(F,E,G){this.options=E;this.elem=F;this.prop=G;if(!E.orig){E.orig={}}}});o.fx.prototype={update:function(){if(this.options.step){this.options.step.call(this.elem,this.now,this)}(o.fx.step[this.prop]||o.fx.step._default)(this);if((this.prop=="height"||this.prop=="width")&&this.elem.style){this.elem.style.display="block"}},cur:function(F){if(this.elem[this.prop]!=null&&(!this.elem.style||this.elem.style[this.prop]==null)){return this.elem[this.prop]}var E=parseFloat(o.css(this.elem,this.prop,F));return E&&E>-10000?E:parseFloat(o.curCSS(this.elem,this.prop))||0},custom:function(I,H,G){this.startTime=e();this.start=I;this.end=H;this.unit=G||this.unit||"px";this.now=this.start;this.pos=this.state=0;var E=this;function F(J){return E.step(J)}F.elem=this.elem;if(F()&&o.timers.push(F)&&!n){n=setInterval(function(){var K=o.timers;for(var J=0;J<K.length;J++){if(!K[J]()){K.splice(J--,1)}}if(!K.length){clearInterval(n);n=g}},13)}},show:function(){this.options.orig[this.prop]=o.attr(this.elem.style,this.prop);this.options.show=true;this.custom(this.prop=="width"||this.prop=="height"?1:0,this.cur());o(this.elem).show()},hide:function(){this.options.orig[this.prop]=o.attr(this.elem.style,this.prop);this.options.hide=true;this.custom(this.cur(),0)},step:function(H){var G=e();if(H||G>=this.options.duration+this.startTime){this.now=this.end;this.pos=this.state=1;this.update();this.options.curAnim[this.prop]=true;var E=true;for(var F in this.options.curAnim){if(this.options.curAnim[F]!==true){E=false}}if(E){if(this.options.display!=null){this.elem.style.overflow=this.options.overflow;this.elem.style.display=this.options.display;if(o.css(this.elem,"display")=="none"){this.elem.style.display="block"}}if(this.options.hide){o(this.elem).hide()}if(this.options.hide||this.options.show){for(var I in this.options.curAnim){o.attr(this.elem.style,I,this.options.orig[I])}}this.options.complete.call(this.elem)}return false}else{var J=G-this.startTime;this.state=J/this.options.duration;this.pos=o.easing[this.options.easing||(o.easing.swing?"swing":"linear")](this.state,J,0,1,this.options.duration);this.now=this.start+((this.end-this.start)*this.pos);this.update()}return true}};o.extend(o.fx,{speeds:{slow:600,fast:200,_default:400},step:{opacity:function(E){o.attr(E.elem.style,"opacity",E.now)},_default:function(E){if(E.elem.style&&E.elem.style[E.prop]!=null){E.elem.style[E.prop]=E.now+E.unit}else{E.elem[E.prop]=E.now}}}});if(document.documentElement.getBoundingClientRect){o.fn.offset=function(){if(!this[0]){return{top:0,left:0}}if(this[0]===this[0].ownerDocument.body){return o.offset.bodyOffset(this[0])}var G=this[0].getBoundingClientRect(),J=this[0].ownerDocument,F=J.body,E=J.documentElement,L=E.clientTop||F.clientTop||0,K=E.clientLeft||F.clientLeft||0,I=G.top+(self.pageYOffset||o.boxModel&&E.scrollTop||F.scrollTop)-L,H=G.left+(self.pageXOffset||o.boxModel&&E.scrollLeft||F.scrollLeft)-K;return{top:I,left:H}}}else{o.fn.offset=function(){if(!this[0]){return{top:0,left:0}}if(this[0]===this[0].ownerDocument.body){return o.offset.bodyOffset(this[0])}o.offset.initialized||o.offset.initialize();var J=this[0],G=J.offsetParent,F=J,O=J.ownerDocument,M,H=O.documentElement,K=O.body,L=O.defaultView,E=L.getComputedStyle(J,null),N=J.offsetTop,I=J.offsetLeft;while((J=J.parentNode)&&J!==K&&J!==H){M=L.getComputedStyle(J,null);N-=J.scrollTop,I-=J.scrollLeft;if(J===G){N+=J.offsetTop,I+=J.offsetLeft;if(o.offset.doesNotAddBorder&&!(o.offset.doesAddBorderForTableAndCells&&/^t(able|d|h)$/i.test(J.tagName))){N+=parseInt(M.borderTopWidth,10)||0,I+=parseInt(M.borderLeftWidth,10)||0}F=G,G=J.offsetParent}if(o.offset.subtractsBorderForOverflowNotVisible&&M.overflow!=="visible"){N+=parseInt(M.borderTopWidth,10)||0,I+=parseInt(M.borderLeftWidth,10)||0}E=M}if(E.position==="relative"||E.position==="static"){N+=K.offsetTop,I+=K.offsetLeft}if(E.position==="fixed"){N+=Math.max(H.scrollTop,K.scrollTop),I+=Math.max(H.scrollLeft,K.scrollLeft)}return{top:N,left:I}}}o.offset={initialize:function(){if(this.initialized){return}var L=document.body,F=document.createElement("div"),H,G,N,I,M,E,J=L.style.marginTop,K='<div style="position:absolute;top:0;left:0;margin:0;border:5px solid #000;padding:0;width:1px;height:1px;"><div></div></div><table style="position:absolute;top:0;left:0;margin:0;border:5px solid #000;padding:0;width:1px;height:1px;" cellpadding="0" cellspacing="0"><tr><td></td></tr></table>';M={position:"absolute",top:0,left:0,margin:0,border:0,width:"1px",height:"1px",visibility:"hidden"};for(E in M){F.style[E]=M[E]}F.innerHTML=K;L.insertBefore(F,L.firstChild);H=F.firstChild,G=H.firstChild,I=H.nextSibling.firstChild.firstChild;this.doesNotAddBorder=(G.offsetTop!==5);this.doesAddBorderForTableAndCells=(I.offsetTop===5);H.style.overflow="hidden",H.style.position="relative";this.subtractsBorderForOverflowNotVisible=(G.offsetTop===-5);L.style.marginTop="1px";this.doesNotIncludeMarginInBodyOffset=(L.offsetTop===0);L.style.marginTop=J;L.removeChild(F);this.initialized=true},bodyOffset:function(E){o.offset.initialized||o.offset.initialize();var G=E.offsetTop,F=E.offsetLeft;if(o.offset.doesNotIncludeMarginInBodyOffset){G+=parseInt(o.curCSS(E,"marginTop",true),10)||0,F+=parseInt(o.curCSS(E,"marginLeft",true),10)||0}return{top:G,left:F}}};o.fn.extend({position:function(){var I=0,H=0,F;if(this[0]){var G=this.offsetParent(),J=this.offset(),E=/^body|html$/i.test(G[0].tagName)?{top:0,left:0}:G.offset();J.top-=j(this,"marginTop");J.left-=j(this,"marginLeft");E.top+=j(G,"borderTopWidth");E.left+=j(G,"borderLeftWidth");F={top:J.top-E.top,left:J.left-E.left}}return F},offsetParent:function(){var E=this[0].offsetParent||document.body;while(E&&(!/^body|html$/i.test(E.tagName)&&o.css(E,"position")=="static")){E=E.offsetParent}return o(E)}});o.each(["Left","Top"],function(F,E){var G="scroll"+E;o.fn[G]=function(H){if(!this[0]){return null}return H!==g?this.each(function(){this==l||this==document?l.scrollTo(!F?H:o(l).scrollLeft(),F?H:o(l).scrollTop()):this[G]=H}):this[0]==l||this[0]==document?self[F?"pageYOffset":"pageXOffset"]||o.boxModel&&document.documentElement[G]||document.body[G]:this[0][G]}});o.each(["Height","Width"],function(I,G){var E=I?"Left":"Top",H=I?"Right":"Bottom",F=G.toLowerCase();o.fn["inner"+G]=function(){return this[0]?o.css(this[0],F,false,"padding"):null};o.fn["outer"+G]=function(K){return this[0]?o.css(this[0],F,false,K?"margin":"border"):null};var J=G.toLowerCase();o.fn[J]=function(K){return this[0]==l?document.compatMode=="CSS1Compat"&&document.documentElement["client"+G]||document.body["client"+G]:this[0]==document?Math.max(document.documentElement["client"+G],document.body["scroll"+G],document.documentElement["scroll"+G],document.body["offset"+G],document.documentElement["offset"+G]):K===g?(this.length?o.css(this[0],J):null):this.css(J,typeof K==="string"?K:K+"px")}})})(); \ No newline at end of file
diff --git a/admin/scripts/mocha.js b/admin/scripts/mocha.js
new file mode 100644
index 0000000..a220424
--- /dev/null
+++ b/admin/scripts/mocha.js
@@ -0,0 +1,156 @@
+/*
+ * --------------------------------------------------------------------
+ * Simple Password Strength Checker
+ * by Siddharth S, www.ssiddharth.com, hello@ssiddharth.com
+ * for Net Tuts, www.net.tutsplus.com
+ * Version: 1.0, 05.10.2009
+ * --------------------------------------------------------------------
+ */
+
+
+$(document).ready(function()
+{
+ var strPassword;
+ var charPassword;
+ var complexity = $("#complexity");
+ var rating = $("#rating")
+ var minPasswordLength = 6;
+ var baseScore = 0, score = 0;
+
+ var num = {};
+ num.Excess = 0;
+ num.Upper = 0;
+ num.Numbers = 0;
+ num.Symbols = 0;
+
+ var bonus = {};
+ bonus.Excess = 3;
+ bonus.Upper = 4;
+ bonus.Numbers = 5;
+ bonus.Symbols = 5;
+ bonus.Combo = 0;
+ bonus.FlatLower = 0;
+ bonus.FlatNumber = 0;
+
+ outputResult();
+ $("#inputPassword").bind("keyup", checkVal);
+
+function checkVal()
+{
+ init();
+
+ if (charPassword.length >= minPasswordLength)
+ {
+ baseScore = 50;
+ analyzeString();
+ calcComplexity();
+ }
+ else
+ {
+ baseScore = 0;
+ }
+
+ outputResult();
+}
+
+function init()
+{
+ strPassword= $("#inputPassword").val();
+ charPassword = strPassword.split("");
+
+ num.Excess = 0;
+ num.Upper = 0;
+ num.Numbers = 0;
+ num.Symbols = 0;
+ bonus.Combo = 0;
+ bonus.FlatLower = 0;
+ bonus.FlatNumber = 0;
+ baseScore = 0;
+ score =0;
+}
+
+function analyzeString ()
+{
+ for (i=0; i<charPassword.length;i++)
+ {
+ if (charPassword[i].match(/[A-Z]/g)) {num.Upper++;}
+ if (charPassword[i].match(/[0-9]/g)) {num.Numbers++;}
+ if (charPassword[i].match(/(.*[!,@,#,$,%,^,&,*,?,_,~])/)) {num.Symbols++;}
+ }
+
+ num.Excess = charPassword.length - minPasswordLength;
+
+ if (num.Upper && num.Numbers && num.Symbols)
+ {
+ bonus.Combo = 25;
+ }
+
+ else if ((num.Upper && num.Numbers) || (num.Upper && num.Symbols) || (num.Numbers && num.Symbols))
+ {
+ bonus.Combo = 15;
+ }
+
+ if (strPassword.match(/^[\sa-z]+$/))
+ {
+ bonus.FlatLower = -15;
+ }
+
+ if (strPassword.match(/^[\s0-9]+$/))
+ {
+ bonus.FlatNumber = -35;
+ }
+}
+
+function calcComplexity()
+{
+ score = baseScore + (num.Excess*bonus.Excess) + (num.Upper*bonus.Upper) + (num.Numbers*bonus.Numbers) + (num.Symbols*bonus.Symbols) + bonus.Combo + bonus.FlatLower + bonus.FlatNumber;
+
+}
+
+function outputResult()
+{
+ if ($("#inputPassword").val()== "")
+ {
+ complexity.html(" ");
+ rating.removeClass("short weak good strong secure").addClass("default");
+ }
+ else if (charPassword.length < minPasswordLength)
+ {
+ complexity.html("Too Short");
+ rating.removeClass("weak good strong secure").addClass("short");
+ }
+ else if (score<50)
+ {
+ complexity.html("Weak");
+ rating.removeClass("good strong secure").addClass("weak");
+ }
+ else if (score>=50 && score<75)
+ {
+ complexity.html("Good");
+ rating.removeClass("strong secure").addClass("good");
+ }
+ else if (score>=75 && score<100)
+ {
+ complexity.html("Strong");
+ rating.removeClass("secure").addClass("strong");
+ }
+ else if (score>=100)
+ {
+ complexity.html("Secure");
+ rating.addClass("secure");
+ }
+
+ /*
+ $("#details").html("Base Score :<span class=\"value\">" + baseScore + "</span>"
+ + "<br />Length Bonus :<span class=\"value\">" + (num.Excess*bonus.Excess) + " ["+num.Excess+"x"+bonus.Excess+"]</span> "
+ + "<br />Upper case bonus :<span class=\"value\">" + (num.Upper*bonus.Upper) + " ["+num.Upper+"x"+bonus.Upper+"]</span> "
+ + "<br />Number Bonus :<span class=\"value\"> " + (num.Numbers*bonus.Numbers) + " ["+num.Numbers+"x"+bonus.Numbers+"]</span>"
+ + "<br />Symbol Bonus :<span class=\"value\"> " + (num.Symbols*bonus.Symbols) + " ["+num.Symbols+"x"+bonus.Symbols+"]</span>"
+ + "<br />Combination Bonus :<span class=\"value\"> " + bonus.Combo + "</span>"
+ + "<br />Lower case only penalty :<span class=\"value\"> " + bonus.FlatLower + "</span>"
+ + "<br />Numbers only penalty :<span class=\"value\"> " + bonus.FlatNumber + "</span>"
+ + "<br />Total Score:<span class=\"value\"> " + score + "</span>" ); */
+}
+
+}
+);
diff --git a/admin/settings/functions.php b/admin/settings/functions.php
new file mode 100644
index 0000000..910a312
--- /dev/null
+++ b/admin/settings/functions.php
@@ -0,0 +1,77 @@
+<?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/>.
+ */
+
+/**
+ * Note to anyone feeling the need to edit this file...
+ * You MUST declare $db as global inside your functions in order access MySQL from here.
+ */
+
+
+function changePassword(){
+
+ global $db;
+
+ if(isset($_POST['processed']))
+ {
+ $password = $_POST['password'];
+ $confirm = $_POST['confirm'];
+
+ if($password != $confirm){
+ ReportError("The passwords you entered did not match.");
+ PageRedirect(3, "?op=settings&change=password");
+ return;
+ }else if(strlen($password)<6){
+ ReportError("The password you entered is less than 6 characters.");
+ PageRedirect(3, "?op=settings&change=password");
+ return;
+ }
+ $newpassword = crypt(md5($password),'iamnotadirtywhorebitch');
+ $username = $_SESSION['username'];
+ $db->Query("UPDATE `bayonet_users` SET `password` = '$newpassword' WHERE `username` = '$username' LIMIT 1");
+
+ echo "Your password has successfully been changed.";
+ PageRedirect(3,"?op=settings");
+ return;
+ }
+?>
+<div id="pwordCont">
+<form method="POST" action="<?php $_SERVER['PHP_SELF']?>">
+<h1>Change Your Password</h1>
+ <table>
+ <tr>
+ <td class="right">Password: </td>
+ <td><input type="password" id="inputPassword" name="password" style="width:200px;" /></td>
+ <td>
+ <table cellspacing="0">
+ <tr><td>Password Strength:</td><td id="complexity"></td></tr>
+ <tr><td colspan="2"><div class="outer"><div id="rating"></div></div></td></tr>
+ </table>
+ </td>
+ </tr>
+ <tr><td></td><td style="text-align:center; color:#626262;">Minimum of 6 Characters</td><td></td></tr>
+ <tr>
+ <td>Confirm Password: </td>
+ <td><input type="password" name="confirm" style="width:200px;" /></td>
+ </tr>
+ <tr><td colspan="2"><input type="submit" value="Change Password" name="processed" /></td>
+ </table>
+</form>
+</div>
+<?php
+} \ No newline at end of file
diff --git a/admin/settings/index.php b/admin/settings/index.php
new file mode 100644
index 0000000..947bba9
--- /dev/null
+++ b/admin/settings/index.php
@@ -0,0 +1,53 @@
+<?php
+/**
+ * Xoma 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/>.
+ */
+ ?>
+
+ <div style="text-align:left;"><h2>- Account Settings</h2>
+ -<a href="?op=settings&change=password" >Change password</a>, email, name<br />
+ </div>
+
+ <?php
+
+if(!defined("ADMIN_FILE"))
+{
+ die("Access denied.");
+}
+
+include $basedir.'settings/functions.php';
+
+ if(isset($_GET['change']))
+ {
+ $change = $_GET['change'];
+ if($change == "password"){
+ changePassword();
+ }else if($change == "email"){
+ changeEmail();
+ }
+ //return;
+ }
+
+
+?>
+
+ </tr>
+ </table>
+
+
+
+ \ No newline at end of file
diff --git a/admin/style.css b/admin/style.css
new file mode 100644
index 0000000..19ad293
--- /dev/null
+++ b/admin/style.css
@@ -0,0 +1,272 @@
+body {
+ background-color:#225eac;
+ text-align:center;
+ font-family:sans-serif;
+ font-size:10pt;
+}
+
+img {
+ border:0px;
+}
+
+a, a:visited, a:active {
+ font-family:sans-serif;
+ font-size:10pt;
+ color:black;
+ text-decoration:none;
+}
+
+a:hover {
+ font-family:sans-serif;
+ font-size:10pt;
+ color: #225eac;
+ text-decoration:none;
+}
+
+h1, h2, h3, h4, h5, h6 {
+ font-family: 'Century Gothic';
+ font-weight: normal;
+}
+h2 {
+ font-size:26px;
+}
+h3 {
+ font-size:20px;
+}
+
+div.content {
+ width:1024px;
+ background-color:white;
+ padding:15px;
+}
+
+td {
+ font-family:sans-serif;
+ font-size:10pt;
+ color:black;
+}
+
+table.panel {
+ height:435px;
+ border:1px solid #848484;
+}
+
+.panel-none {
+ width:201px;
+ vertical-align:top;
+}
+
+.panel-shadow {
+ background-image:url("../images/rightshadow.png");
+ background-position: left;
+ background-repeat: repeat-y;
+ width:201px;
+ padding-left: 10px;
+ vertical-align:top;
+}
+
+.panel-box {
+ background-image:url("../images/rightshadow.png");
+ background-position: left;
+ background-repeat: repeat-y;
+ padding-left: 10px;
+ vertical-align:top;
+}
+
+.option-box {
+ background-color: #6f6f6f;
+}
+
+table.panelitems {
+ font-family:sans-serif;
+ font-size:10pt;
+ color:black;
+}
+
+table.panelitems tr {
+ height:20px;
+}
+
+table.panelitems tr.highlight {
+ background-color: #5b8dda;
+}
+
+/* Panel Links */
+table.panel a, table.panel a:hover, table.panel a:visited, table.panel a:active {
+ font-family:sans-serif;
+ font-size:10pt;
+ color:black;
+ text-decoration:none;
+}
+
+/* Panel Highlight Links << must be after Panel Links */
+tr.highlight a, tr.highlight a:visited, tr.highlight a:hover, tr.highlight a:active {
+ font-family:sans-serif;
+ font-size:10pt;
+ color:white;
+}
+fieldset {
+ padding:0px;
+ border: 1px solid #a1a1a1;
+}
+/* START>> CALENDAR STYLES*/
+ .monthTitle{
+ color:black;
+ text-align:center;
+ font-size:12px;
+ font-weight:bold;
+ font-family:arial;
+ }
+ td.weekday {
+ width:40px;
+ height:20px;
+ background-color:#cb2121;
+ color:green;
+ text-align:center;
+ font-size:10px;
+ font-weight:bold;
+ }
+ th.weekday {
+ width:40px;
+ height:29px;
+ background-color:white;
+ color:black;
+ text-align:center;
+ font-size:11px;
+ font-weight:bold;
+ }
+ .monthday {
+ width:40px;
+ height:20px;
+ background-color:#aea2a2;
+ color:white;
+ text-align:left;
+ font-size:10pt;
+ font-weight:bold;
+
+ }
+ .monthtoday {
+ width:38px;
+ height:38px;
+ /* background-color:#3666ba; */
+ color:#225eac;
+ text-align:center;
+ font-size:14px;
+ font-weight:bold;
+ border:1px solid #333333;
+ }
+ .event {
+ width:38px;
+ height:38px;
+ background-color:#225eac;
+ text-align:center;
+ border:1px solid #333333;
+ }
+ table.calendar a, table.calendar a:visited, table.calendar a:active, table.calendar a:hover {
+ color:white;
+ }
+ .eventtoday{
+ width:38px;
+ height:38px;
+ background-color:#225eac;
+ color:#ef8e25;
+ text-align:center;
+ font-size:14px;
+ font-weight:bold;
+ border:1px solid #333333;
+ }
+ td.cal_weekday {
+ width:40px;
+ height:40px;
+ background-color:#a1a1a1;
+ vertical-align:top;
+ color:#eeeeee;
+ font-family:arial;
+ text-align:center;
+ font-size:14px;
+ }
+ td.cal_weekend {
+ width:40px;
+ height:40px;
+ background-color:#8f8f8f;
+ vertical-align:top;
+ color:#eeeeee;
+ font-family:arial;
+ text-align:center;
+ font-size:14px;
+ }
+ td.cal_notmonth {
+ width:40px;
+ height:40px;
+ background-color:#6e6e6e;
+ vertical-align:top;
+ color:#d4d4d4;
+ text-align:left;
+ font-size:11px;
+ }
+/* END>> CALENDAR STYLES */
+
+/* START>> PASSWORD STYLES */
+
+input{
+ font-family: "Lucida Grande", "Verdana", sans-serif;
+}
+
+#pwordCont{
+ font-family: "Lucida Grande", "Verdana", sans-serif;
+ width: 820px;
+ font-size:12px;
+ margin-left: auto;
+ margin-right: auto;
+ padding: 50px 0 0 0;
+}
+
+#complexity{
+ color: #000;
+ font-size: 10px;
+ text-align: center;
+}
+
+.outer {
+ width:180px;
+ height:5px;
+ background-color: #CCC;
+}
+
+.default {
+ height:5px;
+ background-color: #CCC;
+ width:0px;
+}
+.short {
+ height:5px;
+ background-color: #aa0033;
+ width:15px;
+}
+.weak {
+ height:5px;
+ background-color: #aa0033;
+ width:45px;
+}
+.good {
+ height:5px;
+ background-color: #6699cc;
+ width:90px;
+}
+.strong {
+ height:5px;
+ background-color: #008000;
+ width:135px;
+}
+.secure {
+ height:5px;
+ background-color: #008000;
+ width:180px;
+}
+
+span.value{
+ font-weight:bold;
+ float: right;
+}
+
+/* END>> PASSWORD STYLES */ \ No newline at end of file
diff --git a/ajax/database/New Text Document.txt b/ajax/database/New Text Document.txt
new file mode 100644
index 0000000..e69de29
--- /dev/null
+++ b/ajax/database/New Text Document.txt
diff --git a/ajax/database/getuser.php b/ajax/database/getuser.php
new file mode 100644
index 0000000..bf6e677
--- /dev/null
+++ b/ajax/database/getuser.php
@@ -0,0 +1,38 @@
+<?php
+$q=$_GET["q"];
+
+$con = mysql_connect('localhost', 'peter', 'abc123');
+if (!$con)
+ {
+ die('Could not connect: ' . mysql_error());
+ }
+
+mysql_select_db("ajax_demo", $con);
+
+$sql="SELECT * FROM user WHERE id = '".$q."'";
+
+$result = mysql_query($sql);
+
+echo "<table border='1'>
+<tr>
+<th>Firstname</th>
+<th>Lastname</th>
+<th>Age</th>
+<th>Hometown</th>
+<th>Job</th>
+</tr>";
+
+while($row = mysql_fetch_array($result))
+ {
+ echo "<tr>";
+ echo "<td>" . $row['FirstName'] . "</td>";
+ echo "<td>" . $row['LastName'] . "</td>";
+ echo "<td>" . $row['Age'] . "</td>";
+ echo "<td>" . $row['Hometown'] . "</td>";
+ echo "<td>" . $row['Job'] . "</td>";
+ echo "</tr>";
+ }
+echo "</table>";
+
+mysql_close($con);
+?> \ No newline at end of file
diff --git a/ajax/database/index.htm b/ajax/database/index.htm
new file mode 100644
index 0000000..98b0009
--- /dev/null
+++ b/ajax/database/index.htm
@@ -0,0 +1,20 @@
+<html>
+<head>
+<script type="text/javascript" src="selectuser.js"></script>
+</head>
+<body>
+
+<form>
+Select a User:
+<select name="users" onchange="showUser(this.value)">
+<option value="1">Peter Griffin</option>
+<option value="2">Lois Griffin</option>
+<option value="3">Glenn Quagmire</option>
+<option value="4">Joseph Swanson</option>
+</select>
+</form>
+<br />
+<div id="txtHint"><b>Person info will be listed here.</b></div>
+
+</body>
+</html> \ No newline at end of file
diff --git a/ajax/database/selectuser.js b/ajax/database/selectuser.js
new file mode 100644
index 0000000..a91721e
--- /dev/null
+++ b/ajax/database/selectuser.js
@@ -0,0 +1,40 @@
+var xmlhttp;
+
+function showUser(str)
+{
+xmlhttp=GetXmlHttpObject();
+if (xmlhttp==null)
+ {
+ alert ("Browser does not support HTTP Request");
+ return;
+ }
+var url="getuser.php";
+url=url+"?q="+str;
+url=url+"&sid="+Math.random();
+xmlhttp.onreadystatechange=stateChanged;
+xmlhttp.open("GET",url,true);
+xmlhttp.send(null);
+}
+
+function stateChanged()
+{
+if (xmlhttp.readyState==4)
+{
+document.getElementById("txtHint").innerHTML=xmlhttp.responseText;
+}
+}
+
+function GetXmlHttpObject()
+{
+if (window.XMLHttpRequest)
+ {
+ // code for IE7+, Firefox, Chrome, Opera, Safari
+ return new XMLHttpRequest();
+ }
+if (window.ActiveXObject)
+ {
+ // code for IE6, IE5
+ return new ActiveXObject("Microsoft.XMLHTTP");
+ }
+return null;
+} \ No newline at end of file
diff --git a/ajax/form_suggestions/clienthint.js b/ajax/form_suggestions/clienthint.js
new file mode 100644
index 0000000..408c220
--- /dev/null
+++ b/ajax/form_suggestions/clienthint.js
@@ -0,0 +1,45 @@
+var xmlhttp
+
+function showHint(str)
+{
+if (str.length==0)
+ {
+ document.getElementById("txtHint").innerHTML="";
+ return;
+ }
+xmlhttp=GetXmlHttpObject();
+if (xmlhttp==null)
+ {
+ alert ("Your browser does not support XMLHTTP!");
+ return;
+ }
+var url="gethint.php";
+url=url+"?q="+str;
+url=url+"&sid="+Math.random();
+xmlhttp.onreadystatechange=stateChanged;
+xmlhttp.open("GET",url,true);
+xmlhttp.send(null);
+}
+
+function stateChanged()
+{
+if (xmlhttp.readyState==4)
+ {
+ document.getElementById("txtHint").innerHTML=xmlhttp.responseText;
+ }
+}
+
+function GetXmlHttpObject()
+{
+if (window.XMLHttpRequest)
+ {
+ // code for IE7+, Firefox, Chrome, Opera, Safari
+ return new XMLHttpRequest();
+ }
+if (window.ActiveXObject)
+ {
+ // code for IE6, IE5
+ return new ActiveXObject("Microsoft.XMLHTTP");
+ }
+return null;
+} \ No newline at end of file
diff --git a/ajax/form_suggestions/gethint.php b/ajax/form_suggestions/gethint.php
new file mode 100644
index 0000000..8cb7379
--- /dev/null
+++ b/ajax/form_suggestions/gethint.php
@@ -0,0 +1,71 @@
+<?php
+// Fill up array with names
+$a[]="Anna";
+$a[]="Brittany";
+$a[]="Cinderella";
+$a[]="Diana";
+$a[]="Eva";
+$a[]="Evan";
+$a[]="Fiona";
+$a[]="Gunda";
+$a[]="Hege";
+$a[]="Inga";
+$a[]="Johanna";
+$a[]="Kitty";
+$a[]="Linda";
+$a[]="Nina";
+$a[]="Ophelia";
+$a[]="Petunia";
+$a[]="Amanda";
+$a[]="Raquel";
+$a[]="Cindy";
+$a[]="Doris";
+$a[]="Eve";
+$a[]="Evita";
+$a[]="Sunniva";
+$a[]="Tove";
+$a[]="Unni";
+$a[]="Violet";
+$a[]="Liza";
+$a[]="Elizabeth";
+$a[]="Ellen";
+$a[]="Wenche";
+$a[]="Vicky";
+
+//get the q parameter from URL
+$q=$_GET["q"];
+
+//lookup all hints from array if length of q>0
+if (strlen($q) > 0)
+ {
+ $hint="";
+ for($i=0; $i<count($a); $i++)
+ {
+ if (strtolower($q)==strtolower(substr($a[$i],0,strlen($q))))
+ {
+ if ($hint=="")
+ {
+ $hint=$a[$i];
+ }
+ else
+ {
+ $hint=$hint." , ".$a[$i];
+ }
+ }
+ }
+ }
+
+// Set output to "no suggestion" if no hint were found
+// or to the correct values
+if ($hint == "")
+ {
+ $response="no suggestion";
+ }
+else
+ {
+ $response=$hint;
+ }
+
+//output the response
+echo $response;
+?> \ No newline at end of file
diff --git a/ajax/form_suggestions/index.htm b/ajax/form_suggestions/index.htm
new file mode 100644
index 0000000..c2fc742
--- /dev/null
+++ b/ajax/form_suggestions/index.htm
@@ -0,0 +1,14 @@
+<html>
+<head>
+<script src="clienthint.js"></script>
+</head>
+<body>
+
+<form>
+First Name: <input type="text" id="txt1" onkeyup="showHint(this.value)" />
+</form>
+
+<p>Suggestions: <span id="txtHint"></span></p>
+
+</body>
+</html> \ No newline at end of file
diff --git a/ajax/simple_form/index.htm b/ajax/simple_form/index.htm
new file mode 100644
index 0000000..2c01922
--- /dev/null
+++ b/ajax/simple_form/index.htm
@@ -0,0 +1,36 @@
+<html>
+<body>
+
+<script type="text/javascript">
+function ajaxFunction()
+{
+var xmlhttp;
+if (window.XMLHttpRequest)
+ {
+ // code for IE7+, Firefox, Chrome, Opera, Safari
+ xmlhttp=new XMLHttpRequest();
+ }
+else
+ {
+ // code for IE6, IE5
+ xmlhttp=new ActiveXObject("Microsoft.XMLHTTP");
+ }
+xmlhttp.onreadystatechange=function()
+{
+if(xmlhttp.readyState==4)
+ {
+ document.myForm.time.value=xmlhttp.responseText;
+ }
+}
+xmlhttp.open("GET","time.php",true);
+xmlhttp.send(null);
+}
+</script>
+
+<form name="myForm">
+Name: <input type="text" name="username" onkeyup="ajaxFunction();" />
+Time: <input type="text" name="time" />
+</form>
+
+</body>
+</html> \ No newline at end of file
diff --git a/ajax/simple_form/time.php b/ajax/simple_form/time.php
new file mode 100644
index 0000000..3d938ae
--- /dev/null
+++ b/ajax/simple_form/time.php
@@ -0,0 +1,6 @@
+<?php
+// Date in the past
+header("Expires: Mon, 26 Jul 1997 05:00:00 GMT");
+header("Cache-Control: no-cache");
+echo(date("G:i:s",time()));
+?> \ No newline at end of file
diff --git a/blocks/donations/index.php b/blocks/donations/index.php
new file mode 100644
index 0000000..8695f68
--- /dev/null
+++ b/blocks/donations/index.php
@@ -0,0 +1,13 @@
+<table align="center" width="98%">
+<tr><td id="block">
+<center>
+<form action="https://www.paypal.com/cgi-bin/webscr" method="post">
+<input type="hidden" name="cmd" value="_s-xclick">
+<input type="image" src="https://www.paypal.com/en_US/i/btn/btn_donateCC_LG.gif" border="0" name="submit" alt="PayPal - The safer, easier way to pay online!">
+<img alt="" border="0" src="https://www.paypal.com/en_US/i/scr/pixel.gif" width="1" height="1">
+<input type="hidden" name="encrypted" value="-----BEGIN PKCS7-----MIIHVwYJKoZIhvcNAQcEoIIHSDCCB0QCAQExggEwMIIBLAIBADCBlDCBjjELMAkGA1UEBhMCVVMxCzAJBgNVBAgTAkNBMRYwFAYDVQQHEw1Nb3VudGFpbiBWaWV3MRQwEgYDVQQKEwtQYXlQYWwgSW5jLjETMBEGA1UECxQKbGl2ZV9jZXJ0czERMA8GA1UEAxQIbGl2ZV9hcGkxHDAaBgkqhkiG9w0BCQEWDXJlQHBheXBhbC5jb20CAQAwDQYJKoZIhvcNAQEBBQAEgYCmmWj9W1aXCaHwDsUTUOjXXnlfcloMRgGDPCjMW9TfqhodPcXpXW7s0DwUBNN3gc3f8mKAyjxVqUKoY4oG6lK2vDAjzniUYoFEXnuVKz4NDbYV1ztTiNucvuuGWeQerV8cAbhAFRG5tRsG0jQxhqqBoTbfqmM8rAw+ya6sRuZ0eTELMAkGBSsOAwIaBQAwgdQGCSqGSIb3DQEHATAUBggqhkiG9w0DBwQIbuJdxhunig6AgbCJb/xi+9jWM/0eUPNi0Kx06SdEhU1fbmuSCOyF6rN9J5n11K/oYB2ttBC+zbhEMqLhGTIgQbmssgzoYDg4p80Z/8u6w62Q9yK+3goEDQay6AAawewqt9k4kk6hPrf7O56y2kqy/EF9XqYjty+UP3s7E+dQ8hSOiR7RC7YAiew3bWHJ26yWzjuLTNocWXR+85NDOK05DGbhx+a0tssaQEkMYOdem+QrffgRsRW+t5FXDaCCA4cwggODMIIC7KADAgECAgEAMA0GCSqGSIb3DQEBBQUAMIGOMQswCQYDVQQGEwJVUzELMAkGA1UECBMCQ0ExFjAUBgNVBAcTDU1vdW50YWluIFZpZXcxFDASBgNVBAoTC1BheVBhbCBJbmMuMRMwEQYDVQQLFApsaXZlX2NlcnRzMREwDwYDVQQDFAhsaXZlX2FwaTEcMBoGCSqGSIb3DQEJARYNcmVAcGF5cGFsLmNvbTAeFw0wNDAyMTMxMDEzMTVaFw0zNTAyMTMxMDEzMTVaMIGOMQswCQYDVQQGEwJVUzELMAkGA1UECBMCQ0ExFjAUBgNVBAcTDU1vdW50YWluIFZpZXcxFDASBgNVBAoTC1BheVBhbCBJbmMuMRMwEQYDVQQLFApsaXZlX2NlcnRzMREwDwYDVQQDFAhsaXZlX2FwaTEcMBoGCSqGSIb3DQEJARYNcmVAcGF5cGFsLmNvbTCBnzANBgkqhkiG9w0BAQEFAAOBjQAwgYkCgYEAwUdO3fxEzEtcnI7ZKZL412XvZPugoni7i7D7prCe0AtaHTc97CYgm7NsAtJyxNLixmhLV8pyIEaiHXWAh8fPKW+R017+EmXrr9EaquPmsVvTywAAE1PMNOKqo2kl4Gxiz9zZqIajOm1fZGWcGS0f5JQ2kBqNbvbg2/Za+GJ/qwUCAwEAAaOB7jCB6zAdBgNVHQ4EFgQUlp98u8ZvF71ZP1LXChvsENZklGswgbsGA1UdIwSBszCBsIAUlp98u8ZvF71ZP1LXChvsENZklGuhgZSkgZEwgY4xCzAJBgNVBAYTAlVTMQswCQYDVQQIEwJDQTEWMBQGA1UEBxMNTW91bnRhaW4gVmlldzEUMBIGA1UEChMLUGF5UGFsIEluYy4xEzARBgNVBAsUCmxpdmVfY2VydHMxETAPBgNVBAMUCGxpdmVfYXBpMRwwGgYJKoZIhvcNAQkBFg1yZUBwYXlwYWwuY29tggEAMAwGA1UdEwQFMAMBAf8wDQYJKoZIhvcNAQEFBQADgYEAgV86VpqAWuXvX6Oro4qJ1tYVIT5DgWpE692Ag422H7yRIr/9j/iKG4Thia/Oflx4TdL+IFJBAyPK9v6zZNZtBgPBynXb048hsP16l2vi0k5Q2JKiPDsEfBhGI+HnxLXEaUWAcVfCsQFvd2A1sxRr67ip5y2wwBelUecP3AjJ+YcxggGaMIIBlgIBATCBlDCBjjELMAkGA1UEBhMCVVMxCzAJBgNVBAgTAkNBMRYwFAYDVQQHEw1Nb3VudGFpbiBWaWV3MRQwEgYDVQQKEwtQYXlQYWwgSW5jLjETMBEGA1UECxQKbGl2ZV9jZXJ0czERMA8GA1UEAxQIbGl2ZV9hcGkxHDAaBgkqhkiG9w0BCQEWDXJlQHBheXBhbC5jb20CAQAwCQYFKw4DAhoFAKBdMBgGCSqGSIb3DQEJAzELBgkqhkiG9w0BBwEwHAYJKoZIhvcNAQkFMQ8XDTA4MDYyNDE5NDA1NFowIwYJKoZIhvcNAQkEMRYEFHwgOr66usJFr7worL1HLbU+ZewlMA0GCSqGSIb3DQEBAQUABIGAmyDx3eQWeqd/E0JJaEzLwigGno2dPPdncgs7XWE7vYS5JKm22uUsfrxUlKhhEBDQ8tmh9UvErNKZPrW2WJN0lcTVcc01jHVKnBQt6btAE/FRKM+aIC8dLnFj2gVnuNVVmbcaK9ep5mn4+/TrCymeEomAwuLT9yYcptzZb99/Ccc=-----END PKCS7-----
+">
+</form>
+</center>
+</td></tr>
+</table>
diff --git a/blocks/mini_calendar/functions.php b/blocks/mini_calendar/functions.php
new file mode 100644
index 0000000..06ce910
--- /dev/null
+++ b/blocks/mini_calendar/functions.php
@@ -0,0 +1,301 @@
+<?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/>.
+ */
+
+/**
+ * Note to anyone feeling the need to edit this file...
+ * You MUST declare $db as global inside your functions in order access MySQL from here.
+ */
+
+ /**
+ * 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){
+
+ //function for adding to the db in sql 'datetime' format
+ //$date = date("Y-m-d h:i:s", mktime(8, 30, 0, 10, 26, 2009));
+ //$date = "2009-11-2";
+ //echo $date."<br />";
+ //function for parsing our date format into an array
+ //echo "<pre>";
+ $date_arr = date_parse($date); //returns an associative array $array['year']
+ //print_r($date_arr);
+ //echo "</pre>";
+ //echo $date_arr['year']." ".$date_arr['month']." ".$date_arr['day']."<br />";;
+
+ //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 ListEvents($date){
+
+ global $db;
+
+?>
+ <table width="100%"><tr><td>
+ <h3>Events for: <?php echo date_format(date_create($date),'F jS, Y'); ?></h3>
+ </td><td align="right">
+ <a href="?op=calendar&create=true&date=<?php echo $date; ?>"><img src="images/add.gif" /> Add New Event</a>
+ </td></tr></table>
+<?php
+
+ echo "<table width=\"100%\">";
+
+ $result = $db->Query("SELECT * FROM bayonet_events WHERE `date` = '$date' ORDER BY `time`");
+ while(($row = $db->Fetch($result))!=false)
+ {
+ $tmp = true;
+
+ $datetime = date_create($date.' '.$row['time']);
+ $time = date_format($datetime, 'g:ia'); //gets time in hour:minutes am|pm
+?>
+
+<tr>
+ <td><strong><?php echo $time." - ".$row['title']; ?></strong></td>
+ <td><span style="border:1px solid black;background-color:#<?php echo $row['color'];?>;">&nbsp;&nbsp;&nbsp;&nbsp;</span></td>
+ <td>
+ <a href="?op=calendar&month=<?php echo $_GET['month']; ?>&year=<?php echo $_GET['year']; ?>&edit=<?php echo $row['event_id'];?>">Edit</a>
+ &nbsp;|&nbsp;
+ <a href="?op=calendar&delete=<?php echo $row['event_id']; ?>">Delete</a>
+ </td>
+</tr>
+<tr>
+ <td><?php echo BBCode($row['text']); ?><br /><br /></td>
+</tr>
+
+<tr>
+ <td colspan="2" style="border-top:1px solid black;"><br /></td>
+</tr>
+<?php
+ }
+
+ if(!isset($tmp))
+ echo "<tr><td>There are no events posted for this day.</td></tr>";
+
+ echo "</table>";
+
+ }
+
+
+ /**
+ * PrintCalendar() - prints the calendar with events
+ */
+ function PrintCalendar(){
+
+ $date = time();
+ date_default_timezone_set("America/New_York"); //EASTERN TIME ZONE
+
+ //GET values for month and year
+ $month = "";
+ $year = "";
+ //$month = $_GET['month'];
+ //$year = $_GET['year'];
+
+ $useCurDate = true;
+
+ //check to makes sure month and year are in the desired ranges
+ if(!empty($month) && !empty($year) && $month > 0 && $month < 13 && $year > 1990){
+ $useCurDate = false;
+ }
+ //check to see if the get variables are for todays month
+ if($month == date('n', $date) && $year == date('Y', $date)){
+ $useCurDate = true;
+ }
+
+ //use current date unless GET values are set
+ if($useCurDate)
+ {
+ $day = date('d', $date);
+ $today = date('j', $date);
+ $month = date('m', $date);
+ $monthNum = date('n', $date);
+ $year = date('Y', $date);
+ }
+ else
+ {
+ $monthNum = $month;
+ //if GET values are equal to curdate, set $today
+ if($year == date('Y', $date) && $monthNum == date('n', $date))
+ $today = date('j', $date);
+ else
+ $today = 0;
+ }
+
+ /* Accounts for the last couple days from the previous months */
+ $first_day = mktime(0,0,0,$monthNum, 1, $year);
+
+ $title = date('F', $first_day);
+
+ $day_of_week = date('D', $first_day);
+
+ switch($day_of_week){
+ case "Sun": $blank = 0; break;
+ case "Mon": $blank = 1; break;
+ case "Tue": $blank = 2; break;
+ case "Wed": $blank = 3; break;
+ case "Thu": $blank = 4; break;
+ case "Fri": $blank = 5; break;
+ case "Sat": $blank = 6; break;
+ }
+
+ /* calculates the days in the current month */
+ $days_in_month = cal_days_in_month(0, $monthNum, $year);
+
+ //makes sure that previous year is not year 0
+ if($monthNum == 1){
+ $previous_month = 12;
+ $previous_year = $year-1;
+ }else{
+ $previous_month = $monthNum-1;
+ $previous_year = $year;
+ }
+ //makes sure the next year is not year 13
+ if($monthNum == 12){
+ $next_month = 1;
+ $next_year = $year+1;
+ }else{
+ $next_month = $monthNum+1;
+ $next_year = $year;
+ }
+ ?>
+ <center>
+ <table class="calendar" style="background-color:white;" cellspacing="1" cellpadding="0">
+ <tr style="background-color:#999999; height:27px;">
+ <td colspan="50" style="vertical-align:middle; text-align:center;">
+ <!-- <a href="?op=calendar&month=<?php echo $previous_month.'&year='.$previous_year; ?>"><<</a> -->
+ <!-- Month Name and Year -->
+ &nbsp;&nbsp;<span class="monthTitle"><?php echo strtoupper($title).' '.$year; ?></span>&nbsp;&nbsp;
+ <!-- <a href="?op=calendar&month=<?php echo $next_month.'&year='.$next_year; ?>">>></a> -->
+ </td>
+ </tr>
+
+ <tr>
+ <th class="weekday">Sun</th><th class="weekday">Mon</th><th class="weekday">Tue</th><th class="weekday">Wed</th>
+ <th class="weekday">Thu</th><th class="weekday">Fri</th><th class="weekday">Sat</th>
+ </tr>
+
+ <tr>
+ <?php
+
+ $day_count = 1; //holds the current day of the week 1-7
+ $day_num = 1; //holds the current day of the month 1-31
+
+ $days_monthbefore = cal_days_in_month(0, $previous_month, $year);
+ //prints the numbers of days for the previous month
+ while($blank > 0){
+ $blank = $blank-1;
+ $days_before = $days_monthbefore-$blank;
+ echo '<td class="cal_notmonth">'.$days_before.'</td>'; //'.$days_before.'</td>';
+ $day_count++;
+ }
+
+ //loop printing each day of the CURRENT month ONLY
+ while($day_num <= $days_in_month){
+
+ if($day_count==1 || $day_count==7){
+ echo '<td class="cal_weekend">'; //weekends
+ }else{
+ echo '<td class="cal_weekday">'; //weekdays
+ }
+
+ $sqlDate = $year.'-'.$monthNum.'-'.$day_num; //old way NOT unix
+
+ //checks to see if the current day has events
+ $isEvent=false;
+
+ global $db;
+ $result = $db->Query("SELECT title,color FROM `bayonet_events` WHERE `date` = '$sqlDate' LIMIT 1");
+ while(($row = $db->Fetch($result))!=false)
+ {
+ $isEvent = true;
+ }
+
+ if($day_num == $today && $isEvent==true){
+ echo '<div class="eventtoday">'.$day_num.'</div>';
+ }else if($day_num == $today && $isEvent==false){
+ echo '<div class="monthtoday">'.$day_num.'</div>';
+ }else if($day_num != $today && $isEvent==true){
+ echo '<div class="event" id="event'.$day_num.'" onmouseover="highlightEvent(this.id)" onmouseout="normEvent(this.id)">';
+ echo $day_num;
+ echo '</div>';
+ }else{
+ echo $day_num;
+ }
+
+ echo '</td>';
+
+ $day_num++;
+ $day_count++;
+
+ if($day_count > 7){
+ echo '</tr><tr>';
+ $day_count = 1;
+ }
+ }
+
+ $days_after = 1;
+ //loop for printing the days for the next month
+ while($day_count > 1 && $day_count <=7){
+ echo '<td class="cal_notmonth">'.$days_after.'</td>'; //'.$days_after.'</td>';
+ $days_after++;
+ $day_count++;
+ }
+
+ ?>
+
+ </tr>
+ </table>
+ </center>
+<?php
+
+ }
+
+ ?> \ No newline at end of file
diff --git a/blocks/mini_calendar/index.php b/blocks/mini_calendar/index.php
new file mode 100644
index 0000000..6516646
--- /dev/null
+++ b/blocks/mini_calendar/index.php
@@ -0,0 +1,3 @@
+<link rel="stylesheet" type="text/css" href="blocks/mini_calendar/style.css" media="screen"/>
+<?php include 'blocks/mini_calendar/functions.php'; ?>
+<?php PrintCalendar(); ?> \ No newline at end of file
diff --git a/blocks/mini_calendar/scripts.js b/blocks/mini_calendar/scripts.js
new file mode 100644
index 0000000..e69de29
--- /dev/null
+++ b/blocks/mini_calendar/scripts.js
diff --git a/blocks/mini_calendar/style.css b/blocks/mini_calendar/style.css
new file mode 100644
index 0000000..72898ee
--- /dev/null
+++ b/blocks/mini_calendar/style.css
@@ -0,0 +1,96 @@
+/* START>> CALENDAR STYLES*/
+ .monthTitle{
+ color:black;
+ text-align:center;
+ font-size:12px;
+ font-weight:bold;
+ font-family:arial;
+ }
+ td.weekday {
+ width:40px;
+ height:20px;
+ background-color:#cb2121;
+ color:green;
+ text-align:center;
+ font-size:10px;
+ font-weight:bold;
+ }
+ th.weekday {
+ width:40px;
+ height:29px;
+ background-color:white;
+ color:black;
+ text-align:center;
+ font-size:11px;
+ font-weight:bold;
+ }
+ .monthday {
+ width:40px;
+ height:20px;
+ background-color:#aea2a2;
+ color:white;
+ text-align:left;
+ font-size:10pt;
+ font-weight:bold;
+
+ }
+ .monthtoday {
+ width:38px;
+ height:38px;
+ /* background-color:#3666ba; */
+ color:#225eac;
+ text-align:center;
+ font-size:14px;
+ font-weight:bold;
+ border:1px solid #333333;
+ }
+ .event {
+ width:38px;
+ height:38px;
+ background-color:#225eac;
+ text-align:center;
+ border:1px solid #333333;
+ }
+ table.calendar a, table.calendar a:visited, table.calendar a:active, table.calendar a:hover {
+ color:white;
+ }
+ .eventtoday{
+ width:38px;
+ height:38px;
+ background-color:#225eac;
+ color:#ef8e25;
+ text-align:center;
+ font-size:14px;
+ font-weight:bold;
+ border:1px solid #333333;
+ }
+ td.cal_weekday {
+ width:40px;
+ height:40px;
+ background-color:#a1a1a1;
+ vertical-align:top;
+ color:#eeeeee;
+ font-family:arial;
+ text-align:center;
+ font-size:14px;
+ }
+ td.cal_weekend {
+ width:40px;
+ height:40px;
+ background-color:#8f8f8f;
+ vertical-align:top;
+ color:#eeeeee;
+ font-family:arial;
+ text-align:center;
+ font-size:14px;
+ }
+ td.cal_notmonth {
+ width:40px;
+ height:40px;
+ background-color:#6e6e6e;
+ vertical-align:top;
+ color:#d4d4d4;
+ text-align:left;
+ font-size:11px;
+ }
+/* END>> CALENDAR STYLES */ \ No newline at end of file
diff --git a/blocks/rss_agw/index.php b/blocks/rss_agw/index.php
new file mode 100644
index 0000000..83c3ff1
--- /dev/null
+++ b/blocks/rss_agw/index.php
@@ -0,0 +1,29 @@
+<link rel="stylesheet" type="text/css" href="blocks/rss_agw/style.css" media="screen"/>
+<?php
+
+ include 'rssreader.php';
+
+ $rss = new rss_php;
+
+ $rss->load('http://www.armedglobalwarfare.com/index.php?type=rss;action=.xml;limit=30');
+
+ $items = $rss->getItems(); #returns all rss items
+
+ $numFeeds = 0;
+ echo "<div class=\"rss\" >";
+ foreach($items as $story){
+ if($story['category']=="Tournament Announcements"){
+ $numFeeds++;
+ echo "<a href=\"{$story['link']}\" target=\"_blank\"><span class=\"title\">{$story['title']}</span></a><br />
+ <span class=\"date\">{$story['pubDate']}</span><br />
+ {$story['description']}<br /><br />";
+ }
+ }
+ if(!$numFeeds){
+ echo "No new updates for this news feed.";
+ }
+ echo "</div>";
+ // echo "<pre>";
+ //print_r($items);
+ // echo "</pre>";
+?>
diff --git a/blocks/rss_agw/rssreader.php b/blocks/rss_agw/rssreader.php
new file mode 100644
index 0000000..41fa238
--- /dev/null
+++ b/blocks/rss_agw/rssreader.php
@@ -0,0 +1,161 @@
+<?php
+/*
+ RSS_PHP - the PHP DOM based RSS Parser
+ Author: <rssphp.net>
+ Published: 200801 :: blacknet :: via rssphp.net
+
+ RSS_PHP is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY.
+
+ Usage:
+ See the documentation at http://rssphp.net/documentation
+ Examples:
+ Can be found online at http://rssphp.net/examples
+*/
+
+class rss_php {
+
+ public $document;
+ public $channel;
+ public $items;
+
+/****************************
+ public load methods
+***/
+ # load RSS by URL
+ public function load($url=false, $unblock=true) {
+ if($url) {
+ if($unblock) {
+ $this->loadParser(file_get_contents($url, false, $this->randomContext()));
+ } else {
+ $this->loadParser(file_get_contents($url));
+ }
+ }
+ }
+ # load raw RSS data
+ public function loadRSS($rawxml=false) {
+ if($rawxml) {
+ $this->loadParser($rawxml);
+ }
+ }
+
+/****************************
+ public load methods
+ @param $includeAttributes BOOLEAN
+ return array;
+***/
+ # return full rss array
+ public function getRSS($includeAttributes=false) {
+ if($includeAttributes) {
+ return $this->document;
+ }
+ return $this->valueReturner();
+ }
+ # return channel data
+ public function getChannel($includeAttributes=false) {
+ if($includeAttributes) {
+ return $this->channel;
+ }
+ return $this->valueReturner($this->channel);
+ }
+ # return rss items
+ public function getItems($includeAttributes=false) {
+ if($includeAttributes) {
+ return $this->items;
+ }
+ return $this->valueReturner($this->items);
+ }
+
+/****************************
+ internal methods
+***/
+ private function loadParser($rss=false) {
+ if($rss) {
+ $this->document = array();
+ $this->channel = array();
+ $this->items = array();
+ $DOMDocument = new DOMDocument;
+ $DOMDocument->strictErrorChecking = false;
+ $DOMDocument->loadXML($rss);
+ $this->document = $this->extractDOM($DOMDocument->childNodes);
+ }
+ }
+
+ private function valueReturner($valueBlock=false) {
+ if(!$valueBlock) {
+ $valueBlock = $this->document;
+ }
+ foreach($valueBlock as $valueName => $values) {
+ if(isset($values['value'])) {
+ $values = $values['value'];
+ }
+ if(is_array($values)) {
+ $valueBlock[$valueName] = $this->valueReturner($values);
+ } else {
+ $valueBlock[$valueName] = $values;
+ }
+ }
+ return $valueBlock;
+ }
+
+ private function extractDOM($nodeList,$parentNodeName=false) {
+ $itemCounter = 0;
+ foreach($nodeList as $values) {
+ if(substr($values->nodeName,0,1) != '#') {
+ if($values->nodeName == 'item') {
+ $nodeName = $values->nodeName.':'.$itemCounter;
+ $itemCounter++;
+ } else {
+ $nodeName = $values->nodeName;
+ }
+ $tempNode[$nodeName] = array();
+ if($values->attributes) {
+ for($i=0;$values->attributes->item($i);$i++) {
+ $tempNode[$nodeName]['properties'][$values->attributes->item($i)->nodeName] = $values->attributes->item($i)->nodeValue;
+ }
+ }
+ if(!$values->firstChild) {
+ $tempNode[$nodeName]['value'] = $values->textContent;
+ } else {
+ $tempNode[$nodeName]['value'] = $this->extractDOM($values->childNodes, $values->nodeName);
+ }
+ if(in_array($parentNodeName, array('channel','rdf:RDF'))) {
+ if($values->nodeName == 'item') {
+ $this->items[] = $tempNode[$nodeName]['value'];
+ } elseif(!in_array($values->nodeName, array('rss','channel'))) {
+ $this->channel[$values->nodeName] = $tempNode[$nodeName];
+ }
+ }
+ } elseif(substr($values->nodeName,1) == 'text') {
+
+ $tempValue = trim(preg_replace('/\s\s+/',' ',str_replace("\n",' ', $values->textContent)));
+ if($tempValue) {
+ $tempNode = $tempValue;
+ }
+ } elseif(substr($values->nodeName,1) == 'cdata-section'){
+ $tempNode = $values->textContent;
+ }
+ }
+ return $tempNode;
+ }
+
+ private function randomContext() {
+ $headerstrings = array();
+ $headerstrings['User-Agent'] = 'Mozilla/5.0 (Windows; U; Windows NT 5.'.rand(0,2).'; en-US; rv:1.'.rand(2,9).'.'.rand(0,4).'.'.rand(1,9).') Gecko/2007'.rand(10,12).rand(10,30).' Firefox/2.0.'.rand(0,1).'.'.rand(1,9);
+ $headerstrings['Accept-Charset'] = rand(0,1) ? 'en-gb,en;q=0.'.rand(3,8) : 'en-us,en;q=0.'.rand(3,8);
+ $headerstrings['Accept-Language'] = 'en-us,en;q=0.'.rand(4,6);
+ $setHeaders = 'Accept: text/xml,application/xml,application/xhtml+xml,text/html;q=0.9,text/plain;q=0.8,image/png,*/*;q=0.5'."\r\n".
+ 'Accept-Charset: '.$headerstrings['Accept-Charset']."\r\n".
+ 'Accept-Language: '.$headerstrings['Accept-Language']."\r\n".
+ 'User-Agent: '.$headerstrings['User-Agent']."\r\n";
+ $contextOptions = array(
+ 'http'=>array(
+ 'method'=>"GET",
+ 'header'=>$setHeaders
+ )
+ );
+ return stream_context_create($contextOptions);
+ }
+
+}
+
+?> \ No newline at end of file
diff --git a/blocks/rss_agw/style.css b/blocks/rss_agw/style.css
new file mode 100644
index 0000000..0bc6e81
--- /dev/null
+++ b/blocks/rss_agw/style.css
@@ -0,0 +1,17 @@
+ .rss img {
+ display: none;
+ }
+ .rss span.title{
+ font-size: 16px;
+ font-weight: bold;
+ /* text-decoration:underline; */
+ }
+
+ .rss span.date{
+ font-family: 'Trebuchet MS', Trebuchet, Verdana, sans-serif;
+ font-size: 11px;
+ text-transform: uppercase;
+ font-weight:bold;
+ text-align: center;
+ letter-spacing: 2px;
+ } \ No newline at end of file
diff --git a/blocks/server_monitor/index.php b/blocks/server_monitor/index.php
new file mode 100644
index 0000000..791a5b2
--- /dev/null
+++ b/blocks/server_monitor/index.php
@@ -0,0 +1,16 @@
+<?php
+
+$feed = fopen("http://module.game-monitor.com/216.245.211.59:28910/data/server.php","r");
+$tmp = fgets($feed);
+$server = unserialize($tmp);
+
+OpenBlock("Game Server");
+echo "<div style=\"margin:5px;\">\n
+<a href=\"{$server->link}\">{$server->name}</a><br/>\n
+IP: {$server->ip}:{$server->port}<br/>\n
+Players: {$server->player}/{$server->maxplayer}<br/>\n
+</td></tr>\n
+</div>\n";
+CloseBlock();
+
+?> \ No newline at end of file
diff --git a/blocks/soldier_info/index.php b/blocks/soldier_info/index.php
new file mode 100644
index 0000000..f40f528
--- /dev/null
+++ b/blocks/soldier_info/index.php
@@ -0,0 +1,25 @@
+ <center>
+
+ Your IP: <?php echo $_SERVER['REMOTE_ADDR']; ?><br />
+<?php
+ if ($logged_in == 'true'){
+ echo '<img src="'.$avatar.'" alt="'.$logged_username.'"/><br /><br />'.$postnum.' post(s)<br /><br />
+ </center>
+
+
+ Welcome, '.$logged_username.' <br />
+ <a href="logout.php"><img src="images/arrow-blk.gif" border="0" alt="" />&nbsp;Logout</a><br />';
+ }
+ else{
+ echo 'Welcome Guest.<br />
+ </center>
+ <br />';
+ }
+ if ($logged_in == 'true'){
+ echo'<hr />
+ <img src="images/email-y.gif" />Private Messages <br />
+ <img src="images/email-r.gif" />Unread: <a href="forums/private.php">'.$pm_unread.'</a><br />
+ <img src="images/email-g.gif" />Total: <a href="forums/private.php">'.$pm_total.'</a><br /><hr />';
+ }
+?>
+ </center> \ No newline at end of file
diff --git a/blocks/tsviewer/index.php b/blocks/tsviewer/index.php
new file mode 100644
index 0000000..cee0be4
--- /dev/null
+++ b/blocks/tsviewer/index.php
@@ -0,0 +1,18 @@
+<?php
+
+OpenBlock("Teamspeak Server");
+
+echo "<div style=\"margin: 5px;\">\n";
+////until it works again i'm going to have this here...
+//echo "TSViewer is not working.";
+//echo "</div>\n";
+//CloseBlock();
+//return; //die
+
+?>
+
+<script language="javascript" type="text/javascript" src="http://www.tsviewer.com/ts_viewer_pur.php?ID=58659&bg=transparent&type=eeeeee&type_size=11&type_family=1&info=1&channels=0&users=1&js=1&type_s_weight=normal&type_s_style=normal&type_s_variant=normal&type_s_decoration=none&type_s_weight_h=normal&type_s_style_h=normal&type_s_variant_h=normal&type_s_decoration_h=none&type_i_weight=normal&type_i_style=normal&type_i_variant=normal&type_i_decoration=none&type_i_weight_h=normal&type_i_style_h=normal&type_i_variant_h=normal&type_i_decoration_h=none&type_c_weight=normal&type_c_style=normal&type_c_variant=normal&type_c_decoration=none&type_c_weight_h=normal&type_c_style_h=normal&type_c_variant_h=normal&type_c_decoration_h=none&type_u_weight=normal&type_u_style=normal&type_u_variant=normal&type_u_decoration=none&type_u_weight_h=normal&type_u_style_h=normal&type_u_variant_h=normal&type_u_decoration_h=none&cflags=0"></script><NOSCRIPT>Enable JavaScript to see TeamSpeak Viewer or click <a href="http://www.tsviewer.com/index.php?page=ts_viewer&ID=58659">here</a>.</NOSCRIPT>
+
+<?php
+echo "</div>\n";
+CloseBlock(); ?>
diff --git a/footer.php b/footer.php
new file mode 100644
index 0000000..df7d61a
--- /dev/null
+++ b/footer.php
@@ -0,0 +1,46 @@
+<?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/>Queries: %d | Fetches: %d<br/>\n",
+ $totaltime, ((float)memory_get_usage()/1024/1024), ((float)memory_get_peak_usage()/1024/1024), $phpversion, $db_queries, $db_fetches);
+?>
+
+<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']) 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>
+
+</body>
+</html>
+<?php ob_flush();?> \ No newline at end of file
diff --git a/functions.js b/functions.js
new file mode 100644
index 0000000..88a7412
--- /dev/null
+++ b/functions.js
@@ -0,0 +1,8 @@
+function gotoEditPage(id)
+{
+ var pageid = document.getElementById(id).value;
+ if(pageid == 0)
+ location.href="?load=admin&op=pages";
+ else
+ location.href="?load=admin&op=pages&edit="+pageid;
+} \ No newline at end of file
diff --git a/header.php b/header.php
new file mode 100644
index 0000000..0a79f4d
--- /dev/null
+++ b/header.php
@@ -0,0 +1,50 @@
+<?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/>.
+ */
+
+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"/>
+<link rel="stylesheet" type="text/css" href="style.css" media="screen"/>
+<link rel="stylesheet" type="text/css" href="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/images/add.gif b/images/add.gif
new file mode 100644
index 0000000..836dbf2
--- /dev/null
+++ b/images/add.gif
Binary files differ
diff --git a/images/addnewarticle.png b/images/addnewarticle.png
new file mode 100644
index 0000000..0e29960
--- /dev/null
+++ b/images/addnewarticle.png
Binary files differ
diff --git a/images/addnewpage.png b/images/addnewpage.png
new file mode 100644
index 0000000..c60c68c
--- /dev/null
+++ b/images/addnewpage.png
Binary files differ
diff --git a/images/annoucement.png b/images/annoucement.png
new file mode 100644
index 0000000..c70591d
--- /dev/null
+++ b/images/annoucement.png
Binary files differ
diff --git a/images/announcement.png b/images/announcement.png
new file mode 100644
index 0000000..c70591d
--- /dev/null
+++ b/images/announcement.png
Binary files differ
diff --git a/images/arrowleft.png b/images/arrowleft.png
new file mode 100644
index 0000000..502ae41
--- /dev/null
+++ b/images/arrowleft.png
Binary files differ
diff --git a/images/arrowright.png b/images/arrowright.png
new file mode 100644
index 0000000..ddd163b
--- /dev/null
+++ b/images/arrowright.png
Binary files differ
diff --git a/images/bayonetLogo.png b/images/bayonetLogo.png
new file mode 100644
index 0000000..4183a88
--- /dev/null
+++ b/images/bayonetLogo.png
Binary files differ
diff --git a/images/blockbackground.jpg b/images/blockbackground.jpg
new file mode 100644
index 0000000..ea6c7d3
--- /dev/null
+++ b/images/blockbackground.jpg
Binary files differ
diff --git a/images/calendar.png b/images/calendar.png
new file mode 100644
index 0000000..86b9861
--- /dev/null
+++ b/images/calendar.png
Binary files differ
diff --git a/images/delete.gif b/images/delete.gif
new file mode 100644
index 0000000..4e2a37f
--- /dev/null
+++ b/images/delete.gif
Binary files differ
diff --git a/images/dicon.png b/images/dicon.png
new file mode 100644
index 0000000..e9323cb
--- /dev/null
+++ b/images/dicon.png
Binary files differ
diff --git a/images/dlaxlogo.png b/images/dlaxlogo.png
new file mode 100644
index 0000000..b4991ae
--- /dev/null
+++ b/images/dlaxlogo.png
Binary files differ
diff --git a/images/editfiles.png b/images/editfiles.png
new file mode 100644
index 0000000..500e206
--- /dev/null
+++ b/images/editfiles.png
Binary files differ
diff --git a/images/editpage.png b/images/editpage.png
new file mode 100644
index 0000000..ab3fd58
--- /dev/null
+++ b/images/editpage.png
Binary files differ
diff --git a/images/error.gif b/images/error.gif
new file mode 100644
index 0000000..cb1fcbe
--- /dev/null
+++ b/images/error.gif
Binary files differ
diff --git a/images/error.png b/images/error.png
new file mode 100644
index 0000000..5bc1824
--- /dev/null
+++ b/images/error.png
Binary files differ
diff --git a/images/file_doc.png b/images/file_doc.png
new file mode 100644
index 0000000..b1da1ef
--- /dev/null
+++ b/images/file_doc.png
Binary files differ
diff --git a/images/file_pdf.png b/images/file_pdf.png
new file mode 100644
index 0000000..500e206
--- /dev/null
+++ b/images/file_pdf.png
Binary files differ
diff --git a/images/file_rtf.png b/images/file_rtf.png
new file mode 100644
index 0000000..39304c1
--- /dev/null
+++ b/images/file_rtf.png
Binary files differ
diff --git a/images/file_word.png b/images/file_word.png
new file mode 100644
index 0000000..3011f00
--- /dev/null
+++ b/images/file_word.png
Binary files differ
diff --git a/images/hgrad.png b/images/hgrad.png
new file mode 100644
index 0000000..86daf8b
--- /dev/null
+++ b/images/hgrad.png
Binary files differ
diff --git a/images/larrow.png b/images/larrow.png
new file mode 100644
index 0000000..554b6e9
--- /dev/null
+++ b/images/larrow.png
Binary files differ
diff --git a/images/leftshadow.png b/images/leftshadow.png
new file mode 100644
index 0000000..1f32159
--- /dev/null
+++ b/images/leftshadow.png
Binary files differ
diff --git a/images/limericklax.png b/images/limericklax.png
new file mode 100644
index 0000000..1a565ea
--- /dev/null
+++ b/images/limericklax.png
Binary files differ
diff --git a/images/logo.jpg b/images/logo.jpg
new file mode 100644
index 0000000..cfe19c2
--- /dev/null
+++ b/images/logo.jpg
Binary files differ
diff --git a/images/lvgrad.png b/images/lvgrad.png
new file mode 100644
index 0000000..487d7e3
--- /dev/null
+++ b/images/lvgrad.png
Binary files differ
diff --git a/images/navbackground.jpg b/images/navbackground.jpg
new file mode 100644
index 0000000..93ffece
--- /dev/null
+++ b/images/navbackground.jpg
Binary files differ
diff --git a/images/navbg.png b/images/navbg.png
new file mode 100644
index 0000000..00a8f88
--- /dev/null
+++ b/images/navbg.png
Binary files differ
diff --git a/images/navigation.png b/images/navigation.png
new file mode 100644
index 0000000..739c95f
--- /dev/null
+++ b/images/navigation.png
Binary files differ
diff --git a/images/navspacer.png b/images/navspacer.png
new file mode 100644
index 0000000..cdc8cb4
--- /dev/null
+++ b/images/navspacer.png
Binary files differ
diff --git a/images/news_header.png b/images/news_header.png
new file mode 100644
index 0000000..00861bf
--- /dev/null
+++ b/images/news_header.png
Binary files differ
diff --git a/images/nvgrad.png b/images/nvgrad.png
new file mode 100644
index 0000000..5e4c05c
--- /dev/null
+++ b/images/nvgrad.png
Binary files differ
diff --git a/images/photogallery.png b/images/photogallery.png
new file mode 100644
index 0000000..a161a55
--- /dev/null
+++ b/images/photogallery.png
Binary files differ
diff --git a/images/photoleft.png b/images/photoleft.png
new file mode 100644
index 0000000..f4eb3af
--- /dev/null
+++ b/images/photoleft.png
Binary files differ
diff --git a/images/photoright.png b/images/photoright.png
new file mode 100644
index 0000000..16a251b
--- /dev/null
+++ b/images/photoright.png
Binary files differ
diff --git a/images/rarrow.png b/images/rarrow.png
new file mode 100644
index 0000000..9a272d9
--- /dev/null
+++ b/images/rarrow.png
Binary files differ
diff --git a/images/rightshadow.png b/images/rightshadow.png
new file mode 100644
index 0000000..bc970f0
--- /dev/null
+++ b/images/rightshadow.png
Binary files differ
diff --git a/images/sandbackground.jpg b/images/sandbackground.jpg
new file mode 100644
index 0000000..2a2d800
--- /dev/null
+++ b/images/sandbackground.jpg
Binary files differ
diff --git a/images/spacer.png b/images/spacer.png
new file mode 100644
index 0000000..f187f4a
--- /dev/null
+++ b/images/spacer.png
Binary files differ
diff --git a/images/vgrad.png b/images/vgrad.png
new file mode 100644
index 0000000..e7a96e8
--- /dev/null
+++ b/images/vgrad.png
Binary files differ
diff --git a/images/view.gif b/images/view.gif
new file mode 100644
index 0000000..52cbddb
--- /dev/null
+++ b/images/view.gif
Binary files differ
diff --git a/images/xoma_logo.jpg b/images/xoma_logo.jpg
new file mode 100644
index 0000000..36914ff
--- /dev/null
+++ b/images/xoma_logo.jpg
Binary files differ
diff --git a/includes/debug.php b/includes/debug.php
new file mode 100644
index 0000000..abafd2d
--- /dev/null
+++ b/includes/debug.php
@@ -0,0 +1,77 @@
+<?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("RUDI_DEBUG",true);
+define("RUDI_DEBUG_LEVEL",true);
+define('NO_REPEAT','norepeat');
+define('REPEAT','repeat');
+
+static $last_message = NULL;
+static $last_message_count = 0;
+
+function decho($message, $flag = REPEAT)
+{
+ global $last_message, $last_message_count;
+ if($last_message == $message)
+ {
+ if($flag == NO_REPEAT)
+ ++$last_message_count;
+ else
+ $last_message_count = $last_message_count;
+ return;
+ }
+ elseif($last_message != $message)
+ {
+ if($last_message_count > 0 && !is_array($last_message) && !is_object($last_message))
+ {
+ WriteLog("Receieved previous message <b>$last_message_count</b> times\n",BAYONET_LOG_INFO);
+ }
+ else
+ {
+ if(is_array($message))
+ {
+ $array_dump = print_r($message,true);
+ WriteLog($array_dump,BAYONET_LOG_INFO);
+ }
+ elseif(is_object($message))
+ {
+ ob_start();
+ var_dump($message);
+ $obj_dump = ob_get_contents();
+ ob_end_clean();
+ //htmlentities($obj_dump,ENT_QUOTES);
+ WriteLog($obj_dump,BAYONET_LOG_INFO);
+ }
+ elseif(is_string($message))
+ {
+ $message = wordwrap($message,80,'<br />');
+ WriteLog($message,BAYONET_LOG_INFO);
+ }
+ }
+
+ $last_message_count = 0;
+ }
+
+ $last_message = $message;
+
+}
+
+
+
+?> \ No newline at end of file
diff --git a/includes/functions.php b/includes/functions.php
new file mode 100644
index 0000000..cd25792
--- /dev/null
+++ b/includes/functions.php
@@ -0,0 +1,559 @@
+<?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/>.
+ */
+
+/**
+ * bbcode_format()
+ *
+ * Modified public domain code from www.phpit.net
+ *
+ * @param mixed $str
+ * @return
+ */
+function bbcode_format ($str)
+{
+ $str = htmlentities($str);
+ $str = strip_tags($str);
+ $str = wordwrap($str,100,"\n",true);
+
+ $simple_search = array(
+ '/\[b\](.*?)\[\/b\]/is',
+ '/\[i\](.*?)\[\/i\]/is',
+ '/\[u\](.*?)\[\/u\]/is',
+ '/\[hr\]/is',
+ '/\[pi\](.*?)\[\/pi\]/is',
+ '/\[center\](.*?)\[\/center\]/is',
+ '/\[title\](.*?)\[\/title\]/is',
+ '/\[article\](.*?)\[\/article\]/is',
+ '/\[section\](.*?)\[\/section\]/is',
+ '/\[code\](.*?)\[\/code\]/is',
+ '/\[quote\](.*?)\[\/quote\]/is',
+ '/\[quote\=(.*?)\](.*?)\[\/quote\]/is',
+ '/\[url\=(.*?)\](.*?)\[\/url\]/is',
+ '/\[align\=(.*?)\](.*?)\[\/align\]/is',
+ '/\[size\=(.*?)\](.*?)\[\/size\]/is',
+ '/\[img\=(.*?)\](.*?)\[\/img\]/is'
+ );
+
+ $simple_replace = array(
+ '<strong>$1</strong>',
+ '<em>$1</em>',
+ '<u>$1</u>',
+ '<hr>',
+ '<p style="text-indent:3em;">$1</p>',
+ '<center>$1</center>',
+ '<h2>$1</h2>',
+ '<h3>$1</h3>',
+ '<h4>$1</h4>',
+ '<blockquote><pre>$1</pre></blockquote>',
+ '<blockquote>$1</blockquote>',
+ '<i>$1 wrote:</i><br/><blockquote>$2</blockquote>',
+ '<a href="$1">$2</a>',
+ '<align="$1">$2</align>',
+ '<font style="font-size:$1px;">$2</font>',
+ '<img src="$1" alt="$2"/>'
+ );
+
+ $order = array("\r\n", "\n", "\r");
+ $replace = "\n<br/>";
+
+ $str = preg_replace ($simple_search, $simple_replace, $str);
+ $str = str_ireplace($order,$replace,$str);
+ return $str;
+}
+
+ //BBcode 2 HTML was written by WAY2WEB.net
+
+ function BBCode($Text)
+ {
+ // Replace any html brackets with HTML Entities to prevent executing HTML or script
+ // Don't use strip_tags here because it breaks [url] search by replacing & with amp
+ $Text = str_replace("<", "&lt;", $Text);
+ $Text = str_replace(">", "&gt;", $Text);
+
+ // Convert new line chars to html <br /> tags
+ $Text = nl2br($Text);
+
+ // Set up the parameters for a URL search string
+ $URLSearchString = " a-zA-Z0-9\:\/\-\?\&\.\=\_\~\#\'";
+ // Set up the parameters for a MAIL search string
+ $MAILSearchString = $URLSearchString . " a-zA-Z0-9\.@";
+
+ // Perform URL Search
+ $Text = preg_replace("/\[url\]([$URLSearchString]*)\[\/url\]/", '<a href="$1" target="_blank">$1</a>', $Text);
+ $Text = preg_replace("(\[url\=([$URLSearchString]*)\](.+?)\[/url\])", '<a href="$1" target="_blank">$2</a>', $Text);
+ //$Text = preg_replace("(\[url\=([$URLSearchString]*)\]([$URLSearchString]*)\[/url\])", '<a href="$1" target="_blank">$2</a>', $Text);
+
+ // Perform MAIL Search
+ $Text = preg_replace("(\[mail\]([$MAILSearchString]*)\[/mail\])", '<a href="mailto:$1">$1</a>', $Text);
+ $Text = preg_replace("/\[mail\=([$MAILSearchString]*)\](.+?)\[\/mail\]/", '<a href="mailto:$1">$2</a>', $Text);
+
+ // Check for bold text
+ $Text = preg_replace("(\[b\](.+?)\[\/b])is",'<span class="bold">$1</span>',$Text);
+
+ // Check for Italics text
+ $Text = preg_replace("(\[i\](.+?)\[\/i\])is",'<span class="italics">$1</span>',$Text);
+
+ // Check for Underline text
+ $Text = preg_replace("(\[u\](.+?)\[\/u\])is",'<span class="underline">$1</span>',$Text);
+
+ // Check for strike-through text
+ $Text = preg_replace("(\[s\](.+?)\[\/s\])is",'<span class="strikethrough">$1</span>',$Text);
+
+ // Check for over-line text
+ $Text = preg_replace("(\[o\](.+?)\[\/o\])is",'<span class="overline">$1</span>',$Text);
+
+ // Check for colored text
+ $Text = preg_replace("(\[color=(.+?)\](.+?)\[\/color\])is","<span style=\"color: $1\">$2</span>",$Text);
+
+ // Check for sized text
+ $Text = preg_replace("(\[size=(.+?)\](.+?)\[\/size\])is","<span style=\"font-size: $1px\">$2</span>",$Text);
+
+ // Check for list text
+ $Text = preg_replace("/\[list\](.+?)\[\/list\]/is", '<ul class="listbullet">$1</ul>' ,$Text);
+ $Text = preg_replace("/\[list=1\](.+?)\[\/list\]/is", '<ul class="listdecimal">$1</ul>' ,$Text);
+ $Text = preg_replace("/\[list=i\](.+?)\[\/list\]/s", '<ul class="listlowerroman">$1</ul>' ,$Text);
+ $Text = preg_replace("/\[list=I\](.+?)\[\/list\]/s", '<ul class="listupperroman">$1</ul>' ,$Text);
+ $Text = preg_replace("/\[list=a\](.+?)\[\/list\]/s", '<ul class="listloweralpha">$1</ul>' ,$Text);
+ $Text = preg_replace("/\[list=A\](.+?)\[\/list\]/s", '<ul class="listupperalpha">$1</ul>' ,$Text);
+ $Text = str_replace("[*]", "<li>", $Text);
+
+ // Check for font change text
+ $Text = preg_replace("(\[font=(.+?)\](.+?)\[\/font\])","<span style=\"font-family: $1;\">$2</span>",$Text);
+
+ // Declare the format for [code] layout
+ $CodeLayout = '<table width="90%" border="0" align="center" cellpadding="0" cellspacing="0">
+ <tr>
+ <td class="quotecodeheader"> Code:</td>
+ </tr>
+ <tr>
+ <td class="codebody">$1</td>
+ </tr>
+ </table>';
+ // Check for [code] text
+ $Text = preg_replace("/\[code\](.+?)\[\/code\]/is","$CodeLayout", $Text);
+ // Declare the format for [php] layout
+ $phpLayout = '<table width="90%" border="0" align="center" cellpadding="0" cellspacing="0">
+ <tr>
+ <td class="quotecodeheader"> Code:</td>
+ </tr>
+ <tr>
+ <td class="codebody">$1</td>
+ </tr>
+ </table>';
+ // Check for [php] text
+ $Text = preg_replace("/\[php\](.+?)\[\/php\]/is",$phpLayout, $Text);
+
+ // Declare the format for [quote] layout
+ $QuoteLayout = '<table width="90%" border="0" align="center" cellpadding="0" cellspacing="0">
+ <tr>
+ <td class="quotecodeheader"> Quote:</td>
+ </tr>
+ <tr>
+ <td class="quotebody">$1</td>
+ </tr>
+ </table>';
+
+ // Check for [quote] text
+ $Text = preg_replace("/\[quote\](.+?)\[\/quote\]/is","$QuoteLayout", $Text);
+
+ // Images
+ // [img]pathtoimage[/img]
+ $Text = preg_replace("/\[img\](.+?)\[\/img\]/", '<img src="$1">', $Text);
+
+ //[img=align]image source[/img]
+ $Text = preg_replace("(\[img align\=(.+?)\](.+?)\[\/img\])is","<img src=\"$2\" align=\"$1\" />",$Text);
+
+ // [img=widthxheight]image source[/img]
+ $Text = preg_replace("/\[img\=([0-9]*)x([0-9]*)\](.+?)\[\/img\]/", '<img src="$3" height="$2" width="$1">', $Text);
+
+ // Alignment
+ // [align=type]text[/align]
+ $Text = preg_replace("(\[align=(.+?)\](.+?)\[\/align\])is","<div style=\"text-align: $1\">$2</div>",$Text);
+
+ return $Text;
+ }
+
+function articleHeading($text){
+
+ // Set the content-type
+ header('Content-type: image/png');
+
+ //$text = $_GET['text'];
+
+ $im = imagecreatefrompng('images/news_header.png'); // open image
+ imagealphablending($im, true); // setting alpha blending on
+ imagesavealpha($im, true); // save alphablending setting (important)
+
+ // Create some colors
+ $black = imagecolorallocate($im, 0, 0, 0);
+
+
+ // Replace path by your own font path
+ //$font = 'TrajanPro-Regular.otf';
+ //$font = 'TrajanPro-Bold.otf';
+ $font = 'BrushScriptStd.otf';
+ //$font = 'TRATS__.TTF';
+ //$text = strtoupper($text);
+
+ // Add the text
+ imagettftext($im, 18, 0, 0, 17, $black, $font, $text);
+
+ // Using imagepng() results in clearer text compared with imagejpeg()
+ imagepng($im);
+ imagedestroy($im);
+}
+
+function LinkList($array)
+{
+ if(!is_array($array))
+ {
+ ReportError("List was not an array");
+ return;
+ }
+
+ echo "<ul class=\"block\">";
+ foreach($array as $text => $link)
+ {
+ echo "<li><a href=\"$link\">$text</a></li>";
+ }
+ echo "</ul>";
+}
+
+/**
+ * LinkModule()
+ *
+ * Helper function to link to Bayonet modules.
+ *
+ * @param mixed $module_name
+ * @param mixed $link_name
+ * @return
+ */
+function LinkModule($module_name,$args = NULL,$link_name)
+{
+ return "<a href=\"?load={$module_name}{$args}\">{$link_name}</a>";
+}
+
+/**
+ * LinkPage()
+ *
+ * Helper function to link to Bayonet pages.
+ *
+ * @param mixed $page_id
+ * @param mixed $page_name
+ * @return
+ */
+function LinkPage($page_id,$page_name)
+{
+ return "<a href=\"?load=page&amp;id={$page_id}\">{$page_name}</a>";
+}
+
+/**
+ * LinkInternal()
+ *
+ * Helper function to link to a relative Bayonet path.
+ *
+ * @param mixed $name
+ * @param string $rel_path
+ * @param string $file
+ * @return
+ */
+function LinkInternal($name,$file,$rel_path = "./")
+{
+ return "<a href=\"{$rel_path}{$file}\">{$name}</a>";
+}
+
+if(!defined("CALLED_FROM_ADMIN"))
+{
+ /**
+ * OpenTable()
+ *
+ * Begins a Bayonet site table.
+ *
+ * @return
+ */
+ function OpenTable()
+ {
+ //width="100%" is important. Otherwise all of our tables will be text width.
+ //echo "<table width=\"100%\" align=\"center\" class=\"cleartable\">\n";
+ echo "<div class=\"contentBorder1\">";
+ echo "<div class=\"contentBorder2\">";
+ }
+
+ /**
+ * CloseTable()
+ *
+ * Closes a Bayonet site table.
+ *
+ * @return
+ */
+ function CloseTable()
+ {
+ //echo "</table>";
+ echo "</div>";
+ echo "</div>";
+ }
+}
+
+function OpenBlock($title = 'New Block')
+{
+ OpenTable();
+ echo "<div class=\"contentHeading\">{$title}</div>";
+ echo "<div class=\"content\">";
+}
+
+function CloseBlock()
+{
+ echo "</div>";
+ CloseTable();
+}
+/**
+ * ReportError()
+ *
+ * This function should be called in the event that an error has occured.
+ *
+ * @param mixed $message - automatically logged
+ * @return
+ */
+function ReportError($message)
+{
+ //WriteLog($message,BAYONET_LOG_ERROR);
+ OpenTable();
+ echo "<div class=\"contentHeading\">Error Message</div><div class=\"content\">{$message}</div>";
+ CloseTable();
+}
+
+/**
+ * ReportHack()
+ *
+ * This function should be called in the event that we are confirming
+ * a hacking attempt.
+ *
+ * @param mixed $message - automatically logged
+ * @return void
+ */
+function ReportHack($message)
+{
+ //WriteLog($message,BAYONET_LOG_HACK);
+ OpenTable();
+ echo "<tr><th>Hack Attempt</th></tr><tr><td style=\"text-align:center;\">{$message}</td></tr>";
+ CloseTable();
+}
+
+
+/**
+ * array_dump()
+ *
+ * Useful against $_POST and $_GET variables, for dumping data to
+ * a log file, or to stdout. The return value is a single string,
+ * with each array key => value pair delimited by a character.
+ * The default character is a pipe -> '|'. It is assumed that if
+ * wanted to have a newline character inserted, just replace $spacer
+ * with '\n'.
+ *
+ * @param mixed $array
+ * @param string $spacer
+ * @return
+ */
+function array_dump($array, $spacer = '|')
+{
+ $retval = NULL;
+ foreach($array as $challenge => $answer)
+ {
+ $retval .= " $challenge => $answer " . $spacer;
+ }
+
+ return $retval;
+}
+
+/**
+ * WriteLog()
+ *
+ * This function can be accessed directly, however, anything that is
+ * passed to ReportError() or ReportHack(), or decho() will be logged in their
+ * appropriate log file.
+ *
+ * Change made: added checks to see if the log files exist before opening
+ *
+ * @param mixed $message
+ * @param mixed $flag
+ * @return
+ */
+define('BAYONET_LOG_HACK','bayonet_log_hack');
+define('BAYONET_LOG_ERROR','bayonet_log_error');
+define('BAYONET_LOG_WARN','bayonet_log_warn');
+define('BAYONET_LOG_INFO','bayonet_log_info');
+
+function WriteLog($message,$flag)
+{
+ global $config;
+ $enabled = $config['logs']['enabled'];
+
+ if(!$enabled)
+ {
+ return false;
+ }
+
+ $dir = $config['logs']['dir'];
+ date_default_timezone_set($config['logs']['timezone']);
+ $varstr = array_dump($_GET);
+ $type = NULL;
+ $ip = $_SERVER['REMOTE_ADDR'];
+ $hostname = gethostbyaddr($ip);
+ $executed = $_SERVER['PHP_SELF'];
+ $timestamp = date('Y-M-d H:i:s T');
+
+
+ $message = str_replace("\n",'',$message);
+ $message = str_replace("<br>",'',$message);
+
+ switch($flag)
+ {
+ case BAYONET_LOG_HACK:
+ if(!file_exists($dir.'hacks.log')){
+ break;
+ }
+ $fp = fopen($dir.'hacks.log','a');
+ $type = 'HACK';
+ $full_message = "TIMESTAMP: {$timestamp}\n\t\tIP: {$ip}\n\t\tHOSTNAME: {$hostname}\n\t\tACTION: {$type} of {$executed}\n\t\tDEFERRAL: {$message}\n\t\tVAR: ({$varstr})\n\n";
+ break;
+ case BAYONET_LOG_ERROR:
+ if(!file_exists($dir.'error.log')){
+ break;
+ }
+ $fp = fopen($dir.'error.log','a');
+ $type = 'ERROR';
+ $full_message = "({$timestamp}) - {$type} - {$message} - ({$varstr})\n";
+ break;
+ case BAYONET_LOG_WARN:
+ if(!file_exists($dir.'warn.log')){
+ break;
+ }
+ $fp = fopen($dir.'warn.log','a');
+ $type = 'WARN';
+ $full_message = "({$timestamp}) - {$type} - {$message} - ({$varstr})\n";
+ break;
+ case BAYONET_LOG_INFO:
+ if(!file_exists($dir.'info.log')){
+ break;
+ }
+ $fp = fopen($dir.'info.log','a');
+ $type = 'INFO';
+ $full_message = "({$timestamp}) - {$type} - {$message}\n";
+ break;
+ default:
+ echo 'To log something, you need to define a log to write to.<br>';
+ return;
+ }
+ if(file_exists($fp)){
+ fwrite($fp,$full_message);
+ fclose($fp);
+ }else{
+ //echo "could not write to file because file does not exist.<br />";
+ }
+}
+
+/**
+ * UnderConstruction()
+ *
+ * Displays a site-wide message across the page header.
+ *
+ * @param mixed $message
+ * @param mixed $flag Acceptable flags are BAYONET_SITE, and BAYONET_SECTION
+ * @return
+ */
+define('BAYONET_SITE','bayonet_site');
+define('BAYONET_SECTION','bayonet_section');
+function UnderConstruction($message = NULL, $flag = BAYONET_SITE)
+{
+ $timestamp = date("Y-M-d h:m:s");
+ OpenTable();
+ switch($flag)
+ {
+ case BAYONET_SITE:
+ echo "<tr><th>Site is currently under construction : $timestamp</th></tr>";
+ break;
+ case BAYONET_SECTION:
+ echo "<tr><th>Section currently under construction : $timestamp</th></tr>";
+ }
+
+ if(!is_null($message))
+ {
+ echo "<tr><td><i>$message</i></td></tr>";
+ }
+
+ CloseTable();
+ echo "<br>";
+}
+
+/**
+ * GetBlocks()
+ *
+ * Includes all directories listed in blocks/ and uses the bayonet_blocks
+ * MySQL table to determine the order of the blocks displayed.
+ *
+ * @return
+ */
+
+define('BLOCK_LEFT',false);
+define('BLOCK_RIGHT',false);
+
+function GetBlocks($position = BLOCK_LEFT)
+{
+ global $config;
+ /**
+ * I had to reconnect to the database for some fucking reason at this point.
+ * I have no idea why, but I was recieving errors telling me that $db was no longer
+ * an object. This is/was bullshit.
+ */
+ $db = new Bayonet_SQL();
+ $db->Connect(
+ $config['sql']['hostname'],
+ $config['sql']['username'],
+ $config['sql']['password']
+ );
+ $db->Select_db($config['sql']['database']);
+
+ $result = $db->Query("SELECT * FROM `bayonet_blocks` ORDER BY weight, position");
+ //$result = mysql_query("SELECT * FROM bayonet_blocks ORDER BY weight, position");
+ while(($row = $db->Fetch($result))!==false)
+ {
+ $blocks[] = $row;
+ }
+ $db->Free($result);
+
+ foreach($blocks as $block)
+ {
+ if($block['position'] == $position && $block['active'] == true)
+ {
+ $load = 'blocks/'.$block['dir_name'].'/index.php';
+ if(file_exists($load))
+ {
+ OpenBlock($block['title']);
+ include $load;
+ CloseBlock();
+ }
+ else
+ {
+ ReportError("Failed to load block, '{$block['dir_name']}'. Check block config.");
+ }
+ if($config['blocks']['spacer']) echo "<br />";
+ }
+ }
+}
+?> \ No newline at end of file
diff --git a/includes/sql.class.php b/includes/sql.class.php
new file mode 100644
index 0000000..141a7ae
--- /dev/null
+++ b/includes/sql.class.php
@@ -0,0 +1,115 @@
+<?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/>.
+ */
+
+static $db_queries = 0;
+static $db_connections = 0;
+static $db_frees = 0;
+static $db_fetches = 0;
+
+class Bayonet_SQL
+{
+ protected $hostname;
+ public function Connect($hostname, $username, $passwd)
+ {
+ global $db_connections;
+ ++$db_connections;
+
+ $this->hostname = $hostname;
+
+ decho("Connecting ('$hostname')");
+ return mysql_connect($hostname, $username, $passwd);
+ }
+
+ public function Disconnect($link)
+ {
+ decho("Disconnecting ('$link' from '$this->hostname')");
+ //return mysql_close($link);
+ }
+
+ public function Select_db($db)
+ {
+ decho("Selecting database ('$db')");
+ return mysql_select_db($db);
+ }
+
+ public function Query($str)
+ {
+ global $db_queries;
+ ++$db_queries;
+ //FIGURE OUT HOW TO CHECK EXCEPTION, TRY CATCH ???
+ // if(!mysql_query($str))
+ // {
+ // throw new Exception(mysql_error());
+ // }
+ /*
+ try{
+
+ }catch(Exception $e){
+
+ } */
+ return mysql_query($str);
+ }
+
+ public function Free($result)
+ {
+ global $db_frees;
+ ++$db_frees;
+ //decho("Freeing ('$result')");
+ return mysql_free_result($result);
+ }
+
+ public function Fetch($result)
+ {
+ return $this->FetchArray($result);
+ }
+
+ public function FetchArray($result)
+ {
+ global $db_fetches;
+ ++$db_fetches;
+ /* Alias Fetch() prefered, so no decho information */
+ return mysql_fetch_array($result,MYSQL_ASSOC);
+ }
+
+ public function FetchObject($result,$class)
+ {
+ global $db_fetches;
+ ++$db_fetches;
+ return mysql_fetch_object($result,$class);
+ }
+
+ public function FetchAssoc($result)
+ {
+ global $db_fetches;
+ ++$db_fetches;
+ return mysql_fetch_assoc($result);
+ }
+
+ public function FetchRow($result)
+ {
+ return mysql_fetch_row($result);
+ }
+
+ public function Rows($result)
+ {
+ return mysql_num_rows($result);
+ }
+}
+
+?> \ No newline at end of file
diff --git a/index.php b/index.php
new file mode 100644
index 0000000..e1ded92
--- /dev/null
+++ b/index.php
@@ -0,0 +1,65 @@
+<?php try { ?>
+<?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.
+ */
+
+include './includes/debug.php';
+include './includes/config.php';
+include './includes/sql.class.php';
+include './includes/functions.php';
+
+$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 'navigation.php'; ?></div>
+
+<!-- content -->
+<table border="0" cellspacing="10px" cellpadding="0" class="main" width="100%">
+ <tr>
+ <td class="leftcol">
+ <?php require '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
+} //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/>"
+ );
+}
+?> \ No newline at end of file
diff --git a/logs/error.log b/logs/error.log
new file mode 100644
index 0000000..e69de29
--- /dev/null
+++ b/logs/error.log
diff --git a/logs/hacks.log b/logs/hacks.log
new file mode 100644
index 0000000..e69de29
--- /dev/null
+++ b/logs/hacks.log
diff --git a/logs/info.log b/logs/info.log
new file mode 100644
index 0000000..e69de29
--- /dev/null
+++ b/logs/info.log
diff --git a/markitup/images/body.png b/markitup/images/body.png
new file mode 100644
index 0000000..cad1bea
--- /dev/null
+++ b/markitup/images/body.png
Binary files differ
diff --git a/markitup/images/jaysalvat.png b/markitup/images/jaysalvat.png
new file mode 100644
index 0000000..83b76fa
--- /dev/null
+++ b/markitup/images/jaysalvat.png
Binary files differ
diff --git a/markitup/images/markitup.png b/markitup/images/markitup.png
new file mode 100644
index 0000000..bb52e89
--- /dev/null
+++ b/markitup/images/markitup.png
Binary files differ
diff --git a/markitup/images/style.css b/markitup/images/style.css
new file mode 100644
index 0000000..b29e3c7
--- /dev/null
+++ b/markitup/images/style.css
@@ -0,0 +1,27 @@
+body {
+ background:#EEE url(body.png) repeat-x;
+ font: 13px "Trebuchet MS", Arial, Verdana;
+ padding-top:95px;
+}
+a {
+ text-decoration:none;
+ color:#3C769D;
+}
+h1 a,
+p em a {
+ display:block;
+ overflow:hidden;
+ text-indent:-1000px;
+ position:absolute;
+ top:0px; left:0px;
+}
+h1 a {
+ background:#EEE url(markitup.png) no-repeat top left;
+ width:245px; height:85px;
+ top:28px;
+}
+p em a {
+ background:transparent url(jaysalvat.png) no-repeat 10% 50%;
+ width:120px; height:28px;
+ left:30px;
+} \ No newline at end of file
diff --git a/markitup/index.html b/markitup/index.html
new file mode 100644
index 0000000..4049448
--- /dev/null
+++ b/markitup/index.html
@@ -0,0 +1,65 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
+<title>markItUp! Universal markup editor</title>
+<link rel="stylesheet" type="text/css" href="images/style.css" />
+<!-- jQuery -->
+<script type="text/javascript" src="jquery.pack.js"></script>
+<!-- markItUp! -->
+<script type="text/javascript" src="markitup/jquery.markitup.pack.js"></script>
+<!-- markItUp! toolbar settings -->
+<script type="text/javascript" src="markitup/sets/default/set.js"></script>
+<!-- markItUp! skin -->
+<link rel="stylesheet" type="text/css" href="markitup/skins/markitup/style.css" />
+<!-- markItUp! toolbar skin -->
+<link rel="stylesheet" type="text/css" href="markitup/sets/default/style.css" />
+</head>
+<body>
+<script type="text/javascript">
+<!--
+$(document).ready(function() {
+ // Add markItUp! to your textarea in one line
+ // $('textarea').markItUp( { Settings }, { OptionalExtraSettings } );
+ $('#markItUp').markItUp(mySettings);
+
+ // You can add content from anywhere in your page
+ // $.markItUp( { Settings } );
+ $('.add').click(function() {
+ $.markItUp( { openWith:'<opening tag>',
+ closeWith:'<\/closing tag>',
+ placeHolder:"New content"
+ }
+ );
+ return false;
+ });
+
+ // And you can add/remove markItUp! whenever you want
+ // $(textarea).markItUpRemove();
+ $('.toggle').click(function() {
+ if ($("#markItUp.markItUpEditor").length === 1) {
+ $("#markItUp").markItUpRemove();
+ $("span", this).text("get markItUp! back");
+ } else {
+ $('#markItUp').markItUp(mySettings);
+ $("span", this).text("remove markItUp!");
+ }
+ return false;
+ });
+});
+-->
+</script>
+<h1><a href="http://markitup.jaysalvat.com/">markItUp!</a></h1>
+<p><em><a href="http://www.jaysalvat.com">By Jay Salvat</a></em></p>
+<p>Downloads, examples and documentation at <a href="http://markitup.jaysalvat.com">http://markitup.jaysalvat.com</a>.</p>
+<p>Click <a href="#" class="add">this link to insert content</a> from anywhere in the page or <a href="#" class="toggle">this one to <span>remove markItUp!</span></a></p>
+<p>
+<textarea id="markItUp" cols="80" rows="20">
+&lt;h1&gt;Welcome on markItUp!&lt;/h1&gt;
+
+&lt;p&gt;&lt;strong&gt;markItUp!&lt;/strong&gt; is a JavaScript plugin built on the jQuery library. It allows you to turn any textarea into a markup editor. Html, Textile, Wiki Syntax, Markdown, BBcode or even your own markup system can be easily implemented.&lt;/p&gt;
+</textarea>
+</p>
+<p>Support the projet : <a href="http://markitup.jaysalvat.com/">Donate</a> | <a href="http://markitup.jaysalvat.com/">Contact</a></p>
+</body>
+</html>
diff --git a/markitup/jquery.pack.js b/markitup/jquery.pack.js
new file mode 100644
index 0000000..74cdfee
--- /dev/null
+++ b/markitup/jquery.pack.js
@@ -0,0 +1,11 @@
+/*
+ * jQuery 1.2.3 - New Wave Javascript
+ *
+ * Copyright (c) 2008 John Resig (jquery.com)
+ * Dual licensed under the MIT (MIT-LICENSE.txt)
+ * and GPL (GPL-LICENSE.txt) licenses.
+ *
+ * $Date: 2008-02-06 00:21:25 -0500 (Wed, 06 Feb 2008) $
+ * $Rev: 4663 $
+ */
+eval(function(p,a,c,k,e,r){e=function(c){return(c<a?'':e(parseInt(c/a)))+((c=c%a)>35?String.fromCharCode(c+29):c.toString(36))};if(!''.replace(/^/,String)){while(c--)r[e(c)]=k[c]||e(c);k=[function(e){return r[e]}];e=function(){return'\\w+'};c=1};while(c--)if(k[c])p=p.replace(new RegExp('\\b'+e(c)+'\\b','g'),k[c]);return p}('(J(){7(1e.3N)L w=1e.3N;L E=1e.3N=J(a,b){K 1B E.2l.4T(a,b)};7(1e.$)L D=1e.$;1e.$=E;L u=/^[^<]*(<(.|\\s)+>)[^>]*$|^#(\\w+)$/;L G=/^.[^:#\\[\\.]*$/;E.1n=E.2l={4T:J(d,b){d=d||T;7(d.15){6[0]=d;6.M=1;K 6}N 7(1o d=="25"){L c=u.2O(d);7(c&&(c[1]||!b)){7(c[1])d=E.4a([c[1]],b);N{L a=T.5J(c[3]);7(a)7(a.2w!=c[3])K E().2s(d);N{6[0]=a;6.M=1;K 6}N d=[]}}N K 1B E(b).2s(d)}N 7(E.1q(d))K 1B E(T)[E.1n.21?"21":"3U"](d);K 6.6E(d.1k==1M&&d||(d.5h||d.M&&d!=1e&&!d.15&&d[0]!=10&&d[0].15)&&E.2I(d)||[d])},5h:"1.2.3",87:J(){K 6.M},M:0,22:J(a){K a==10?E.2I(6):6[a]},2F:J(b){L a=E(b);a.54=6;K a},6E:J(a){6.M=0;1M.2l.1g.1i(6,a);K 6},R:J(a,b){K E.R(6,a,b)},4X:J(b){L a=-1;6.R(J(i){7(6==b)a=i});K a},1J:J(c,a,b){L d=c;7(c.1k==4e)7(a==10)K 6.M&&E[b||"1J"](6[0],c)||10;N{d={};d[c]=a}K 6.R(J(i){Q(c 1p d)E.1J(b?6.W:6,c,E.1l(6,d[c],b,i,c))})},1j:J(b,a){7((b==\'27\'||b==\'1R\')&&2M(a)<0)a=10;K 6.1J(b,a,"2o")},1u:J(b){7(1o b!="3V"&&b!=V)K 6.4x().3t((6[0]&&6[0].2i||T).5r(b));L a="";E.R(b||6,J(){E.R(6.3p,J(){7(6.15!=8)a+=6.15!=1?6.6K:E.1n.1u([6])})});K a},5m:J(b){7(6[0])E(b,6[0].2i).5k().3o(6[0]).2c(J(){L a=6;2b(a.1C)a=a.1C;K a}).3t(6);K 6},8w:J(a){K 6.R(J(){E(6).6z().5m(a)})},8p:J(a){K 6.R(J(){E(6).5m(a)})},3t:J(){K 6.3O(18,P,S,J(a){7(6.15==1)6.38(a)})},6q:J(){K 6.3O(18,P,P,J(a){7(6.15==1)6.3o(a,6.1C)})},6o:J(){K 6.3O(18,S,S,J(a){6.1a.3o(a,6)})},5a:J(){K 6.3O(18,S,P,J(a){6.1a.3o(a,6.2B)})},3h:J(){K 6.54||E([])},2s:J(b){L c=E.2c(6,J(a){K E.2s(b,a)});K 6.2F(/[^+>] [^+>]/.17(b)||b.1f("..")>-1?E.57(c):c)},5k:J(e){L f=6.2c(J(){7(E.14.1d&&!E.3E(6)){L a=6.69(P),4Y=T.3s("1x");4Y.38(a);K E.4a([4Y.3d])[0]}N K 6.69(P)});L d=f.2s("*").4R().R(J(){7(6[F]!=10)6[F]=V});7(e===P)6.2s("*").4R().R(J(i){7(6.15==3)K;L c=E.O(6,"2R");Q(L a 1p c)Q(L b 1p c[a])E.16.1b(d[i],a,c[a][b],c[a][b].O)});K f},1E:J(b){K 6.2F(E.1q(b)&&E.3y(6,J(a,i){K b.1P(a,i)})||E.3e(b,6))},56:J(b){7(b.1k==4e)7(G.17(b))K 6.2F(E.3e(b,6,P));N b=E.3e(b,6);L a=b.M&&b[b.M-1]!==10&&!b.15;K 6.1E(J(){K a?E.33(6,b)<0:6!=b})},1b:J(a){K!a?6:6.2F(E.37(6.22(),a.1k==4e?E(a).22():a.M!=10&&(!a.12||E.12(a,"3u"))?a:[a]))},3H:J(a){K a?E.3e(a,6).M>0:S},7j:J(a){K 6.3H("."+a)},5O:J(b){7(b==10){7(6.M){L c=6[0];7(E.12(c,"2k")){L e=c.3T,5I=[],11=c.11,2X=c.U=="2k-2X";7(e<0)K V;Q(L i=2X?e:0,2f=2X?e+1:11.M;i<2f;i++){L d=11[i];7(d.2p){b=E.14.1d&&!d.9J.1A.9y?d.1u:d.1A;7(2X)K b;5I.1g(b)}}K 5I}N K(6[0].1A||"").1r(/\\r/g,"")}K 10}K 6.R(J(){7(6.15!=1)K;7(b.1k==1M&&/5u|5t/.17(6.U))6.3k=(E.33(6.1A,b)>=0||E.33(6.31,b)>=0);N 7(E.12(6,"2k")){L a=b.1k==1M?b:[b];E("98",6).R(J(){6.2p=(E.33(6.1A,a)>=0||E.33(6.1u,a)>=0)});7(!a.M)6.3T=-1}N 6.1A=b})},3q:J(a){K a==10?(6.M?6[0].3d:V):6.4x().3t(a)},6S:J(a){K 6.5a(a).1V()},6Z:J(i){K 6.2K(i,i+1)},2K:J(){K 6.2F(1M.2l.2K.1i(6,18))},2c:J(b){K 6.2F(E.2c(6,J(a,i){K b.1P(a,i,a)}))},4R:J(){K 6.1b(6.54)},O:J(d,b){L a=d.23(".");a[1]=a[1]?"."+a[1]:"";7(b==V){L c=6.5n("8P"+a[1]+"!",[a[0]]);7(c==10&&6.M)c=E.O(6[0],d);K c==V&&a[1]?6.O(a[0]):c}N K 6.1N("8K"+a[1]+"!",[a[0],b]).R(J(){E.O(6,d,b)})},35:J(a){K 6.R(J(){E.35(6,a)})},3O:J(g,f,h,d){L e=6.M>1,3n;K 6.R(J(){7(!3n){3n=E.4a(g,6.2i);7(h)3n.8D()}L b=6;7(f&&E.12(6,"1O")&&E.12(3n[0],"4v"))b=6.3S("1U")[0]||6.38(6.2i.3s("1U"));L c=E([]);E.R(3n,J(){L a=e?E(6).5k(P)[0]:6;7(E.12(a,"1m")){c=c.1b(a)}N{7(a.15==1)c=c.1b(E("1m",a).1V());d.1P(b,a)}});c.R(6A)})}};E.2l.4T.2l=E.2l;J 6A(i,a){7(a.3Q)E.3P({1c:a.3Q,3l:S,1H:"1m"});N E.5g(a.1u||a.6x||a.3d||"");7(a.1a)a.1a.34(a)}E.1s=E.1n.1s=J(){L b=18[0]||{},i=1,M=18.M,5c=S,11;7(b.1k==8d){5c=b;b=18[1]||{};i=2}7(1o b!="3V"&&1o b!="J")b={};7(M==1){b=6;i=0}Q(;i<M;i++)7((11=18[i])!=V)Q(L a 1p 11){7(b===11[a])6w;7(5c&&11[a]&&1o 11[a]=="3V"&&b[a]&&!11[a].15)b[a]=E.1s(b[a],11[a]);N 7(11[a]!=10)b[a]=11[a]}K b};L F="3N"+(1B 3v()).3L(),6t=0,5b={};L H=/z-?4X|86-?84|1w|6k|7Z-?1R/i;E.1s({7Y:J(a){1e.$=D;7(a)1e.3N=w;K E},1q:J(a){K!!a&&1o a!="25"&&!a.12&&a.1k!=1M&&/J/i.17(a+"")},3E:J(a){K a.1F&&!a.1h||a.28&&a.2i&&!a.2i.1h},5g:J(a){a=E.3g(a);7(a){L b=T.3S("6f")[0]||T.1F,1m=T.3s("1m");1m.U="1u/4m";7(E.14.1d)1m.1u=a;N 1m.38(T.5r(a));b.38(1m);b.34(1m)}},12:J(b,a){K b.12&&b.12.2E()==a.2E()},1T:{},O:J(c,d,b){c=c==1e?5b:c;L a=c[F];7(!a)a=c[F]=++6t;7(d&&!E.1T[a])E.1T[a]={};7(b!=10)E.1T[a][d]=b;K d?E.1T[a][d]:a},35:J(c,b){c=c==1e?5b:c;L a=c[F];7(b){7(E.1T[a]){2V E.1T[a][b];b="";Q(b 1p E.1T[a])1Q;7(!b)E.35(c)}}N{1S{2V c[F]}1X(e){7(c.52)c.52(F)}2V E.1T[a]}},R:J(c,a,b){7(b){7(c.M==10){Q(L d 1p c)7(a.1i(c[d],b)===S)1Q}N Q(L i=0,M=c.M;i<M;i++)7(a.1i(c[i],b)===S)1Q}N{7(c.M==10){Q(L d 1p c)7(a.1P(c[d],d,c[d])===S)1Q}N Q(L i=0,M=c.M,1A=c[0];i<M&&a.1P(1A,i,1A)!==S;1A=c[++i]){}}K c},1l:J(b,a,c,i,d){7(E.1q(a))a=a.1P(b,i);K a&&a.1k==51&&c=="2o"&&!H.17(d)?a+"2S":a},1t:{1b:J(c,b){E.R((b||"").23(/\\s+/),J(i,a){7(c.15==1&&!E.1t.3Y(c.1t,a))c.1t+=(c.1t?" ":"")+a})},1V:J(c,b){7(c.15==1)c.1t=b!=10?E.3y(c.1t.23(/\\s+/),J(a){K!E.1t.3Y(b,a)}).6a(" "):""},3Y:J(b,a){K E.33(a,(b.1t||b).3X().23(/\\s+/))>-1}},68:J(b,c,a){L e={};Q(L d 1p c){e[d]=b.W[d];b.W[d]=c[d]}a.1P(b);Q(L d 1p c)b.W[d]=e[d]},1j:J(d,e,c){7(e=="27"||e=="1R"){L b,46={43:"4W",4U:"1Z",19:"3D"},3c=e=="27"?["7O","7M"]:["7J","7I"];J 5E(){b=e=="27"?d.7H:d.7F;L a=0,2N=0;E.R(3c,J(){a+=2M(E.2o(d,"7E"+6,P))||0;2N+=2M(E.2o(d,"2N"+6+"5X",P))||0});b-=24.7C(a+2N)}7(E(d).3H(":4d"))5E();N E.68(d,46,5E);K 24.2f(0,b)}K E.2o(d,e,c)},2o:J(e,k,j){L d;J 3x(b){7(!E.14.2d)K S;L a=T.4c.4K(b,V);K!a||a.4M("3x")==""}7(k=="1w"&&E.14.1d){d=E.1J(e.W,"1w");K d==""?"1":d}7(E.14.2z&&k=="19"){L c=e.W.50;e.W.50="0 7r 7o";e.W.50=c}7(k.1D(/4g/i))k=y;7(!j&&e.W&&e.W[k])d=e.W[k];N 7(T.4c&&T.4c.4K){7(k.1D(/4g/i))k="4g";k=k.1r(/([A-Z])/g,"-$1").2h();L h=T.4c.4K(e,V);7(h&&!3x(e))d=h.4M(k);N{L f=[],2C=[];Q(L a=e;a&&3x(a);a=a.1a)2C.4J(a);Q(L i=0;i<2C.M;i++)7(3x(2C[i])){f[i]=2C[i].W.19;2C[i].W.19="3D"}d=k=="19"&&f[2C.M-1]!=V?"2H":(h&&h.4M(k))||"";Q(L i=0;i<f.M;i++)7(f[i]!=V)2C[i].W.19=f[i]}7(k=="1w"&&d=="")d="1"}N 7(e.4n){L g=k.1r(/\\-(\\w)/g,J(a,b){K b.2E()});d=e.4n[k]||e.4n[g];7(!/^\\d+(2S)?$/i.17(d)&&/^\\d/.17(d)){L l=e.W.26,3K=e.3K.26;e.3K.26=e.4n.26;e.W.26=d||0;d=e.W.7f+"2S";e.W.26=l;e.3K.26=3K}}K d},4a:J(l,h){L k=[];h=h||T;7(1o h.3s==\'10\')h=h.2i||h[0]&&h[0].2i||T;E.R(l,J(i,d){7(!d)K;7(d.1k==51)d=d.3X();7(1o d=="25"){d=d.1r(/(<(\\w+)[^>]*?)\\/>/g,J(b,a,c){K c.1D(/^(aa|a6|7e|a5|4D|7a|a0|3m|9W|9U|9S)$/i)?b:a+"></"+c+">"});L f=E.3g(d).2h(),1x=h.3s("1x");L e=!f.1f("<9P")&&[1,"<2k 74=\'74\'>","</2k>"]||!f.1f("<9M")&&[1,"<73>","</73>"]||f.1D(/^<(9G|1U|9E|9B|9x)/)&&[1,"<1O>","</1O>"]||!f.1f("<4v")&&[2,"<1O><1U>","</1U></1O>"]||(!f.1f("<9w")||!f.1f("<9v"))&&[3,"<1O><1U><4v>","</4v></1U></1O>"]||!f.1f("<7e")&&[2,"<1O><1U></1U><6V>","</6V></1O>"]||E.14.1d&&[1,"1x<1x>","</1x>"]||[0,"",""];1x.3d=e[1]+d+e[2];2b(e[0]--)1x=1x.5o;7(E.14.1d){L g=!f.1f("<1O")&&f.1f("<1U")<0?1x.1C&&1x.1C.3p:e[1]=="<1O>"&&f.1f("<1U")<0?1x.3p:[];Q(L j=g.M-1;j>=0;--j)7(E.12(g[j],"1U")&&!g[j].3p.M)g[j].1a.34(g[j]);7(/^\\s/.17(d))1x.3o(h.5r(d.1D(/^\\s*/)[0]),1x.1C)}d=E.2I(1x.3p)}7(d.M===0&&(!E.12(d,"3u")&&!E.12(d,"2k")))K;7(d[0]==10||E.12(d,"3u")||d.11)k.1g(d);N k=E.37(k,d)});K k},1J:J(d,e,c){7(!d||d.15==3||d.15==8)K 10;L f=E.3E(d)?{}:E.46;7(e=="2p"&&E.14.2d)d.1a.3T;7(f[e]){7(c!=10)d[f[e]]=c;K d[f[e]]}N 7(E.14.1d&&e=="W")K E.1J(d.W,"9u",c);N 7(c==10&&E.14.1d&&E.12(d,"3u")&&(e=="9r"||e=="9o"))K d.9m(e).6K;N 7(d.28){7(c!=10){7(e=="U"&&E.12(d,"4D")&&d.1a)6Q"U 9i 9h\'t 9g 9e";d.9b(e,""+c)}7(E.14.1d&&/6O|3Q/.17(e)&&!E.3E(d))K d.4z(e,2);K d.4z(e)}N{7(e=="1w"&&E.14.1d){7(c!=10){d.6k=1;d.1E=(d.1E||"").1r(/6M\\([^)]*\\)/,"")+(2M(c).3X()=="96"?"":"6M(1w="+c*6L+")")}K d.1E&&d.1E.1f("1w=")>=0?(2M(d.1E.1D(/1w=([^)]*)/)[1])/6L).3X():""}e=e.1r(/-([a-z])/95,J(a,b){K b.2E()});7(c!=10)d[e]=c;K d[e]}},3g:J(a){K(a||"").1r(/^\\s+|\\s+$/g,"")},2I:J(b){L a=[];7(1o b!="93")Q(L i=0,M=b.M;i<M;i++)a.1g(b[i]);N a=b.2K(0);K a},33:J(b,a){Q(L i=0,M=a.M;i<M;i++)7(a[i]==b)K i;K-1},37:J(a,b){7(E.14.1d){Q(L i=0;b[i];i++)7(b[i].15!=8)a.1g(b[i])}N Q(L i=0;b[i];i++)a.1g(b[i]);K a},57:J(a){L c=[],2r={};1S{Q(L i=0,M=a.M;i<M;i++){L b=E.O(a[i]);7(!2r[b]){2r[b]=P;c.1g(a[i])}}}1X(e){c=a}K c},3y:J(c,a,d){L b=[];Q(L i=0,M=c.M;i<M;i++)7(!d&&a(c[i],i)||d&&!a(c[i],i))b.1g(c[i]);K b},2c:J(d,a){L c=[];Q(L i=0,M=d.M;i<M;i++){L b=a(d[i],i);7(b!==V&&b!=10){7(b.1k!=1M)b=[b];c=c.71(b)}}K c}});L v=8Y.8W.2h();E.14={5K:(v.1D(/.+(?:8T|8S|8R|8O)[\\/: ]([\\d.]+)/)||[])[1],2d:/77/.17(v),2z:/2z/.17(v),1d:/1d/.17(v)&&!/2z/.17(v),48:/48/.17(v)&&!/(8L|77)/.17(v)};L y=E.14.1d?"6H":"75";E.1s({8I:!E.14.1d||T.6F=="79",46:{"Q":"8F","8E":"1t","4g":y,75:y,6H:y,3d:"3d",1t:"1t",1A:"1A",2Y:"2Y",3k:"3k",8C:"8B",2p:"2p",8A:"8z",3T:"3T",6C:"6C",28:"28",12:"12"}});E.R({6B:J(a){K a.1a},8y:J(a){K E.4u(a,"1a")},8x:J(a){K E.2Z(a,2,"2B")},8v:J(a){K E.2Z(a,2,"4t")},8u:J(a){K E.4u(a,"2B")},8t:J(a){K E.4u(a,"4t")},8s:J(a){K E.5i(a.1a.1C,a)},8r:J(a){K E.5i(a.1C)},6z:J(a){K E.12(a,"8q")?a.8o||a.8n.T:E.2I(a.3p)}},J(c,d){E.1n[c]=J(b){L a=E.2c(6,d);7(b&&1o b=="25")a=E.3e(b,a);K 6.2F(E.57(a))}});E.R({6y:"3t",8m:"6q",3o:"6o",8l:"5a",8k:"6S"},J(c,b){E.1n[c]=J(){L a=18;K 6.R(J(){Q(L i=0,M=a.M;i<M;i++)E(a[i])[b](6)})}});E.R({8j:J(a){E.1J(6,a,"");7(6.15==1)6.52(a)},8i:J(a){E.1t.1b(6,a)},8h:J(a){E.1t.1V(6,a)},8g:J(a){E.1t[E.1t.3Y(6,a)?"1V":"1b"](6,a)},1V:J(a){7(!a||E.1E(a,[6]).r.M){E("*",6).1b(6).R(J(){E.16.1V(6);E.35(6)});7(6.1a)6.1a.34(6)}},4x:J(){E(">*",6).1V();2b(6.1C)6.34(6.1C)}},J(a,b){E.1n[a]=J(){K 6.R(b,18)}});E.R(["8f","5X"],J(i,c){L b=c.2h();E.1n[b]=J(a){K 6[0]==1e?E.14.2z&&T.1h["5e"+c]||E.14.2d&&1e["8e"+c]||T.6F=="79"&&T.1F["5e"+c]||T.1h["5e"+c]:6[0]==T?24.2f(24.2f(T.1h["5d"+c],T.1F["5d"+c]),24.2f(T.1h["5L"+c],T.1F["5L"+c])):a==10?(6.M?E.1j(6[0],b):V):6.1j(b,a.1k==4e?a:a+"2S")}});L C=E.14.2d&&4s(E.14.5K)<8c?"(?:[\\\\w*4r-]|\\\\\\\\.)":"(?:[\\\\w\\8b-\\8a*4r-]|\\\\\\\\.)",6v=1B 4q("^>\\\\s*("+C+"+)"),6u=1B 4q("^("+C+"+)(#)("+C+"+)"),6s=1B 4q("^([#.]?)("+C+"*)");E.1s({6r:{"":J(a,i,m){K m[2]=="*"||E.12(a,m[2])},"#":J(a,i,m){K a.4z("2w")==m[2]},":":{89:J(a,i,m){K i<m[3]-0},88:J(a,i,m){K i>m[3]-0},2Z:J(a,i,m){K m[3]-0==i},6Z:J(a,i,m){K m[3]-0==i},3j:J(a,i){K i==0},3J:J(a,i,m,r){K i==r.M-1},6n:J(a,i){K i%2==0},6l:J(a,i){K i%2},"3j-4p":J(a){K a.1a.3S("*")[0]==a},"3J-4p":J(a){K E.2Z(a.1a.5o,1,"4t")==a},"83-4p":J(a){K!E.2Z(a.1a.5o,2,"4t")},6B:J(a){K a.1C},4x:J(a){K!a.1C},82:J(a,i,m){K(a.6x||a.81||E(a).1u()||"").1f(m[3])>=0},4d:J(a){K"1Z"!=a.U&&E.1j(a,"19")!="2H"&&E.1j(a,"4U")!="1Z"},1Z:J(a){K"1Z"==a.U||E.1j(a,"19")=="2H"||E.1j(a,"4U")=="1Z"},80:J(a){K!a.2Y},2Y:J(a){K a.2Y},3k:J(a){K a.3k},2p:J(a){K a.2p||E.1J(a,"2p")},1u:J(a){K"1u"==a.U},5u:J(a){K"5u"==a.U},5t:J(a){K"5t"==a.U},59:J(a){K"59"==a.U},3I:J(a){K"3I"==a.U},58:J(a){K"58"==a.U},6j:J(a){K"6j"==a.U},6i:J(a){K"6i"==a.U},2G:J(a){K"2G"==a.U||E.12(a,"2G")},4D:J(a){K/4D|2k|6h|2G/i.17(a.12)},3Y:J(a,i,m){K E.2s(m[3],a).M},7X:J(a){K/h\\d/i.17(a.12)},7W:J(a){K E.3y(E.3G,J(b){K a==b.Y}).M}}},6g:[/^(\\[) *@?([\\w-]+) *([!*$^~=]*) *(\'?"?)(.*?)\\4 *\\]/,/^(:)([\\w-]+)\\("?\'?(.*?(\\(.*?\\))?[^(]*?)"?\'?\\)/,1B 4q("^([:.#]*)("+C+"+)")],3e:J(a,c,b){L d,2m=[];2b(a&&a!=d){d=a;L f=E.1E(a,c,b);a=f.t.1r(/^\\s*,\\s*/,"");2m=b?c=f.r:E.37(2m,f.r)}K 2m},2s:J(t,p){7(1o t!="25")K[t];7(p&&p.15!=1&&p.15!=9)K[];p=p||T;L d=[p],2r=[],3J,12;2b(t&&3J!=t){L r=[];3J=t;t=E.3g(t);L o=S;L g=6v;L m=g.2O(t);7(m){12=m[1].2E();Q(L i=0;d[i];i++)Q(L c=d[i].1C;c;c=c.2B)7(c.15==1&&(12=="*"||c.12.2E()==12))r.1g(c);d=r;t=t.1r(g,"");7(t.1f(" ")==0)6w;o=P}N{g=/^([>+~])\\s*(\\w*)/i;7((m=g.2O(t))!=V){r=[];L l={};12=m[2].2E();m=m[1];Q(L j=0,3f=d.M;j<3f;j++){L n=m=="~"||m=="+"?d[j].2B:d[j].1C;Q(;n;n=n.2B)7(n.15==1){L h=E.O(n);7(m=="~"&&l[h])1Q;7(!12||n.12.2E()==12){7(m=="~")l[h]=P;r.1g(n)}7(m=="+")1Q}}d=r;t=E.3g(t.1r(g,""));o=P}}7(t&&!o){7(!t.1f(",")){7(p==d[0])d.4l();2r=E.37(2r,d);r=d=[p];t=" "+t.6e(1,t.M)}N{L k=6u;L m=k.2O(t);7(m){m=[0,m[2],m[3],m[1]]}N{k=6s;m=k.2O(t)}m[2]=m[2].1r(/\\\\/g,"");L f=d[d.M-1];7(m[1]=="#"&&f&&f.5J&&!E.3E(f)){L q=f.5J(m[2]);7((E.14.1d||E.14.2z)&&q&&1o q.2w=="25"&&q.2w!=m[2])q=E(\'[@2w="\'+m[2]+\'"]\',f)[0];d=r=q&&(!m[3]||E.12(q,m[3]))?[q]:[]}N{Q(L i=0;d[i];i++){L a=m[1]=="#"&&m[3]?m[3]:m[1]!=""||m[0]==""?"*":m[2];7(a=="*"&&d[i].12.2h()=="3V")a="3m";r=E.37(r,d[i].3S(a))}7(m[1]==".")r=E.55(r,m[2]);7(m[1]=="#"){L e=[];Q(L i=0;r[i];i++)7(r[i].4z("2w")==m[2]){e=[r[i]];1Q}r=e}d=r}t=t.1r(k,"")}}7(t){L b=E.1E(t,r);d=r=b.r;t=E.3g(b.t)}}7(t)d=[];7(d&&p==d[0])d.4l();2r=E.37(2r,d);K 2r},55:J(r,m,a){m=" "+m+" ";L c=[];Q(L i=0;r[i];i++){L b=(" "+r[i].1t+" ").1f(m)>=0;7(!a&&b||a&&!b)c.1g(r[i])}K c},1E:J(t,r,h){L d;2b(t&&t!=d){d=t;L p=E.6g,m;Q(L i=0;p[i];i++){m=p[i].2O(t);7(m){t=t.7V(m[0].M);m[2]=m[2].1r(/\\\\/g,"");1Q}}7(!m)1Q;7(m[1]==":"&&m[2]=="56")r=G.17(m[3])?E.1E(m[3],r,P).r:E(r).56(m[3]);N 7(m[1]==".")r=E.55(r,m[2],h);N 7(m[1]=="["){L g=[],U=m[3];Q(L i=0,3f=r.M;i<3f;i++){L a=r[i],z=a[E.46[m[2]]||m[2]];7(z==V||/6O|3Q|2p/.17(m[2]))z=E.1J(a,m[2])||\'\';7((U==""&&!!z||U=="="&&z==m[5]||U=="!="&&z!=m[5]||U=="^="&&z&&!z.1f(m[5])||U=="$="&&z.6e(z.M-m[5].M)==m[5]||(U=="*="||U=="~=")&&z.1f(m[5])>=0)^h)g.1g(a)}r=g}N 7(m[1]==":"&&m[2]=="2Z-4p"){L e={},g=[],17=/(-?)(\\d*)n((?:\\+|-)?\\d*)/.2O(m[3]=="6n"&&"2n"||m[3]=="6l"&&"2n+1"||!/\\D/.17(m[3])&&"7U+"+m[3]||m[3]),3j=(17[1]+(17[2]||1))-0,d=17[3]-0;Q(L i=0,3f=r.M;i<3f;i++){L j=r[i],1a=j.1a,2w=E.O(1a);7(!e[2w]){L c=1;Q(L n=1a.1C;n;n=n.2B)7(n.15==1)n.4k=c++;e[2w]=P}L b=S;7(3j==0){7(j.4k==d)b=P}N 7((j.4k-d)%3j==0&&(j.4k-d)/3j>=0)b=P;7(b^h)g.1g(j)}r=g}N{L f=E.6r[m[1]];7(1o f=="3V")f=f[m[2]];7(1o f=="25")f=6c("S||J(a,i){K "+f+";}");r=E.3y(r,J(a,i){K f(a,i,m,r)},h)}}K{r:r,t:t}},4u:J(b,c){L d=[];L a=b[c];2b(a&&a!=T){7(a.15==1)d.1g(a);a=a[c]}K d},2Z:J(a,e,c,b){e=e||1;L d=0;Q(;a;a=a[c])7(a.15==1&&++d==e)1Q;K a},5i:J(n,a){L r=[];Q(;n;n=n.2B){7(n.15==1&&(!a||n!=a))r.1g(n)}K r}});E.16={1b:J(f,i,g,e){7(f.15==3||f.15==8)K;7(E.14.1d&&f.53!=10)f=1e;7(!g.2D)g.2D=6.2D++;7(e!=10){L h=g;g=J(){K h.1i(6,18)};g.O=e;g.2D=h.2D}L j=E.O(f,"2R")||E.O(f,"2R",{}),1v=E.O(f,"1v")||E.O(f,"1v",J(){L a;7(1o E=="10"||E.16.5f)K a;a=E.16.1v.1i(18.3R.Y,18);K a});1v.Y=f;E.R(i.23(/\\s+/),J(c,b){L a=b.23(".");b=a[0];g.U=a[1];L d=j[b];7(!d){d=j[b]={};7(!E.16.2y[b]||E.16.2y[b].4j.1P(f)===S){7(f.3F)f.3F(b,1v,S);N 7(f.6b)f.6b("4i"+b,1v)}}d[g.2D]=g;E.16.2a[b]=P});f=V},2D:1,2a:{},1V:J(e,h,f){7(e.15==3||e.15==8)K;L i=E.O(e,"2R"),29,4X;7(i){7(h==10||(1o h=="25"&&h.7T(0)=="."))Q(L g 1p i)6.1V(e,g+(h||""));N{7(h.U){f=h.2q;h=h.U}E.R(h.23(/\\s+/),J(b,a){L c=a.23(".");a=c[0];7(i[a]){7(f)2V i[a][f.2D];N Q(f 1p i[a])7(!c[1]||i[a][f].U==c[1])2V i[a][f];Q(29 1p i[a])1Q;7(!29){7(!E.16.2y[a]||E.16.2y[a].4h.1P(e)===S){7(e.67)e.67(a,E.O(e,"1v"),S);N 7(e.66)e.66("4i"+a,E.O(e,"1v"))}29=V;2V i[a]}}})}Q(29 1p i)1Q;7(!29){L d=E.O(e,"1v");7(d)d.Y=V;E.35(e,"2R");E.35(e,"1v")}}},1N:J(g,c,d,f,h){c=E.2I(c||[]);7(g.1f("!")>=0){g=g.2K(0,-1);L a=P}7(!d){7(6.2a[g])E("*").1b([1e,T]).1N(g,c)}N{7(d.15==3||d.15==8)K 10;L b,29,1n=E.1q(d[g]||V),16=!c[0]||!c[0].36;7(16)c.4J(6.4Z({U:g,2L:d}));c[0].U=g;7(a)c[0].65=P;7(E.1q(E.O(d,"1v")))b=E.O(d,"1v").1i(d,c);7(!1n&&d["4i"+g]&&d["4i"+g].1i(d,c)===S)b=S;7(16)c.4l();7(h&&E.1q(h)){29=h.1i(d,b==V?c:c.71(b));7(29!==10)b=29}7(1n&&f!==S&&b!==S&&!(E.12(d,\'a\')&&g=="4V")){6.5f=P;1S{d[g]()}1X(e){}}6.5f=S}K b},1v:J(c){L a;c=E.16.4Z(c||1e.16||{});L b=c.U.23(".");c.U=b[0];L f=E.O(6,"2R")&&E.O(6,"2R")[c.U],42=1M.2l.2K.1P(18,1);42.4J(c);Q(L j 1p f){L d=f[j];42[0].2q=d;42[0].O=d.O;7(!b[1]&&!c.65||d.U==b[1]){L e=d.1i(6,42);7(a!==S)a=e;7(e===S){c.36();c.44()}}}7(E.14.1d)c.2L=c.36=c.44=c.2q=c.O=V;K a},4Z:J(c){L a=c;c=E.1s({},a);c.36=J(){7(a.36)a.36();a.7S=S};c.44=J(){7(a.44)a.44();a.7R=P};7(!c.2L)c.2L=c.7Q||T;7(c.2L.15==3)c.2L=a.2L.1a;7(!c.4S&&c.5w)c.4S=c.5w==c.2L?c.7P:c.5w;7(c.64==V&&c.63!=V){L b=T.1F,1h=T.1h;c.64=c.63+(b&&b.2v||1h&&1h.2v||0)-(b.62||0);c.7N=c.7L+(b&&b.2x||1h&&1h.2x||0)-(b.60||0)}7(!c.3c&&((c.4f||c.4f===0)?c.4f:c.5Z))c.3c=c.4f||c.5Z;7(!c.7b&&c.5Y)c.7b=c.5Y;7(!c.3c&&c.2G)c.3c=(c.2G&1?1:(c.2G&2?3:(c.2G&4?2:0)));K c},2y:{21:{4j:J(){5M();K},4h:J(){K}},3C:{4j:J(){7(E.14.1d)K S;E(6).2j("4P",E.16.2y.3C.2q);K P},4h:J(){7(E.14.1d)K S;E(6).3w("4P",E.16.2y.3C.2q);K P},2q:J(a){7(I(a,6))K P;18[0].U="3C";K E.16.1v.1i(6,18)}},3B:{4j:J(){7(E.14.1d)K S;E(6).2j("4O",E.16.2y.3B.2q);K P},4h:J(){7(E.14.1d)K S;E(6).3w("4O",E.16.2y.3B.2q);K P},2q:J(a){7(I(a,6))K P;18[0].U="3B";K E.16.1v.1i(6,18)}}}};E.1n.1s({2j:J(c,a,b){K c=="4H"?6.2X(c,a,b):6.R(J(){E.16.1b(6,c,b||a,b&&a)})},2X:J(d,b,c){K 6.R(J(){E.16.1b(6,d,J(a){E(6).3w(a);K(c||b).1i(6,18)},c&&b)})},3w:J(a,b){K 6.R(J(){E.16.1V(6,a,b)})},1N:J(c,a,b){K 6.R(J(){E.16.1N(c,a,6,P,b)})},5n:J(c,a,b){7(6[0])K E.16.1N(c,a,6[0],S,b);K 10},2g:J(){L b=18;K 6.4V(J(a){6.4N=0==6.4N?1:0;a.36();K b[6.4N].1i(6,18)||S})},7D:J(a,b){K 6.2j(\'3C\',a).2j(\'3B\',b)},21:J(a){5M();7(E.2Q)a.1P(T,E);N E.3A.1g(J(){K a.1P(6,E)});K 6}});E.1s({2Q:S,3A:[],21:J(){7(!E.2Q){E.2Q=P;7(E.3A){E.R(E.3A,J(){6.1i(T)});E.3A=V}E(T).5n("21")}}});L x=S;J 5M(){7(x)K;x=P;7(T.3F&&!E.14.2z)T.3F("5W",E.21,S);7(E.14.1d&&1e==3b)(J(){7(E.2Q)K;1S{T.1F.7B("26")}1X(3a){3z(18.3R,0);K}E.21()})();7(E.14.2z)T.3F("5W",J(){7(E.2Q)K;Q(L i=0;i<T.4L.M;i++)7(T.4L[i].2Y){3z(18.3R,0);K}E.21()},S);7(E.14.2d){L a;(J(){7(E.2Q)K;7(T.39!="5V"&&T.39!="1y"){3z(18.3R,0);K}7(a===10)a=E("W, 7a[7A=7z]").M;7(T.4L.M!=a){3z(18.3R,0);K}E.21()})()}E.16.1b(1e,"3U",E.21)}E.R(("7y,7x,3U,7w,5d,4H,4V,7v,"+"7G,7u,7t,4P,4O,7s,2k,"+"58,7K,7q,7p,3a").23(","),J(i,b){E.1n[b]=J(a){K a?6.2j(b,a):6.1N(b)}});L I=J(a,c){L b=a.4S;2b(b&&b!=c)1S{b=b.1a}1X(3a){b=c}K b==c};E(1e).2j("4H",J(){E("*").1b(T).3w()});E.1n.1s({3U:J(g,d,c){7(E.1q(g))K 6.2j("3U",g);L e=g.1f(" ");7(e>=0){L i=g.2K(e,g.M);g=g.2K(0,e)}c=c||J(){};L f="4Q";7(d)7(E.1q(d)){c=d;d=V}N{d=E.3m(d);f="61"}L h=6;E.3P({1c:g,U:f,1H:"3q",O:d,1y:J(a,b){7(b=="1W"||b=="5U")h.3q(i?E("<1x/>").3t(a.4b.1r(/<1m(.|\\s)*?\\/1m>/g,"")).2s(i):a.4b);h.R(c,[a.4b,b,a])}});K 6},7n:J(){K E.3m(6.5T())},5T:J(){K 6.2c(J(){K E.12(6,"3u")?E.2I(6.7m):6}).1E(J(){K 6.31&&!6.2Y&&(6.3k||/2k|6h/i.17(6.12)||/1u|1Z|3I/i.17(6.U))}).2c(J(i,c){L b=E(6).5O();K b==V?V:b.1k==1M?E.2c(b,J(a,i){K{31:c.31,1A:a}}):{31:c.31,1A:b}}).22()}});E.R("5S,6d,5R,6D,5Q,6m".23(","),J(i,o){E.1n[o]=J(f){K 6.2j(o,f)}});L B=(1B 3v).3L();E.1s({22:J(d,b,a,c){7(E.1q(b)){a=b;b=V}K E.3P({U:"4Q",1c:d,O:b,1W:a,1H:c})},7l:J(b,a){K E.22(b,V,a,"1m")},7k:J(c,b,a){K E.22(c,b,a,"3i")},7i:J(d,b,a,c){7(E.1q(b)){a=b;b={}}K E.3P({U:"61",1c:d,O:b,1W:a,1H:c})},85:J(a){E.1s(E.4I,a)},4I:{2a:P,U:"4Q",2U:0,5P:"4o/x-7h-3u-7g",5N:P,3l:P,O:V,6p:V,3I:V,49:{3M:"4o/3M, 1u/3M",3q:"1u/3q",1m:"1u/4m, 4o/4m",3i:"4o/3i, 1u/4m",1u:"1u/a7",4G:"*/*"}},4F:{},3P:J(s){L f,2W=/=\\?(&|$)/g,1z,O;s=E.1s(P,s,E.1s(P,{},E.4I,s));7(s.O&&s.5N&&1o s.O!="25")s.O=E.3m(s.O);7(s.1H=="4E"){7(s.U.2h()=="22"){7(!s.1c.1D(2W))s.1c+=(s.1c.1D(/\\?/)?"&":"?")+(s.4E||"7d")+"=?"}N 7(!s.O||!s.O.1D(2W))s.O=(s.O?s.O+"&":"")+(s.4E||"7d")+"=?";s.1H="3i"}7(s.1H=="3i"&&(s.O&&s.O.1D(2W)||s.1c.1D(2W))){f="4E"+B++;7(s.O)s.O=(s.O+"").1r(2W,"="+f+"$1");s.1c=s.1c.1r(2W,"="+f+"$1");s.1H="1m";1e[f]=J(a){O=a;1W();1y();1e[f]=10;1S{2V 1e[f]}1X(e){}7(h)h.34(g)}}7(s.1H=="1m"&&s.1T==V)s.1T=S;7(s.1T===S&&s.U.2h()=="22"){L i=(1B 3v()).3L();L j=s.1c.1r(/(\\?|&)4r=.*?(&|$)/,"$a4="+i+"$2");s.1c=j+((j==s.1c)?(s.1c.1D(/\\?/)?"&":"?")+"4r="+i:"")}7(s.O&&s.U.2h()=="22"){s.1c+=(s.1c.1D(/\\?/)?"&":"?")+s.O;s.O=V}7(s.2a&&!E.5H++)E.16.1N("5S");7((!s.1c.1f("a3")||!s.1c.1f("//"))&&s.1H=="1m"&&s.U.2h()=="22"){L h=T.3S("6f")[0];L g=T.3s("1m");g.3Q=s.1c;7(s.7c)g.a2=s.7c;7(!f){L l=S;g.9Z=g.9Y=J(){7(!l&&(!6.39||6.39=="5V"||6.39=="1y")){l=P;1W();1y();h.34(g)}}}h.38(g);K 10}L m=S;L k=1e.78?1B 78("9X.9V"):1B 76();k.9T(s.U,s.1c,s.3l,s.6p,s.3I);1S{7(s.O)k.4C("9R-9Q",s.5P);7(s.5C)k.4C("9O-5A-9N",E.4F[s.1c]||"9L, 9K 9I 9H 5z:5z:5z 9F");k.4C("X-9C-9A","76");k.4C("9z",s.1H&&s.49[s.1H]?s.49[s.1H]+", */*":s.49.4G)}1X(e){}7(s.6Y)s.6Y(k);7(s.2a)E.16.1N("6m",[k,s]);L c=J(a){7(!m&&k&&(k.39==4||a=="2U")){m=P;7(d){6I(d);d=V}1z=a=="2U"&&"2U"||!E.6X(k)&&"3a"||s.5C&&E.6J(k,s.1c)&&"5U"||"1W";7(1z=="1W"){1S{O=E.6W(k,s.1H)}1X(e){1z="5x"}}7(1z=="1W"){L b;1S{b=k.5q("6U-5A")}1X(e){}7(s.5C&&b)E.4F[s.1c]=b;7(!f)1W()}N E.5v(s,k,1z);1y();7(s.3l)k=V}};7(s.3l){L d=53(c,13);7(s.2U>0)3z(J(){7(k){k.9t();7(!m)c("2U")}},s.2U)}1S{k.9s(s.O)}1X(e){E.5v(s,k,V,e)}7(!s.3l)c();J 1W(){7(s.1W)s.1W(O,1z);7(s.2a)E.16.1N("5Q",[k,s])}J 1y(){7(s.1y)s.1y(k,1z);7(s.2a)E.16.1N("5R",[k,s]);7(s.2a&&!--E.5H)E.16.1N("6d")}K k},5v:J(s,a,b,e){7(s.3a)s.3a(a,b,e);7(s.2a)E.16.1N("6D",[a,s,e])},5H:0,6X:J(r){1S{K!r.1z&&9q.9p=="59:"||(r.1z>=6T&&r.1z<9n)||r.1z==6R||r.1z==9l||E.14.2d&&r.1z==10}1X(e){}K S},6J:J(a,c){1S{L b=a.5q("6U-5A");K a.1z==6R||b==E.4F[c]||E.14.2d&&a.1z==10}1X(e){}K S},6W:J(r,b){L c=r.5q("9k-U");L d=b=="3M"||!b&&c&&c.1f("3M")>=0;L a=d?r.9j:r.4b;7(d&&a.1F.28=="5x")6Q"5x";7(b=="1m")E.5g(a);7(b=="3i")a=6c("("+a+")");K a},3m:J(a){L s=[];7(a.1k==1M||a.5h)E.R(a,J(){s.1g(3r(6.31)+"="+3r(6.1A))});N Q(L j 1p a)7(a[j]&&a[j].1k==1M)E.R(a[j],J(){s.1g(3r(j)+"="+3r(6))});N s.1g(3r(j)+"="+3r(a[j]));K s.6a("&").1r(/%20/g,"+")}});E.1n.1s({1G:J(c,b){K c?6.2e({1R:"1G",27:"1G",1w:"1G"},c,b):6.1E(":1Z").R(J(){6.W.19=6.5s||"";7(E.1j(6,"19")=="2H"){L a=E("<"+6.28+" />").6y("1h");6.W.19=a.1j("19");7(6.W.19=="2H")6.W.19="3D";a.1V()}}).3h()},1I:J(b,a){K b?6.2e({1R:"1I",27:"1I",1w:"1I"},b,a):6.1E(":4d").R(J(){6.5s=6.5s||E.1j(6,"19");6.W.19="2H"}).3h()},6N:E.1n.2g,2g:J(a,b){K E.1q(a)&&E.1q(b)?6.6N(a,b):a?6.2e({1R:"2g",27:"2g",1w:"2g"},a,b):6.R(J(){E(6)[E(6).3H(":1Z")?"1G":"1I"]()})},9f:J(b,a){K 6.2e({1R:"1G"},b,a)},9d:J(b,a){K 6.2e({1R:"1I"},b,a)},9c:J(b,a){K 6.2e({1R:"2g"},b,a)},9a:J(b,a){K 6.2e({1w:"1G"},b,a)},99:J(b,a){K 6.2e({1w:"1I"},b,a)},97:J(c,a,b){K 6.2e({1w:a},c,b)},2e:J(l,k,j,h){L i=E.6P(k,j,h);K 6[i.2P===S?"R":"2P"](J(){7(6.15!=1)K S;L g=E.1s({},i);L f=E(6).3H(":1Z"),4A=6;Q(L p 1p l){7(l[p]=="1I"&&f||l[p]=="1G"&&!f)K E.1q(g.1y)&&g.1y.1i(6);7(p=="1R"||p=="27"){g.19=E.1j(6,"19");g.32=6.W.32}}7(g.32!=V)6.W.32="1Z";g.40=E.1s({},l);E.R(l,J(c,a){L e=1B E.2t(4A,g,c);7(/2g|1G|1I/.17(a))e[a=="2g"?f?"1G":"1I":a](l);N{L b=a.3X().1D(/^([+-]=)?([\\d+-.]+)(.*)$/),1Y=e.2m(P)||0;7(b){L d=2M(b[2]),2A=b[3]||"2S";7(2A!="2S"){4A.W[c]=(d||1)+2A;1Y=((d||1)/e.2m(P))*1Y;4A.W[c]=1Y+2A}7(b[1])d=((b[1]=="-="?-1:1)*d)+1Y;e.45(1Y,d,2A)}N e.45(1Y,a,"")}});K P})},2P:J(a,b){7(E.1q(a)||(a&&a.1k==1M)){b=a;a="2t"}7(!a||(1o a=="25"&&!b))K A(6[0],a);K 6.R(J(){7(b.1k==1M)A(6,a,b);N{A(6,a).1g(b);7(A(6,a).M==1)b.1i(6)}})},94:J(b,c){L a=E.3G;7(b)6.2P([]);6.R(J(){Q(L i=a.M-1;i>=0;i--)7(a[i].Y==6){7(c)a[i](P);a.72(i,1)}});7(!c)6.5p();K 6}});L A=J(b,c,a){7(!b)K 10;c=c||"2t";L q=E.O(b,c+"2P");7(!q||a)q=E.O(b,c+"2P",a?E.2I(a):[]);K q};E.1n.5p=J(a){a=a||"2t";K 6.R(J(){L q=A(6,a);q.4l();7(q.M)q[0].1i(6)})};E.1s({6P:J(b,a,c){L d=b&&b.1k==92?b:{1y:c||!c&&a||E.1q(b)&&b,2u:b,3Z:c&&a||a&&a.1k!=91&&a};d.2u=(d.2u&&d.2u.1k==51?d.2u:{90:8Z,9D:6T}[d.2u])||8X;d.5y=d.1y;d.1y=J(){7(d.2P!==S)E(6).5p();7(E.1q(d.5y))d.5y.1i(6)};K d},3Z:{70:J(p,n,b,a){K b+a*p},5j:J(p,n,b,a){K((-24.8V(p*24.8U)/2)+0.5)*a+b}},3G:[],3W:V,2t:J(b,c,a){6.11=c;6.Y=b;6.1l=a;7(!c.47)c.47={}}});E.2t.2l={4y:J(){7(6.11.30)6.11.30.1i(6.Y,[6.2J,6]);(E.2t.30[6.1l]||E.2t.30.4G)(6);7(6.1l=="1R"||6.1l=="27")6.Y.W.19="3D"},2m:J(a){7(6.Y[6.1l]!=V&&6.Y.W[6.1l]==V)K 6.Y[6.1l];L r=2M(E.1j(6.Y,6.1l,a));K r&&r>-8Q?r:2M(E.2o(6.Y,6.1l))||0},45:J(c,b,d){6.5B=(1B 3v()).3L();6.1Y=c;6.3h=b;6.2A=d||6.2A||"2S";6.2J=6.1Y;6.4B=6.4w=0;6.4y();L e=6;J t(a){K e.30(a)}t.Y=6.Y;E.3G.1g(t);7(E.3W==V){E.3W=53(J(){L a=E.3G;Q(L i=0;i<a.M;i++)7(!a[i]())a.72(i--,1);7(!a.M){6I(E.3W);E.3W=V}},13)}},1G:J(){6.11.47[6.1l]=E.1J(6.Y.W,6.1l);6.11.1G=P;6.45(0,6.2m());7(6.1l=="27"||6.1l=="1R")6.Y.W[6.1l]="8N";E(6.Y).1G()},1I:J(){6.11.47[6.1l]=E.1J(6.Y.W,6.1l);6.11.1I=P;6.45(6.2m(),0)},30:J(a){L t=(1B 3v()).3L();7(a||t>6.11.2u+6.5B){6.2J=6.3h;6.4B=6.4w=1;6.4y();6.11.40[6.1l]=P;L b=P;Q(L i 1p 6.11.40)7(6.11.40[i]!==P)b=S;7(b){7(6.11.19!=V){6.Y.W.32=6.11.32;6.Y.W.19=6.11.19;7(E.1j(6.Y,"19")=="2H")6.Y.W.19="3D"}7(6.11.1I)6.Y.W.19="2H";7(6.11.1I||6.11.1G)Q(L p 1p 6.11.40)E.1J(6.Y.W,p,6.11.47[p])}7(b&&E.1q(6.11.1y))6.11.1y.1i(6.Y);K S}N{L n=t-6.5B;6.4w=n/6.11.2u;6.4B=E.3Z[6.11.3Z||(E.3Z.5j?"5j":"70")](6.4w,n,0,1,6.11.2u);6.2J=6.1Y+((6.3h-6.1Y)*6.4B);6.4y()}K P}};E.2t.30={2v:J(a){a.Y.2v=a.2J},2x:J(a){a.Y.2x=a.2J},1w:J(a){E.1J(a.Y.W,"1w",a.2J)},4G:J(a){a.Y.W[a.1l]=a.2J+a.2A}};E.1n.5L=J(){L b=0,3b=0,Y=6[0],5l;7(Y)8M(E.14){L d=Y.1a,41=Y,1K=Y.1K,1L=Y.2i,5D=2d&&4s(5K)<8J&&!/a1/i.17(v),2T=E.1j(Y,"43")=="2T";7(Y.6G){L c=Y.6G();1b(c.26+24.2f(1L.1F.2v,1L.1h.2v),c.3b+24.2f(1L.1F.2x,1L.1h.2x));1b(-1L.1F.62,-1L.1F.60)}N{1b(Y.5G,Y.5F);2b(1K){1b(1K.5G,1K.5F);7(48&&!/^t(8H|d|h)$/i.17(1K.28)||2d&&!5D)2N(1K);7(!2T&&E.1j(1K,"43")=="2T")2T=P;41=/^1h$/i.17(1K.28)?41:1K;1K=1K.1K}2b(d&&d.28&&!/^1h|3q$/i.17(d.28)){7(!/^8G|1O.*$/i.17(E.1j(d,"19")))1b(-d.2v,-d.2x);7(48&&E.1j(d,"32")!="4d")2N(d);d=d.1a}7((5D&&(2T||E.1j(41,"43")=="4W"))||(48&&E.1j(41,"43")!="4W"))1b(-1L.1h.5G,-1L.1h.5F);7(2T)1b(24.2f(1L.1F.2v,1L.1h.2v),24.2f(1L.1F.2x,1L.1h.2x))}5l={3b:3b,26:b}}J 2N(a){1b(E.2o(a,"a8",P),E.2o(a,"a9",P))}J 1b(l,t){b+=4s(l)||0;3b+=4s(t)||0}K 5l}})();',62,631,'||||||this|if||||||||||||||||||||||||||||||||||||||function|return|var|length|else|data|true|for|each|false|document|type|null|style||elem||undefined|options|nodeName||browser|nodeType|event|test|arguments|display|parentNode|add|url|msie|window|indexOf|push|body|apply|css|constructor|prop|script|fn|typeof|in|isFunction|replace|extend|className|text|handle|opacity|div|complete|status|value|new|firstChild|match|filter|documentElement|show|dataType|hide|attr|offsetParent|doc|Array|trigger|table|call|break|height|try|cache|tbody|remove|success|catch|start|hidden||ready|get|split|Math|string|left|width|tagName|ret|global|while|map|safari|animate|max|toggle|toLowerCase|ownerDocument|bind|select|prototype|cur||curCSS|selected|handler|done|find|fx|duration|scrollLeft|id|scrollTop|special|opera|unit|nextSibling|stack|guid|toUpperCase|pushStack|button|none|makeArray|now|slice|target|parseFloat|border|exec|queue|isReady|events|px|fixed|timeout|delete|jsre|one|disabled|nth|step|name|overflow|inArray|removeChild|removeData|preventDefault|merge|appendChild|readyState|error|top|which|innerHTML|multiFilter|rl|trim|end|json|first|checked|async|param|elems|insertBefore|childNodes|html|encodeURIComponent|createElement|append|form|Date|unbind|color|grep|setTimeout|readyList|mouseleave|mouseenter|block|isXMLDoc|addEventListener|timers|is|password|last|runtimeStyle|getTime|xml|jQuery|domManip|ajax|src|callee|getElementsByTagName|selectedIndex|load|object|timerId|toString|has|easing|curAnim|offsetChild|args|position|stopPropagation|custom|props|orig|mozilla|accepts|clean|responseText|defaultView|visible|String|charCode|float|teardown|on|setup|nodeIndex|shift|javascript|currentStyle|application|child|RegExp|_|parseInt|previousSibling|dir|tr|state|empty|update|getAttribute|self|pos|setRequestHeader|input|jsonp|lastModified|_default|unload|ajaxSettings|unshift|getComputedStyle|styleSheets|getPropertyValue|lastToggle|mouseout|mouseover|GET|andSelf|relatedTarget|init|visibility|click|absolute|index|container|fix|outline|Number|removeAttribute|setInterval|prevObject|classFilter|not|unique|submit|file|after|windowData|deep|scroll|client|triggered|globalEval|jquery|sibling|swing|clone|results|wrapAll|triggerHandler|lastChild|dequeue|getResponseHeader|createTextNode|oldblock|checkbox|radio|handleError|fromElement|parsererror|old|00|Modified|startTime|ifModified|safari2|getWH|offsetTop|offsetLeft|active|values|getElementById|version|offset|bindReady|processData|val|contentType|ajaxSuccess|ajaxComplete|ajaxStart|serializeArray|notmodified|loaded|DOMContentLoaded|Width|ctrlKey|keyCode|clientTop|POST|clientLeft|clientX|pageX|exclusive|detachEvent|removeEventListener|swap|cloneNode|join|attachEvent|eval|ajaxStop|substr|head|parse|textarea|reset|image|zoom|odd|ajaxSend|even|before|username|prepend|expr|quickClass|uuid|quickID|quickChild|continue|textContent|appendTo|contents|evalScript|parent|defaultValue|ajaxError|setArray|compatMode|getBoundingClientRect|styleFloat|clearInterval|httpNotModified|nodeValue|100|alpha|_toggle|href|speed|throw|304|replaceWith|200|Last|colgroup|httpData|httpSuccess|beforeSend|eq|linear|concat|splice|fieldset|multiple|cssFloat|XMLHttpRequest|webkit|ActiveXObject|CSS1Compat|link|metaKey|scriptCharset|callback|col|pixelLeft|urlencoded|www|post|hasClass|getJSON|getScript|elements|serialize|black|keyup|keypress|solid|change|mousemove|mouseup|dblclick|resize|focus|blur|stylesheet|rel|doScroll|round|hover|padding|offsetHeight|mousedown|offsetWidth|Bottom|Top|keydown|clientY|Right|pageY|Left|toElement|srcElement|cancelBubble|returnValue|charAt|0n|substring|animated|header|noConflict|line|enabled|innerText|contains|only|weight|ajaxSetup|font|size|gt|lt|uFFFF|u0128|417|Boolean|inner|Height|toggleClass|removeClass|addClass|removeAttr|replaceAll|insertAfter|prependTo|contentWindow|contentDocument|wrap|iframe|children|siblings|prevAll|nextAll|prev|wrapInner|next|parents|maxLength|maxlength|readOnly|readonly|reverse|class|htmlFor|inline|able|boxModel|522|setData|compatible|with|1px|ie|getData|10000|ra|it|rv|PI|cos|userAgent|400|navigator|600|slow|Function|Object|array|stop|ig|NaN|fadeTo|option|fadeOut|fadeIn|setAttribute|slideToggle|slideUp|changed|slideDown|be|can|property|responseXML|content|1223|getAttributeNode|300|method|protocol|location|action|send|abort|cssText|th|td|cap|specified|Accept|With|colg|Requested|fast|tfoot|GMT|thead|1970|Jan|attributes|01|Thu|leg|Since|If|opt|Type|Content|embed|open|area|XMLHTTP|hr|Microsoft|onreadystatechange|onload|meta|adobeair|charset|http|1_|img|br|plain|borderLeftWidth|borderTopWidth|abbr'.split('|'),0,{})) \ No newline at end of file
diff --git a/markitup/markitup/jquery.markitup.js b/markitup/markitup/jquery.markitup.js
new file mode 100644
index 0000000..1bdf319
--- /dev/null
+++ b/markitup/markitup/jquery.markitup.js
@@ -0,0 +1,553 @@
+// ----------------------------------------------------------------------------
+// markItUp! Universal MarkUp Engine, JQuery plugin
+// v 1.1.5
+// Dual licensed under the MIT and GPL licenses.
+// ----------------------------------------------------------------------------
+// Copyright (C) 2007-2008 Jay Salvat
+// http://markitup.jaysalvat.com/
+// ----------------------------------------------------------------------------
+// Permission is hereby granted, free of charge, to any person obtaining a copy
+// of this software and associated documentation files (the "Software"), to deal
+// in the Software without restriction, including without limitation the rights
+// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+// copies of the Software, and to permit persons to whom the Software is
+// furnished to do so, subject to the following conditions:
+//
+// The above copyright notice and this permission notice shall be included in
+// all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+// THE SOFTWARE.
+// ----------------------------------------------------------------------------
+(function($) {
+ $.fn.markItUp = function(settings, extraSettings) {
+ var options, ctrlKey, shiftKey, altKey;
+ ctrlKey = shiftKey = altKey = false;
+
+ options = { id: '',
+ nameSpace: '',
+ root: '',
+ previewInWindow: '', // 'width=800, height=600, resizable=yes, scrollbars=yes'
+ previewAutoRefresh: true,
+ previewPosition: 'after',
+ previewTemplatePath: '~/templates/preview.html',
+ previewParserPath: '',
+ previewParserVar: 'data',
+ resizeHandle: true,
+ beforeInsert: '',
+ afterInsert: '',
+ onEnter: {},
+ onShiftEnter: {},
+ onCtrlEnter: {},
+ onTab: {},
+ markupSet: [ { /* set */ } ]
+ };
+ $.extend(options, settings, extraSettings);
+
+ // compute markItUp! path
+ if (!options.root) {
+ $('script').each(function(a, tag) {
+ miuScript = $(tag).get(0).src.match(/(.*)jquery\.markitup(\.pack)?\.js$/);
+ if (miuScript !== null) {
+ options.root = miuScript[1];
+ }
+ });
+ }
+
+ return this.each(function() {
+ var $$, textarea, levels, scrollPosition, caretPosition, caretOffset,
+ clicked, hash, header, footer, previewWindow, template, iFrame, abort;
+ $$ = $(this);
+ textarea = this;
+ levels = [];
+ abort = false;
+ scrollPosition = caretPosition = 0;
+ caretOffset = -1;
+
+ options.previewParserPath = localize(options.previewParserPath);
+ options.previewTemplatePath = localize(options.previewTemplatePath);
+
+ // apply the computed path to ~/
+ function localize(data, inText) {
+ if (inText) {
+ return data.replace(/("|')~\//g, "$1"+options.root);
+ }
+ return data.replace(/^~\//, options.root);
+ }
+
+ // init and build editor
+ function init() {
+ id = ''; nameSpace = '';
+ if (options.id) {
+ id = 'id="'+options.id+'"';
+ } else if ($$.attr("id")) {
+ id = 'id="markItUp'+($$.attr("id").substr(0, 1).toUpperCase())+($$.attr("id").substr(1))+'"';
+
+ }
+ if (options.nameSpace) {
+ nameSpace = 'class="'+options.nameSpace+'"';
+ }
+ $$.wrap('<div '+nameSpace+'></div>');
+ $$.wrap('<div '+id+' class="markItUp"></div>');
+ $$.wrap('<div class="markItUpContainer"></div>');
+ $$.addClass("markItUpEditor");
+
+ // add the header before the textarea
+ header = $('<div class="markItUpHeader"></div>').insertBefore($$);
+ $(dropMenus(options.markupSet)).appendTo(header);
+
+ // add the footer after the textarea
+ footer = $('<div class="markItUpFooter"></div>').insertAfter($$);
+
+ // add the resize handle after textarea
+ if (options.resizeHandle === true && $.browser.safari !== true) {
+ resizeHandle = $('<div class="markItUpResizeHandle"></div>')
+ .insertAfter($$)
+ .bind("mousedown", function(e) {
+ var h = $$.height(), y = e.clientY, mouseMove, mouseUp;
+ mouseMove = function(e) {
+ $$.css("height", Math.max(20, e.clientY+h-y)+"px");
+ return false;
+ };
+ mouseUp = function(e) {
+ $("html").unbind("mousemove", mouseMove).unbind("mouseup", mouseUp);
+ return false;
+ };
+ $("html").bind("mousemove", mouseMove).bind("mouseup", mouseUp);
+ });
+ footer.append(resizeHandle);
+ }
+
+ // listen key events
+ $$.keydown(keyPressed).keyup(keyPressed);
+
+ // bind an event to catch external calls
+ $$.bind("insertion", function(e, settings) {
+ if (settings.target !== false) {
+ get();
+ }
+ if (textarea === $.markItUp.focused) {
+ markup(settings);
+ }
+ });
+
+ // remember the last focus
+ $$.focus(function() {
+ $.markItUp.focused = this;
+ });
+ }
+
+ // recursively build header with dropMenus from markupset
+ function dropMenus(markupSet) {
+ var ul = $('<ul></ul>'), i = 0;
+ $('li:hover > ul', ul).css('display', 'block');
+ $.each(markupSet, function() {
+ var button = this, t = '', title, li, j;
+ title = (button.key) ? (button.name||'')+' [Ctrl+'+button.key+']' : (button.name||'');
+ key = (button.key) ? 'accesskey="'+button.key+'"' : '';
+ if (button.separator) {
+ li = $('<li class="markItUpSeparator">'+(button.separator||'')+'</li>').appendTo(ul);
+ } else {
+ i++;
+ for (j = levels.length -1; j >= 0; j--) {
+ t += levels[j]+"-";
+ }
+ li = $('<li class="markItUpButton markItUpButton'+t+(i)+' '+(button.className||'')+'"><a href="" '+key+' title="'+title+'">'+(button.name||'')+'</a></li>')
+ .bind("contextmenu", function() { // prevent contextmenu on mac and allow ctrl+click
+ return false;
+ }).click(function() {
+ return false;
+ }).mouseup(function() {
+ if (button.call) {
+ eval(button.call)();
+ }
+ markup(button);
+ return false;
+ }).hover(function() {
+ $('> ul', this).show();
+ $(document).one('click', function() { // close dropmenu if click outside
+ $('ul ul', header).hide();
+ }
+ );
+ }, function() {
+ $('> ul', this).hide();
+ }
+ ).appendTo(ul);
+ if (button.dropMenu) {
+ levels.push(i);
+ $(li).addClass('markItUpDropMenu').append(dropMenus(button.dropMenu));
+ }
+ }
+ });
+ levels.pop();
+ return ul;
+ }
+
+ // markItUp! markups
+ function magicMarkups(string) {
+ if (string) {
+ string = string.toString();
+ string = string.replace(/\(\!\(([\s\S]*?)\)\!\)/g,
+ function(x, a) {
+ var b = a.split('|!|');
+ if (altKey === true) {
+ return (b[1] !== undefined) ? b[1] : b[0];
+ } else {
+ return (b[1] === undefined) ? "" : b[0];
+ }
+ }
+ );
+ // [![prompt]!], [![prompt:!:value]!]
+ string = string.replace(/\[\!\[([\s\S]*?)\]\!\]/g,
+ function(x, a) {
+ var b = a.split(':!:');
+ if (abort === true) {
+ return false;
+ }
+ value = prompt(b[0], (b[1]) ? b[1] : '');
+ if (value === null) {
+ abort = true;
+ }
+ return value;
+ }
+ );
+ return string;
+ }
+ return "";
+ }
+
+ // prepare action
+ function prepare(action) {
+ if ($.isFunction(action)) {
+ action = action(hash);
+ }
+ return magicMarkups(action);
+ }
+
+ // build block to insert
+ function build(string) {
+ openWith = prepare(clicked.openWith);
+ placeHolder = prepare(clicked.placeHolder);
+ replaceWith = prepare(clicked.replaceWith);
+ closeWith = prepare(clicked.closeWith);
+ if (replaceWith !== "") {
+ block = openWith + replaceWith + closeWith;
+ } else if (selection === '' && placeHolder !== '') {
+ block = openWith + placeHolder + closeWith;
+ } else {
+ block = openWith + (string||selection) + closeWith;
+ }
+ return { block:block,
+ openWith:openWith,
+ replaceWith:replaceWith,
+ placeHolder:placeHolder,
+ closeWith:closeWith
+ };
+ }
+
+ // define markup to insert
+ function markup(button) {
+ var len, j, n, i;
+ hash = clicked = button;
+ get();
+
+ $.extend(hash, { line:"",
+ root:options.root,
+ textarea:textarea,
+ selection:(selection||''),
+ caretPosition:caretPosition,
+ ctrlKey:ctrlKey,
+ shiftKey:shiftKey,
+ altKey:altKey
+ }
+ );
+ // callbacks before insertion
+ prepare(options.beforeInsert);
+ prepare(clicked.beforeInsert);
+ if (ctrlKey === true && shiftKey === true) {
+ prepare(clicked.beforeMultiInsert);
+ }
+ $.extend(hash, { line:1 });
+
+ if (ctrlKey === true && shiftKey === true) {
+ lines = selection.split(/\r?\n/);
+ for (j = 0, n = lines.length, i = 0; i < n; i++) {
+ if ($.trim(lines[i]) !== '') {
+ $.extend(hash, { line:++j, selection:lines[i] } );
+ lines[i] = build(lines[i]).block;
+ } else {
+ lines[i] = "";
+ }
+ }
+ string = { block:lines.join('\n')};
+ start = caretPosition;
+ len = string.block.length + (($.browser.opera) ? n : 0);
+ } else if (ctrlKey === true) {
+ string = build(selection);
+ start = caretPosition + string.openWith.length;
+ len = string.block.length - string.openWith.length - string.closeWith.length;
+ len -= fixIeBug(string.block);
+ } else if (shiftKey === true) {
+ string = build(selection);
+ start = caretPosition;
+ len = string.block.length;
+ len -= fixIeBug(string.block);
+ } else {
+ string = build(selection);
+ start = caretPosition + string.block.length ;
+ len = 0;
+ start -= fixIeBug(string.block);
+ }
+ if ((selection === '' && string.replaceWith === '')) {
+ caretOffset += fixOperaBug(string.block);
+
+ start = caretPosition + string.openWith.length;
+ len = string.block.length - string.openWith.length - string.closeWith.length;
+
+ caretOffset = $$.val().substring(caretPosition, $$.val().length).length;
+ caretOffset -= fixOperaBug($$.val().substring(0, caretPosition));
+ }
+ $.extend(hash, { caretPosition:caretPosition, scrollPosition:scrollPosition } );
+
+ if (string.block !== selection && abort === false) {
+ insert(string.block);
+ set(start, len);
+ } else {
+ caretOffset = -1;
+ }
+ get();
+
+ $.extend(hash, { line:'', selection:selection });
+
+ // callbacks after insertion
+ if (ctrlKey === true && shiftKey === true) {
+ prepare(clicked.afterMultiInsert);
+ }
+ prepare(clicked.afterInsert);
+ prepare(options.afterInsert);
+
+ // refresh preview if opened
+ if (previewWindow && options.previewAutoRefresh) {
+ refreshPreview();
+ }
+
+ // reinit keyevent
+ shiftKey = altKey = ctrlKey = abort = false;
+ }
+
+ // Substract linefeed in Opera
+ function fixOperaBug(string) {
+ if ($.browser.opera) {
+ return string.length - string.replace(/\n*/g, '').length;
+ }
+ return 0;
+ }
+ // Substract linefeed in IE
+ function fixIeBug(string) {
+ if ($.browser.msie) {
+ return string.length - string.replace(/\r*/g, '').length;
+ }
+ return 0;
+ }
+
+ // add markup
+ function insert(block) {
+ if (document.selection) {
+ var newSelection = document.selection.createRange();
+ newSelection.text = block;
+ } else {
+ $$.val($$.val().substring(0, caretPosition) + block + $$.val().substring(caretPosition + selection.length, $$.val().length));
+ }
+ }
+
+ // set a selection
+ function set(start, len) {
+ if (textarea.createTextRange){
+ // quick fix to make it work on Opera 9.5
+ if ($.browser.opera && $.browser.version >= 9.5 && len == 0) {
+ return false;
+ }
+ range = textarea.createTextRange();
+ range.collapse(true);
+ range.moveStart('character', start);
+ range.moveEnd('character', len);
+ range.select();
+ } else if (textarea.setSelectionRange ){
+ textarea.setSelectionRange(start, start + len);
+ }
+ textarea.scrollTop = scrollPosition;
+ textarea.focus();
+ }
+
+ // get the selection
+ function get() {
+ textarea.focus();
+
+ scrollPosition = textarea.scrollTop;
+ if (document.selection) {
+ selection = document.selection.createRange().text;
+ if ($.browser.msie) { // ie
+ var range = document.selection.createRange(), rangeCopy = range.duplicate();
+ rangeCopy.moveToElementText(textarea);
+ caretPosition = -1;
+ while(rangeCopy.inRange(range)) { // fix most of the ie bugs with linefeeds...
+ rangeCopy.moveStart('character');
+ caretPosition ++;
+ }
+ } else { // opera
+ caretPosition = textarea.selectionStart;
+ }
+ } else { // gecko
+ caretPosition = textarea.selectionStart;
+ selection = $$.val().substring(caretPosition, textarea.selectionEnd);
+ }
+ return selection;
+ }
+
+ // open preview window
+ function preview() {
+ if (!previewWindow || previewWindow.closed) {
+ if (options.previewInWindow) {
+ previewWindow = window.open('', 'preview', options.previewInWindow);
+ } else {
+ iFrame = $('<iframe class="markItUpPreviewFrame"></iframe>');
+ if (options.previewPosition == 'after') {
+ iFrame.insertAfter(footer);
+ } else {
+ iFrame.insertBefore(header);
+ }
+ previewWindow = iFrame[iFrame.length-1].contentWindow || frame[iFrame.length-1];
+ }
+ } else if (altKey === true) {
+ if (iFrame) {
+ iFrame.remove();
+ }
+ previewWindow.close();
+ previewWindow = iFrame = false;
+ }
+ if (!options.previewAutoRefresh) {
+ refreshPreview();
+ }
+ }
+
+ // refresh Preview window
+ function refreshPreview() {
+ if (previewWindow.document) {
+ try {
+ sp = previewWindow.document.documentElement.scrollTop
+ } catch(e) {
+ sp = 0;
+ }
+ previewWindow.document.open();
+ previewWindow.document.write(renderPreview());
+ previewWindow.document.close();
+ previewWindow.document.documentElement.scrollTop = sp;
+ }
+ if (options.previewInWindow) {
+ previewWindow.focus();
+ }
+ }
+
+ function renderPreview() {
+ if (options.previewParserPath !== '') {
+ $.ajax( {
+ type: 'POST',
+ async: false,
+ url: options.previewParserPath,
+ data: options.previewParserVar+'='+encodeURIComponent($$.val()),
+ success: function(data) {
+ phtml = localize(data, 1);
+ }
+ } );
+ } else {
+ if (!template) {
+ $.ajax( {
+ async: false,
+ url: options.previewTemplatePath,
+ success: function(data) {
+ template = localize(data, 1);
+ }
+ } );
+ }
+ phtml = template.replace(/<!-- content -->/g, $$.val());
+ }
+ return phtml;
+ }
+
+ // set keys pressed
+ function keyPressed(e) {
+ shiftKey = e.shiftKey;
+ altKey = e.altKey;
+ ctrlKey = (!(e.altKey && e.ctrlKey)) ? e.ctrlKey : false;
+
+ if (e.type === 'keydown') {
+ if (ctrlKey === true) {
+ li = $("a[accesskey="+String.fromCharCode(e.keyCode)+"]", header).parent('li');
+ if (li.length !== 0) {
+ ctrlKey = false;
+ li.triggerHandler('mouseup');
+ return false;
+ }
+ }
+ if (e.keyCode === 13 || e.keyCode === 10) { // Enter key
+ if (ctrlKey === true) { // Enter + Ctrl
+ ctrlKey = false;
+ markup(options.onCtrlEnter);
+ return options.onCtrlEnter.keepDefault;
+ } else if (shiftKey === true) { // Enter + Shift
+ shiftKey = false;
+ markup(options.onShiftEnter);
+ return options.onShiftEnter.keepDefault;
+ } else { // only Enter
+ markup(options.onEnter);
+ return options.onEnter.keepDefault;
+ }
+ }
+ if (e.keyCode === 9) { // Tab key
+ if (shiftKey == true || ctrlKey == true || altKey == true) { // Thx Dr Floob.
+ return false;
+ }
+ if (caretOffset !== -1) {
+ get();
+ caretOffset = $$.val().length - caretOffset;
+ set(caretOffset, 0);
+ caretOffset = -1;
+ return false;
+ } else {
+ markup(options.onTab);
+ return options.onTab.keepDefault;
+ }
+ }
+ }
+ }
+
+ init();
+ });
+ };
+
+ $.fn.markItUpRemove = function() {
+ return this.each(function() {
+ $$ = $(this).unbind().removeClass('markItUpEditor');
+ $$.parent('div').parent('div.markItUp').parent('div').replaceWith($$);
+ }
+ );
+ };
+
+ $.markItUp = function(settings) {
+ var options = { target:false };
+ $.extend(options, settings);
+ if (options.target) {
+ return $(options.target).each(function() {
+ $(this).focus();
+ $(this).trigger('insertion', [options]);
+ });
+ } else {
+ $('textarea').trigger('insertion', [options]);
+ }
+ };
+})(jQuery);
diff --git a/markitup/markitup/jquery.markitup.pack.js b/markitup/markitup/jquery.markitup.pack.js
new file mode 100644
index 0000000..f1244c9
--- /dev/null
+++ b/markitup/markitup/jquery.markitup.pack.js
@@ -0,0 +1,9 @@
+// ----------------------------------------------------------------------------
+// markItUp! Universal MarkUp Engine, JQuery plugin
+// v 1.1.5
+// Dual licensed under the MIT and GPL licenses.
+// ----------------------------------------------------------------------------
+// Copyright (C) 2007-2008 Jay Salvat
+// http://markitup.jaysalvat.com/
+// ----------------------------------------------------------------------------
+eval(function(p,a,c,k,e,r){e=function(c){return(c<a?'':e(parseInt(c/a)))+((c=c%a)>35?String.fromCharCode(c+29):c.toString(36))};if(!''.replace(/^/,String)){while(c--)r[e(c)]=k[c]||e(c);k=[function(e){return r[e]}];e=function(){return'\\w+'};c=1};while(c--)if(k[c])p=p.replace(new RegExp('\\b'+e(c)+'\\b','g'),k[c]);return p}('(3($){$.24.T=3(f,g){E k,v,A,F;v=A=F=7;k={C:\'\',12:\'\',U:\'\',1j:\'\',1A:8,25:\'26\',1k:\'~/2Q/1B.1C\',1b:\'\',27:\'28\',1l:8,1D:\'\',1E:\'\',1F:{},1G:{},1H:{},1I:{},29:[{}]};$.V(k,f,g);2(!k.U){$(\'2R\').1c(3(a,b){1J=$(b).14(0).2S.2T(/(.*)2U\\.2V(\\.2W)?\\.2X$/);2(1J!==2a){k.U=1J[1]}})}4 G.1c(3(){E d,u,15,16,p,H,L,P,17,1m,w,1n,M,18;d=$(G);u=G;15=[];18=7;16=p=0;H=-1;k.1b=1d(k.1b);k.1k=1d(k.1k);3 1d(a,b){2(b){4 a.W(/("|\')~\\//g,"$1"+k.U)}4 a.W(/^~\\//,k.U)}3 2b(){C=\'\';12=\'\';2(k.C){C=\'C="\'+k.C+\'"\'}l 2(d.1K("C")){C=\'C="T\'+(d.1K("C").2c(0,1).2Y())+(d.1K("C").2c(1))+\'"\'}2(k.12){12=\'N="\'+k.12+\'"\'}d.1L(\'<z \'+12+\'></z>\');d.1L(\'<z \'+C+\' N="T"></z>\');d.1L(\'<z N="2Z"></z>\');d.2d("2e");17=$(\'<z N="30"></z>\').2f(d);$(1M(k.29)).1N(17);1m=$(\'<z N="31"></z>\').1O(d);2(k.1l===8&&$.X.32!==8){1l=$(\'<z N="33"></z>\').1O(d).1e("34",3(e){E h=d.2g(),y=e.2h,1o,1p;1o=3(e){d.2i("2g",35.36(20,e.2h+h-y)+"37");4 7};1p=3(e){$("1C").1P("2j",1o).1P("1q",1p);4 7};$("1C").1e("2j",1o).1e("1q",1p)});1m.2k(1l)}d.2l(1Q).38(1Q);d.1e("1R",3(e,a){2(a.1r!==7){14()}2(u===$.T.2m){Y(a)}});d.1f(3(){$.T.2m=G})}3 1M(b){E c=$(\'<Z></Z>\'),i=0;$(\'B:2n > Z\',c).2i(\'39\',\'q\');$.1c(b,3(){E a=G,t=\'\',1s,B,j;1s=(a.19)?(a.1S||\'\')+\' [3a+\'+a.19+\']\':(a.1S||\'\');19=(a.19)?\'2o="\'+a.19+\'"\':\'\';2(a.2p){B=$(\'<B N="3b">\'+(a.2p||\'\')+\'</B>\').1N(c)}l{i++;2q(j=15.6-1;j>=0;j--){t+=15[j]+"-"}B=$(\'<B N="2r 2r\'+t+(i)+\' \'+(a.3c||\'\')+\'"><a 3d="" \'+19+\' 1s="\'+1s+\'">\'+(a.1S||\'\')+\'</a></B>\').1e("3e",3(){4 7}).2s(3(){4 7}).1q(3(){2(a.2t){3f(a.2t)()}Y(a);4 7}).2n(3(){$(\'> Z\',G).3g();$(D).3h(\'2s\',3(){$(\'Z Z\',17).2u()})},3(){$(\'> Z\',G).2u()}).1N(c);2(a.2v){15.3i(i);$(B).2d(\'3j\').2k(1M(a.2v))}}});15.3k();4 c}3 2w(c){2(c){c=c.3l();c=c.W(/\\(\\!\\(([\\s\\S]*?)\\)\\!\\)/g,3(x,a){E b=a.1T(\'|!|\');2(F===8){4(b[1]!==2x)?b[1]:b[0]}l{4(b[1]===2x)?"":b[0]}});c=c.W(/\\[\\!\\[([\\s\\S]*?)\\]\\!\\]/g,3(x,a){E b=a.1T(\':!:\');2(18===8){4 7}1U=3m(b[0],(b[1])?b[1]:\'\');2(1U===2a){18=8}4 1U});4 c}4""}3 I(a){2($.3n(a)){a=a(P)}4 2w(a)}3 1g(a){J=I(L.J);1a=I(L.1a);Q=I(L.Q);O=I(L.O);2(Q!==""){q=J+Q+O}l 2(m===\'\'&&1a!==\'\'){q=J+1a+O}l{q=J+(a||m)+O}4{q:q,J:J,Q:Q,1a:1a,O:O}}3 Y(a){E b,j,n,i;P=L=a;14();$.V(P,{1t:"",U:k.U,u:u,m:(m||\'\'),p:p,v:v,A:A,F:F});I(k.1D);I(L.1D);2(v===8&&A===8){I(L.3o)}$.V(P,{1t:1});2(v===8&&A===8){R=m.1T(/\\r?\\n/);2q(j=0,n=R.6,i=0;i<n;i++){2($.3p(R[i])!==\'\'){$.V(P,{1t:++j,m:R[i]});R[i]=1g(R[i]).q}l{R[i]=""}}o={q:R.3q(\'\\n\')};11=p;b=o.q.6+(($.X.1V)?n:0)}l 2(v===8){o=1g(m);11=p+o.J.6;b=o.q.6-o.J.6-o.O.6;b-=1u(o.q)}l 2(A===8){o=1g(m);11=p;b=o.q.6;b-=1u(o.q)}l{o=1g(m);11=p+o.q.6;b=0;11-=1u(o.q)}2((m===\'\'&&o.Q===\'\')){H+=1W(o.q);11=p+o.J.6;b=o.q.6-o.J.6-o.O.6;H=d.K().1h(p,d.K().6).6;H-=1W(d.K().1h(0,p))}$.V(P,{p:p,16:16});2(o.q!==m&&18===7){2y(o.q);1X(11,b)}l{H=-1}14();$.V(P,{1t:\'\',m:m});2(v===8&&A===8){I(L.3r)}I(L.1E);I(k.1E);2(w&&k.1A){1Y()}A=F=v=18=7}3 1W(a){2($.X.1V){4 a.6-a.W(/\\n*/g,\'\').6}4 0}3 1u(a){2($.X.2z){4 a.6-a.W(/\\r*/g,\'\').6}4 0}3 2y(a){2(D.m){E b=D.m.1Z();b.2A=a}l{d.K(d.K().1h(0,p)+a+d.K().1h(p+m.6,d.K().6))}}3 1X(a,b){2(u.2B){2($.X.1V&&$.X.3s>=9.5&&b==0){4 7}1i=u.2B();1i.3t(8);1i.2C(\'21\',a);1i.3u(\'21\',b);1i.3v()}l 2(u.2D){u.2D(a,a+b)}u.1v=16;u.1f()}3 14(){u.1f();16=u.1v;2(D.m){m=D.m.1Z().2A;2($.X.2z){E a=D.m.1Z(),1w=a.3w();1w.3x(u);p=-1;3y(1w.3z(a)){1w.2C(\'21\');p++}}l{p=u.2E}}l{p=u.2E;m=d.K().1h(p,u.3A)}4 m}3 1B(){2(!w||w.3B){2(k.1j){w=3C.2F(\'\',\'1B\',k.1j)}l{M=$(\'<2G N="3D"></2G>\');2(k.25==\'26\'){M.1O(1m)}l{M.2f(17)}w=M[M.6-1].3E||3F[M.6-1]}}l 2(F===8){2(M){M.3G()}w.2H();w=M=7}2(!k.1A){1Y()}}3 1Y(){2(w.D){3H{22=w.D.2I.1v}3I(e){22=0}w.D.2F();w.D.3J(2J());w.D.2H();w.D.2I.1v=22}2(k.1j){w.1f()}}3 2J(){2(k.1b!==\'\'){$.2K({2L:\'3K\',2M:7,2N:k.1b,28:k.27+\'=\'+3L(d.K()),2O:3(a){23=1d(a,1)}})}l{2(!1n){$.2K({2M:7,2N:k.1k,2O:3(a){1n=1d(a,1)}})}23=1n.W(/<!-- 3M -->/g,d.K())}4 23}3 1Q(e){A=e.A;F=e.F;v=(!(e.F&&e.v))?e.v:7;2(e.2L===\'2l\'){2(v===8){B=$("a[2o="+3N.3O(e.1x)+"]",17).1y(\'B\');2(B.6!==0){v=7;B.3P(\'1q\');4 7}}2(e.1x===13||e.1x===10){2(v===8){v=7;Y(k.1H);4 k.1H.1z}l 2(A===8){A=7;Y(k.1G);4 k.1G.1z}l{Y(k.1F);4 k.1F.1z}}2(e.1x===9){2(A==8||v==8||F==8){4 7}2(H!==-1){14();H=d.K().6-H;1X(H,0);H=-1;4 7}l{Y(k.1I);4 k.1I.1z}}}}2b()})};$.24.3Q=3(){4 G.1c(3(){$$=$(G).1P().3R(\'2e\');$$.1y(\'z\').1y(\'z.T\').1y(\'z\').Q($$)})};$.T=3(a){E b={1r:7};$.V(b,a);2(b.1r){4 $(b.1r).1c(3(){$(G).1f();$(G).2P(\'1R\',[b])})}l{$(\'u\').2P(\'1R\',[b])}}})(3S);',62,241,'||if|function|return||length|false|true|||||||||||||else|selection||string|caretPosition|block||||textarea|ctrlKey|previewWindow|||div|shiftKey|li|id|document|var|altKey|this|caretOffset|prepare|openWith|val|clicked|iFrame|class|closeWith|hash|replaceWith|lines||markItUp|root|extend|replace|browser|markup|ul||start|nameSpace||get|levels|scrollPosition|header|abort|key|placeHolder|previewParserPath|each|localize|bind|focus|build|substring|range|previewInWindow|previewTemplatePath|resizeHandle|footer|template|mouseMove|mouseUp|mouseup|target|title|line|fixIeBug|scrollTop|rangeCopy|keyCode|parent|keepDefault|previewAutoRefresh|preview|html|beforeInsert|afterInsert|onEnter|onShiftEnter|onCtrlEnter|onTab|miuScript|attr|wrap|dropMenus|appendTo|insertAfter|unbind|keyPressed|insertion|name|split|value|opera|fixOperaBug|set|refreshPreview|createRange||character|sp|phtml|fn|previewPosition|after|previewParserVar|data|markupSet|null|init|substr|addClass|markItUpEditor|insertBefore|height|clientY|css|mousemove|append|keydown|focused|hover|accesskey|separator|for|markItUpButton|click|call|hide|dropMenu|magicMarkups|undefined|insert|msie|text|createTextRange|moveStart|setSelectionRange|selectionStart|open|iframe|close|documentElement|renderPreview|ajax|type|async|url|success|trigger|templates|script|src|match|jquery|markitup|pack|js|toUpperCase|markItUpContainer|markItUpHeader|markItUpFooter|safari|markItUpResizeHandle|mousedown|Math|max|px|keyup|display|Ctrl|markItUpSeparator|className|href|contextmenu|eval|show|one|push|markItUpDropMenu|pop|toString|prompt|isFunction|beforeMultiInsert|trim|join|afterMultiInsert|version|collapse|moveEnd|select|duplicate|moveToElementText|while|inRange|selectionEnd|closed|window|markItUpPreviewFrame|contentWindow|frame|remove|try|catch|write|POST|encodeURIComponent|content|String|fromCharCode|triggerHandler|markItUpRemove|removeClass|jQuery'.split('|'),0,{})) \ No newline at end of file
diff --git a/markitup/markitup/readme.txt b/markitup/markitup/readme.txt
new file mode 100644
index 0000000..8e52604
--- /dev/null
+++ b/markitup/markitup/readme.txt
@@ -0,0 +1,62 @@
+markItUp! 1.1.5
+
+CHANGE LOG
+markItUp! 1.1.5 2009-05-01
+- Modified: http://drupal.org/project/wysiwyg compatibility
+- Modified: Alt/Ctrl/Alt+Tab are now disabled
+
+markItUp! 1.1.4 2008-12-03
+- Fixed: Extra quote deleted line 95
+
+markItUp! 1.1.3 2008-09-12
+- Fixed: IE7 preview problem
+
+markItUp! 1.1.2 2008-07-17
+- Fixed: Quick fix for Opera 9.5 caret position problem after insertion
+
+markItUp! 1.1.1 2008-06-02
+- Fixed: Key events status are passed to callbacks properly
+- Improved: ScrollPosition is kept in the preview when its refreshed
+
+markItUp! 1.1.0 2008-05-04
+- Modified: Textarea's id is no more moved to the main container
+- Modified: NameSpace Span become a Div to remain strict
+- Added: Relative path to the script is computed
+- Added: Relative path to the script passed to callbacks
+- Added: Global instance ID property
+- Added: $(element).markItUpRemove() to remove markItUp!
+- Added: Resize handle is now optional with resizeHandle property
+- Added: Property previewInWindow is added and accept window parameter
+- Added: Property previewPosition is added
+- Modified: Resize handle is no more displayed in Safari to avoid repetition with the native handle
+- Modified: Property previewIframeRefresh become previewAutorefresh
+- Modified: Built-in Html Preview call a template file
+- Improved: Autorefreshing is now apply for preview in window too
+- Improved: Cancel button in prompt window cancel now the whole insertion process
+- Improved: Cleaner markItUp! code added to the DOM
+- Removed: Depreciated preview properties as previewBaseUrl, previewCharset, previewCssPath, previewBodyId, previewBodyClassName
+- Removed: Property previewIframe not longer exists
+- Fixed: "Magic markups" works with line feeds
+- Fixed: Key events are initialized after insertion
+- Fixed: Internet Explorer line feed offset bug
+- Fixed: Shortcut keys on Mac OS
+- Fixed: Ctrl+click works and doesn't open Mac context menu anymore
+- Fixed: Ctrl+click works and doesn't open the page in a new tab anymore
+- Fixed: Minor Css modifications
+
+markItUp! 1.0.3 2008-04-04
+- Fixed: IE7 Preview empty baseurl problem
+- Fixed: IE7 external targeted insertion
+- Added: Property scrollPosition is passed to callbacks functions
+
+markItUp! 1.0.2 2008-03-31
+- Fixed: IE7 Html preview problems
+- Fixed: Selection is kept if nothing is inserted
+- Improved: Code minified
+
+markItUp! 1.0.1 2008-03-21
+- Removed: Global PlaceHolder
+- Modified: Property previewCharset is setted to "utf-8" by default
+
+markItUp! 1.0.0 2008-03-01
+- First public release
diff --git a/markitup/markitup/sets/bbcode/images/bold.png b/markitup/markitup/sets/bbcode/images/bold.png
new file mode 100644
index 0000000..889ae80
--- /dev/null
+++ b/markitup/markitup/sets/bbcode/images/bold.png
Binary files differ
diff --git a/markitup/markitup/sets/bbcode/images/clean.png b/markitup/markitup/sets/bbcode/images/clean.png
new file mode 100644
index 0000000..7e7cefb
--- /dev/null
+++ b/markitup/markitup/sets/bbcode/images/clean.png
Binary files differ
diff --git a/markitup/markitup/sets/bbcode/images/code.png b/markitup/markitup/sets/bbcode/images/code.png
new file mode 100644
index 0000000..63fe6ce
--- /dev/null
+++ b/markitup/markitup/sets/bbcode/images/code.png
Binary files differ
diff --git a/markitup/markitup/sets/bbcode/images/fonts.png b/markitup/markitup/sets/bbcode/images/fonts.png
new file mode 100644
index 0000000..b7960db
--- /dev/null
+++ b/markitup/markitup/sets/bbcode/images/fonts.png
Binary files differ
diff --git a/markitup/markitup/sets/bbcode/images/italic.png b/markitup/markitup/sets/bbcode/images/italic.png
new file mode 100644
index 0000000..8482ac8
--- /dev/null
+++ b/markitup/markitup/sets/bbcode/images/italic.png
Binary files differ
diff --git a/markitup/markitup/sets/bbcode/images/link.png b/markitup/markitup/sets/bbcode/images/link.png
new file mode 100644
index 0000000..25eacb7
--- /dev/null
+++ b/markitup/markitup/sets/bbcode/images/link.png
Binary files differ
diff --git a/markitup/markitup/sets/bbcode/images/list-bullet.png b/markitup/markitup/sets/bbcode/images/list-bullet.png
new file mode 100644
index 0000000..4a8672b
--- /dev/null
+++ b/markitup/markitup/sets/bbcode/images/list-bullet.png
Binary files differ
diff --git a/markitup/markitup/sets/bbcode/images/list-item.png b/markitup/markitup/sets/bbcode/images/list-item.png
new file mode 100644
index 0000000..8cb4d69
--- /dev/null
+++ b/markitup/markitup/sets/bbcode/images/list-item.png
Binary files differ
diff --git a/markitup/markitup/sets/bbcode/images/list-numeric.png b/markitup/markitup/sets/bbcode/images/list-numeric.png
new file mode 100644
index 0000000..33b0b8d
--- /dev/null
+++ b/markitup/markitup/sets/bbcode/images/list-numeric.png
Binary files differ
diff --git a/markitup/markitup/sets/bbcode/images/picture.png b/markitup/markitup/sets/bbcode/images/picture.png
new file mode 100644
index 0000000..4a158fe
--- /dev/null
+++ b/markitup/markitup/sets/bbcode/images/picture.png
Binary files differ
diff --git a/markitup/markitup/sets/bbcode/images/preview.png b/markitup/markitup/sets/bbcode/images/preview.png
new file mode 100644
index 0000000..a9925a0
--- /dev/null
+++ b/markitup/markitup/sets/bbcode/images/preview.png
Binary files differ
diff --git a/markitup/markitup/sets/bbcode/images/quotes.png b/markitup/markitup/sets/bbcode/images/quotes.png
new file mode 100644
index 0000000..e54ebeb
--- /dev/null
+++ b/markitup/markitup/sets/bbcode/images/quotes.png
Binary files differ
diff --git a/markitup/markitup/sets/bbcode/images/stroke.png b/markitup/markitup/sets/bbcode/images/stroke.png
new file mode 100644
index 0000000..612058a
--- /dev/null
+++ b/markitup/markitup/sets/bbcode/images/stroke.png
Binary files differ
diff --git a/markitup/markitup/sets/bbcode/images/underline.png b/markitup/markitup/sets/bbcode/images/underline.png
new file mode 100644
index 0000000..90d0df2
--- /dev/null
+++ b/markitup/markitup/sets/bbcode/images/underline.png
Binary files differ
diff --git a/markitup/markitup/sets/bbcode/readme.txt b/markitup/markitup/sets/bbcode/readme.txt
new file mode 100644
index 0000000..745d5dd
--- /dev/null
+++ b/markitup/markitup/sets/bbcode/readme.txt
@@ -0,0 +1,11 @@
+Markup language:
+BBCode
+
+Description:
+A basic BBCode markup set with Bold, Italic, Underline, Picture, Link, Size, List, Quotes, Code, Clean button, Preview button.
+
+Install:
+- Download the zip file
+- Unzip it in your markItUp! sets folder
+- Modify your JS link to point at this set.js
+- Modify your CSS link to point at this style.css \ No newline at end of file
diff --git a/markitup/markitup/sets/bbcode/set.js b/markitup/markitup/sets/bbcode/set.js
new file mode 100644
index 0000000..4641a1d
--- /dev/null
+++ b/markitup/markitup/sets/bbcode/set.js
@@ -0,0 +1,39 @@
+// ----------------------------------------------------------------------------
+// markItUp!
+// ----------------------------------------------------------------------------
+// Copyright (C) 2008 Jay Salvat
+// http://markitup.jaysalvat.com/
+// ----------------------------------------------------------------------------
+// BBCode tags example
+// http://en.wikipedia.org/wiki/Bbcode
+// ----------------------------------------------------------------------------
+// Feel free to add more tags
+// ----------------------------------------------------------------------------
+mySettings = {
+ previewParserPath: '', // path to your BBCode parser
+ markupSet: [
+ {name:'Bold', key:'B', openWith:'[b]', closeWith:'[/b]'},
+ {name:'Italic', key:'I', openWith:'[i]', closeWith:'[/i]'},
+ {name:'Underline', key:'U', openWith:'[u]', closeWith:'[/u]'},
+ {separator:'---------------' },
+ {name:'Picture', key:'P', replaceWith:'[img][![Url]!][/img]'},
+ {name:'Link', key:'L', openWith:'[url=[![Url]!]]', closeWith:'[/url]', placeHolder:'Your text to link here...'},
+ {separator:'---------------' },
+ {name:'Size', key:'S', openWith:'[size=[![Text size]!]]', closeWith:'[/size]',
+ dropMenu :[
+ {name:'Big', openWith:'[size=200]', closeWith:'[/size]' },
+ {name:'Normal', openWith:'[size=100]', closeWith:'[/size]' },
+ {name:'Small', openWith:'[size=50]', closeWith:'[/size]' }
+ ]},
+ {separator:'---------------' },
+ {name:'Bulleted list', openWith:'[list]\n', closeWith:'\n[/list]'},
+ {name:'Numeric list', openWith:'[list=[![Starting number]!]]\n', closeWith:'\n[/list]'},
+ {name:'List item', openWith:'[*] '},
+ {separator:'---------------' },
+ {name:'Quotes', openWith:'[quote]', closeWith:'[/quote]'},
+ {name:'Code', openWith:'[code]', closeWith:'[/code]'},
+ {separator:'---------------' },
+ {name:'Clean', className:"clean", replaceWith:function(markitup) { return markitup.selection.replace(/\[(.*?)\]/g, "") } },
+ {name:'Preview', className:"preview", call:'preview' }
+ ]
+} \ No newline at end of file
diff --git a/markitup/markitup/sets/bbcode/style.css b/markitup/markitup/sets/bbcode/style.css
new file mode 100644
index 0000000..3da35fd
--- /dev/null
+++ b/markitup/markitup/sets/bbcode/style.css
@@ -0,0 +1,47 @@
+/* -------------------------------------------------------------------
+// markItUp!
+// By Jay Salvat - http://markitup.jaysalvat.com/
+// ------------------------------------------------------------------*/
+.markItUp .markItUpButton1 a {
+ background-image:url(images/bold.png);
+}
+.markItUp .markItUpButton2 a {
+ background-image:url(images/italic.png);
+}
+.markItUp .markItUpButton3 a {
+ background-image:url(images/underline.png);
+}
+
+.markItUp .markItUpButton4 a {
+ background-image:url(images/picture.png);
+}
+.markItUp .markItUpButton5 a {
+ background-image:url(images/link.png);
+}
+
+.markItUp .markItUpButton6 a {
+ background-image:url(images/fonts.png);
+}
+.markItUp .markItUpButton7 a {
+ background-image:url(images/list-bullet.png);
+}
+.markItUp .markItUpButton8 a {
+ background-image:url(images/list-numeric.png);
+}
+.markItUp .markItUpButton9 a {
+ background-image:url(images/list-item.png);
+}
+
+.markItUp .markItUpButton10 a {
+ background-image:url(images/quotes.png);
+}
+.markItUp .markItUpButton11 a {
+ background-image:url(images/code.png);
+}
+
+.markItUp .clean a {
+ background-image:url(images/clean.png);
+}
+.markItUp .preview a {
+ background-image:url(images/preview.png);
+} \ No newline at end of file
diff --git a/markitup/markitup/sets/default/images/bold.png b/markitup/markitup/sets/default/images/bold.png
new file mode 100644
index 0000000..889ae80
--- /dev/null
+++ b/markitup/markitup/sets/default/images/bold.png
Binary files differ
diff --git a/markitup/markitup/sets/default/images/clean.png b/markitup/markitup/sets/default/images/clean.png
new file mode 100644
index 0000000..7e7cefb
--- /dev/null
+++ b/markitup/markitup/sets/default/images/clean.png
Binary files differ
diff --git a/markitup/markitup/sets/default/images/image.png b/markitup/markitup/sets/default/images/image.png
new file mode 100644
index 0000000..fc3c393
--- /dev/null
+++ b/markitup/markitup/sets/default/images/image.png
Binary files differ
diff --git a/markitup/markitup/sets/default/images/italic.png b/markitup/markitup/sets/default/images/italic.png
new file mode 100644
index 0000000..8482ac8
--- /dev/null
+++ b/markitup/markitup/sets/default/images/italic.png
Binary files differ
diff --git a/markitup/markitup/sets/default/images/link.png b/markitup/markitup/sets/default/images/link.png
new file mode 100644
index 0000000..25eacb7
--- /dev/null
+++ b/markitup/markitup/sets/default/images/link.png
Binary files differ
diff --git a/markitup/markitup/sets/default/images/picture.png b/markitup/markitup/sets/default/images/picture.png
new file mode 100644
index 0000000..4a158fe
--- /dev/null
+++ b/markitup/markitup/sets/default/images/picture.png
Binary files differ
diff --git a/markitup/markitup/sets/default/images/preview.png b/markitup/markitup/sets/default/images/preview.png
new file mode 100644
index 0000000..a9925a0
--- /dev/null
+++ b/markitup/markitup/sets/default/images/preview.png
Binary files differ
diff --git a/markitup/markitup/sets/default/images/stroke.png b/markitup/markitup/sets/default/images/stroke.png
new file mode 100644
index 0000000..612058a
--- /dev/null
+++ b/markitup/markitup/sets/default/images/stroke.png
Binary files differ
diff --git a/markitup/markitup/sets/default/set.js b/markitup/markitup/sets/default/set.js
new file mode 100644
index 0000000..2498b25
--- /dev/null
+++ b/markitup/markitup/sets/default/set.js
@@ -0,0 +1,27 @@
+// ----------------------------------------------------------------------------
+// markItUp!
+// ----------------------------------------------------------------------------
+// Copyright (C) 2008 Jay Salvat
+// http://markitup.jaysalvat.com/
+// ----------------------------------------------------------------------------
+// Html tags
+// http://en.wikipedia.org/wiki/html
+// ----------------------------------------------------------------------------
+// Basic set. Feel free to add more tags
+// ----------------------------------------------------------------------------
+mySettings = {
+ onShiftEnter: {keepDefault:false, replaceWith:'<br />\n'},
+ onCtrlEnter: {keepDefault:false, openWith:'\n<p>', closeWith:'</p>'},
+ onTab: {keepDefault:false, replaceWith:' '},
+ markupSet: [
+ {name:'Bold', key:'B', openWith:'(!(<strong>|!|<b>)!)', closeWith:'(!(</strong>|!|</b>)!)' },
+ {name:'Italic', key:'I', openWith:'(!(<em>|!|<i>)!)', closeWith:'(!(</em>|!|</i>)!)' },
+ {name:'Stroke through', key:'S', openWith:'<del>', closeWith:'</del>' },
+ {separator:'---------------' },
+ {name:'Picture', key:'P', replaceWith:'<img src="[![Source:!:http://]!]" alt="[![Alternative text]!]" />' },
+ {name:'Link', key:'L', openWith:'<a href="[![Link:!:http://]!]"(!( title="[![Title]!]")!)>', closeWith:'</a>', placeHolder:'Your text to link...' },
+ {separator:'---------------' },
+ {name:'Clean', className:'clean', replaceWith:function(markitup) { return markitup.selection.replace(/<(.*?)>/g, "") } },
+ {name:'Preview', className:'preview', call:'preview'}
+ ]
+} \ No newline at end of file
diff --git a/markitup/markitup/sets/default/style.css b/markitup/markitup/sets/default/style.css
new file mode 100644
index 0000000..26cb927
--- /dev/null
+++ b/markitup/markitup/sets/default/style.css
@@ -0,0 +1,27 @@
+/* -------------------------------------------------------------------
+// markItUp!
+// By Jay Salvat - http://markitup.jaysalvat.com/
+// ------------------------------------------------------------------*/
+.markItUp .markItUpButton1 a {
+ background-image:url(images/bold.png);
+}
+.markItUp .markItUpButton2 a {
+ background-image:url(images/italic.png);
+}
+.markItUp .markItUpButton3 a {
+ background-image:url(images/stroke.png);
+}
+
+.markItUp .markItUpButton4 a {
+ background-image:url(images/picture.png);
+}
+.markItUp .markItUpButton5 a {
+ background-image:url(images/link.png);
+}
+
+.markItUp .markItUpButton6 a {
+ background-image:url(images/clean.png);
+}
+.markItUp .preview a {
+ background-image:url(images/preview.png);
+} \ No newline at end of file
diff --git a/markitup/markitup/skins/markitup/images/bg-container.png b/markitup/markitup/skins/markitup/images/bg-container.png
new file mode 100644
index 0000000..a28e018
--- /dev/null
+++ b/markitup/markitup/skins/markitup/images/bg-container.png
Binary files differ
diff --git a/markitup/markitup/skins/markitup/images/bg-editor-bbcode.png b/markitup/markitup/skins/markitup/images/bg-editor-bbcode.png
new file mode 100644
index 0000000..39cdbd8
--- /dev/null
+++ b/markitup/markitup/skins/markitup/images/bg-editor-bbcode.png
Binary files differ
diff --git a/markitup/markitup/skins/markitup/images/bg-editor-dotclear.png b/markitup/markitup/skins/markitup/images/bg-editor-dotclear.png
new file mode 100644
index 0000000..b3188dc
--- /dev/null
+++ b/markitup/markitup/skins/markitup/images/bg-editor-dotclear.png
Binary files differ
diff --git a/markitup/markitup/skins/markitup/images/bg-editor-html.png b/markitup/markitup/skins/markitup/images/bg-editor-html.png
new file mode 100644
index 0000000..11bff45
--- /dev/null
+++ b/markitup/markitup/skins/markitup/images/bg-editor-html.png
Binary files differ
diff --git a/markitup/markitup/skins/markitup/images/bg-editor-json.png b/markitup/markitup/skins/markitup/images/bg-editor-json.png
new file mode 100644
index 0000000..e898c1d
--- /dev/null
+++ b/markitup/markitup/skins/markitup/images/bg-editor-json.png
Binary files differ
diff --git a/markitup/markitup/skins/markitup/images/bg-editor-markdown.png b/markitup/markitup/skins/markitup/images/bg-editor-markdown.png
new file mode 100644
index 0000000..c199715
--- /dev/null
+++ b/markitup/markitup/skins/markitup/images/bg-editor-markdown.png
Binary files differ
diff --git a/markitup/markitup/skins/markitup/images/bg-editor-textile.png b/markitup/markitup/skins/markitup/images/bg-editor-textile.png
new file mode 100644
index 0000000..3ab1e9f
--- /dev/null
+++ b/markitup/markitup/skins/markitup/images/bg-editor-textile.png
Binary files differ
diff --git a/markitup/markitup/skins/markitup/images/bg-editor-wiki.png b/markitup/markitup/skins/markitup/images/bg-editor-wiki.png
new file mode 100644
index 0000000..7887181
--- /dev/null
+++ b/markitup/markitup/skins/markitup/images/bg-editor-wiki.png
Binary files differ
diff --git a/markitup/markitup/skins/markitup/images/bg-editor-xml.png b/markitup/markitup/skins/markitup/images/bg-editor-xml.png
new file mode 100644
index 0000000..33b1c5d
--- /dev/null
+++ b/markitup/markitup/skins/markitup/images/bg-editor-xml.png
Binary files differ
diff --git a/markitup/markitup/skins/markitup/images/bg-editor.png b/markitup/markitup/skins/markitup/images/bg-editor.png
new file mode 100644
index 0000000..ab7cde4
--- /dev/null
+++ b/markitup/markitup/skins/markitup/images/bg-editor.png
Binary files differ
diff --git a/markitup/markitup/skins/markitup/images/handle.png b/markitup/markitup/skins/markitup/images/handle.png
new file mode 100644
index 0000000..3993b20
--- /dev/null
+++ b/markitup/markitup/skins/markitup/images/handle.png
Binary files differ
diff --git a/markitup/markitup/skins/markitup/images/menu.png b/markitup/markitup/skins/markitup/images/menu.png
new file mode 100644
index 0000000..44a07af
--- /dev/null
+++ b/markitup/markitup/skins/markitup/images/menu.png
Binary files differ
diff --git a/markitup/markitup/skins/markitup/images/submenu.png b/markitup/markitup/skins/markitup/images/submenu.png
new file mode 100644
index 0000000..03d1977
--- /dev/null
+++ b/markitup/markitup/skins/markitup/images/submenu.png
Binary files differ
diff --git a/markitup/markitup/skins/markitup/style.css b/markitup/markitup/skins/markitup/style.css
new file mode 100644
index 0000000..05f053c
--- /dev/null
+++ b/markitup/markitup/skins/markitup/style.css
@@ -0,0 +1,148 @@
+/* -------------------------------------------------------------------
+// markItUp! Universal MarkUp Engine, JQuery plugin
+// By Jay Salvat - http://markitup.jaysalvat.com/
+// ------------------------------------------------------------------*/
+.markItUp * {
+ margin:0px; padding:0px;
+ outline:none;
+}
+.markItUp a:link,
+.markItUp a:visited {
+ color:#000;
+ text-decoration:none;
+}
+.markItUp {
+ width:580px;
+ margin:5px 0 5px 0;
+ border:5px solid #F5F5F5;
+}
+.markItUpContainer {
+ border:1px solid #3C769D;
+ background:#FFF url(images/bg-container.png) repeat-x top left;
+ padding:5px 5px 2px 5px;
+ font:11px Verdana, Arial, Helvetica, sans-serif;
+}
+.markItUpEditor {
+ font:12px 'Courier New', Courier, monospace;
+ padding:5px 5px 5px 35px;
+ border:3px solid #3C769D;
+ width:567px;
+ height:320px;
+ background-image:url(images/bg-editor.png);
+ background-repeat:no-repeat;
+ clear:both; display:block;
+ line-height:18px;
+ overflow:auto;
+}
+.markItUpPreviewFrame {
+ overflow:auto;
+ background-color:#FFFFFF;
+ border:1px solid #3C769D;
+ width:99.9%;
+ height:300px;
+ margin:5px 0;
+}
+.markItUpFooter {
+ width:100%;
+ cursor:n-resize;
+}
+.markItUpResizeHandle {
+ overflow:hidden;
+ width:22px; height:5px;
+ margin-left:auto;
+ margin-right:auto;
+ background-image:url(images/handle.png);
+ cursor:n-resize;
+}
+/***************************************************************************************/
+/* first row of buttons */
+.markItUpHeader ul li {
+ list-style:none;
+ float:left;
+ position:relative;
+}
+.markItUpHeader ul li ul{
+ display:none;
+}
+.markItUpHeader ul li:hover > ul{
+ display:block;
+}
+.markItUpHeader ul .markItUpDropMenu {
+ background:transparent url(images/menu.png) no-repeat 115% 50%;
+ margin-right:5px;
+}
+.markItUpHeader ul .markItUpDropMenu li {
+ margin-right:0px;
+}
+.markItUpHeader ul .markItUpSeparator {
+ margin:0 10px;
+ width:1px;
+ height:16px;
+ overflow:hidden;
+ background-color:#CCC;
+}
+.markItUpHeader ul ul .markItUpSeparator {
+ width:auto; height:1px;
+ margin:0px;
+}
+/* next rows of buttons */
+.markItUpHeader ul ul {
+ display:none;
+ position:absolute;
+ top:18px; left:0px;
+ background:#F5F5F5;
+ border:1px solid #3C769D;
+ height:inherit;
+}
+.markItUpHeader ul ul li {
+ float:none;
+ border-bottom:1px solid #3C769D;
+}
+.markItUpHeader ul ul .markItUpDropMenu {
+ background:#F5F5F5 url(images/submenu.png) no-repeat 100% 50%;
+}
+/* next rows of buttons */
+.markItUpHeader ul ul ul {
+ position:absolute;
+ top:-1px; left:150px;
+}
+.markItUpHeader ul ul ul li {
+ float:none;
+}
+.markItUpHeader ul a {
+ display:block;
+ width:16px; height:16px;
+ text-indent:-10000px;
+ background-repeat:no-repeat;
+ padding:3px;
+ margin:0px;
+}
+.markItUpHeader ul ul a {
+ display:block;
+ padding-left:0px;
+ text-indent:0;
+ width:120px;
+ padding:5px 5px 5px 25px;
+ background-position:2px 50%;
+}
+.markItUpHeader ul ul a:hover {
+ color:#FFF;
+ background-color:#3C769D;
+}
+/**************************************************************************************
+.html .markItUpEditor {
+ background-image:url(images/bg-editor-html.png);
+}
+.markdown .markItUpEditor {
+ background-image:url(images/bg-editor-markdown.png);
+}
+.textile .markItUpEditor {
+ background-image:url(images/bg-editor-textile.png);
+}
+.bbcode .markItUpEditor {
+ background-image:url(images/bg-editor-bbcode.png);
+}
+.wiki .markItUpEditor,
+.dotclear .markItUpEditor {
+ background-image:url(images/bg-editor-wiki.png);
+}*/ \ No newline at end of file
diff --git a/markitup/markitup/skins/simple/images/handle.png b/markitup/markitup/skins/simple/images/handle.png
new file mode 100644
index 0000000..3993b20
--- /dev/null
+++ b/markitup/markitup/skins/simple/images/handle.png
Binary files differ
diff --git a/markitup/markitup/skins/simple/images/menu.png b/markitup/markitup/skins/simple/images/menu.png
new file mode 100644
index 0000000..44a07af
--- /dev/null
+++ b/markitup/markitup/skins/simple/images/menu.png
Binary files differ
diff --git a/markitup/markitup/skins/simple/images/submenu.png b/markitup/markitup/skins/simple/images/submenu.png
new file mode 100644
index 0000000..03d1977
--- /dev/null
+++ b/markitup/markitup/skins/simple/images/submenu.png
Binary files differ
diff --git a/markitup/markitup/skins/simple/style.css b/markitup/markitup/skins/simple/style.css
new file mode 100644
index 0000000..1838ded
--- /dev/null
+++ b/markitup/markitup/skins/simple/style.css
@@ -0,0 +1,118 @@
+/* -------------------------------------------------------------------
+// markItUp! Universal MarkUp Engine, JQuery plugin
+// By Jay Salvat - http://markitup.jaysalvat.com/
+// ------------------------------------------------------------------*/
+.markItUp * {
+ margin:0px; padding:0px;
+ outline:none;
+}
+.markItUp a:link,
+.markItUp a:visited {
+ color:#000;
+ text-decoration:none;
+}
+.markItUp {
+ width:700px;
+ margin:5px 0 5px 0;
+}
+.markItUpContainer {
+ font:11px Verdana, Arial, Helvetica, sans-serif;
+}
+.markItUpEditor {
+ font:12px 'Courier New', Courier, monospace;
+ padding:5px;
+ width:690px;
+ height:320px;
+ clear:both; display:block;
+ line-height:18px;
+ overflow:auto;
+}
+.markItUpPreviewFrame {
+ overflow:auto;
+ background-color:#FFF;
+ width:99.9%;
+ height:300px;
+ margin:5px 0;
+}
+.markItUpFooter {
+ width:100%;
+}
+.markItUpResizeHandle {
+ overflow:hidden;
+ width:22px; height:5px;
+ margin-left:auto;
+ margin-right:auto;
+ background-image:url(images/handle.png);
+ cursor:n-resize;
+}
+/***************************************************************************************/
+/* first row of buttons */
+.markItUpHeader ul li {
+ list-style:none;
+ float:left;
+ position:relative;
+}
+.markItUpHeader ul li:hover > ul{
+ display:block;
+}
+.markItUpHeader ul .markItUpDropMenu {
+ background:transparent url(images/menu.png) no-repeat 115% 50%;
+ margin-right:5px;
+}
+.markItUpHeader ul .markItUpDropMenu li {
+ margin-right:0px;
+}
+/* next rows of buttons */
+.markItUpHeader ul ul {
+ display:none;
+ position:absolute;
+ top:18px; left:0px;
+ background:#FFF;
+ border:1px solid #000;
+}
+.markItUpHeader ul ul li {
+ float:none;
+ border-bottom:1px solid #000;
+}
+.markItUpHeader ul ul .markItUpDropMenu {
+ background:#FFF url(images/submenu.png) no-repeat 100% 50%;
+}
+.markItUpHeader ul .markItUpSeparator {
+ margin:0 10px;
+ width:1px;
+ height:16px;
+ overflow:hidden;
+ background-color:#CCC;
+}
+.markItUpHeader ul ul .markItUpSeparator {
+ width:auto; height:1px;
+ margin:0px;
+}
+/* next rows of buttons */
+.markItUpHeader ul ul ul {
+ position:absolute;
+ top:-1px; left:150px;
+}
+.markItUpHeader ul ul ul li {
+ float:none;
+}
+.markItUpHeader ul a {
+ display:block;
+ width:16px; height:16px;
+ text-indent:-10000px;
+ background-repeat:no-repeat;
+ padding:3px;
+ margin:0px;
+}
+.markItUpHeader ul ul a {
+ display:block;
+ padding-left:0px;
+ text-indent:0;
+ width:120px;
+ padding:5px 5px 5px 25px;
+ background-position:2px 50%;
+}
+.markItUpHeader ul ul a:hover {
+ color:#FFF;
+ background-color:#000;
+}
diff --git a/markitup/markitup/templates/preview.css b/markitup/markitup/templates/preview.css
new file mode 100644
index 0000000..ad91a87
--- /dev/null
+++ b/markitup/markitup/templates/preview.css
@@ -0,0 +1,5 @@
+/* preview style examples */
+body {
+ background-color:#EFEFEF;
+ font:70% Verdana, Arial, Helvetica, sans-serif;
+} \ No newline at end of file
diff --git a/markitup/markitup/templates/preview.html b/markitup/markitup/templates/preview.html
new file mode 100644
index 0000000..b8b3702
--- /dev/null
+++ b/markitup/markitup/templates/preview.html
@@ -0,0 +1,11 @@
+<!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">
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
+<title>markItUp! preview template</title>
+<link rel="stylesheet" type="text/css" href="~/templates/preview.css" />
+</head>
+<body>
+<!-- content -->
+</body>
+</html>
diff --git a/modules.php b/modules.php
new file mode 100644
index 0000000..96bb241
--- /dev/null
+++ b/modules.php
@@ -0,0 +1,94 @@
+<?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_FILE",true);
+
+global $load,$index_module;
+
+if(isset($_GET['load']))
+ $load = $_GET['load'];
+
+if(isset($_GET['file']))
+ $file = $_GET['file'];
+
+if(is_null($load))
+{
+ $load = $config['modules']['default'];
+}
+
+$deny_chars = $config['modules']['deny_chars'];
+
+$load_temp = $load;
+
+/*
+ * broken i guess.
+for($chars = 0; $chars <= strlen($load_temp); ++$chars)
+{
+ foreach($deny_chars as $deny)
+ {
+ if($load_temp[$chars] == $deny)
+ {
+ OpenTable();
+ ReportHack("Invalid characters detected.\n");
+ CloseTable();
+ }
+ }
+}
+*/
+if(isset($load) && !empty($load) && !isset($file))
+{
+ if(file_exists("modules/" . $load))
+ {
+ include 'modules/' . $load . '/index.php';
+ }
+ else
+ {
+ ReportError("Cannot load module directory.<br>\n");
+ }
+}
+elseif(isset($load) && isset($file))
+{
+ if(file_exists("modules/" . $load))
+ {
+ //$file_temp = explode('.',$file);
+ //$file = $file_temp[0];
+
+ $run = "modules/" . $load . "/" . $file;
+
+ if(file_exists($run))
+ {
+ include $run;
+ }
+ else
+ {
+ ReportError("Cannot load module directory.<br>\n");
+ }
+ }
+ else
+ {
+ ReportError("Cannot load module file.<br>\n");
+ }
+}
+else
+{
+ ReportError("Failure to load module.<br>\n");
+}
+
+
+?> \ No newline at end of file
diff --git a/modules/admin/admin_functions.php b/modules/admin/admin_functions.php
new file mode 100644
index 0000000..30a40d0
--- /dev/null
+++ b/modules/admin/admin_functions.php
@@ -0,0 +1,151 @@
+<?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/>.
+ */
+
+if(!defined("ADMIN_FILE"))
+{
+ die("Access denied.");
+ return;
+}
+
+function is_loggedin()
+{
+ $id = session_id();
+ if($id == "")
+ {
+ header("location: index.php");
+ return false;
+ }
+ return true;
+}
+
+function login()
+{
+ global $db;
+
+ if(isset($_SESSION['username']) || isset($_SESSION['password']))
+ {
+ return true;
+ }
+
+ if(isset($_POST['processed']))
+ {
+ $username = addslashes($_POST['username']);
+ $password = addslashes($_POST['password']);
+ $password = crypt(md5($password),'iamnotadirtywhorebitch');
+ $result = $db->Query("SELECT * FROM bayonet_users WHERE username = '$username' AND password = '$password'");
+ $rows = $db->Rows($result);
+
+ if($rows > 0)
+ {
+ $_SESSION['username'] = stripslashes($username);
+ $_SESSION['password'] = stripslashes($password);
+ return true;
+ }
+ else
+ {
+ ReportError("Login incorrect.");
+ return false;
+ }
+
+ }
+ else
+ {
+ echo "<form action=\"\" method=\"post\">\n";
+ OpenTable();
+ echo "<tr><th colspan=\"2\">Administrative Login</th></tr>\n";
+
+ echo "<tr><td><table width=\"5\" align=\"center\">\n
+ <tr><th style=\"text-align:right;\">Username</th><td><input size=\"20\" type=\"text\" name=\"username\"></td></tr>\n
+ <tr><th style=\"text-align:right;\">Password</th><td><input size=\"20\" type=\"password\" name=\"password\"></td></tr>\n
+ <tr><th colspan=\"2\" align=\"right\"><input type=\"Submit\" name=\"processed\" value=\"Submit\"></th></tr></td></tr>\n
+ </table>\n";
+ CloseTable();
+ echo "</form>\n";
+ return false;
+ }
+}
+
+function logout()
+{
+ session_unset();
+ session_destroy();
+}
+
+/**
+ * CompileAdmin()
+ *
+ * because we want to have a horizontal display of options, we need to have
+ * the data separated by arrays. the data is processed into single tables, and is
+ * echoed in realtime. we checked to make sure they were arrays, but there is no
+ * checking to make sure the data passed is not malicious in nature.
+ *
+ * @param mixed $head
+ * @param mixed $body
+ * @return
+ */
+function CompileAdmin($head,$body)
+{
+ /*if we were not passed arrays, then say goodbye*/
+ if(!is_array($head) || !is_array($body))
+ {
+ echo "must be array\n";
+ return;
+ }
+
+ echo "<table class=\"cleartable\" width=\"100%\">";
+ echo "<tr style=\"text-align:center; height:90px;\">";
+
+ $num = 1;
+ foreach($body as $td)
+ {
+ echo "<td class=\"center\" style=\"width:25%;\">$td</td>\n";
+ if($num%4 == 0){
+ echo "</tr><tr style=\"text-align:center; height:90px;\">";
+ }
+ $num++;
+ }
+ echo "</tr></table>\n";
+}
+
+/**
+ * OpenTable()
+ *
+ * The administration OpenTable() function requires an argument to define
+ * the header title. It may be wise to replace the standard OpenTable() function
+ * with this one... that's alot of code to unfuck though.
+ *
+ * @param mixed $title
+ * @return
+ */
+function OpenTable_Ex($title)
+{
+ echo "<table align=\"center\"><tr><th>{$title}</th></tr><tr><td>";
+}
+
+/**
+ * CloseTable()
+ *
+ * @return
+ */
+function CloseTable_Ex()
+{
+ echo "</td></tr></table>";
+}
+
+?> \ No newline at end of file
diff --git a/modules/admin/blocks/functions.php b/modules/admin/blocks/functions.php
new file mode 100644
index 0000000..660b8e7
--- /dev/null
+++ b/modules/admin/blocks/functions.php
@@ -0,0 +1,173 @@
+<?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/>.
+ */
+
+function ListBlocks()
+{
+ global $db;
+ $result = $db->Query("SELECT * FROM bayonet_blocks");
+ while(($rows = $db->fetch($result))!=false)
+ {
+ $blocks[] = $rows;
+ }
+
+ echo "<table align=\"center\"><tr><th colspan=\"3\">Existing Blocks</th></tr>";
+ foreach($blocks as $block)
+ {
+ echo "<tr><td>{$block['weight']} : {$block['dir_name']}</td><td><a href=\"?load=admin&op=blocks&edit={$block['block_id']}\">Edit</a></td><td><a href=\"?load=admin&op=blocks&delete={$block['block_id']}\">Delete</a></td></tr>";
+ }
+ echo "</table>";
+}
+
+function NewBlock()
+{
+ global $db;
+ if(isset($_POST['processed']))
+ {
+ //Secure our data to prevent injection attacks.
+ $weight = addslashes($_POST['weight']);
+ $dir_name = addslashes($_POST['dir_name']);
+ $position = addslashes($_POST['position']);
+ $active = addslashes($_POST['active']);
+
+ if(empty($weight) || empty($dir_name) || empty($position))
+ {
+ echo "You must fill everything out before proceeding.";
+ return;
+ }
+ //Update the database with the new data.
+ $db->Query("INSERT INTO bayonet_blocks SET weight = '$weight', dir_name = '$dir_name', position = '$position', active = '$active'");
+ //die, because we have completed what we wanted to do.
+ echo "New block, '$dir_name', at position '$weight' added.\n";
+ return;
+ }
+
+ ?>
+ <form action="<?php $_SERVER['PHP_SELF']?>" method="post">
+ <table align="center">
+ <tr><th>Weight</th><td><input type="text" name="weight" value="<?php echo $block['weight'] ?>"></td></tr>
+ <tr><th>Position</th><td><input type="text" name="position" value="<?php echo $block['position'] ?>"></td></tr>
+ <tr><th>Directory Name</th><td><input type="text" name="dir_name" value="<?php echo $block['dir_name'] ?>"></td>
+ <tr><th>Active</th><td>
+ <select name="active">
+ <option value="1">Yes</option>
+ <option value="0">No</option>
+ </select></td>
+ <tr><th colspan="2"><input type="submit" name="processed" value="Submit"></th></tr>
+ </table>
+ </form>
+ <?php
+}
+
+function GetActive($block_id, &$active)
+{
+ $options = array(1 => 'Yes',0 => 'No');
+ foreach($options as $option => $value)
+ {
+ $selected = NULL;
+ if($active == $option)
+ {
+ $selected = "selected";
+ }
+ echo "<option " . $selected . " value=\"". $option ."\">" . $value . "</option>\n";
+ }
+
+
+}
+
+function EditBlock($block_id)
+{
+ global $db;
+ if(isset($_POST['processed']))
+ {
+ //Secure our data to prevent injection attacks.
+ $weight = addslashes($_POST['weight']);
+ $dir_name = addslashes($_POST['dir_name']);
+ $position = addslashes($_POST['position']);
+ $active = addslashes($_POST['active']);
+
+ if(empty($weight) || empty($dir_name) || empty($position))
+ {
+ echo "You must fill everything out before proceeding.";
+ return;
+ }
+
+ //Update the database with the new data.
+ $db->Query("UPDATE bayonet_blocks SET weight = '$weight', dir_name = '$dir_name', position = '$position', active = '$active' WHERE block_id = '$block_id'");
+ //$isActive = $active ? "IS" : "IS NOT";
+ echo "Block, '$dir_name', at position '$weight' has been edited.\n";
+ //die, because we have completed what we wanted to do.
+ return;
+ }
+
+ //Grab the page from the database according to the $page_id passed to the function.
+ $result = $db->Query("SELECT weight,dir_name,position,active FROM bayonet_blocks WHERE block_id = '$block_id'");
+ while(($row = $db->Fetch($result))!=false)
+ {
+ //We only want one row, so we don't have to $block[]... No foreach necessary.
+ $block = $row;
+ }
+
+ ?>
+ <form action="<?php $_SERVER['PHP_SELF']?>" method="post">
+ <table align="center">
+ <tr><th>Weight</th><td><input type="text" name="weight" value="<?php echo $block['weight'] ?>"></td></tr>
+ <tr><th>Position</th><td><input type="text" name="position" value="<?php echo $block['position'] ?>"></td></tr>
+ <tr><th>Directory Name</th><td><input type="text" name="dir_name" value="<?php echo $block['dir_name'] ?>"></td>
+ <tr><th>Active</th><td>
+ <select name="active">
+ <?php GetActive($block_id, $block['active']) ?>
+ </select>
+ </td>
+
+ <tr><th colspan="2"><input type="submit" name="processed" value="Submit"></th></tr>
+ </table>
+ </form>
+ <?php
+}
+
+function DeleteBlock($block_id)
+{
+ global $db;
+
+ $result = $db->Query("SELECT dir_name FROM bayonet_blocks WHERE block_id = '$block_id'");
+ $block = $db->Fetch($result);
+
+ if(isset($_POST['proceed']))
+ {
+ echo "Block '{$block['dir_name']}', was deleted.";
+ $db->Query("DELETE FROM bayonet_blocks WHERE block_id = '$block_id' LIMIT 1");
+ return;
+ }
+ if(isset($_POST['cancel']))
+ {
+ echo "User cancelled deletion of page: '{$block['dir_name']}'";
+ return;
+ }
+
+ ?>
+ <form action="<?php $_SERVER['PHP_SELF'] ?>" method="post">
+ <table align="center">
+ <th>Are you SURE you want to delete the block titled: '<?php echo $block['dir_name']?>'?</th>
+ <tr><th><button name="proceed">Yes</button>&nbsp;&nbsp;&nbsp;<button name="cancel">No</button></th></tr>
+ </table>
+ </form>
+ <?php
+}
+
+?> \ No newline at end of file
diff --git a/modules/admin/blocks/index.php b/modules/admin/blocks/index.php
new file mode 100644
index 0000000..6dac3d2
--- /dev/null
+++ b/modules/admin/blocks/index.php
@@ -0,0 +1,59 @@
+<?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/>.
+ */
+
+/**
+ * This file administers the site blocks.
+ *
+ * -weight
+ * -directory name
+ */
+
+if(!defined("ADMIN_FILE"))
+{
+ die("Access denied.");
+}
+
+
+include $basedir.'blocks/functions.php';
+
+if(isset($_GET['edit']))
+{
+ $block_id = $_GET['edit'];
+ EditBlock($block_id);
+ return;
+}
+
+if(isset($_GET['delete']))
+{
+ $block_id = $_GET['delete'];
+ DeleteBlock($block_id);
+ return;
+}
+
+if(isset($_GET['create']))
+{
+ NewBlock();
+ return;
+}
+
+echo "<table align=\"center\" width=\"200px\"><tr><th>".LinkInternal('Create a Block','?load=admin&op=blocks&create=true')."</th></tr></table>";
+
+ListBlocks();
+
+?> \ No newline at end of file
diff --git a/modules/admin/images/addnewarticle.png b/modules/admin/images/addnewarticle.png
new file mode 100644
index 0000000..0e29960
--- /dev/null
+++ b/modules/admin/images/addnewarticle.png
Binary files differ
diff --git a/modules/admin/images/addnewpage.png b/modules/admin/images/addnewpage.png
new file mode 100644
index 0000000..c60c68c
--- /dev/null
+++ b/modules/admin/images/addnewpage.png
Binary files differ
diff --git a/modules/admin/images/announcement.png b/modules/admin/images/announcement.png
new file mode 100644
index 0000000..c70591d
--- /dev/null
+++ b/modules/admin/images/announcement.png
Binary files differ
diff --git a/modules/admin/images/calendar.png b/modules/admin/images/calendar.png
new file mode 100644
index 0000000..86b9861
--- /dev/null
+++ b/modules/admin/images/calendar.png
Binary files differ
diff --git a/modules/admin/images/editfiles.png b/modules/admin/images/editfiles.png
new file mode 100644
index 0000000..500e206
--- /dev/null
+++ b/modules/admin/images/editfiles.png
Binary files differ
diff --git a/modules/admin/images/editpage.png b/modules/admin/images/editpage.png
new file mode 100644
index 0000000..ab3fd58
--- /dev/null
+++ b/modules/admin/images/editpage.png
Binary files differ
diff --git a/modules/admin/images/file_doc.png b/modules/admin/images/file_doc.png
new file mode 100644
index 0000000..b1da1ef
--- /dev/null
+++ b/modules/admin/images/file_doc.png
Binary files differ
diff --git a/modules/admin/images/file_pdf.png b/modules/admin/images/file_pdf.png
new file mode 100644
index 0000000..500e206
--- /dev/null
+++ b/modules/admin/images/file_pdf.png
Binary files differ
diff --git a/modules/admin/images/file_rtf.png b/modules/admin/images/file_rtf.png
new file mode 100644
index 0000000..39304c1
--- /dev/null
+++ b/modules/admin/images/file_rtf.png
Binary files differ
diff --git a/modules/admin/images/file_word.png b/modules/admin/images/file_word.png
new file mode 100644
index 0000000..3011f00
--- /dev/null
+++ b/modules/admin/images/file_word.png
Binary files differ
diff --git a/modules/admin/images/photogallery.png b/modules/admin/images/photogallery.png
new file mode 100644
index 0000000..a161a55
--- /dev/null
+++ b/modules/admin/images/photogallery.png
Binary files differ
diff --git a/modules/admin/index.php b/modules/admin/index.php
new file mode 100644
index 0000000..4dd4539
--- /dev/null
+++ b/modules/admin/index.php
@@ -0,0 +1,73 @@
+<?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/>.
+ */
+
+ if(!defined("MODULE_FILE"))
+ {
+ die("Access denied.");
+ }
+
+ define("ADMIN_FILE",'admin_file');
+ include 'admin_functions.php';
+
+ if($_GET['op'] == 'logout')
+ {
+ logout();
+ }
+
+/* if(login())
+ {
+ //this is so dirty... sigh.
+ if(is_loggedin())
+ {
+ */ ?>
+ <!-- Add id="wrapper" for full height -->
+ <table align="center" width="90%" >
+ <tr><td><div style="text-align:right"><a href="?load=admin&op=logout">Logout, <?php echo $_SESSION['username']?></a></div></td></tr>
+ <tr><td>
+
+ <div class="maincontent">
+ <fieldset>
+ <legend>Administrative Tools:</legend>
+ <?php
+ $th = array('Blocks','Pages');
+ $td = array(
+ //LinkInternal('Blocks','?load=admin&op=blocks'),
+ LinkInternal('<img src="images/editpage.png" /><br />Manage Pages','?load=admin&op=pages'),
+ LinkInternal('<img src="images/navigation.png" /><br />Edit Navigation','?load=admin'),
+ LinkInternal('<img src="images/announcement.png" /><br />Edit Announcements','?load=admin'),
+ LinkInternal('<img src="images/calendar.png" /><br />Manage Events','?load=admin'),
+ LinkInternal('<img src="images/photogallery.png" /><br />Manage Galleries', '?load=admin')
+
+ );
+
+ //render administration table
+ CompileAdmin($th,$td);
+ ?>
+ </fieldset>
+
+ </td></tr>
+ <tr><td><div style="text-align:center"><?php include 'operation.php' ?></div></td></tr>
+
+ </table>
+ </div>
+ <?php /*)
+ }
+ } */
+
+?> \ No newline at end of file
diff --git a/modules/admin/operation.php b/modules/admin/operation.php
new file mode 100644
index 0000000..0ac2a9b
--- /dev/null
+++ b/modules/admin/operation.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/>.
+ */
+
+if(!defined("ADMIN_FILE"))
+{
+ die("Access denied.");
+ return;
+}
+
+if(!isset($_GET['op']))
+{
+ echo "<center>No operation selected</center>\n";
+ return;
+}
+
+$op = $_GET['op'];
+$basedir = 'modules/admin/';
+
+if(file_exists($basedir))
+{
+ if(file_exists($basedir . $op))
+ {
+ include $basedir . $op . '/index.php';
+ }
+ else
+ {
+ ReportError("Administrative operation '$op' does not exist.");
+ }
+}
+else
+{
+ ReportError("Administrative base directory path does not exist.");
+}
+
+
+
+?> \ No newline at end of file
diff --git a/modules/admin/pages/functions.php b/modules/admin/pages/functions.php
new file mode 100644
index 0000000..104a19a
--- /dev/null
+++ b/modules/admin/pages/functions.php
@@ -0,0 +1,230 @@
+<?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/>.
+ */
+
+/**
+ * Note to anyone feeling the need to edit this file...
+ * You MUST declare $db as global inside your functions in order access MySQL from here.
+ */
+
+function ListArticles($pageid){
+
+ global $db;
+ $result = $db->Query("SELECT article_id,title FROM bayonet_articles WHERE `page_id` = $pageid ORDER BY `weight`");
+ while(($row = $db->Fetch($result))!=false)
+ {
+ $articles[] = $row;
+ }
+
+ echo "<table class=\"cleartable\" width=\"100%\" cellspacing=\"0\">";
+
+ if(count($articles)==0){
+ echo "<tr><td>There are no articles posted on this page.<br /></td></tr></table>";
+ return;
+ }
+ foreach($articles as $article)
+ {
+ if($_GET['aid'] == $article['article_id'])
+ echo '<tr style="background-color:#c1c1c1; height:30px;">';
+ else
+ echo '<tr style="height:30px;">';
+ ?>
+
+ <td>^</td>
+ <td style="text-align:center; text-overflow:ellipsis; overflow:hidden;">
+ <a href="?load=admin&op=pages&edit=<?php echo $pageid; ?>&aid=<?php echo $article['article_id']?>"><?php echo $article['title']; ?></a>
+ </td>
+ <td>v</td>
+ </tr>
+
+ <?php
+ }
+
+ echo "</table>";
+
+
+
+}
+
+function EditArticle($article_id){
+
+ global $db;
+ //Grab the page from the database according to the $article_id passed to the function.
+ $result = $db->Query("SELECT title,text FROM bayonet_articles WHERE article_id = '$article_id'");
+ while(($row = $db->Fetch($result))!=false)
+ {
+ //We only want one row, so we don't have to $article[]... No foreach necessary.
+ $article = $row;
+ }
+ ?>
+ <form action="<?php $_SERVER['PHP_SELF'] ?>" method="post">
+ <table class="cleartable">
+ <tr><td>
+ <input type="text" name="title" value="<?php echo $article['title'] ?>" maxlength="50" size="30" />
+ <input type="submit" name="processed" value="Submit Changes" />
+ </td></tr>
+ <tr><td><textarea id="markItUp" rows="30" cols="80" name="text"><?php echo $article['text'] ?></textarea></td></tr>
+ </table>
+ </form>
+ <?php
+}
+
+function ListPages($pid = NULL)
+{
+ global $db;
+ $result = $db->Query("SELECT page_id,title FROM bayonet_pages");
+ while(($row = $db->Fetch($result))!=false)
+ {
+ $pages[] = $row;
+ }
+
+ echo 'Select page: <select id="pagenames" onchange="gotoEditPage(this.id)">';
+ echo '<option value="0">-&nbsp;-&nbsp;-&nbsp;-&nbsp;-&nbsp;-&nbsp;-&nbsp;-</option>';
+ //echo "<table align=\"center\"><tr><th colspan=\"3\">Existing Pages</th></tr>";
+
+
+ foreach($pages as $page)
+ {
+ if($pid == $page['page_id'])
+ echo "<option value=\"{$page['page_id']}\" selected>{$page['title']}</option>";
+ else
+ echo "<option value=\"{$page['page_id']}\">{$page['title']}</option>";
+ }
+ echo '</select>';
+ // echo "</table>";
+}
+
+function NewPage()
+{
+ global $db;
+ if(isset($_POST['processed']))
+ {
+ //Secure our data to prevent injection attacks.
+ $title = addslashes($_POST['title']);
+ $text = addslashes($_POST['text']);
+ if(empty($title) || empty($text))
+ {
+ echo "You must fill everything out before proceeding.";
+ return;
+ }
+
+ //Update the database with the new data.
+ $db->Query("INSERT INTO bayonet_pages SET title = '$title', text = '$text'");
+ echo "New page, '$title', has been added.\n";
+ //die, because we have completed what we wanted to do.
+ return;
+ }
+
+ ?>
+ <h3>Add New Page</h3>
+ <form action="<?php $_SERVER['PHP_SELF']?>" method="post">
+ <table>
+ <tr><th>Title</th><td><input type="text" name="title" value="<?php echo $page['title'] ?>" /></td></tr>
+ <tr><th>Text</th><td><textarea id="markItUp" rows="30" cols="80" name="text"><?php echo $page['text'] ?></textarea></td>
+ <tr><th colspan="2"><input type="submit" name="processed" value="Submit" /></th></tr>
+ </table>
+ </form>
+ <?php
+}
+
+function EditPage($page_id)
+{
+ global $db;
+ $page_id = addslashes($page_id);
+
+ // If the user has submitted, then process their request.
+ if(isset($_POST['processed']))
+ {
+ //Secure our data to prevent injection attacks.
+ $title = addslashes($_POST['title']);
+ $text = addslashes($_POST['text']);
+ if(empty($title) || empty($text))
+ {
+ echo "You must fill everything out before proceeding.";
+ return;
+ }
+
+ //Update the database with the new data.
+ $db->Query("UPDATE bayonet_pages SET title = '$title', text = '$text' WHERE page_id = '$page_id'");
+ echo "Page, '$title', has been edited.\n";
+ //die, because we have completed what we wanted to do.
+ return;
+ }
+
+ $aid = $_GET['aid'];
+?>
+ <table width="100%">
+ <tr>
+ <td><?php ListPages($page_id); ?></td>
+ <td><?php echo LinkInternal('<img src="images/view.gif" />&nbsp;View this Page','?load=page&id='.$page_id); ?></td>
+ <td class="right"><?php echo LinkInternal('<img src="images/delete.gif" />&nbsp;Delete this Page','?load=admin&op=pages&delete='.$page_id); ?></td>
+ </tr>
+ </table>
+ <hr />
+ <table class="cleartable" width="100%" style="height:95%;" cellspacing="0">
+ <tr>
+ <td style="vertical-align:top;">
+ <?php ListArticles($page_id); ?>
+ </td>
+ <td style="width:589px; vertical-align:top; border-left:1px solid #848484;">
+ <?php
+ //if article is set then EditArticle();
+ if($aid > 0){
+ EditArticle($aid);
+ }
+ ?>
+ </td>
+ </tr>
+ </table>
+ <?php
+}
+
+function DeletePage($page_id)
+{
+ global $db;
+
+ $result = $db->Query("SELECT title FROM bayonet_pages WHERE page_id = '$page_id'");
+ $page = $db->Fetch($result);
+
+ if(isset($_POST['proceed']))
+ {
+ echo "Page '{$page['title']}', was deleted.";
+ $db->Query("DELETE FROM bayonet_pages WHERE page_id = '$page_id' LIMIT 1");
+ return;
+ }
+ if(isset($_POST['cancel']))
+ {
+ echo "User cancelled deletion of page: '{$page['title']}'";
+ return;
+ }
+ if($page_id == 1){
+ echo "You can not delete the home page.";
+ return;
+ }
+
+ ?>
+ <form action="<?php $_SERVER['PHP_SELF'] ?>" method="post">
+ <table>
+ <th>Are you SURE you want to delete the page titled: '<?php echo $page['title']?>'?</th>
+ <tr><th><button name="proceed">Yes</button>&nbsp;&nbsp;&nbsp;<button name="cancel">No</button></th></tr>
+ </table>
+ </form>
+ <?php
+}
+
+?> \ No newline at end of file
diff --git a/modules/admin/pages/index.php b/modules/admin/pages/index.php
new file mode 100644
index 0000000..0fb6cff
--- /dev/null
+++ b/modules/admin/pages/index.php
@@ -0,0 +1,68 @@
+<?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/>.
+ */
+ ?>
+
+ <div class="maincontent">
+ <fieldset style="height:500px">
+ <legend>Manage Pages:</legend>
+<?php
+
+if(!defined("ADMIN_FILE"))
+{
+ die("Access denied.");
+}
+
+include $basedir.'pages/functions.php';
+
+if(isset($_GET['edit']))
+{
+ $page_id = $_GET['edit'];
+ EditPage($page_id);
+ return;
+}
+
+if(isset($_GET['delete']))
+{
+ $page_id = $_GET['delete'];
+ DeletePage($page_id);
+ return;
+}
+
+if(isset($_GET['create']))
+{
+ $create = $_GET['create'];
+ if($create)
+ {
+ NewPage();
+ return;
+ }
+}
+?>
+
+ <table width="100%">
+ <tr>
+ <td><?php ListPages(); ?></td>
+ <td class="right">
+ <?php echo LinkInternal('<img src="images/add.gif" />&nbsp;Create a Page','?load=admin&op=pages&create=true'); ?>
+ </td>
+
+ <tr>
+ </table>
+ </fieldset>
+</div>
diff --git a/modules/gallery/dynamitelax/100_2867.JPG b/modules/gallery/dynamitelax/100_2867.JPG
new file mode 100644
index 0000000..92a423d
--- /dev/null
+++ b/modules/gallery/dynamitelax/100_2867.JPG
Binary files differ
diff --git a/modules/gallery/dynamitelax/100_2889.JPG b/modules/gallery/dynamitelax/100_2889.JPG
new file mode 100644
index 0000000..c216acf
--- /dev/null
+++ b/modules/gallery/dynamitelax/100_2889.JPG
Binary files differ
diff --git a/modules/gallery/dynamitelax/100_2901.JPG b/modules/gallery/dynamitelax/100_2901.JPG
new file mode 100644
index 0000000..48a68e5
--- /dev/null
+++ b/modules/gallery/dynamitelax/100_2901.JPG
Binary files differ
diff --git a/modules/gallery/dynamitelax/100_3042.JPG b/modules/gallery/dynamitelax/100_3042.JPG
new file mode 100644
index 0000000..cabdf59
--- /dev/null
+++ b/modules/gallery/dynamitelax/100_3042.JPG
Binary files differ
diff --git a/modules/gallery/dynamitelax/100_3047.JPG b/modules/gallery/dynamitelax/100_3047.JPG
new file mode 100644
index 0000000..1d8966d
--- /dev/null
+++ b/modules/gallery/dynamitelax/100_3047.JPG
Binary files differ
diff --git a/modules/gallery/dynamitelax/100_3050.JPG b/modules/gallery/dynamitelax/100_3050.JPG
new file mode 100644
index 0000000..1f201eb
--- /dev/null
+++ b/modules/gallery/dynamitelax/100_3050.JPG
Binary files differ
diff --git a/modules/gallery/dynamitelax/100_3051.JPG b/modules/gallery/dynamitelax/100_3051.JPG
new file mode 100644
index 0000000..c8e30a1
--- /dev/null
+++ b/modules/gallery/dynamitelax/100_3051.JPG
Binary files differ
diff --git a/modules/gallery/dynamitelax/100_3883.jpg b/modules/gallery/dynamitelax/100_3883.jpg
new file mode 100644
index 0000000..95d43f1
--- /dev/null
+++ b/modules/gallery/dynamitelax/100_3883.jpg
Binary files differ
diff --git a/modules/gallery/index.php b/modules/gallery/index.php
new file mode 100644
index 0000000..e69de29
--- /dev/null
+++ b/modules/gallery/index.php
diff --git a/modules/gallery/testphotos/dlogo.png b/modules/gallery/testphotos/dlogo.png
new file mode 100644
index 0000000..68d3aa8
--- /dev/null
+++ b/modules/gallery/testphotos/dlogo.png
Binary files differ
diff --git a/modules/gallery/testphotos/logo.png b/modules/gallery/testphotos/logo.png
new file mode 100644
index 0000000..2c62008
--- /dev/null
+++ b/modules/gallery/testphotos/logo.png
Binary files differ
diff --git a/modules/gallery/testphotos/player.jpg b/modules/gallery/testphotos/player.jpg
new file mode 100644
index 0000000..434f6c2
--- /dev/null
+++ b/modules/gallery/testphotos/player.jpg
Binary files differ
diff --git a/modules/gallery/testphotos/team.jpg b/modules/gallery/testphotos/team.jpg
new file mode 100644
index 0000000..8e5c6eb
--- /dev/null
+++ b/modules/gallery/testphotos/team.jpg
Binary files differ
diff --git a/modules/index/index.php b/modules/index/index.php
new file mode 100644
index 0000000..fd1eef1
--- /dev/null
+++ b/modules/index/index.php
@@ -0,0 +1,36 @@
+<?php
+/**
+ * MODULE - INDEX >>
+ * This page is a module that displays multiple modules
+ * Database should store a list of module names in the order they are to be displayed
+ * This should be fairly simple to produce -- Dont forget to set this as the default
+ * in the config.php array
+ *
+ */
+?>
+
+<?php
+
+ $result = $db->Query("SELECT `index_modules` FROM `bayonet_settings` WHERE `title` = 'Default'");
+ while(($row = $db->Fetch($result))!==false)
+ {
+ $indexModules = $row['index_modules'];
+ }
+
+ $indexModules = explode(',',$indexModules);
+
+ foreach($indexModules as $module)
+ {
+ if(file_exists("modules/" . $module))
+ {
+ include 'modules/' . $module . '/index.php';
+ }
+ else
+ {
+ OpenTable();
+ ReportError("Cannot load module '{$module}' directory.<br>\n");
+ CloseTable();
+ }
+ echo "<br />";
+ }
+?> \ No newline at end of file
diff --git a/modules/news/categories/3rdIDnews.png b/modules/news/categories/3rdIDnews.png
new file mode 100644
index 0000000..e31a7f5
--- /dev/null
+++ b/modules/news/categories/3rdIDnews.png
Binary files differ
diff --git a/modules/news/categories/marnemessenger.png b/modules/news/categories/marnemessenger.png
new file mode 100644
index 0000000..691129e
--- /dev/null
+++ b/modules/news/categories/marnemessenger.png
Binary files differ
diff --git a/modules/news/functions.php b/modules/news/functions.php
new file mode 100644
index 0000000..66c8b68
--- /dev/null
+++ b/modules/news/functions.php
@@ -0,0 +1,260 @@
+<?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/>.
+ */
+
+ /**
+ * getNewsComments($id)
+ * Function getting an array of comments for posted news
+ * @param id - news_id cooresponding to `bayonet_news`
+ * @return - associative array of comments
+ */
+function getNewsComments($id){
+
+ global $db;
+ $result = $db->Query("SELECT c.comment_id, c.news_id, c.author_id, c.message, c.date, u.username AS author, u.avatar as avatar ".
+ "FROM `bayonet_news_comments` AS c ".
+ "LEFT OUTER JOIN `mybb_users` AS u ON u.uid = c.author_id ".
+ "WHERE c.news_id = '$id' ".
+ "ORDER BY date ASC");
+ while(($row = $db->Fetch($result)) != false)
+ {
+ $comments[] = $row;
+ }
+
+ $db->Free($result);
+
+ return $comments;
+}
+
+ /**
+ * displayComments($data)
+ * Function that takes an array of comments and displays them in html
+ * @param data - associative array of comments from the database
+ */
+function displayComments($data){
+
+ date_default_timezone_set("America/New_York");
+ OpenTable();
+ ?>
+
+ <div id="comments">
+ <table width="100%">
+ <tr>
+ <td><h2>User Comments</h2></td>
+ <td style="text-align:right"><a href="#add">Add Yours</a></td>
+ </tr>
+ </table>
+ <ol class="comment_list parent">
+
+ <?php
+ foreach($data as $comment)
+ {
+ ?>
+ <li id="comment-<?php echo $comment['comment_id']; ?>">
+ <div class="comment_wrap">
+
+ <div class="comment_author">
+ <?php
+ if(!empty($comment['avatar'])){
+ echo "<img src=\"{$comment['avatar']}\" height=\"80px\" />";
+ }else{
+ echo "<img src=\"modules/news/images/avatar.png\" />";
+ }
+ ?>
+ <p>
+ <?php
+ if($comment['author_id']>0){
+ echo "<a href=\"{$comment['author_id']}\">{$comment['author']}</a>";
+ }else{
+ echo "Guest";
+ }
+ ?>
+
+ <span><?php echo date('F jS', strtotime($comment['date'])); ?></span>
+ </p>
+ </div>
+
+ <div class="single_comment">
+ <img src="modules/news/images/comment_arrow.png" class="comment_arrow" />
+ <p> <?php echo BBCode($comment['message']); ?></p>
+
+ </div>
+
+ </div>
+ </li>
+
+ <?php
+ }
+ echo "</ol>";
+
+ commentForm();
+
+ CloseTable();
+}
+
+ /**
+ * getNumOfComments($id)
+ * Function that gets the number of comments a news post has
+ * @param id - news_id cooresponding to `bayonet_news`
+ */
+function getNumOfComments($id){
+
+ global $db;
+ $result = $db->Query("SELECT `comment_id` FROM `bayonet_news_comments` WHERE `news_id` = '$id'");
+
+ return $db->Rows($result);;
+}
+
+ /**
+ * getNumOfComments($id)
+ * Function that gets the desired news from the database and returns it as an array
+ * @param id - (optional) news_id cooresponding to `bayonet_news`
+ */
+function getNews($id = NULL){
+
+ global $db;
+ $query = "SELECT n.news_id, n.title, n.message, n.date, n.category_id, u.username AS author, c.name AS catname, c.image AS catimage ".
+ "FROM `bayonet_news` AS n ".
+ "INNER JOIN `bayonet_news_categories` AS c ON c.category_id = n.category_id ".
+ "LEFT OUTER JOIN `mybb_users` AS u ON u.uid = n.author_id ";
+ if(isset($id)){
+ $query = $query."WHERE n.news_id = '$id' ";
+ }else{
+ $query = $query."ORDER BY date DESC";
+ if($limit !=NULL){
+ $query = $query." LIMIT '$limit'";
+ }
+ }
+
+ $result = $db->Query($query);
+ while(($row = $db->Fetch($result)) != false)
+ {
+ $data[] = $row;
+ }
+
+ $db->Free($result);
+
+ return $data;
+}
+
+ /**
+ * displayNews($data)
+ * Function that takes an array of news and displays it as html
+ * @param data - associative array of news from the database
+ */
+function displayNews($data){
+
+ date_default_timezone_set("America/New_York");
+ foreach($data as $news)
+ {
+ $numComments = getNumOfComments($news['news_id']);
+
+ OpenTable(); ?>
+
+ <div class="contentHeading">
+ <table width="100%">
+ <tr>
+ <td style="text-align:left;"><?php echo $news['title']; ?></td>
+ <td style="text-align:right;">Posted by: <?php echo $news['author']; ?></td>
+ </tr>
+ </table>
+ </div>
+ <div class="content">
+ <img src="modules/news/categories/<?php echo $news['catimage']; ?>" alt="<?php echo $news['catname']; ?>" align="right" />
+ <?php echo BBCode($news['message']); ?>
+ </div>
+ <div class="contentFooter">
+ <table width="100%">
+ <tr>
+ <td style="text-align:left;">
+ View Comments: <a href="?load=news&id=<?php echo $news['news_id']; ?>"><?php echo $numComments;?> Comments</a>
+ </td>
+ <td style="text-align:right;">Posted on: <?php echo date('D M j, Y H:i a T', strtotime($news['date'])); ?></td>
+ </tr>
+ </table>
+ </div>
+
+ <?php
+ CloseTable();
+ echo "<br />";
+ }
+}
+
+/** This was coded on Coda with a MacBook Pro **/
+function commentForm(){
+
+ global $db;
+
+ if(isset($_POST['processed']))
+ {
+ $comment = stripslashes($_POST['comment']);
+ $author_id = stripslashes($_POST['author']);
+
+ echo "Author: {$author_id}<br />Comment: {$comment}<br />";
+ echo "Your comment has been processed. Please wait.<br />";
+ }
+
+ $cur_user_id = 0; //testing variable, until i get the login system working for this
+
+ $logged_in = false;
+ $result = $db->Query("SELECT `username`, `avatar` FROM `mybb_users` WHERE `uid` = '$cur_user_id' LIMIT 1");
+ while(($row = $db->Fetch($result)) != false)
+ {
+ $username = $row['username'];
+ $avatar = $row['avatar'];
+ $logged_in = true;
+ }
+
+?>
+<a name="add"></a>
+<h2>Add Your Comment</h2>
+
+ <ol class="comment_form_wrap">
+ <li>
+ <img src="modules/news/images/comment_arrow.png" class="textarea_arrow" />
+ <div class="comment_author">
+ <?php
+ if($avatar!=""){
+ echo "<img src=\"{$avatar}\" height=\"80px\" />";
+ }else{
+ echo "<img src=\"modules/news/images/avatar.png\" />";
+ }
+ ?>
+ <p>
+ <?php
+ if($logged_in){
+ echo $username;
+ }else{
+ echo "Guest";
+ }
+ ?>
+ <br><span><?php echo date('F jS', time()); ?></span></p>
+ </div>
+ <form action="<?php $_SERVER['PHP_SELF']?>" method="POST" id="comment_form">
+ <!-- <fieldset> -->
+ <textarea name="comment" id="comment" rows="8" cols="10" tabindex="1" class="input textarea required"></textarea>
+ <input type="hidden" value="<?php echo $cur_user_id; ?>" name="author" />
+ <input type="submit" value="Add Comment" name="processed" />
+ <!-- </fieldset> -->
+ </form>
+ </li>
+ </ol>
+
+<?php
+}
+?> \ No newline at end of file
diff --git a/modules/news/images/avatar.png b/modules/news/images/avatar.png
new file mode 100644
index 0000000..825197a
--- /dev/null
+++ b/modules/news/images/avatar.png
Binary files differ
diff --git a/modules/news/images/comment_arrow.png b/modules/news/images/comment_arrow.png
new file mode 100644
index 0000000..0962f4f
--- /dev/null
+++ b/modules/news/images/comment_arrow.png
Binary files differ
diff --git a/modules/news/index.php b/modules/news/index.php
new file mode 100644
index 0000000..6aaec2d
--- /dev/null
+++ b/modules/news/index.php
@@ -0,0 +1,44 @@
+<link rel="stylesheet" type="text/css" href="modules/news/style.css" media="screen"/>
+<?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/>.
+ */
+
+if(!defined("MODULE_FILE"))
+{
+ die('Access Denied.');
+}
+
+include 'modules/news/functions.php';
+
+$logged_id = 2;
+
+if(isset($_GET['id']))
+{
+ $news_id = $_GET['id'];
+ displayNews(getNews($news_id));
+ displayComments(getNewsComments($news_id));
+ return;
+}
+else
+{
+ displayNews(getNews());
+ return;
+}
+
+
+?> \ No newline at end of file
diff --git a/modules/news/style.css b/modules/news/style.css
new file mode 100644
index 0000000..fe98982
--- /dev/null
+++ b/modules/news/style.css
@@ -0,0 +1,234 @@
+ /*********************************
+ ** Comment Styles **
+ *********************************/
+
+ div.comment_author a, div.comment_author a:visited {
+ font-size: 10px;
+ font-family: verdana;
+ color:#3666ba;
+ }
+
+ div.comment_author a:hover, div.comment_author a:visited:hover {
+ font-size: 10px;
+ font-family: verdana;
+ color:#42423d;
+ }
+
+/* Comments */
+#comments {
+ background: #ededed;
+ padding: 25px 25px;
+ padding-top:0px;
+ border: 1px solid #dcdddd;
+ color: #42423d;
+}
+#comments a {
+ text-decoration: none;
+}
+#comments_wrap h3 {
+ font-size: 22px;
+ font-weight: normal;
+ margin: 0px;
+ padding-bottom: 20px;
+ margin-top: 10px;
+}
+#comments_wrap h3 a, #comments_wrap h3 a:hover {
+ color: #242323;
+ text-decoration: none;
+}
+#comments_wrap .get_avatar {
+ color: #a7a7a7;
+ font-size: 10px;
+ letter-spacing: -1px;
+ padding-top: 10px;
+}
+#comments ol.parent {
+ padding-bottom: 25px
+}
+#comments ol {
+ margin: 0px;
+ padding: 0px;
+ padding-left: 120px;
+}
+#comments ol li {
+ list-style: none;
+ padding: 0px;
+ margin: 10px 0px;
+ padding-top: 1px;
+}
+#comments span.comment-reply {
+ position: absolute;
+ bottom: 10px;
+ left: 20px;
+ font-size: 10px;
+ text-transform: uppercase;
+}
+#comments .comment_wrap {
+ position: relative;
+ background: #fff;
+ border: 1px solid #dcdddd;
+}
+#comments .single_comment {
+ padding: 20px;
+ padding-bottom: 60px;
+ color: #42423d;
+}
+#comments .comment_arrow {
+ position: absolute;
+ top: 20px;
+ left: -32px;
+}
+#comments .comment_author {
+ position: absolute;
+ left: -120px;
+ width: 100px;
+ color: #8d8d8d;
+ font-size: 10px;
+ line-height: 14px;
+}
+#comments .comment_author span {
+ display: block;
+}
+#comments .children {
+ padding-left: 0px;
+ border-left: 1px solid #ced0d0;
+}
+#comments .children li {
+ padding-left: 25px;
+ background: url(images/comment_li_bg.gif) no-repeat 0px 25px;
+}
+#comments .children .comment_wrap {
+ background: #f8f8f8;
+ border: 1px solid #d3d5d5;
+}
+#comments .children .comment_arrow {
+ display: none;
+}
+#comments .children .comment_author {
+ position: absolute;
+ left: auto;
+ right: 20px;
+ bottom: 10px;
+ width: 200px;
+ height: 40px;
+}
+#comments .children .comment_author p {
+ position: absolute;
+ right: 50px;
+ bottom: -20px;
+ text-align: right;
+}
+#comments .children .comment_author span {
+ display: block;
+}
+#comments .children .comment_author img {
+ width: 40px;
+ height: 40px;
+ float: right;
+}
+/* Comments Form */
+#respond {
+ position: relative;
+}
+#comments .comment_form_wrap {
+ position: relative;
+ padding-left: 120px;
+}
+#comments .parent .comment_form_wrap {
+ position: relative;
+ padding-left: 0px;
+}
+#comments .textarea_arrow {
+ position: absolute;
+ top: 25px;
+ left: 89px;
+}
+#comments .children .textarea_arrow,
+#comments .parent .textarea_arrow {
+ display: none;
+}
+#comments .comment_form_wrap .comment_author {
+ position: absolute;
+ left: 0px;
+}
+#comments .children .comment_form_wrap {
+ position: relative;
+ padding-left: 0px;
+}
+#comments .children .comment_form_wrap .comment_author,
+#comments .parent .comment_form_wrap .comment_author,
+#comments .children .form_header,
+#comments .parent .form_header {
+ display: none;
+}
+#comments .input {
+ width: 456px;
+ padding: 4px 5px;
+ background: #fff;
+ border: 1px solid #ced0d0;
+ color: #5f6565;
+ font-family: Tahoma, Arial, Helvetica, sans-serif;
+ display: block;
+ margin-bottom: 10px;
+}
+#comments .children .input {
+ width: 431px;
+}
+#comments .textarea {
+ padding-top: 20px;
+ padding-left: 20px;
+ width: 448px;
+ max-width: 468px;
+ height: 135px;
+ font-size: 12px;
+ color: #5f6565;
+ font-family: Tahoma, Arial, Helvetica, sans-serif;
+}
+#comments .children .textarea {
+ width: 423px;
+}
+#comments #submit_comment {
+ width: 12.0em;
+ height: 3.0em;
+ float: right;
+ margin-right: 7px;
+ margin-top: 10px;
+}
+#wpUserLinks_form #submit_comment {
+ width: 12.0em;
+ height: 3.0em;
+ margin-top: 10px;
+}
+#comments .inputerror {
+ border-color: #555;
+}
+#cancel-comment-reply {
+ float: left;
+ width: 120px;
+ height: 30px;
+ margin-top: 8px;
+}
+#cancel-comment-reply-link {
+ background: #fdfdfd url(images/button_bg.png) repeat-x 0 100%;
+ border: 1px solid #bbbbbb;
+ font-family: Verdana, Arial, Helvetica, sans-serif;
+ font-size: 9px;
+ text-transform: uppercase;
+ height: 22px;
+ width: 70px;
+ text-align: center;
+ padding-bottom: 2px;
+ letter-spacing: -0.05em;
+ cursor: pointer;
+ display: block;
+ line-height: 22px;
+}
+*+html #cancel-comment-reply-link {
+ height: 22px;
+ padding-bottom: 0px;
+}
+#cancel-comment-reply-link:hover {
+ color: #232323;
+ background: #eeeeee url(images/button_bg_hover.png) repeat-x 0 100%;
+ text-decoration: none;
+}
diff --git a/modules/newsreel/images/slidenavbg.png b/modules/newsreel/images/slidenavbg.png
new file mode 100644
index 0000000..6e3a726
--- /dev/null
+++ b/modules/newsreel/images/slidenavbg.png
Binary files differ
diff --git a/modules/newsreel/images/slidenavbg2.png b/modules/newsreel/images/slidenavbg2.png
new file mode 100644
index 0000000..8b9f612
--- /dev/null
+++ b/modules/newsreel/images/slidenavbg2.png
Binary files differ
diff --git a/modules/newsreel/images/slidenavbg3.png b/modules/newsreel/images/slidenavbg3.png
new file mode 100644
index 0000000..a027d26
--- /dev/null
+++ b/modules/newsreel/images/slidenavbg3.png
Binary files differ
diff --git a/modules/newsreel/index.php b/modules/newsreel/index.php
new file mode 100644
index 0000000..5aaf9ba
--- /dev/null
+++ b/modules/newsreel/index.php
@@ -0,0 +1,113 @@
+<!-- START News Reel -->
+<?php OpenTable(); ?>
+<script type="text/javascript">
+
+var current = "0";
+var stop = false;
+var slide=new Array(); //declares a new array called banner
+var x=0; //loop control and array counting variable
+var timing=7000; //value is in milliseconds, used for 3 seconds on each image
+<?php
+ $x=0;
+
+ $get_slides = mysql_query("SELECT * FROM `news_slideshow` WHERE `visable`=1 ORDER BY `order` DESC LIMIT 0,6");
+ //$get_slides = mysql_query("SELECT * FROM `news_slideshow` WHERE `visable`=1");
+
+ while($echo_slides = mysql_fetch_array($get_slides)){
+
+ echo 'slide['.$x.']=new Image();';
+ echo 'slide['.$x.'].src="modules/newsreel/slides/'.$echo_slides['src'].'";';
+ if($x==0){
+ $startSRC=$echo_slides['src'];
+ }
+ $x++;
+
+ }
+
+ $width = 100/$x;
+?>
+
+ function changeStart()
+ {
+ document.getElementById(0).style.backgroundImage="url(modules/newsreel/images/slidenavbg2.png)";
+
+ }
+
+ function mouseOverBG(id, image)
+ {
+ if(id!=current){
+ document.getElementById(id).style.backgroundImage="url(modules/newsreel/images/slidenavbg3.png)";
+ document.getElementById(id).style.color="#3666ba";
+ document.body.style.cursor = 'pointer';
+ }
+ }
+
+ function mouseOutBG(id, image)
+ {
+ if(id!=current){
+ document.getElementById(id).style.backgroundImage="url(modules/newsreel/images/slidenavbg.png)";
+ document.getElementById(id).style.color="white";
+ document.body.style.cursor = 'default';
+ }
+ }
+ function nextSlide(num, clicked)
+ {
+ if(num!=current){
+ document.myBanner.src=slide[num].src;
+ document.getElementById(num).style.backgroundImage="url(modules/newsreel/images/slidenavbg2.png)";
+ document.getElementById(current).style.backgroundImage="url(modules/newsreel/images/slidenavbg.png)";
+ document.getElementById(num).style.color="white";
+ document.body.style.cursor = 'default';
+ current=num;
+ if(clicked){
+ stop=true;
+ }
+ }
+
+ }
+ function playBanner()
+ {
+ if(!stop){
+ if(document.images)
+ {
+ if(document.myBanner.complete)
+ {
+ nextSlide(x,false)
+ x++;
+ }
+ <?php
+ echo' if(x=='.$x.'){
+ x=0;}';
+ ?>
+ var timerId=setTimeout("playBanner()", timing);
+ }
+ }
+ }
+ function init_Slides(){
+ changeStart();
+ playBanner();
+ }
+
+window.onload = init_Slides; //starts the reels movement
+
+
+</script>
+
+<div class="content1"><div class="content2">
+ <img src="modules/newsreel/slides/<?php echo $startSRC; ?>" name="myBanner" alt="newsreel" />
+ <table border="0" cellspacing="0" cellpadding="0" height="21px" width="100%">
+ <tr>
+<?php
+$y=0;
+ $get_slidenav = mysql_query("SELECT * FROM `news_slideshow` WHERE `visable`=1 ORDER BY `order` DESC LIMIT 0, 6");
+ while($echo_slidenav = mysql_fetch_array($get_slidenav)){
+
+ echo '<td id="'.$y.'" width="'.$width.'%" class="slidenav" onClick="nextSlide(this.id,true)" onmouseover="mouseOverBG(this.id)" onmouseout="mouseOutBG(this.id)">'.$echo_slidenav['title'].'</td>';
+ $y++;
+ }
+?>
+ </tr>
+ </table>
+</div></div>
+<?php CloseTable(); ?>
+<!-- END News Reel --> \ No newline at end of file
diff --git a/modules/newsreel/slides/arma2move.png b/modules/newsreel/slides/arma2move.png
new file mode 100644
index 0000000..7c7c419
--- /dev/null
+++ b/modules/newsreel/slides/arma2move.png
Binary files differ
diff --git a/modules/newsreel/slides/newsite.png b/modules/newsreel/slides/newsite.png
new file mode 100644
index 0000000..88a28e8
--- /dev/null
+++ b/modules/newsreel/slides/newsite.png
Binary files differ
diff --git a/modules/newsreel/slides/recruitmentGT.png b/modules/newsreel/slides/recruitmentGT.png
new file mode 100644
index 0000000..c74ae8c
--- /dev/null
+++ b/modules/newsreel/slides/recruitmentGT.png
Binary files differ
diff --git a/modules/newsreel/slides/teamwork.png b/modules/newsreel/slides/teamwork.png
new file mode 100644
index 0000000..99f760b
--- /dev/null
+++ b/modules/newsreel/slides/teamwork.png
Binary files differ
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
diff --git a/modules/tsviewer/index.php b/modules/tsviewer/index.php
new file mode 100644
index 0000000..18ee7c5
--- /dev/null
+++ b/modules/tsviewer/index.php
@@ -0,0 +1,43 @@
+<?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/>.
+ */
+
+if(!defined("MODULE_FILE"))
+{
+ echo "Access denied...";
+ return;
+}
+
+OpenTable();
+echo "<tr><th>How to Connect</th></tr><tr><td style=\"text-align:center;\"><p>IP: 64.214.185.50:9004</p><p>Password: Garand</p></td></tr>";
+CloseTable();
+
+
+OpenTable();
+echo "<tr><th>Teamspeak Server</th></tr><tr><td>";
+/*echo "<div style=\"vertical-align:middle; margin-left:40%; margin-right:auto;\">\n";*/
+echo "<div style=\"width: 30%; margin-left: auto; margin-right: auto;\">\n";
+?>
+<script language="javascript" type="text/javascript" src="http://www.tsviewer.com/ts_viewer_pur.php?ID=58659&bg=transparent&type=eee&type_size=11&type_family=1&info=1&channels=1&users=1&js=1&type_s_weight=normal&type_s_style=normal&type_s_variant=normal&type_s_decoration=none&type_s_weight_h=normal&type_s_style_h=normal&type_s_variant_h=normal&type_s_decoration_h=none&type_i_weight=normal&type_i_style=normal&type_i_variant=normal&type_i_decoration=none&type_i_weight_h=normal&type_i_style_h=normal&type_i_variant_h=normal&type_i_decoration_h=none&type_c_weight=normal&type_c_style=normal&type_c_variant=normal&type_c_decoration=none&type_c_weight_h=normal&type_c_style_h=normal&type_c_variant_h=normal&type_c_decoration_h=none&type_u_weight=normal&type_u_style=normal&type_u_variant=normal&type_u_decoration=none&type_u_weight_h=normal&type_u_style_h=normal&type_u_variant_h=normal&type_u_decoration_h=none"></script><NOSCRIPT>Enable JavaScript to see TeamSpeak Viewer or click <a href="http://www.tsviewer.com/index.php?page=ts_viewer&ID=58659">here</a>.</NOSCRIPT>
+<?php
+echo "</div>\n";
+echo "</td></tr>";
+CloseTable();
+
+
+?>
diff --git a/navigation.php b/navigation.php
new file mode 100644
index 0000000..ecf1236
--- /dev/null
+++ b/navigation.php
@@ -0,0 +1,23 @@
+<?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`");
+ while(($row = $db->Fetch($result))!==false)
+ {
+ echo '<td>&nbsp;&nbsp;<a href="'.$row['link'].'">'.strtoUpper($row['title']).'</a>&nbsp;&nbsp;</td>';
+ }
+?>
+ </tr>
+</table> \ No newline at end of file
diff --git a/style.css b/style.css
new file mode 100644
index 0000000..b5492ef
--- /dev/null
+++ b/style.css
@@ -0,0 +1,389 @@
+ /*********************************
+ ** Layout Styles **
+ *********************************/
+ div.container {
+ /* width:990px;
+ margin: 0px auto 0px auto;
+ text-align:center; */
+ /* background-image:url('images/sandbackground.jpg');
+ background-repeat: repeat;*/
+ width: 990px;
+ color: #000000;
+ margin: auto auto;
+ text-align: left; /* IE 5 fix */
+ }
+ div.banner {
+ /* width:800px;
+ height:125px;
+ text-align:center;
+ vertical-align:middle;
+ background-color:#202020; */
+ width: 990px;
+ background: #fff;
+ color: #000000;
+ margin: auto auto;
+ }
+ div.nav {
+ /*
+ height:19px;
+ text-align:center;
+ vertical-align:top;
+ background-color:blue; */
+ /* background-image:url("images/navbg.png"); */
+ width: 990px;
+ height: 28px;
+ background: #284c75;
+ background-image:url('images/navbackground.jpg');
+ color: #000000;
+ margin: auto auto;
+ font-size:14px;
+ }
+ table.main {
+ background-image:url('images/sandbackground.jpg');
+ padding: 0px;
+ color:#ffffff;
+ width:990px;
+ background-color:#a3a2a0;
+ }
+
+ table.main td {
+ /* color:white; */
+ }
+ .leftcol {
+ width:644px;
+ background-color:transparent;
+ vertical-align:top;
+ }
+ .rightcol {
+ 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;
+ }
+ div.content img {
+ padding:5px;
+ }
+ 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;
+ }
+
+ /*********************************
+ ** Nav Links Styles **
+ *********************************/
+
+ h1, h2, h3, h4, h5, h6 {
+ font-family: Helvetica, Arial, sans-serif;
+ font-weight: normal;
+ }
+
+ .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;
+ }
+ 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.admin, a.admin:visited, a.admin:active {
+
+ color:#e3c70b;
+ font-size:16px;
+ text-decoration:none;
+ }
+ a.admin:hover, a.admin:visited:hover {
+
+ color:#b90000;
+ font-size:16px;
+ text-decoration:none;
+ }
+ body {
+ background-color:#091a34;
+ margin:0;
+ padding:0;
+ text-align:left;
+ }
+
+/* div.content {
+ width:800px;
+ min-height:570px;
+ background-color:white;
+ } */
+ 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;
+ }
+ .footertext {
+ color:blue;
+ }
+ div.announcement {
+ color:black;
+ padding:7px;
+ }
+ .navspacer {
+ text-align:center;
+ width:20px;
+ }
+ table.slideshow {
+ border-top:1px #ffffff solid;
+ background-image:url(slidebg.png);
+ vertical-align:baseline;
+ width:100%;
+ height:100%;
+ }
+ table.slideshow td {
+ color:white;
+ }
+ .slidenav {
+ text-align:center;
+ font-size:11pt;
+ line-height: 1.4;
+ background-image:url("modules/newsreel/images/slidenavbg.png");
+ vertical-align:text-bottom;
+ border-right:1px solid #333333;
+ }
+ a img {
+ border:0px;
+ }
+ table.cleartable td {
+ background-color:transparent;
+ }
+ table.wide-table {
+ width:100%;
+ background-color: yellow;
+ }
+ div.maincontent {
+ color:black;
+ width:766px;
+ padding:15px;
+ padding-bottom:5px;
+ text-align:left;
+ }
+ div.maincontent-news {
+ width:663px;
+ padding:15px;
+ padding-top:5px;
+ padding-bottom:5px;
+ }
+ input {
+ /*background-color:black; */
+ /*color:#575757; */
+ /*border:1px solid #575757;*/
+ }
+ input.input {
+ background-color:black;
+ width:119px;
+ border:1px solid #575757;
+ margin-bottom:5px;
+ color:#575757;
+ padding:3px;
+ font-family:verdana;
+ }
+ div.submitbutton {
+ text-align:right;
+ margin-bottom:0;
+ float:right;
+ }
+ form {
+ margin:0;
+ }
+ p.contentp {
+ margin-top:0;
+ }
+ p.contentpc {
+ margin-top:0;
+ text-align:center;
+ }
+ table.options {
+ width:100%;
+ /*text-align:right;*/
+ vertical-align:middle;
+ /*background-color: #a1a1a1;*/
+ border-top: 1px solid #a1a1a1;
+ border-left: 1px solid #a1a1a1;
+ border-bottom: 1px solid #a1a1a1;
+ }
+ table.options th {
+ background-color:#666666;
+ color:white;
+ height:17px;
+ font-size:10px;
+ font-weight:bold;
+ text-align:center;
+ }
+ table.options td {
+ background-color:transparent;
+ border-right: 1px solid #a1a1a1;
+ border-top: 1px solid #a1a1a1;
+ padding:3px;
+ font-size:10px;
+ vertical-align:middle;
+ color:black;
+ }
+ table.options td a, table.options td a:visited {
+ font-weight:bold;
+ font-size:10px;
+ color:#333333;
+ }
+ table.options td a:hover, table.options td a.visited:hover {
+ font-weight:bold;
+ font-size:10px;
+ color:#333333;
+ }
+ table.options td a.highlight, table.options td a.highlight:visited {
+ font-weight:bold;
+ font-size:10px;
+ color:#474747;
+ }
+ table.options td a.highlight:hover, table.options td a.highlight.visited:hover {
+ font-weight:bold;
+ font-size:10px;
+ color:#474747;
+ }
+ table.options tr {
+
+ }
+ tr.rownorm{
+ background-color:white;
+
+ }
+ tr.rowhigh{
+ background-color:#e0e0e0;
+ }
+ .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;
+ }
+ .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/style_bbcode.css b/style_bbcode.css
new file mode 100644
index 0000000..7299c06
--- /dev/null
+++ b/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;
+}