diff options
355 files changed, 7758 insertions, 3950 deletions
diff --git a/admin/adjutant/functions.php b/admin/adjutant/functions.php index 57e9fe8..87bc4b4 100644 --- a/admin/adjutant/functions.php +++ b/admin/adjutant/functions.php @@ -21,7 +21,7 @@ global $db; - $result = $db->Query("SELECT * FROM `rudi_unit_members` JOIN `rudi_ranks` ON rudi_unit_members.rank_id=rudi_ranks.rank_id WHERE rudi_unit_members.status_id != 4 AND rudi_unit_members.status_id != 5 ORDER BY rudi_ranks.weight DESC , rudi_unit_members.date_promotion ASC , rudi_unit_members.date_enlisted ASC"); + $result = $db->Query("SELECT * FROM `rudi_unit_members` JOIN `rudi_ranks` ON rudi_unit_members.rank_id=rudi_ranks.rank_id WHERE rudi_unit_members.status_id < 4 ORDER BY rudi_ranks.weight DESC , rudi_unit_members.date_promotion ASC , rudi_unit_members.date_enlisted ASC"); $row = $db->Fetch($result); if(isset($_POST['processed'])){ @@ -29,10 +29,11 @@ foreach($row as $soldier){ $mID = $soldier['member_id']; $missed = $_POST[$mID.'missed']; + $attended = $_POST[$mID.'attended']; $points = $_POST[$mID.'points']; if($missed !="" && $points != ""){ - $db->Query("UPDATE `rudi_unit_members` SET `points` = $points, `drillcount` = $missed WHERE `member_id` = $mID LIMIT 1"); + $db->Query("UPDATE `rudi_unit_members` SET `points` = $points, `drillcount` = $missed, `attendcount` = $attended WHERE `member_id` = $mID LIMIT 1"); }else{ ReportError("Error updating points for soldier id# '$mID'. Please contact administrator."); } @@ -42,9 +43,9 @@ } ?> <form method="POST" action="<?php $_SERVER['PHP_SELF']?>"> - <table style="text-align:center;" width="100%"> + <table style="text-align:center;" width="100%" cellspacing="0"> <?php //OpenTable(); ?> - <tr><th>Rank</th><th>Soldier</th><th>Status</th><th>Points</th><th>Drills Missed</th></tr> + <tr><th>Rank</th><th>Soldier</th><th>Status</th><th>Points</th><th>Drills Missed</th><th>Drills Attended</th></tr> <?php foreach($row as $soldier){ $memberID = $soldier['member_id']; @@ -56,7 +57,8 @@ <td>{$soldier['first_name']} {$soldier['last_name']}</td> <td>".getStatus($soldier['status_id'])."</td> <td><input type=\"text\" class=\"lrg\" value=\"{$soldier['points']}\" name=\"{$memberID}points\" size=\"1\" maxlength=\"3\" />/100</td> - <td><input type=\"text\" class=\"lrg\" value=\"{$soldier['drillcount']}\" name=\"{$memberID}missed\" size=\"1\" maxlength=\"1\" />/3</td>"; + <td><input type=\"text\" class=\"lrg\" value=\"{$soldier['drillcount']}\" name=\"{$memberID}missed\" size=\"1\" maxlength=\"1\" />/3</td> + <td><input type=\"text\" class=\"lrg\" value=\"{$soldier['attendcount']}\" name=\"{$memberID}attended\" size=\"1\" maxlength=\"1\" />/3</td>"; echo "<input type=\"hidden\" value=\"{$memberID}\" name=\"{$memberID}id\" />\n"; @@ -104,7 +106,7 @@ $num = 1; foreach($row as $member){ if($num %2 == 0) - echo "<tr style=\"background-color:#c6c6c6;\">"; + echo "<tr style=\"background-color:#dfdfdf;\">"; else echo "<tr>"; echo "<td>{$member['shortname']}</td><td>{$member['first_name']} {$member['last_name']}</td><td><a href=\"?op=adjutant&edit=loas&member={$member['member_id']}\">Edit</a></td></tr>"; diff --git a/admin/adjutant/style.css b/admin/adjutant/style.css index 24a3eb8..823873b 100644 --- a/admin/adjutant/style.css +++ b/admin/adjutant/style.css @@ -1,13 +1,13 @@ - input.lrg {
- font-size:14px;
- font-weight:bold;
- text-align:center;
- font-family: Arial, Sans-Serif;
- }
-
- tr.inactive {
- background-color:#dfdfdf;
- }
- tr.inactive td {
- color:#a2a2a2;
+ input.lrg { + font-size:14px; + font-weight:bold; + text-align:center; + font-family: Arial, Sans-Serif; + } + + tr.inactive { + background-color:#dfdfdf; + } + tr.inactive td { + color:#a2a2a2; }
\ No newline at end of file diff --git a/admin/admins/functions.php b/admin/admins/functions.php index d28ff7d..f3da1be 100644 --- a/admin/admins/functions.php +++ b/admin/admins/functions.php @@ -1,329 +1,329 @@ -<script type="text/javascript">
- $(document).ready(function(){
- $(".flip").click(function(){
- $(".slidepanel").slideToggle("slow");
- });
- });
-</script>
-
-<style type="text/css">
- p.flip
- {
- margin:0px;
- padding:5px;
- text-align:center;
- background: #5b8dda;
- border:solid 1px #848484;
- color:white;
- }
- div.slidepanel
- {
- height:75px;
- display:none;
- }
-</style>
-<?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, `username` ASC");
- $admins = $db->fetch($result);
-
- $num = 1;
- OpenTable("300px");
- echo "<tr><th></th><th style=\"text-align:left;\">Username</th><th style=\"text-align:left;\">Level</th></tr>";
- foreach($admins as $admin)
- {
- if($admin['level'] != $level){
- $level = $admin['level'];
- echo "<tr><td colspan=\"3\"><hr /></td></tr>";
- }
- 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()
- {
-
- global $db;
- $maxLevel = $_SESSION['level'];
-
- if(isset($_POST['processed'])){
-
- $username = addslashes($_POST['username']);
- $email = addslashes($_POST['email']);
- $first = addslashes($_POST['first']);
- $last = addslashes($_POST['last']);
-
- $level = $_POST['level'];
- $all = $_POST['all'];
- $squadleader = $_POST['squadleader'];
- $adjutant = $_POST['adjutant'];
- $quartermaster = $_POST['quartermaster'];
-
- $level = (int)$level;
- $all = (int)$all;
- $squadleader = (int)$squadleader;
- $adjutant = (int)$adjutant;
- $quartermaster = (int)$quartermaster;
-
- $password = GeneratePassword(8);
- $cryptpassword = crypt(md5($password),'iamnotadirtywhorebitch');
-
- if(empty($username))
- {
- ReportError("This user must have a username to continue.");
- return;
- }
-
- $result = $db->Query("SELECT `level` FROM `bayonet_users` WHERE `username` = '$username' OR `email` = '$email'");
- if($db->Rows($result) > 0){
- ReportError("The email and or username you entered is already in use.");
- return;
- }
-
-
- $Name = "Rocky the Marne Dog";
- $subject = "3rd ID Admin Password";
- $header = "From: ". $Name . " < DO NOT RESPOND >\r\n"; //optional headerfields
- $mail_body = "Do not respond to this email.\n\n------------------------------\nUsername: ".$username."\nPassword: ".$password."\n------------------------------\n\nTo login click on this link. http://testbed.3rd-infantry-division.org/cms/admin/ \n\nIt is recommended that you change your password once you login. To do so, click on Account Settings>Change Password.";
-
- $sent = mail($email, $subject, $mail_body, $header);
- if(!$sent){
- ReportError("Error validating email. This user was not saved.");
- return;
- }
-
- $db->Query("INSERT INTO `bayonet_users` (`user_id` ,`username` ,`password` ,`lastname` ,`firstname` ,`email` ,`joined` ,`level` ,`all` ,`squadleader` ,`adjutant` ,`quartermaster`) VALUES (NULL, '$username', '$cryptpassword', '$last', '$first', '$email', CURRENT_TIMESTAMP, $level, $all, $squadleader, $adjutant, $quartermaster)");
-
- echo "Admin, '$username' level '$level' has been added. An email has been sent to him with his username and password.\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(2, "?op=admins");
- return;
- }
-?>
-<div style="text-align:right"><img src="images/cancel.png" />Cancel</div>
-<center>
- <form method="POST" action="<?php $_SERVER['PHP_SELF']?>">
- <table>
- <tr><th>Username:</th><td><input type="text" value="" name="username" />*</td></tr>
- <tr><th>First Name:</th><td><input type="text" value="" name="first" /></td></tr>
- <tr><th>Last Name:</th><td><input type="text" value="" name="last" /></td></tr>
- <tr><th>Email Address:</th><td><input type="text" value="" name="email" />*</td></tr>
- <tr>
- <th>Level:</th>
- <td>
- <select name="level">
- <?php
- for($x=$maxLevel; $x>0;$x--){
- echo "<option value=\"{$x}\">{$x}</option>";
- }
- ?>
- </select>
- </td>
- </tr>
- <tr>
- <td colspan="2" style="text-align:center;">
- <input type="submit" name="processed" value="Submit" />
- </td>
- </tr>
- </table>
- <br />
- <?php GetPermissions(); ?>
- </form>
-</center>
-<?php
- }
-
- function GetPermissions($user = NULL)
- {
- ?>
- <div class="slidepanel">
- <table width="100%" style="text-align:center;">
- <tr><th>Everything else</th><th>Squad Leader</th><th>Adjutant</th><th>Quartermaster</th></tr>
- <tr>
- <td width="25%">
- <input type="hidden" name="all" value="0" />
- <?php
- if(isset($user['all']) && $user['all'] == 1)
- echo "<input type=\"checkbox\" name=\"all\" value=\"1\" checked/>";
- else
- echo "<input type=\"checkbox\" name=\"all\" value=\"1\" />";
- ?>
- </td>
- <td width="25%">
- <input type="hidden" name="squadleader" value="0" />
- <?php
- if(isset($user['squadleader']) && $user['squadleader'] == 1)
- echo "<input type=\"checkbox\" name=\"squadleader\" value=\"1\" checked/>";
- else
- echo "<input type=\"checkbox\" name=\"squadleader\" value=\"1\" />";
- ?>
- </td>
- <td width="25%">
- <input type="hidden" name="adjutant" value="0" />
- <?php
- if(isset($user['adjutant']) && $user['adjutant'] == 1)
- echo "<input type=\"checkbox\" name=\"adjutant\" value=\"1\" checked/>";
- else
- echo "<input type=\"checkbox\" name=\"adjutant\" value=\"1\" />";
- ?>
- </td>
- <td width="25%">
- <input type="hidden" name="quartermaster" value="0" />
- <?php
- if(isset($user['quartermaster']) && $user['quartermaster'] == 1)
- echo "<input type=\"checkbox\" name=\"quartermaster\" value=\"1\" checked/>";
- else
- echo "<input type=\"checkbox\" name=\"quartermaster\" value=\"1\" />";
- ?>
- </td>
- </tr>
- </table>
- </div>
-
- <p class="flip">Show/Hide Permissions</p>
- <?php
- }
-
- function GeneratePassword($length)
- {
- srand(date("s"));
- $possible_charactors = "abcdefghijklmnopqrstuvwxyz1234567890ABCDEFGHIJKLMNOPQRSTUVWXYZ";
- $string = "";
- while(strlen($string)<$length) {
- $string .= substr($possible_charactors, rand()%(strlen($possible_charactors)),1);
- }
- return($string);
- }
-
- function EditAdmin($user_id)
- {
- global $db;
- $maxLevel = $_SESSION['level'];
-
- if(isset($_POST['processed']))
- {
- $username = addslashes($_POST['username']);
- $level = addslashes($_POST['level']);
-
- $all = $_POST['all'];
- $squadleader = $_POST['squadleader'];
- $adjutant = $_POST['adjutant'];
- $quartermaster = $_POST['quartermaster'];
-
- if(empty($username))
- {
- echo "You must fill everything out before proceeding.";
- return;
- }
-
- $db->Query("UPDATE `bayonet_users` SET `username` = '$username', `level` = '$level', `all` = '$all', `squadleader` = '$squadleader', `adjutant` = '$adjutant', `quartermaster` = '$quartermaster' 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(2, "?op=admins&edit={$user_id}");
- return;
- }
-
- $result = $db->Query("SELECT * FROM `bayonet_users` WHERE `user_id` = '$user_id' LIMIT 1");
- $admin = $db->FetchRow($result);
-
- 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>
- <br />
- <?php GetPermissions($admin); ?>
- </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(1,"?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> <button name="cancel">No</button></th></tr>
- </table>
- </form>
- </center>
- <?php
- }
+<script type="text/javascript"> + $(document).ready(function(){ + $(".flip").click(function(){ + $(".slidepanel").slideToggle("slow"); + }); + }); +</script> + +<style type="text/css"> + p.flip + { + margin:0px; + padding:5px; + text-align:center; + background: #5b8dda; + border:solid 1px #848484; + color:white; + } + div.slidepanel + { + height:75px; + display:none; + } +</style> +<?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, `username` ASC"); + $admins = $db->fetch($result); + + $num = 1; + OpenTable("300px"); + echo "<tr><th></th><th style=\"text-align:left;\">Username</th><th style=\"text-align:left;\">Level</th></tr>"; + foreach($admins as $admin) + { + if($admin['level'] != $level){ + $level = $admin['level']; + echo "<tr><td colspan=\"3\"><hr /></td></tr>"; + } + 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() + { + + global $db; + $maxLevel = $_SESSION['level']; + + if(isset($_POST['processed'])){ + + $username = addslashes($_POST['username']); + $email = addslashes($_POST['email']); + $first = addslashes($_POST['first']); + $last = addslashes($_POST['last']); + + $level = $_POST['level']; + $all = $_POST['all']; + $squadleader = $_POST['squadleader']; + $adjutant = $_POST['adjutant']; + $quartermaster = $_POST['quartermaster']; + + $level = (int)$level; + $all = (int)$all; + $squadleader = (int)$squadleader; + $adjutant = (int)$adjutant; + $quartermaster = (int)$quartermaster; + + $password = GeneratePassword(8); + $cryptpassword = crypt(md5($password),'iamnotadirtywhorebitch'); + + if(empty($username)) + { + ReportError("This user must have a username to continue."); + return; + } + + $result = $db->Query("SELECT `level` FROM `bayonet_users` WHERE `username` = '$username' OR `email` = '$email'"); + if($db->Rows($result) > 0){ + ReportError("The email and or username you entered is already in use."); + return; + } + + + $Name = "Rocky the Marne Dog"; + $subject = "3rd ID Admin Password"; + $header = "From: ". $Name . " < DO NOT RESPOND >\r\n"; //optional headerfields + $mail_body = "Do not respond to this email.\n\n------------------------------\nUsername: ".$username."\nPassword: ".$password."\n------------------------------\n\nTo login click on this link. http://testbed.3rd-infantry-division.org/cms/admin/ \n\nIt is recommended that you change your password once you login. To do so, click on Account Settings>Change Password."; + + $sent = mail($email, $subject, $mail_body, $header); + if(!$sent){ + ReportError("Error validating email. This user was not saved."); + return; + } + + $db->Query("INSERT INTO `bayonet_users` (`user_id` ,`username` ,`password` ,`lastname` ,`firstname` ,`email` ,`joined` ,`level` ,`all` ,`squadleader` ,`adjutant` ,`quartermaster`) VALUES (NULL, '$username', '$cryptpassword', '$last', '$first', '$email', CURRENT_TIMESTAMP, $level, $all, $squadleader, $adjutant, $quartermaster)"); + + echo "Admin, '$username' level '$level' has been added. An email has been sent to him with his username and password.\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(2, "?op=admins"); + return; + } +?> +<div style="text-align:right"><img src="images/cancel.png" />Cancel</div> +<center> + <form method="POST" action="<?php $_SERVER['PHP_SELF']?>"> + <table> + <tr><th>Username:</th><td><input type="text" value="" name="username" />*</td></tr> + <tr><th>First Name:</th><td><input type="text" value="" name="first" /></td></tr> + <tr><th>Last Name:</th><td><input type="text" value="" name="last" /></td></tr> + <tr><th>Email Address:</th><td><input type="text" value="" name="email" />*</td></tr> + <tr> + <th>Level:</th> + <td> + <select name="level"> + <?php + for($x=$maxLevel; $x>0;$x--){ + echo "<option value=\"{$x}\">{$x}</option>"; + } + ?> + </select> + </td> + </tr> + <tr> + <td colspan="2" style="text-align:center;"> + <input type="submit" name="processed" value="Submit" /> + </td> + </tr> + </table> + <br /> + <?php GetPermissions(); ?> + </form> +</center> +<?php + } + + function GetPermissions($user = NULL) + { + ?> + <div class="slidepanel"> + <table width="100%" style="text-align:center;"> + <tr><th>Everything else</th><th>Squad Leader</th><th>Adjutant</th><th>Quartermaster</th></tr> + <tr> + <td width="25%"> + <input type="hidden" name="all" value="0" /> + <?php + if(isset($user['all']) && $user['all'] == 1) + echo "<input type=\"checkbox\" name=\"all\" value=\"1\" checked/>"; + else + echo "<input type=\"checkbox\" name=\"all\" value=\"1\" />"; + ?> + </td> + <td width="25%"> + <input type="hidden" name="squadleader" value="0" /> + <?php + if(isset($user['squadleader']) && $user['squadleader'] == 1) + echo "<input type=\"checkbox\" name=\"squadleader\" value=\"1\" checked/>"; + else + echo "<input type=\"checkbox\" name=\"squadleader\" value=\"1\" />"; + ?> + </td> + <td width="25%"> + <input type="hidden" name="adjutant" value="0" /> + <?php + if(isset($user['adjutant']) && $user['adjutant'] == 1) + echo "<input type=\"checkbox\" name=\"adjutant\" value=\"1\" checked/>"; + else + echo "<input type=\"checkbox\" name=\"adjutant\" value=\"1\" />"; + ?> + </td> + <td width="25%"> + <input type="hidden" name="quartermaster" value="0" /> + <?php + if(isset($user['quartermaster']) && $user['quartermaster'] == 1) + echo "<input type=\"checkbox\" name=\"quartermaster\" value=\"1\" checked/>"; + else + echo "<input type=\"checkbox\" name=\"quartermaster\" value=\"1\" />"; + ?> + </td> + </tr> + </table> + </div> + + <p class="flip">Show/Hide Permissions</p> + <?php + } + + function GeneratePassword($length) + { + srand(date("s")); + $possible_charactors = "abcdefghijklmnopqrstuvwxyz1234567890ABCDEFGHIJKLMNOPQRSTUVWXYZ"; + $string = ""; + while(strlen($string)<$length) { + $string .= substr($possible_charactors, rand()%(strlen($possible_charactors)),1); + } + return($string); + } + + function EditAdmin($user_id) + { + global $db; + $maxLevel = $_SESSION['level']; + + if(isset($_POST['processed'])) + { + $username = addslashes($_POST['username']); + $level = addslashes($_POST['level']); + + $all = $_POST['all']; + $squadleader = $_POST['squadleader']; + $adjutant = $_POST['adjutant']; + $quartermaster = $_POST['quartermaster']; + + if(empty($username)) + { + echo "You must fill everything out before proceeding."; + return; + } + + $db->Query("UPDATE `bayonet_users` SET `username` = '$username', `level` = '$level', `all` = '$all', `squadleader` = '$squadleader', `adjutant` = '$adjutant', `quartermaster` = '$quartermaster' 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(2, "?op=admins&edit={$user_id}"); + return; + } + + $result = $db->Query("SELECT * FROM `bayonet_users` WHERE `user_id` = '$user_id' LIMIT 1"); + $admin = $db->FetchRow($result); + + 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> + <br /> + <?php GetPermissions($admin); ?> + </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(1,"?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> <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 index 1223d3a..a2e71e9 100644 --- a/admin/admins/index.php +++ b/admin/admins/index.php @@ -1,54 +1,54 @@ -<?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';
-?>
-
-<table class="panel" width="100%" cellspacing="0">
- <tr>
- <td class="panel-none">
- <table align="center" width="200px">
- <tr><th><?php echo LinkInternal('<img src="images/add.png" />Add New Admin','?op=admins&create=true'); ?></th></tr>
- </table>
- <?php ListAdmins(); ?>
- </td>
- <td class="panel-box">
-<?php
-if(isset($_GET['edit'])){
- $user_id = $_GET['edit'];
- EditAdmin($user_id);
-}
-else if(isset($_GET['delete'])){
- $user_id = $_GET['delete'];
- DeleteAdmin($user_id);
-}
-else if(isset($_GET['create'])){
- NewAdmin();
-}
-?>
- </td>
- </tr>
-</table>
+<?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'; +?> + +<table class="panel" width="100%" cellspacing="0"> + <tr> + <td class="panel-none"> + <table align="center" width="200px"> + <tr><th><?php echo LinkInternal('<img src="images/add.png" />Add New Admin','?op=admins&create=true'); ?></th></tr> + </table> + <?php ListAdmins(); ?> + </td> + <td class="panel-box"> +<?php +if(isset($_GET['edit'])){ + $user_id = $_GET['edit']; + EditAdmin($user_id); +} +else if(isset($_GET['delete'])){ + $user_id = $_GET['delete']; + DeleteAdmin($user_id); +} +else if(isset($_GET['create'])){ + NewAdmin(); +} +?> + </td> + </tr> +</table> diff --git a/admin/announcements/functions.php b/admin/announcements/functions.php index f45a7e3..b089cf3 100644 --- a/admin/announcements/functions.php +++ b/admin/announcements/functions.php @@ -1,67 +1,67 @@ -<?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['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_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
- PageRedirect(2, "?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");
- $announcement = $db->FetchRow($result);
-
- ?>
- <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="processed" value="Submit Changes" /> </td></tr>
- </table>
- </form>
- <?php
-}
+<?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['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_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 + PageRedirect(2, "?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"); + $announcement = $db->FetchRow($result); + + ?> + <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="processed" 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 index 6b0874e..14d7710 100644 --- a/admin/announcements/index.php +++ b/admin/announcements/index.php @@ -1,34 +1,34 @@ -<?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>- Edit Announcements</h2></div>
-
- <?php
-
-if(!defined("ADMIN_FILE"))
-{
- die("Access denied.");
-}
-
-include $basedir.'announcements/functions.php';
-?>
-<table class="panel" width="100%">
- <tr><td><?php EditAnnouncements(); ?></td></tr>
+<?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>- Edit Announcements</h2></div> + + <?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/calendar/index.php b/admin/calendar/index.php index 2b631d8..097622f 100644 --- a/admin/calendar/index.php +++ b/admin/calendar/index.php @@ -1,90 +1,90 @@ -<?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/>.
- */
- ?>
- <link rel="stylesheet" type="text/css" href="calendar/style.css" media="screen"/>
- <div style="text-align:left;"><h2>- Manage Calendar & Events</h2></div>
-<?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.png" /> 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>
-
+<?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/>. + */ + ?> + <link rel="stylesheet" type="text/css" href="calendar/style.css" media="screen"/> + <div style="text-align:left;"><h2>- Manage Calendar & Events</h2></div> +<?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.png" /> 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/calendar/style.css b/admin/calendar/style.css new file mode 100644 index 0000000..167b75f --- /dev/null +++ b/admin/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/admin/functions.php b/admin/functions.php index 9b950c4..5c018a0 100644 --- a/admin/functions.php +++ b/admin/functions.php @@ -1,563 +1,563 @@ -<?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("<", "<", $Text);
- $Text = str_replace(">", ">", $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&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");
- $blocks = $db->Fetch($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}\">";
-}
+<?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("<", "<", $Text); + $Text = str_replace(">", ">", $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&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"); + $blocks = $db->Fetch($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 index 61c19fa..7ecc702 100644 --- a/admin/header.php +++ b/admin/header.php @@ -1,81 +1,81 @@ -<?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"/>
-
-<!-- jQuery 1.3.2 -->
-<script type="text/javascript" src="scripts/jquery-1.3.2.min.js"></script>
-<!-- PASSWORD CHECK
-<script type="text/javascript" src="../functions.js"></script> -->
-
-<!-- markItUp! -->
-<script type="text/javascript" src="scripts/markitup/markitup/jquery.markitup.pack.js"></script>
-<!-- markItUp! toolbar settings -->
-<script type="text/javascript" src="scripts/markitup/markitup/sets/bbcode/set.js"></script>
-<!-- markItUp! skin -->
-<link rel="stylesheet" type="text/css" href="scripts/markitup/markitup/skins/markitup/style.css" />
-<!-- markItUp! toolbar skin -->
-<link rel="stylesheet" type="text/css" href="scripts/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>
-
+<?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"/> + +<!-- jQuery 1.3.2 --> +<script type="text/javascript" src="scripts/jquery-1.3.2.min.js"></script> +<!-- PASSWORD CHECK +<script type="text/javascript" src="../functions.js"></script> --> + +<!-- markItUp! --> +<script type="text/javascript" src="scripts/markitup/markitup/jquery.markitup.pack.js"></script> +<!-- markItUp! toolbar settings --> +<script type="text/javascript" src="scripts/markitup/markitup/sets/bbcode/set.js"></script> +<!-- markItUp! skin --> +<link rel="stylesheet" type="text/css" href="scripts/markitup/markitup/skins/markitup/style.css" /> +<!-- markItUp! toolbar skin --> +<link rel="stylesheet" type="text/css" href="scripts/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/tree_blank.gif b/admin/images/tree_blank.gif Binary files differnew file mode 100644 index 0000000..a2a96d6 --- /dev/null +++ b/admin/images/tree_blank.gif diff --git a/admin/images/tree_branch.gif b/admin/images/tree_branch.gif Binary files differnew file mode 100644 index 0000000..5e13681 --- /dev/null +++ b/admin/images/tree_branch.gif diff --git a/admin/images/tree_leaf.gif b/admin/images/tree_leaf.gif Binary files differnew file mode 100644 index 0000000..94ef67a --- /dev/null +++ b/admin/images/tree_leaf.gif diff --git a/admin/index.php b/admin/index.php index da8e92d..c1209e5 100644 --- a/admin/index.php +++ b/admin/index.php @@ -55,6 +55,23 @@ include 'header.php'; //this is so dirty... sigh. if(is_loggedin()) { + + //GET ADMIN USER INFO - DEFINE IMPORTANT INFO + $username = $_SESSION['username']; + $result = $db->Query("SELECT user_id, level FROM bayonet_users WHERE username = '$username' LIMIT 1"); + $row = $db->FetchRow($result); + define("ADMIN_USERNAME", $username); + define("ADMIN_ID", $row['user_id']); + define("ADMIN_LEVEL", $row['level']); + + + if(isset($_GET['op'])){ + ?> + <script type="text/javascript"> + window.location = window.location+"#operation"; + </script> + <?php + } ?> <center> @@ -65,7 +82,7 @@ include 'header.php'; <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> | - <a href="?op=logout">Logout, <?php echo $_SESSION['username']; ?></a> + <a href="?op=logout">Logout, <?php echo ADMIN_USERNAME; ?></a> </td> </tr> </table> @@ -109,6 +126,7 @@ include 'header.php'; </fieldset> <br /> +<a name="operation"></a> <div style="text-align:center"><?php include 'operation.php' ?></div> </div> diff --git a/admin/modules/functions.php b/admin/modules/functions.php index 3c44b5a..1d8d917 100644 --- a/admin/modules/functions.php +++ b/admin/modules/functions.php @@ -1,171 +1,42 @@ -<?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 ListModules()
-{
- global $db;
- $result = $db->Query("SELECT * FROM `bayonet_blocks` ORDER BY `active` DESC, `weight` ASC, `position`");
- $blocks = $db->fetch($result);
-
- 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 NewModule()
-{
- 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($module_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 EditModule($module_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']);
- $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("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'");
- $block = $db->Fetch($result)
-
- ?>
- <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 DeleteModule($module_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> <button name="cancel">No</button></th></tr>
- </table>
- </form>
- <?php
-}
-
+<?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 ListModules(){ + + global $db; + $result = $db->Query("SELECT dir_name, weight, status FROM bayonet_modules ORDER BY status DESC, weight ASC"); + $modules = $db->Fetch($result); + + OpenTable("50%"); + echo "<tr><th>Directory Name</th><th>Weight</th><th>Status</th></tr>"; + foreach($modules as $module){ + echo "<tr><td>".$module['dir_name']."</td><td>".$module['weight']."</td><td>".$module['status']."</td></tr>"; + } + CloseTable(); +} + +function EditModule($module_id){ + +} + +function DeleteModule($module_id){ + +} + ?>
\ No newline at end of file diff --git a/admin/modules/index.php b/admin/modules/index.php index 94e2814..28382eb 100644 --- a/admin/modules/index.php +++ b/admin/modules/index.php @@ -1,59 +1,61 @@ -<?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 modules.
- *
- * -weight
- * -directory name
- */
-
-if(!defined("ADMIN_FILE"))
-{
- die("Access denied.");
-}
-
-echo "Do a database for the index modules, thats all this really is anyway.<br />";
-include $basedir.'modules/functions.php';
-
-if(isset($_GET['edit']))
-{
- $module_id = $_GET['edit'];
- EditModule($module_id);
- return;
-}
-
-if(isset($_GET['delete']))
-{
- $module_id = $_GET['delete'];
- DeleteModule($module_id);
- return;
-}
-
-if(isset($_GET['create']))
-{
- NewModule();
- return;
-}
-
-//echo "<table align=\"center\" width=\"200px\"><tr><th>".LinkInternal('Create a Module','?load=admin&op=modules&create=true')."</th></tr></table>";
-
-//ListModules();
-
+<?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 modules. + * + * -weight + * -directory name + */ + + ?> + <div style="text-align:left;"><h2>- Manage Modules</h2></div> + <?php + +if(!defined("ADMIN_FILE")) +{ + die("Access denied."); +} + +echo "Do a database for the index modules, thats all this really is anyway.<br />"; +include $basedir.'modules/functions.php'; + +if(isset($_GET['edit'])){ + $module_id = $_GET['edit']; + EditModule($module_id); + return; + +}else if(isset($_GET['delete'])){ + $module_id = $_GET['delete']; + DeleteModule($module_id); + return; + +}else if(isset($_GET['create'])){ + NewModule(); + return; + +}else{ + ListModules(); +} + +//echo "<table align=\"center\" width=\"200px\"><tr><th>".LinkInternal('Create a Module','?load=admin&op=modules&create=true')."</th></tr></table>"; + +//ListModules(); + ?>
\ No newline at end of file diff --git a/admin/navigation/functions.php b/admin/navigation/functions.php index 68ab7c3..da8a8e4 100644 --- a/admin/navigation/functions.php +++ b/admin/navigation/functions.php @@ -1,91 +1,91 @@ -<style>
-
-ul {
- margin: 0;
-}
-
-#contentLeft {
- width: 400px;
-}
-
-#contentLeft li {
- list-style: none;
- margin: 0 0 4px 0;
- padding: 10px;
- background-color:#a1a1a1;
- border: #CCCCCC solid 1px;
- color:#fff;
- text-align:center;
- cursor:move;
-}
-
-</style>
-<script type="text/javascript" src="scripts/jquery-ui-1.7.1.custom.min.js"></script>
-<script type="text/javascript">
-$(document).ready(function(){
-
- $(function() {
- $("#contentLeft ul").sortable({ opacity: 0.6, cursor: 'move', update: function() {
- var order = $(this).sortable("serialize") + '&action=updateOrder';
- $.post("navigation/updateDB.php", order, function(theResponse){
- $("#updateStatus").html(theResponse);
- });
- }
- });
- });
-
-});
-</script>
-<?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`");
- $data = $db->Fetch($result);
-
- ?>
- <div id="contentLeft">
- <table>
- <tr>
- <th>News Reel Order</th>
- <td id="updateStatus"></td>
- </tr>
- </table>
- <ul>
- <?php
-
- foreach($data as $nav){
-
- echo "<li id=\"recordsArray_{$nav['nav_id']}\">{$nav['title']}</li>";
- }
- ?>
- </ul>
- Click and drag on a slide to change the order. Wait for confirmation indicating the changes have been saved.
- </div>
- <?php
-
-}
+<style> + +ul { + margin: 0; +} + +#contentLeft { + width: 400px; +} + +#contentLeft li { + list-style: none; + margin: 0 0 4px 0; + padding: 10px; + background-color:#a1a1a1; + border: #CCCCCC solid 1px; + color:#fff; + text-align:center; + cursor:move; +} + +</style> +<script type="text/javascript" src="scripts/jquery-ui-1.7.1.custom.min.js"></script> +<script type="text/javascript"> +$(document).ready(function(){ + + $(function() { + $("#contentLeft ul").sortable({ opacity: 0.6, cursor: 'move', update: function() { + var order = $(this).sortable("serialize") + '&action=updateOrder'; + $.post("navigation/updateDB.php", order, function(theResponse){ + $("#updateStatus").html(theResponse); + }); + } + }); + }); + +}); +</script> +<?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`"); + $data = $db->Fetch($result); + + ?> + <div id="contentLeft"> + <table> + <tr> + <th>News Reel Order</th> + <td id="updateStatus"></td> + </tr> + </table> + <ul> + <?php + + foreach($data as $nav){ + + echo "<li id=\"recordsArray_{$nav['nav_id']}\">{$nav['title']}</li>"; + } + ?> + </ul> + Click and drag on a slide to change the order. Wait for confirmation indicating the changes have been saved. + </div> + <?php + +} ?>
\ No newline at end of file diff --git a/admin/navigation/index.php b/admin/navigation/index.php index e2179a1..fff3196 100644 --- a/admin/navigation/index.php +++ b/admin/navigation/index.php @@ -1,54 +1,54 @@ -<?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>- 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();
+<?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>- 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 index 6feabcf..9645311 100644 --- a/admin/news/functions.php +++ b/admin/news/functions.php @@ -21,24 +21,20 @@ function ListNews(){ global $db; - $result = $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 ". + $result = $db->Query("SELECT n.news_id, n.title, 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 ORDER BY `date` DESC"); + "LEFT OUTER JOIN `bayonet_users` AS u ON u.user_id = n.author_id ORDER BY `date` DESC"); $row = $db->Fetch($result); foreach($row as $news) { - $newsBody = $news['message']; - echo "<a href=\"?op=news&edit={$news['news_id']}\">"; - echo "<span class=\"bold\">{$news['title']}</span> | <span class=\"blue\">{$news['catname']}</span> <img src=\"images/page.png\" /></a><br />"; - if(($len = strlen($newsBody))>150) - echo substr($newsBody, 0, 150)."..."; - else - echo $newsBody; - echo '<br />'; - echo "Posted By: {$news['author']} on ".date('D M j, Y g:i a T', strtotime($news['date'])); - echo '<br /><br />'; +?> + <a href="?op=news&edit=<?php echo $news['news_id']; ?>"> + <span class="bold"><?php echo $news['title']; ?></span> | <span class="blue"><?php echo $news['catname']; ?></span> <img src="images/page.png" /></a><br /> + Posted By: <?php echo $news['author']; ?> on <?php echo date('n/j/Y @ g:ia T', strtotime($news['date'])); ?> + <br /><br /> +<?php } } @@ -49,26 +45,90 @@ function EditNews($news_id){ if(isset($_POST['processed'])){ + $title = $_POST['title']; + //$datetime = $_POST['year']."-".$_POST['month']."-".$_POST['day']." ".$_POST['time']; + date_default_timezone_set('America/New_York'); + $datetime = date('Y-m-d H:i:s'); + $text = $_POST['text']; + $author_id = $_POST['author']; + $edited_id = ADMIN_ID; + //$category_id = 1; + $text = addslashes($text); + + $db->Query("UPDATE `bayonet_news` SET `title` = '$title', `message` = '$text', `author_id` = '$author_id', `edited` = '$datetime', `edited_id` = '$edited_id' WHERE `news_id` = '$news_id'"); + decho("UPDATE `bayonet_news` SET `title` = '$title', `message` = '$text', `author_id` = '$author_id', `edited` = '$datetime', `edited_id` = '$edited_id' WHERE `news_id` = '$news_id'"); + PageRedirect(1, "?op=news"); return; } - $result = $db->Query("SELECT `author_id`, `title`, `message`, `date`, `category_id` FROM `bayonet_news` WHERE `news_id` = '$news_id' LIMIT 1"); + $result = $db->Query("SELECT `author_id`, `title`, `message`, `date`, `category_id`, `edited`, `edited_id` FROM `bayonet_news` WHERE `news_id` = '$news_id' LIMIT 1"); $row = $db->FetchRow($result); - ?> +?> +<style type="text/css"> +input { + height: 35px; + width: 300px; + font-size: 18px; + } +</style> <h3>Edit News</h3> - <form action="<?php $_SERVER['PHP_SELF']?>" method="post"> + <form action="" method="post"> + Originally posted on <?php echo date('n/j/Y @ g:ia e', strtotime($row['date'])); ?> +<?php + if($row['edited'] != NULL){ + echo "<br />Last edited on ".date('n/j/Y @ g:ia e', strtotime($row['edited'])); + } +?> <table> <tr><th>Author</th><td><?php SelectAuthor($row['author_id']); ?></td></tr> <tr><th>Title</th><td><input type="text" name="title" value="<?php echo $row['title']; ?>" /></td></tr> - <tr><th>Date</th><td><?php SelectDate($row['date']); ?></td></tr> - <tr><th>Time</th><td><input type="text" name="time" value="<?php echo date('G:i', strtotime($row['date'])); ?>" maxlength="5" size="5" /></td></tr> <tr><th>Text</th><td><textarea id="markItUp" rows="30" cols="80" name="text"><?php echo $row['message']; ?></textarea></td> <tr><th colspan="2"><input type="submit" name="processed" value="Submit" /></th></tr> </table> </form> - <?php +<?php +} + +function CreateNews(){ + + global $db; + + if(isset($_POST['processed'])){ + + $title = $_POST['title']; + //$datetime = $_POST['year']."-".$_POST['month']."-".$_POST['day']." ".$_POST['time']; + date_default_timezone_set('America/New_York'); + $datetime = date('Y-m-d H:i:s'); + $text = $_POST['text']; + $author_id = ADMIN_ID; + $category_id = 1; + $text = addslashes($text); + + $db->Query("INSERT INTO `bayonet_news` SET `title` = '$title', `message` = '$text', `author_id` = '$author_id', `date` = '$datetime', `category_id` = '$category_id'"); + + decho("INSERT INTO `bayonet_news` SET `title` = '$title', `message` = '$text', `author_id` = '$author_id', `date` = '$datetime', `category_id` = '$category_id'"); + PageRedirect(1, "?op=news"); + return; + } +?> +<style type="text/css"> +input { + height: 35px; + width: 300px; + font-size: 18px; + } +</style> + <h3>Post News</h3> + <form action="" method="post"> + <table> + <tr><td> <input type="text" name="title" value="" /></td></tr> + <tr><td><textarea id="markItUp" rows="30" cols="80" name="text"></textarea></td> + <tr><th colspan="2"><input type="submit" name="processed" value="Post" /></th></tr> + </table> + </form> +<?php } /** diff --git a/admin/news/index.php b/admin/news/index.php index ec78089..6cd8d30 100644 --- a/admin/news/index.php +++ b/admin/news/index.php @@ -39,6 +39,8 @@ if(isset($_GET['edit'])){ } else{ ListNews(); + echo "</td><td class=\"panel-shadow\">"; + CreateNews(); } diff --git a/admin/newsreel/functions.php b/admin/newsreel/functions.php index 6bde17c..f8cb759 100644 --- a/admin/newsreel/functions.php +++ b/admin/newsreel/functions.php @@ -1,160 +1,160 @@ -<style>
-
-ul {
- margin: 0;
-}
-
-#contentLeft {
- width: 400px;
-}
-
-#contentLeft li {
- list-style: none;
- margin: 0 0 4px 0;
- padding: 10px;
- background-color:#a1a1a1;
- border: #CCCCCC solid 1px;
- color:#fff;
- text-align:center;
- cursor:move;
-}
-
-</style>
-<script type="text/javascript" src="scripts/jquery-ui-1.7.1.custom.min.js"></script>
-<script type="text/javascript">
-$(document).ready(function(){
-
- $(function() {
-
- $("#contentLeft ul").sortable({ opacity: 0.6, cursor: 'move', update: function() {
- var order = $(this).sortable("serialize") + '&action=updateReelOrder';
- $.post("newsreel/updateDB.php", order, function(theResponse){
- $("#updateStatus").html(theResponse);
- });
- }
- });
- });
-
-});
-</script>
-<?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/>.
- */
-
- define(MAX_SLIDES, 6);
-
- function EditOrder(){
-
- global $db;
- ?>
- <div id="contentLeft">
- <table>
- <tr>
- <th>News Reel Order</th>
- <td id="updateStatus"></td>
- </tr>
- </table>
- <ul>
- <?php
- $result = $db->Query("SELECT `title`, `slide_id`, `src` FROM `bayonet_newsreel` WHERE `visible` = 1 ORDER BY `weight` ASC");
- $row = $db->Fetch($result);
-
- foreach($row as $slide){
- echo "<li id=\"recordsArray_{$slide['slide_id']}\">";
- PrintSlide($slide);
- echo "<br /><a href=\"?op=newsreel&disable={$slide['slide_id']}\"><input type=\"button\" value=\"Disable\" /></a></li>";
- }
-?>
- </ul>
- Click and drag on a slide to change the order. Wait for confirmation indicating the changes have been saved.
- </div>
-<?php
- }
-
- function EnableSlide($slide_id){
-
- global $db;
- $lastspot = GetLastPosition();
- if($lastspot >= MAX_SLIDES){
- ReportError("There are already 6 active slides. You must disable one in order to enable another.");
- PageRedirect(3,"?op=newsreel");
- return;
- }
- $weight = $lastspot+1;
- $db->Query("UPDATE `bayonet_newsreel` SET `visible` = 1, `weight` = '$weight' WHERE `slide_id` = '$slide_id' LIMIT 1");
- PageRedirect(0,"?op=newsreel");
- }
-
- function DisableSlide($slide_id){
-
- global $db;
- $result = $db->Query("SELECT `weight` FROM `bayonet_newsreel` WHERE `slide_id` = '$slide_id' LIMIT 1");
- $slide = $db->FetchRow($result);
-
- $oldWeight = $slide['weight'];
-
- if($oldWeight < MAX_SLIDES){
- $total = getNumOfActive();
- for($i=$oldWeight+1; $i<=$total; $i++){
- //echo "Change Weight:".$i." to ".($i-1)."<br />";
- $new = $i-1;
- $db->Query("UPDATE `bayonet_newsreel` SET `weight` = '$new' WHERE `weight` = '$i' LIMIT 1");
- }
- }
-
- $db->Query("UPDATE `bayonet_newsreel` SET `visible` = 0, `weight` = 0 WHERE `slide_id` = '$slide_id' LIMIT 1");
- PageRedirect(0,"?op=newsreel");
- }
-
- function ListInactive(){
-
- global $db;
- echo "<h3>Disabled Slides</h3>";
- $result = $db->Query("SELECT `slide_id`, `title`, `src` FROM `bayonet_newsreel` WHERE `visible` = 0 ORDER BY `slide_id` DESC");
- $row = $db->Fetch($result);
-
- foreach($row as $slide){
- echo PrintSlide($slide);
- echo "<br /><a href=\"?op=newsreel&enable={$slide['slide_id']}\"><input type=\"button\" value=\"Enable\" /></a><br /><br />";
- }
- }
-
- function PrintSlide($slide){
- echo "{$slide['title']}";
- if(file_exists("../modules/newsreel/slides/{$slide['src']}") && $slide['src'] != ""){
- echo "<br /><img src=\"../modules/newsreel/slides/{$slide['src']}\" width=\"100px\" />";
- }
- }
-
- function GetLastPosition(){
-
- global $db;
- $result = $db->Query("SELECT `weight` FROM `bayonet_newsreel` WHERE `visible` = 1 ORDER BY `weight` DESC LIMIT 1");
- $row = $db->FetchRow($result);
-
- return $row['weight'];
- }
-
- function getNumOfActive(){
- global $db;
- $result = $db->Query("SELECT `slide_id` FROM `bayonet_newsreel` WHERE `visible` = 1");
- return $db->Rows($result);
- }
-
-
+<style> + +ul { + margin: 0; +} + +#contentLeft { + width: 400px; +} + +#contentLeft li { + list-style: none; + margin: 0 0 4px 0; + padding: 10px; + background-color:#a1a1a1; + border: #CCCCCC solid 1px; + color:#fff; + text-align:center; + cursor:move; +} + +</style> +<script type="text/javascript" src="scripts/jquery-ui-1.7.1.custom.min.js"></script> +<script type="text/javascript"> +$(document).ready(function(){ + + $(function() { + + $("#contentLeft ul").sortable({ opacity: 0.6, cursor: 'move', update: function() { + var order = $(this).sortable("serialize") + '&action=updateReelOrder'; + $.post("newsreel/updateDB.php", order, function(theResponse){ + $("#updateStatus").html(theResponse); + }); + } + }); + }); + +}); +</script> +<?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/>. + */ + + define(MAX_SLIDES, 6); + + function EditOrder(){ + + global $db; + ?> + <div id="contentLeft"> + <table> + <tr> + <th>News Reel Order</th> + <td id="updateStatus"></td> + </tr> + </table> + <ul> + <?php + $result = $db->Query("SELECT `title`, `slide_id`, `src` FROM `bayonet_newsreel` WHERE `visible` = 1 ORDER BY `weight` ASC"); + $row = $db->Fetch($result); + + foreach($row as $slide){ + echo "<li id=\"recordsArray_{$slide['slide_id']}\">"; + PrintSlide($slide); + echo "<br /><a href=\"?op=newsreel&disable={$slide['slide_id']}\"><input type=\"button\" value=\"Disable\" /></a></li>"; + } +?> + </ul> + Click and drag on a slide to change the order. Wait for confirmation indicating the changes have been saved. + </div> +<?php + } + + function EnableSlide($slide_id){ + + global $db; + $lastspot = GetLastPosition(); + if($lastspot >= MAX_SLIDES){ + ReportError("There are already 6 active slides. You must disable one in order to enable another."); + PageRedirect(3,"?op=newsreel"); + return; + } + $weight = $lastspot+1; + $db->Query("UPDATE `bayonet_newsreel` SET `visible` = 1, `weight` = '$weight' WHERE `slide_id` = '$slide_id' LIMIT 1"); + PageRedirect(0,"?op=newsreel"); + } + + function DisableSlide($slide_id){ + + global $db; + $result = $db->Query("SELECT `weight` FROM `bayonet_newsreel` WHERE `slide_id` = '$slide_id' LIMIT 1"); + $slide = $db->FetchRow($result); + + $oldWeight = $slide['weight']; + + if($oldWeight < MAX_SLIDES){ + $total = getNumOfActive(); + for($i=$oldWeight+1; $i<=$total; $i++){ + //echo "Change Weight:".$i." to ".($i-1)."<br />"; + $new = $i-1; + $db->Query("UPDATE `bayonet_newsreel` SET `weight` = '$new' WHERE `weight` = '$i' LIMIT 1"); + } + } + + $db->Query("UPDATE `bayonet_newsreel` SET `visible` = 0, `weight` = 0 WHERE `slide_id` = '$slide_id' LIMIT 1"); + PageRedirect(0,"?op=newsreel"); + } + + function ListInactive(){ + + global $db; + echo "<h3>Disabled Slides</h3>"; + $result = $db->Query("SELECT `slide_id`, `title`, `src` FROM `bayonet_newsreel` WHERE `visible` = 0 ORDER BY `slide_id` DESC"); + $row = $db->Fetch($result); + + foreach($row as $slide){ + echo PrintSlide($slide); + echo "<br /><a href=\"?op=newsreel&enable={$slide['slide_id']}\"><input type=\"button\" value=\"Enable\" /></a><br /><br />"; + } + } + + function PrintSlide($slide){ + echo "{$slide['title']}"; + if(file_exists("../modules/newsreel/slides/{$slide['src']}") && $slide['src'] != ""){ + echo "<br /><img src=\"../modules/newsreel/slides/{$slide['src']}\" width=\"100px\" />"; + } + } + + function GetLastPosition(){ + + global $db; + $result = $db->Query("SELECT `weight` FROM `bayonet_newsreel` WHERE `visible` = 1 ORDER BY `weight` DESC LIMIT 1"); + $row = $db->FetchRow($result); + + return $row['weight']; + } + + function getNumOfActive(){ + global $db; + $result = $db->Query("SELECT `slide_id` FROM `bayonet_newsreel` WHERE `visible` = 1"); + return $db->Rows($result); + } + + ?>
\ No newline at end of file diff --git a/admin/newsreel/index.php b/admin/newsreel/index.php index 0b97deb..18a239d 100644 --- a/admin/newsreel/index.php +++ b/admin/newsreel/index.php @@ -1,46 +1,46 @@ -<?php
-/**
- * Bayonet Content Management System
- * Copyright (C) 2008 Joseph Hunkeler & Evan O'Connell
- *
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation, either version 3 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program. If not, see <http://www.gnu.org/licenses/>.
- */
-
-if(!defined("ADMIN_FILE"))
-{
- die("Access denied.");
-}
-
-include $basedir.'newsreel/functions.php';
-?>
- <div style="text-align:left;"><h2>- Manage News Reel</h2></div>
- -Add/Edit/Delete needs to be completed.
- <table class="panel" width="100%">
- <tr>
- <td class="panel"><?php EditOrder(); ?></td>
- <td class="panel-box" width="50%">
- <?php
- if(isset($_GET['enable'])){
- $slide_id = $_GET['enable'];
- EnableSlide($slide_id);
- }else if(isset($_GET['disable'])){
- $slide_id = $_GET['disable'];
- DisableSlide($slide_id);
- }else{
- ListInactive();
- }
- ?>
- </td>
- </tr>
- </table>
+<?php +/** + * Bayonet Content Management System + * Copyright (C) 2008 Joseph Hunkeler & Evan O'Connell + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see <http://www.gnu.org/licenses/>. + */ + +if(!defined("ADMIN_FILE")) +{ + die("Access denied."); +} + +include $basedir.'newsreel/functions.php'; +?> + <div style="text-align:left;"><h2>- Manage News Reel</h2></div> + -Add/Edit/Delete needs to be completed. + <table class="panel" width="100%"> + <tr> + <td class="panel"><?php EditOrder(); ?></td> + <td class="panel-box" width="50%"> + <?php + if(isset($_GET['enable'])){ + $slide_id = $_GET['enable']; + EnableSlide($slide_id); + }else if(isset($_GET['disable'])){ + $slide_id = $_GET['disable']; + DisableSlide($slide_id); + }else{ + ListInactive(); + } + ?> + </td> + </tr> + </table> diff --git a/admin/newsreel/updateDB.php b/admin/newsreel/updateDB.php index f4031a2..cd1a311 100644 --- a/admin/newsreel/updateDB.php +++ b/admin/newsreel/updateDB.php @@ -1,40 +1,49 @@ -<?php
-
-include '../../includes/debug.php';
-include '../../includes/config.php';
-include '../../includes/sql.class.php';
-include '../../includes/functions.php';
-
-$action = $_POST['action'];
-$updateRecordsArray = $_POST['recordsArray'];
-
-$db = new Bayonet_SQL();
-$db->Connect(
- $config['sql']['hostname'],
- $config['sql']['username'],
- $config['sql']['password']
- );
-$db->Select_db($config['sql']['database']);
-
-if ($action == "updateReelOrder"){
-
- $listingCounter = 1;
- foreach ($updateRecordsArray as $recordIDValue) {
-
- $db->Query("UPDATE `bayonet_newsreel` SET `weight` = '$listingCounter' WHERE `slide_id` = '$recordIDValue'");
- $listingCounter = $listingCounter + 1;
- }
- echo "<img src=\"images/accepted.png\" />";
-/*
- echo '<pre>';
- print_r($updateRecordsArray);
- echo '</pre>';
- echo 'If you refresh the page, you will see that records will stay just as you modified.';
-*/
-}
-else{
- echo "<img src=\"images/rejected.png\" />";
-}
-date_default_timezone_set("America/New_York");
-echo " Updated at ".date("g:i:s a", time());
+<?php + +//basename(dirname('.')) +$dirname = "/home/thirdid/3rd-infantry-division.org"; + +define('BAYONET_ROOT', $dirname); +define('BAYONET_INCLUDE', BAYONET_ROOT . '/include'); +define('BAYONET_CONFIG', BAYONET_ROOT . '/include/config.ini'); + +require BAYONET_INCLUDE . '/debug.php'; +require BAYONET_INCLUDE . '/sql.class.php'; +require BAYONET_INCLUDE . '/functions.php'; + +Bayonet_Config::init(); +$config = Bayonet_Config::$ini; +$db = new Bayonet_SQL(); + + +//Connect to the MySQL server +$db->Connect($config['sql']['hostname'], $config['sql']['username'], $config['sql']['password']); +$db->Select_db($config['sql']['database']); + +/*----------------------------- */ + +$action = $_POST['action']; +$updateRecordsArray = $_POST['recordsArray']; + +if ($action == "updateReelOrder"){ + + $listingCounter = 1; + foreach ($updateRecordsArray as $recordIDValue) { + + $db->Query("UPDATE `bayonet_newsreel` SET `weight` = '$listingCounter' WHERE `slide_id` = '$recordIDValue'"); + $listingCounter = $listingCounter + 1; + } + echo "<img src=\"images/accepted.png\" />"; +/* + echo '<pre>'; + print_r($updateRecordsArray); + echo '</pre>'; + echo 'If you refresh the page, you will see that records will stay just as you modified.'; +*/ +} +else{ + echo "<img src=\"images/rejected.png\" />"; +} +date_default_timezone_set("America/New_York"); +echo " Updated at ".date("g:i:s a", time()); ?>
\ No newline at end of file diff --git a/admin/rudi/functions.php b/admin/rudi/functions.php index b22468b..dc6faea 100644 --- a/admin/rudi/functions.php +++ b/admin/rudi/functions.php @@ -1,71 +1,71 @@ -<?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/>.
- */
- /*
- include $basedir.'rudi/functions.php';
-
- //chek to see if the person is indeed an quartermaster
-
- if(isset($_GET['edit'])){
-
- if($_GET['edit'] == "profile"){
- $member_id = $_GET['id'];
- EditProfile($member_id);
- return;
- }
- if($_GET['edit'] == "service"){
- if(isset($_GET['var'])){
- if($_GET['var'] == "add"){
- $member_id = $_GET['id'];
- AddServiceRecord($member_id);
- }
- if($_GET['var'] == "edit"){
- $record_id = $_GET['id'];
- EditServiceRecord($record_id);
- }
- if($_GET['var'] == "delete"){
- $record_id = $_GET['id'];
- }
- }else{
- $member_id = $_GET['id'];
- ListServiceRecord($member_id);
- }
- return;
- }
- if($_GET['edit'] == "medals"){
- if(isset($_GET['var'])){
- if($_GET['var'] == "add"){
-
- }
- if($_GET['var'] == "edit"){
-
- }
- if($_GET['var'] == "delete"){
-
- }
- }else{
- $member_id = $_GET['id'];
- ListMedalRecord($member_id);
- }
-
- return;
- }
- }
-
- ListMembers(); */
+<?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/>. + */ + /* + include $basedir.'rudi/functions.php'; + + //chek to see if the person is indeed an quartermaster + + if(isset($_GET['edit'])){ + + if($_GET['edit'] == "profile"){ + $member_id = $_GET['id']; + EditProfile($member_id); + return; + } + if($_GET['edit'] == "service"){ + if(isset($_GET['var'])){ + if($_GET['var'] == "add"){ + $member_id = $_GET['id']; + AddServiceRecord($member_id); + } + if($_GET['var'] == "edit"){ + $record_id = $_GET['id']; + EditServiceRecord($record_id); + } + if($_GET['var'] == "delete"){ + $record_id = $_GET['id']; + } + }else{ + $member_id = $_GET['id']; + ListServiceRecord($member_id); + } + return; + } + if($_GET['edit'] == "medals"){ + if(isset($_GET['var'])){ + if($_GET['var'] == "add"){ + + } + if($_GET['var'] == "edit"){ + + } + if($_GET['var'] == "delete"){ + + } + }else{ + $member_id = $_GET['id']; + ListMedalRecord($member_id); + } + + return; + } + } + + ListMembers(); */ ?>
\ No newline at end of file diff --git a/admin/rudi/includes/functions.awards.php b/admin/rudi/includes/functions.awards.php index 439f0e1..0b4b1e2 100644 --- a/admin/rudi/includes/functions.awards.php +++ b/admin/rudi/includes/functions.awards.php @@ -1,20 +1,20 @@ -<?php
-
- function getAwardClasses(){
- global $db;
- $result = $db->Query("SELECT `name`, `class_id` FROM `rudi_award_classes`");
- return $db->Fetch($result);
- }
-
- function getAwardsByClass($class_id){
- global $db;
- $result = $db->Query("SELECT `award_id`, `name`, `image`, `description` FROM `rudi_awards` WHERE `class_id` = '$class_id' ORDER BY `name`");
- return $db->Fetch($result);
- }
-
- function getAward($award_id){
- global $db;
- $result = $db->Query("SELECT `award_id`, `name`, `image`, `description`, `class_id` FROM `rudi_awards` WHERE `award_id` = '$award_id' LIMIT 1");
- return $db->FetchRow($result);
- }
+<?php + + function getAwardClasses(){ + global $db; + $result = $db->Query("SELECT `name`, `class_id` FROM `rudi_award_classes`"); + return $db->Fetch($result); + } + + function getAwardsByClass($class_id){ + global $db; + $result = $db->Query("SELECT `award_id`, `name`, `image`, `description` FROM `rudi_awards` WHERE `class_id` = '$class_id' ORDER BY `name`"); + return $db->Fetch($result); + } + + function getAward($award_id){ + global $db; + $result = $db->Query("SELECT `award_id`, `name`, `image`, `description`, `class_id` FROM `rudi_awards` WHERE `award_id` = '$award_id' LIMIT 1"); + return $db->FetchRow($result); + } ?>
\ No newline at end of file diff --git a/admin/rudi/includes/functions.battles.php b/admin/rudi/includes/functions.battles.php new file mode 100644 index 0000000..2b878da --- /dev/null +++ b/admin/rudi/includes/functions.battles.php @@ -0,0 +1,70 @@ +<?php + + function getAllBattles(){ + global $db; + + $result = $db->Query("SELECT w.war_id, + w.title, + w.visit_unit_id, + w.home_score, + w.visit_score, + w.date, + w.status, + v.name + FROM rudi_war_stats AS w + LEFT OUTER JOIN rudi_war_units AS v + ON v.visitor_id = w.visit_unit_id + ORDER BY w.date"); + $data = $db->Fetch($result); + + return $data; + } + + function getBattleInfo($war_id){ + global $db; + + $result = $db->Query("SELECT w.war_id, + w.title, + w.visit_unit_id, + w.home_score, + w.visit_score, + w.date, + w.status, + v.name + FROM rudi_war_stats AS w + LEFT OUTER JOIN rudi_war_units AS v + ON v.visitor_id = w.visit_unit_id + WHERE w.war_id = {$war_id}"); + $data = $db->FetchRow($result); + + return $data; + } + + function getCombatSoldiers($war_id){ + global $db; + + $query = "SELECT m.member_id, + m.first_name, + m.last_name, + r.shortname, + r.longname, + w.record_id, + + FROM rudi_combat_record AS w + JOIN rudi_unit_members AS m + ON m.member_id = w.member_id + JOIN rudi_ranks AS r + ON m.rank_id = r.rank_id + WHERE m.status_id < 4, w.war_id = {$war_id} OR w.war_id IS NULL + ORDER BY r.weight DESC , m.date_promotion ASC , m.date_enlisted ASC"; + + decho($query); + $result = $db->Query($query); + $data = $db->Fetch($result); + + + + return $data; + } + +?>
\ No newline at end of file diff --git a/admin/rudi/includes/functions.members.php b/admin/rudi/includes/functions.members.php index 6a4970e..86848dc 100644 --- a/admin/rudi/includes/functions.members.php +++ b/admin/rudi/includes/functions.members.php @@ -48,9 +48,17 @@ function GetRoles(){ global $db; - $result = $db->Query("SELECT * FROM `rudi_roles`"); - $row = $db->Fetch($result); - return $row; + $data = array(); + $result = $db->Query("SELECT * FROM `rudi_role_classes` ORDER BY `weight` ASC"); + $classes = $db->Fetch($result); + + foreach($classes as $class){ + $rclass_id = $class['rclass_id']; + $result2 = $db->Query("SELECT * FROM rudi_roles WHERE rclass_id = '$rclass_id' ORDER BY `weight` ASC"); + $data[] = array("name" => $class['name'], "roles" => $db->Fetch($result2)); + } + + return $data; } function GetCountry(){ @@ -177,7 +185,7 @@ <td><?php echo date("M j Y", strtotime($record['date_added'])); ?></td> <td><?php echo $record['record_note']; ?></td> <td><a href="?op=rudi&show=members&award=<?php echo $member_id; ?>&edit=<?php echo $record['record_id']; ?>">Edit</a></td> - <td><a href="?op=rudi&show=members&award=<?php echo $row['member_id']; ?>&delete=<?php echo $record['record_id']; ?>">Delete</a></td> + <td><a href="?op=rudi&show=members&award=<?php echo $member_id; ?>&delete=<?php echo $record['record_id']; ?>">Delete</a></td> </tr> <?php } @@ -224,6 +232,38 @@ } + function DeleteAwardRecord($record_id){ + global $db; + + $result = $db->Query("SELECT r.date_added, r.record_note, r.member_id, a.name FROM rudi_award_record AS r LEFT OUTER JOIN rudi_awards AS a ON a.award_id = r.award_id WHERE r.record_id = '$record_id' LIMIT 1"); + $record = $db->FetchRow($result); + decho($record_id); + decho($record); + $form = new BayonetForm("", "POST"); + + if(isset($_POST['proceed'])) + { + echo "Award '{$record['name']}', was deleted from that soldiers record."; + $db->Query("DELETE FROM `rudi_award_record` WHERE `record_id` = '$record_id' LIMIT 1"); + PageRedirect(2, "?op=rudi&show=members&award={$record['member_id']}"); + return; + } + if(isset($_POST['cancel'])) + { + echo "User cancelled deletion of award: '{$record['name']}'"; + PageRedirect(2, "?op=rudi&show=members&award={$award['member_id']}"); + return; + } + + OpenTable(); +?> + <th>Are you <u>SURE</u> you want to delete the award record: '<?php echo $record['name'];?>'? for this member?<br />All changes are final.</th> + <tr><th><button name="proceed">Yes</button> <button name="cancel">No</button></th></tr> +<?php + CloseTable(); + $form->__destruct(); + } + function AddAwardRecord($member_id){ global $db; diff --git a/admin/rudi/includes/functions.units.php b/admin/rudi/includes/functions.units.php new file mode 100644 index 0000000..5005fa0 --- /dev/null +++ b/admin/rudi/includes/functions.units.php @@ -0,0 +1,33 @@ +<?php + + function DisplayUnits(){ + global $db; + $result = $db->Query("SELECT `unit_id`, `name` FROM `rudi_combat_units` WHERE `detachment` = 0 "); + $row = $db->Fetch($result); + foreach($row as $unit){ + $unit_name = $unit['name']; + $unit_id = $unit['unit_id']; + echo '<img src="images/tree_branch.gif" /> '.$unit_name.'<br />'; + selectUnits($unit_id, 0, $member['cunit_id']); + } + } + + function selectUnits($previous_unit, $indent, $members_unit){ + global $db; + + $indent++; + //$formatting = str_repeat(" ", $indent); + $formatting = str_repeat('<img src="images/tree_leaf.gif" />', $indent); + + $result = $db->Query("SELECT `unit_id`, `name` FROM `rudi_combat_units` WHERE `detachment` = '$previous_unit'"); + $row = $db->Fetch($result); + foreach($row as $unit){ + $unit_id = $unit['unit_id']; + $unit_name = $unit['name']; + echo $formatting.'<img src="images/tree_branch.gif" /> '.$unit_name.'<br />'; + + selectUnits($unit_id, $indent, $members_unit); + } + } + +?>
\ No newline at end of file diff --git a/admin/rudi/index.php b/admin/rudi/index.php index 2e4a42a..62eaacf 100644 --- a/admin/rudi/index.php +++ b/admin/rudi/index.php @@ -1,59 +1,63 @@ -<?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/>.
- */
-
- ?>
- <link rel="stylesheet" type="text/css" href="rudi/style.css" media="screen"/>
- <div style="text-align:left;"><h2>- RUDI/Quartermaster Control Panel</h2></div>
- <?php
- if(!defined("ADMIN_FILE"))
- {
- die("Access denied.");
- }
-
- if(isset($_GET['show'])){
-
- switch($_GET['show']){
- case 'members':
- include $basedir.'rudi/views/view.members.php';
- break;
- case 'units':
- include $basedir.'rudi/views/view.units.php';
- break;
- case 'awards':
- include $basedir.'rudi/views/view.awards.php';
- break;
- case 'ranks':
- include $basedir.'rudi/views/view.ranks.php';
- break;
- case 'drills':
- include $basedir.'rudi/views/view.drills.php';
- break;
- }
- }else{
- $th = array('Rudi Options','');
- $td = array(
- LinkInternal('Roster','?op=rudi&show=members'),
- LinkInternal('Units','?op=rudi&show=units'),
- LinkInternal('Awards', '?op=rudi&show=awards')
- );
-
- //render administration table
- CompileAdmin($th,$td);
- }
+<?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/>. + */ + + ?> + <link rel="stylesheet" type="text/css" href="rudi/style.css" media="screen"/> + <div style="text-align:left;"><h2>- RUDI/Quartermaster Control Panel</h2></div> + <?php + if(!defined("ADMIN_FILE")) + { + die("Access denied."); + } + + if(isset($_GET['show'])){ + + switch($_GET['show']){ + case 'members': + include $basedir.'rudi/views/view.members.php'; + break; + case 'units': + include $basedir.'rudi/views/view.units.php'; + break; + case 'awards': + include $basedir.'rudi/views/view.awards.php'; + break; + case 'ranks': + include $basedir.'rudi/views/view.ranks.php'; + break; + case 'drills': + include $basedir.'rudi/views/view.drills.php'; + break; + case 'battles': + include $basedir.'rudi/views/view.battles.php'; + break; + } + }else{ + $th = array('Rudi Options',''); + $td = array( + LinkInternal('Roster','?op=rudi&show=members'), + LinkInternal('Units','?op=rudi&show=units'), + LinkInternal('Awards', '?op=rudi&show=awards'), + LinkInternal('Battles', '?op=rudi&show=battles') + ); + + //render administration table + CompileAdmin($th,$td); + } ?>
\ No newline at end of file diff --git a/admin/rudi/views/view.awards.add.php b/admin/rudi/views/view.awards.add.php new file mode 100644 index 0000000..9c97c54 --- /dev/null +++ b/admin/rudi/views/view.awards.add.php @@ -0,0 +1,27 @@ +<?php + $class_id = $_GET['cid']; + $form = new BayonetForm("", "POST"); + if($form->verifySubmit('processed')) + { + global $db; + $name = $form->request['name']; + $text = $form->request['text']; + $db->Query("INSERT INTO `rudi_awards` SET `class_id` = '$class_id', `name` = '$name', `image` = '', `description` = '$text'"); + + PageRedirect(1, "?op=rudi&show=awards&cid={$class_id}"); + return; + } + echo LinkInternal("Cancel","?op=rudi&show=awards&cid={$class_id}"); + OpenTable(); +?> + +<tr><th>Name:</th><td><?php $form->textField('name', "", false, "50"); ?></td><tr> +<tr><th>Image:</th><td><?php ?></td></tr> +<tr><th>Text:</th><td><?php $form->textArea('text',10,30); ?></td></tr> +<tr><td><?php $form->submitButton('processed', 'Add'); ?></td></tr> + +<?php + CloseTable(); + $form->__destruct(); +?> + diff --git a/admin/rudi/views/view.awards.delete.php b/admin/rudi/views/view.awards.delete.php new file mode 100644 index 0000000..6fde068 --- /dev/null +++ b/admin/rudi/views/view.awards.delete.php @@ -0,0 +1,29 @@ +<?php + global $db; + + $result = $db->Query("SELECT `name`, `class_id` FROM `rudi_awards` WHERE `award_id` = '$award_id' LIMIT 1"); + $award = $db->FetchRow($result); + $form = new BayonetForm("", "POST"); + + if(isset($_POST['proceed'])) + { + echo "Award '{$award['name']}', was deleted."; + $db->Query("DELETE FROM `rudi_awards` WHERE `award_id` = '$award_id' LIMIT 1"); + PageRedirect(2, "?op=rudi&show=awards&cid={$award['class_id']}"); + return; + } + if(isset($_POST['cancel'])) + { + echo "User cancelled deletion of award: '{$award['name']}'"; + PageRedirect(2, "?op=rudi&show=awards&cid={$award['class_id']}"); + return; + } + + OpenTable(); +?> + <th>Are you <u>SURE</u> you want to delete the award titled: '<?php echo $award['name'];?>'?<br />All users who have recieved this award will lose it off their records (not yet at least).</th> + <tr><th><button name="proceed">Yes</button> <button name="cancel">No</button></th></tr> +<?php + CloseTable(); + $form->__destruct(); +?>
\ No newline at end of file diff --git a/admin/rudi/views/view.awards.edit.php b/admin/rudi/views/view.awards.edit.php index 21ec156..0b82ef6 100644 --- a/admin/rudi/views/view.awards.edit.php +++ b/admin/rudi/views/view.awards.edit.php @@ -1,27 +1,27 @@ -<?php
- $award = getAward($award_id);
- $form = new BayonetForm("", "POST");
- if($form->verifySubmit('processed'))
- {
- global $db;
- $name = $form->request['name'];
- $text = $form->request['text'];
- $db->Query("UPDATE `rudi_awards` SET `name` = '$name', `description` = '$text' WHERE `award_id` = '$award_id' LIMIT 1");
-
- PageRedirect(1, "?op=rudi&show=awards&award={$award_id}");
- return;
- }
- echo LinkInternal("Cancel","?op=rudi&show=awards&cid={$award['class_id']}");
- OpenTable();
-?>
-
-<tr><th>Name:</th><td><?php $form->textField('name', $award['name'], false, "50"); ?></td><tr>
-<tr><th>Image:</th><td><?php ?></td></tr>
-<tr><th>Text:</th><td><?php $form->textArea('text',10,30,$award['description']); ?></td></tr>
-<tr><td><?php $form->submitButton('processed', 'Update'); ?></td></tr>
-
-<?php
- CloseTable();
- $form->__destruct();
-?>
-
+<?php + $award = getAward($award_id); + $form = new BayonetForm("", "POST"); + if($form->verifySubmit('processed')) + { + global $db; + $name = $form->request['name']; + $text = $form->request['text']; + $db->Query("UPDATE `rudi_awards` SET `name` = '$name', `description` = '$text' WHERE `award_id` = '$award_id' LIMIT 1"); + + PageRedirect(1, "?op=rudi&show=awards&award={$award_id}"); + return; + } + echo LinkInternal("Cancel","?op=rudi&show=awards&cid={$award['class_id']}"); + OpenTable(); +?> + +<tr><th>Name:</th><td><?php $form->textField('name', $award['name'], false, "50"); ?></td><tr> +<tr><th>Image:</th><td><?php ?></td></tr> +<tr><th>Text:</th><td><?php $form->textArea('text',10,30,$award['description']); ?></td></tr> +<tr><td><?php $form->submitButton('processed', 'Update'); ?></td></tr> + +<?php + CloseTable(); + $form->__destruct(); +?> + diff --git a/admin/rudi/views/view.awards.php b/admin/rudi/views/view.awards.php index b4c912f..3a5729f 100644 --- a/admin/rudi/views/view.awards.php +++ b/admin/rudi/views/view.awards.php @@ -1,40 +1,40 @@ -<?php
- include $basedir.'rudi/includes/functions.awards.php';
- if(isset($_GET['award'])){
- $award_id = $_GET['award'];
- include 'view.awards.edit.php';
- }else if(isset($_GET['add'])){
- include 'view.awards.add.php';
- }else if(isset($_GET['delete'])){
- $award_id = $_GET['delete'];
- include 'view.awards.delete.php';
- }else{
- echo "<h3>Award Classes</h3>";
- $classes = getAwardClasses();
- OpenTable();
- echo "<tr style=\"text-align:center\">";
- foreach($classes as $class){
- echo "<td>".LinkInternal($class['name'],'?op=rudi&show=awards&cid='.$class['class_id'])."</td>";
- }
- echo "</tr>";
- CloseTable();
-
- if(isset($_GET['cid'])){
- $class_id = $_GET['cid'];
- $awards = getAwardsByClass($class_id);
- echo "<h3>Awards</h3>";
- echo LinkInternal('<img src="images/add.png" /> Add New Award','?op=rudi&show=awards&cid={$class_id}&add=true');
- OpenTable();
- foreach($awards as $award){
- echo "<tr><td>".$award['name']."</td>
- <td><a href=\"?op=rudi&show=awards&award={$award['award_id']}\">Edit</a></td>
- <td><a href=\"?op=rudi&show=awards&delete={$award['award_id']}\">Delete</a></td></tr>";
- }
- CloseTable();
- //include 'view.members.profile.php';
- }else if(isset($_GET['aid'])){
- $award_id = $_GET['aid'];
- //include 'view.members.service.php';
- }
- }
+<?php + include $basedir.'rudi/includes/functions.awards.php'; + if(isset($_GET['award'])){ + $award_id = $_GET['award']; + include 'view.awards.edit.php'; + }else if(isset($_GET['add'])){ + include 'view.awards.add.php'; + }else if(isset($_GET['delete'])){ + $award_id = $_GET['delete']; + include 'view.awards.delete.php'; + }else{ + echo "<h3>Award Classes</h3>"; + $classes = getAwardClasses(); + OpenTable(); + echo "<tr style=\"text-align:center\">"; + foreach($classes as $class){ + echo "<td>".LinkInternal($class['name'],'?op=rudi&show=awards&cid='.$class['class_id'])."</td>"; + } + echo "</tr>"; + CloseTable(); + + if(isset($_GET['cid'])){ + $class_id = $_GET['cid']; + $awards = getAwardsByClass($class_id); + echo "<h3>Awards</h3>"; + echo LinkInternal('<img src="images/add.png" /> Add New Award','?op=rudi&show=awards&cid={$class_id}&add=true'); + OpenTable(); + foreach($awards as $award){ + echo "<tr><td>".$award['name']."</td> + <td><a href=\"?op=rudi&show=awards&award={$award['award_id']}\">Edit</a></td> + <td><a href=\"?op=rudi&show=awards&delete={$award['award_id']}\">Delete</a></td></tr>"; + } + CloseTable(); + //include 'view.members.profile.php'; + }else if(isset($_GET['aid'])){ + $award_id = $_GET['aid']; + //include 'view.members.service.php'; + } + } ?>
\ No newline at end of file diff --git a/admin/rudi/views/view.battles.list.php b/admin/rudi/views/view.battles.list.php new file mode 100644 index 0000000..573d422 --- /dev/null +++ b/admin/rudi/views/view.battles.list.php @@ -0,0 +1,18 @@ +<?php + + global $db; + + // get all active members and members that attended the match + // each member has a checkbox + // -> Use AJAX oncheck to save the status of that member + + $battle = getBattleInfo($war_id); + + decho($battle); + + $members = getCombatSoldiers($war_id); + + decho($members); + +?> +<h3>Engagement : <?php echo $battle['title']; ?></h3>
\ No newline at end of file diff --git a/admin/rudi/views/view.battles.php b/admin/rudi/views/view.battles.php new file mode 100644 index 0000000..d00452e --- /dev/null +++ b/admin/rudi/views/view.battles.php @@ -0,0 +1,36 @@ +<?php + + // list all battles + // -> click one to view who was attending (lists everyone in the unit and those attending) + // buttons to add/edit/delete battles + + // definitely gonna use ajax for this... + + include $basedir.'rudi/includes/functions.battles.php'; + + if(isset($_GET['id'])){ + $war_id = $_GET['id']; + include 'view.battles.list.php'; + }else if(isset($_GET['service'])){ + $member_id = $_GET['service']; + include 'view.members.service.php'; + }else{ + + // list all battles + $battles = getAllBattles(); + decho($battles); + +?> + <h3>Unit Engagement:</h3> + <table width="100%" style="text-align:center;"> + <tr><th>Title</th><th>Opponent</th><th>Result</th><th>Date</th></tr> +<?php + foreach($battles as $battle){ + echo "<tr><td><a href=\"?op=rudi&show=battles&id={$battle['war_id']}\">{$battle['title']}</a></td><td>vs {$battle['name']}</td><td>{$battle['status']} {$battle['home_score']}-{$battle['visit_score']}</td><td>"; + echo date("M j Y", strtotime($battle['date'])); + echo "</td><tr>"; + + } + CloseTable(); + } +?>
\ No newline at end of file diff --git a/admin/rudi/views/view.members.award.php b/admin/rudi/views/view.members.award.php index cda8595..db6f88e 100644 --- a/admin/rudi/views/view.members.award.php +++ b/admin/rudi/views/view.members.award.php @@ -1,19 +1,22 @@ -<?php
- global $db;
- $result = $db->Query("SELECT `first_name`, `last_name` FROM `rudi_unit_members` WHERE `member_id` = '$member_id' LIMIT 1");
- $member = $db->FetchRow($result);
- echo "<h3>Award Record of {$member['first_name']} {$member['last_name']}</h3>";
-
- if(isset($_GET['edit'])){
- $record_id = $_GET['edit'];
- EditAwardRecord($record_id);
- }else if(isset($_GET['add'])){
- if($_GET['add']){
- AddAwardRecord($_GET['award']);
- }
- }else{
-
- echo "<div style=\"text-align:left;\">".LinkInternal('Back to Roster', '?op=rudi&show=members')."</div>";
- ListAwardRecord($_GET['award']);
- }
+<?php + global $db; + $result = $db->Query("SELECT `first_name`, `last_name` FROM `rudi_unit_members` WHERE `member_id` = '$member_id' LIMIT 1"); + $member = $db->FetchRow($result); + echo "<h3>Award Record of {$member['first_name']} {$member['last_name']}</h3>"; + + if(isset($_GET['edit'])){ + $record_id = $_GET['edit']; + EditAwardRecord($record_id); + }else if(isset($_GET['add'])){ + if($_GET['add']){ + AddAwardRecord($_GET['award']); + } + }else if(isset($_GET['delete'])){ + $record_id = $_GET['delete']; + DeleteAwardRecord($record_id); + }else{ + + echo "<div style=\"text-align:left;\">".LinkInternal('Back to Roster', '?op=rudi&show=members')."</div>"; + ListAwardRecord($_GET['award']); + } ?>
\ No newline at end of file diff --git a/admin/rudi/views/view.members.new.php b/admin/rudi/views/view.members.new.php new file mode 100644 index 0000000..cbc086f --- /dev/null +++ b/admin/rudi/views/view.members.new.php @@ -0,0 +1,179 @@ +<?php
+ global $db;
+
+ if(isset($_POST['processed'])){
+
+ echo "Please wait while the information is processed...";
+
+ $rank_id = $_POST['rank'];
+ $country_id = $_POST['country'];
+ $status_id = $_POST['status'];
+ $role_id = $_POST['role'];
+ $unit_id = $_POST['unit'];
+ $weapon_id = $_POST['weapon'];
+ $first_name = addslashes($_POST['first']);
+ $last_name = addslashes($_POST['last']);
+ $username = addslashes($_POST['username']);
+ $city = addslashes($_POST['city']);
+ $province = addslashes($_POST['province']);
+ $primary_mos = addslashes($_POST['primmos']);
+ $enlisted = addslashes($_POST['enlist']);
+ $promoted = addslashes($_POST['promote']);
+ $discharged = addslashes($_POST['discharge']);
+ $xfire = addslashes($_POST['xfire']);
+ $email = addslashes($_POST['email']);
+ $bio = addslashes($_POST['bio']);
+
+ //$discharged = empty($discharged) ? NULL : "'{$discharged}'";
+
+ $query = "INSERT INTO `rudi_unit_members` SET"
+ ." `rank_id` = '$rank_id',"
+ ." `country_id` = '$country_id',"
+ ." `status_id` = '$status_id',"
+ ." `cunit_id` = '$unit_id',"
+ ." `weapon_id` = '$weapon_id',"
+ ." `username` = '$username',"
+ ." `email` = '$email',"
+ ." `xfire` = '$xfire',"
+ ." `first_name` = '$first_name',"
+ ." `last_name` = '$last_name',"
+ ." `location_city` = '$city',"
+ ." `location_province` = '$province',"
+ ." `bio` = '$bio',"
+ ." `date_enlisted` = '$enlisted',"
+ ." `date_promotion` = '$promoted',"
+ ." `primary_mos` = '$primary_mos',";
+ if(empty($discharged))
+ $query = $query." `date_discharged` = null";
+ else
+ $query = $query." `date_discharged` = '$discharged'";
+ decho($query);
+ $db->Query($query);
+
+ $member_id = $db->InsertID();
+ decho($member_id);
+ $db->Query("INSERT INTO `rudi_roles_container` SET `role_id` = '$role_id', `member_id` = '$member_id'");
+
+ PageRedirect(1, "?op=rudi&show=members");
+ return;
+ }
+?>
+ <a href="?op=rudi&show=members">Cancel</a><br />
+ <form method="POST" action="">
+ <table width="100%" style="text-align:center;">
+ <tr><th colspan="2" style="background-color:#c4c4c4;">Personnel File of <?php echo $member['first_name']." ".$member['last_name']; ?></th></tr>
+ <tr><td class="right" width="50%">Rank:</td><td class="left">
+ <select name="rank">
+<?php $ranks = GetRanks();
+ foreach($ranks as $rank){
+ echo "<option value=\"{$rank['rank_id']}\">{$rank['longname']}</option>";
+ }
+?>
+ </select>
+ </td></tr>
+ <tr><td class="right">Country:</td><td class="left">
+ <select name="country">
+<?php $countries = GetCountry();
+ foreach($countries as $country){
+ echo "<option value=\"{$country['country_id']}\">{$country['name']}</option>";
+ }
+?>
+ </select>
+ </td></tr>
+ </table>
+ <table width="100%" style="text-align:center;">
+ <tr><th colspan="2" style="background-color:#c4c4c4;">Vital Statistics</th></tr>
+ <tr>
+ <td class="right" width="50%">First:</td>
+ <td class="left"><input type="text" name="first" value="" /></td>
+ </tr>
+ <tr>
+ <td class="right">Last:</td>
+ <td class="left"><input type="text" name="last" value="" /></td>
+ </tr>
+ <tr><td class="right">Username:</td><td class="left"><input type="text" name="username" value="" /></td></tr>
+ <tr><td class="right">City:</td><td class="left"><input type="text" name="city" value=""/></td></tr>
+ <tr><td class="right">Province:</td><td class="left"><input type="text" name="province" value="" /></td></tr>
+ <tr><td class="right">Status:</td><td class="left">
+ <select name="status">
+<?php $statuses = GetStatuses();
+ foreach($statuses as $status){
+ echo "<option value=\"{$status['status_id']}\">{$status['name']}</option>";
+ }
+?>
+ </select>
+ </td></tr>
+ <tr><td class="right">Primary MOS:</td><td class="left"><input type="text" name="primmos" value="" /></td></tr>
+ <tr>
+ <td class="right">Role:</td>
+ <td class="left">
+ <select name="role">
+<?php
+ $roles = GetRoles();
+ foreach($roles as $role){
+ echo "<option value=\"{$role['role_id']}\">{$role['name']}</option>";
+ }
+?>
+ </select>
+ </td>
+ </tr>
+ <tr>
+ <td class="right" style="font-weight:bold;">Unit:</td>
+ <td class="left">
+ <select name="unit">
+ <option value="0">N/A</option>
+<?php
+ $result = $db->Query("SELECT `unit_id`, `name` FROM `rudi_combat_units` WHERE `detachment` = 0 ");
+ $row = $db->Fetch($result);
+ foreach($row as $unit){
+ $unit_name = $unit['name'];
+ $unit_id = $unit['unit_id'];
+ if($member['cunit_id']==$unit_id)
+ echo '<option value="'.$unit_id.'" selected>'.$unit_name.'</option>';
+ else
+ echo '<option value="'.$unit_id.'">'.$unit_name.'</option>';
+ selectUnits($unit_id, 0, $member['cunit_id']);
+ }
+?>
+ </select>
+ </td>
+ </tr>
+ <tr><td class="right">Weapons:</td><td class="left">
+ <select name="weapon">
+<?php $weapons = GetWeapons();
+ foreach($weapons as $weapon){
+ echo "<option value=\"{$weapon['weapon_id']}\">{$weapon['model']}</option>";
+ }
+?>
+ </select>
+ </td></tr>
+ <tr>
+ <td class="right">Enlisted Date:</td>
+ <td class="left"><input type="text" name="enlist" value="" /></td>
+ </tr>
+ <tr>
+ <td class="right">Promotion Date:</td>
+ <td class="left">
+ <input type="text" name="promote" value="" />
+ </td>
+ </tr>
+ <tr>
+ <td class="right">Discharge Date:</td>
+ <td class="left"><input type="text" name="discharge" value="" /></td>
+ </tr>
+ <tr>
+ <td class="right">Xfire:</td>
+ <td class="left"><input type="text" name="xfire" value=""/></td>
+ </tr>
+ <tr>
+ <td class="right">E-Mail:</td>
+ <td class="left"><input type="text" name="email" value=""/></td>
+ </tr>
+ </table>
+ <br />
+ <table width="100%" style="text-align:center;">
+ <tr><th colspan="2" style="background-color:#c4c4c4;">Personal Bio</th></tr>
+ <tr><td><textarea rows="7" name="bio" cols="60"></textarea></td></tr>
+ <tr><td colspan="2"><input type="submit" value="Submit" name="processed" /></td>
+ </table>
+ </form>
\ No newline at end of file diff --git a/admin/rudi/views/view.members.php b/admin/rudi/views/view.members.php index 38929df..9013b8e 100644 --- a/admin/rudi/views/view.members.php +++ b/admin/rudi/views/view.members.php @@ -9,13 +9,18 @@ }else if(isset($_GET['award'])){ $member_id = $_GET['award']; include 'view.members.award.php'; + }else if(isset($_GET['create']) && $_GET['create'] == "soldier"){ + include 'view.members.new.php'; }else{ global $db; - echo "<h3>Current Members</h3>"; - echo "<table width=\"100%\" style=\"text-align:center;\">"; - echo "<tr><th>Rank</th><th>Soldier</th><th>Main Info</th><th>Service Record</th><th>Medal Record</th></tr>"; + echo LinkInternal('New Soldier','?op=rudi&show=members&create=soldier'); +?> + <h3>Current Members</h3> + <table width="100%" style="text-align:center;"> + <tr><th>Rank</th><th>Soldier</th><th>Main Info</th><th>Service Record</th><th>Medal Record</th></tr> +<?php $result = $db->Query("SELECT * FROM `rudi_unit_members` JOIN `rudi_ranks` ON rudi_unit_members.rank_id=rudi_ranks.rank_id WHERE rudi_unit_members.status_id <= 3 ORDER BY rudi_ranks.weight DESC , rudi_unit_members.date_promotion ASC , rudi_unit_members.date_enlisted ASC"); $row = $db->Fetch($result); @@ -28,10 +33,11 @@ echo "<tr>"; } CloseTable(); - - echo "<h3>Previous Members</h3>"; - echo "<table width=\"100%\" style=\"text-align:center;\">"; - echo "<tr><th>Rank</th><th>Soldier</th><th>Main Info</th><th>Service Record</th><th>Medal Record</th></tr>"; +?> + <h3>Previous Members</h3> + <table width="100%" style="text-align:center;"> + <tr><th>Rank</th><th>Soldier</th><th>Main Info</th><th>Service Record</th><th>Medal Record</th></tr> +<?php $result = $db->Query("SELECT * FROM `rudi_unit_members` JOIN `rudi_ranks` ON rudi_unit_members.rank_id=rudi_ranks.rank_id WHERE rudi_unit_members.status_id > 3 ORDER BY rudi_ranks.weight DESC, rudi_unit_members.date_promotion ASC, rudi_unit_members.date_enlisted ASC"); $row = $db->Fetch($result); diff --git a/admin/rudi/views/view.members.profile.php b/admin/rudi/views/view.members.profile.php index bd776d7..6355d2e 100644 --- a/admin/rudi/views/view.members.profile.php +++ b/admin/rudi/views/view.members.profile.php @@ -10,7 +10,10 @@ $status_id = $_POST['status']; $role_id = $_POST['role']; $unit_id = $_POST['unit']; + $a2_id = $_POST['a2_id']; + $oa_id = $_POST['oa_id']; $weapon_id = $_POST['weapon']; + $weapon2_id = $_POST['weapon2']; $first_name = addslashes($_POST['first']); $last_name = addslashes($_POST['last']); $username = addslashes($_POST['username']); @@ -29,9 +32,13 @@ $query = "UPDATE `rudi_unit_members` SET" ." `rank_id` = '$rank_id'," ." `country_id` = '$country_id'," + ." `role_id` = '$role_id', " ." `status_id` = '$status_id'," ." `cunit_id` = '$unit_id'," ." `weapon_id` = '$weapon_id'," + ." `weapon2_id` = '$weapon2_id'," + ." `a2_id` = '$a2_id'," + ." `oa_id` = '$oa_id'," ." `username` = '$username'," ." `email` = '$email'," ." `xfire` = '$xfire'," @@ -51,10 +58,10 @@ decho($query); $db->Query($query); - $db->Query("UPDATE `rudi_roles_container` SET `role_id` = '$role_id' WHERE `member_id` = '$member_id' LIMIT 1"); + //$db->Query("UPDATE `rudi_roles_container` SET `role_id` = '$role_id' WHERE `member_id` = '$member_id' LIMIT 1"); /* do the role query as well */ - PageRedirect(1, "?op=rudi&show=members&profile={$member_id}"); + PageRedirect(1, "?op=rudi&show=members"); return; } $member = GetMember($member_id); @@ -87,6 +94,8 @@ ?> </select> </td></tr> + <tr><td class="right" width="50%">ArmA2 ID</td><td class="left"><input type="text" name="a2_id" value="<?php echo $member['a2_id']; ?>"/></td></tr> + <tr><td class="right" width="50%">ArmA2:OA ID</td><td class="left"><input type="text" name="oa_id" value="<?php echo $member['oa_id']; ?>"/></td></tr> </table> <table width="100%" style="text-align:center;"> <tr><th colspan="2" style="background-color:#c4c4c4;">Vital Statistics</th></tr> @@ -118,15 +127,21 @@ <td class="right">Role:</td> <td class="left"> <select name="role"> + <option value="0">---SELECT-POSITION---</option> <?php - $member_roles = GetMembersRoles($member['member_id']); - $roles = GetRoles(); - foreach($member_roles as $member_role){} - foreach($roles as $role){ - if($role['role_id']==$member_role['role_id']) - echo "<option value=\"{$role['role_id']}\" selected>{$role['name']}</option>"; - else - echo "<option value=\"{$role['role_id']}\">{$role['name']}</option>"; + //$member_roles = GetMembersRoles($member['member_id']); + $groups = GetRoles(); + decho($groups); + //foreach($member_roles as $member_role){} + foreach($groups as $group){ + echo "<optgroup label=\"{$group['name']}\">"; + foreach($group['roles'] as $role){ + if($role['role_id']==$member['role_id']) + echo "<option value=\"{$role['role_id']}\" selected>{$role['name']}</option>"; + else + echo "<option value=\"{$role['role_id']}\">{$role['name']}</option>"; + } + echo "</optgroup>"; } ?> </select> @@ -153,7 +168,7 @@ </select> </td> </tr> - <tr><td class="right">Weapons:</td><td class="left"> + <tr><td class="right">Primary Weapon:</td><td class="left"> <select name="weapon"> <?php $weapons = GetWeapons(); foreach($weapons as $weapon){ @@ -165,6 +180,19 @@ ?> </select> </td></tr> + <tr><td class="right">Secondary Weapon:</td><td class="left"> + <select name="weapon2"> + <option value="0">None</option> +<?php + foreach($weapons as $weapon){ + if($weapon['weapon_id'] == $member['weapon2_id']) + echo "<option value=\"{$weapon['weapon_id']}\" selected>{$weapon['model']}</option>"; + else + echo "<option value=\"{$weapon['weapon_id']}\">{$weapon['model']}</option>"; + } +?> + </select> + </td></tr> <tr> <td class="right">Enlisted Date:</td> <td class="left"><input type="text" name="enlist" value="<?php echo !empty($member['date_enlisted']) ? date('Y-m-d', strtotime($member['date_enlisted'])) : ""; ?>" /></td> diff --git a/admin/rudi/views/view.units.php b/admin/rudi/views/view.units.php index 2ccf35a..ab3dedd 100644 --- a/admin/rudi/views/view.units.php +++ b/admin/rudi/views/view.units.php @@ -1,22 +1,29 @@ -<?php
- include $basedir.'rudi/includes/functions.units.php';
- if(isset($_GET['unit'])){
-
- }else{
- //list units
- DisplayUnits();
-
- }
-
-
-?>
-<div style="text-align:left;">
-<img src="images/tree_branch.gif" /> Kilo Company<br />
-<img src="images/tree_blank.gif" /><img src="images/tree_branch.gif" /> 1st Platoon<br />
-<img src="images/tree_blank.gif" /><img src="images/tree_blank.gif" /><img src="images/tree_branch.gif" /> 1st Squad<br />
-<img src="images/tree_blank.gif" /><img src="images/tree_blank.gif" /><img src="images/tree_leaf.gif" /><img src="images/tree_branch.gif" /> Fireteam Alpha<br />
-<img src="images/tree_blank.gif" /><img src="images/tree_blank.gif" /><img src="images/tree_leaf.gif" /><img src="images/tree_branch.gif" /> Fireteam Bravo<br />
-<img src="images/tree_blank.gif" /><img src="images/tree_blank.gif" /><img src="images/tree_branch.gif" /> 2nd Squad<br />
-<img src="images/tree_blank.gif" /><img src="images/tree_blank.gif" /><img src="images/tree_blank.gif" /><img src="images/tree_branch.gif" /> Fireteam Alpha<br />
-<img src="images/tree_blank.gif" /><img src="images/tree_blank.gif" /><img src="images/tree_blank.gif" /><img src="images/tree_branch.gif" /> Fireteam Bravo<br />
-</div>
\ No newline at end of file +<h3>Unit Structure</h3> +<center> +<?php + include $basedir.'rudi/includes/functions.units.php'; + if(isset($_GET['unit'])){ + + }else{ + //list units + echo '<div style="text-align:left; width:300px;">'; + DisplayUnits(); + echo '</div>'; + + } + + +?> +</center> +<!-- +<div style="text-align:left;"> +<img src="images/tree_branch.gif" /> Kilo Company<br /> +<img src="images/tree_blank.gif" /><img src="images/tree_branch.gif" /> 1st Platoon<br /> +<img src="images/tree_blank.gif" /><img src="images/tree_blank.gif" /><img src="images/tree_branch.gif" /> 1st Squad<br /> +<img src="images/tree_blank.gif" /><img src="images/tree_blank.gif" /><img src="images/tree_leaf.gif" /><img src="images/tree_branch.gif" /> Fireteam Alpha<br /> +<img src="images/tree_blank.gif" /><img src="images/tree_blank.gif" /><img src="images/tree_leaf.gif" /><img src="images/tree_branch.gif" /> Fireteam Bravo<br /> +<img src="images/tree_blank.gif" /><img src="images/tree_blank.gif" /><img src="images/tree_branch.gif" /> 2nd Squad<br /> +<img src="images/tree_blank.gif" /><img src="images/tree_blank.gif" /><img src="images/tree_blank.gif" /><img src="images/tree_branch.gif" /> Fireteam Alpha<br /> +<img src="images/tree_blank.gif" /><img src="images/tree_blank.gif" /><img src="images/tree_blank.gif" /><img src="images/tree_branch.gif" /> Fireteam Bravo<br /> +</div> +-->
\ No newline at end of file diff --git a/admin/scripts/mocha.js b/admin/scripts/mocha.js index a220424..2e250c2 100644 --- a/admin/scripts/mocha.js +++ b/admin/scripts/mocha.js @@ -1,156 +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>" ); */
-}
-
-}
-);
+/* + * -------------------------------------------------------------------- + * 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 index 1e3ada4..74155fa 100644 --- a/admin/settings/functions.php +++ b/admin/settings/functions.php @@ -1,77 +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(){
-echo "<script type=\"text/javascript\" src=\"scripts/mocha.js\"></script>";
- 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
+<?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(){ +echo "<script type=\"text/javascript\" src=\"scripts/mocha.js\"></script>"; + 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 index e3c8946..49ad784 100644 --- a/admin/settings/index.php +++ b/admin/settings/index.php @@ -1,53 +1,53 @@ -<?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/>.
- */
- ?>
- <link rel="stylesheet" type="text/css" href="settings/style.css" media="screen"/>
- <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>
-
-
-
+<?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/>. + */ + ?> + <link rel="stylesheet" type="text/css" href="settings/style.css" media="screen"/> + <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/settings/style.css b/admin/settings/style.css index 9969542..ff45ec6 100644 --- a/admin/settings/style.css +++ b/admin/settings/style.css @@ -1,64 +1,64 @@ -/* 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;
-}
-
+/* 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/admin/style.css b/admin/style.css index 686276b..48ab804 100644 --- a/admin/style.css +++ b/admin/style.css @@ -140,4 +140,8 @@ fieldset { .right{ text-align:right; } + +.bold { + font-size:18px; +}
\ No newline at end of file diff --git a/include/classes.php b/include/classes.php index 5f51e99..ac62115 100644 --- a/include/classes.php +++ b/include/classes.php @@ -1,238 +1,238 @@ -<?php
-
-abstract class Bayonet_Layout
-{
- function OpenContent()
- {
- echo "<div class=\"contentBorder1\">";
- echo "<div class=\"contentBorder2\">";
- }
-
- function CloseContent()
- {
- echo "</div>";
- echo "</div>";
- }
-}
-
-class Bayonet_Theme extends Bayonet_Layout
-{
- static public $index;
- static public $header;
- static public $footer;
-
- static public $name;
- static public $root_path;
- static public $include_path;
- static public $image_path;
- static public $config_path;
- static public $config;
- static public $primary_css;
-
- static function init()
- {
- if (!isset($_GET['theme']))
- {
- self::$name = Bayonet_Config::$ini['site']['theme'];
- }
- else
- {
- self::$name = $_GET['theme'];
- }
-
- decho('Initializing theme variables for \'' . self::$name . '\'');
- self::$root_path = dirname(BAYONET_ROOT) . '/themes/' . self::$name;
- self::$include_path = self::$root_path . '/include';
- self::$image_path = self::$root_path . '/images';
- self::$primary_css = self::$include_path . '/primary.css';
- self::$config_path = self::$include_path . '/theme.ini';
-
- if (!self::is_valid())
- {
- die('Theme failed during initialization.');
- }
- self::$config = parse_ini_file(self::$config_path, true);
-
- self::$index = self::$root_path . '/index.php';
- self::$header = self::$root_path . '/header.php';
- self::$footer = self::$root_path . '/footer.php';
-
- //decho(get_class_vars(Bayonet_Theme)); //do not re-enable this
- self::load();
- }
-
- static private function is_valid()
- {
- if (file_exists(self::$root_path) && file_exists(self::$include_path) &&
- file_exists(self::$config_path)) return true;
- else return false;
- }
-
- static function load()
- {
- global $db, $config;
- decho("Loading theme: '" . self::$name . "'");
- require self::$index;
- }
-}
-
-class Bayonet_Config
-{
- static $ini;
- static function init()
- {
- decho('Parsing configuration data');
- if (file_exists(BAYONET_CONFIG))
- {
- self::$ini = parse_ini_file(BAYONET_CONFIG, true);
- decho(self::$ini);
- }
- else die(BAYONET_CONFIG . ' not found');
- }
-}
-
-class Bayonet
-{
- static function init()
- {
- global $db, $config;
- Bayonet_Config::init();
-
- // Set globally referenced configuration and database variables
- $config = Bayonet_Config::$ini;
- $db = new Bayonet_SQL();
-
- //Connect to the MySQL server
- $db->Connect($config['sql']['hostname'], $config['sql']['username'], $config['sql']['password']);
- $db->Select_db($config['sql']['database']);
-
- decho('Initializing Bayonet');
- Bayonet_Theme::init();
- }
-}
-
-
-define('PASSWORD', true);
-define('NO_PASSWORD', false);
-define('CHECKED', true);
-
-class BayonetForm
-{
- static public $request;
-
- public function __construct($action, $method)
- {
- $this->request = $_POST;
- echo "<form action=\"$action\" method=\"$method\">\n";
- }
-
- public function __destruct()
- {
- echo "</form>\n";
- }
-
- function getKeyStates($keys)
- {
- $good = array();
- $bad = array();
-
- if (!is_array($keys)) return array();
-
- foreach ($keys as $key => $value)
- {
- if (!empty($value)) $good[$key] = $value;
- else $bad[$key] = $value;
- }
-
- $data = array('set' => $good, 'unset' => $bad);
-
- return $data;
- }
-
- function verify($submit_key)
- {
- return $this->verifySubmit($submit_key);
- }
-
- function verifySubmit($submit_key)
- {
- return isset($this->request[$submit_key]) ? true : false;
- }
-
- function button($extern_name, $value, $text = "Button")
- {
- echo "<button name=\"{$extern_name}\" value=\"{$value}\">{$text}</button>\n";
- }
-
- function submitButton($extern_name, $value = "Submit")
- {
- echo "<input type=\"submit\" name=\"{$extern_name}\" value=\"{$value}\" />\n";
- }
-
- function reset($value = "Reset")
- {
- echo "<input type=\"reset\" value=\"{$value}\" />\n";
- }
-
- function textField($extern_name, $value = null, $isPassword = false, $size = null,
- $max = null)
- {
- $type = 'text';
- if ($isPassword) $type = 'password';
-
- $value = filter_var($value, FILTER_SANITIZE_STRING);
- echo "<input type=\"{$type}\" name=\"{$extern_name}\" value=\"$value\" size=\"{$size}\" maxLength=\"{$max}\" />\n";
- }
-
- function radioButton($extern_name, $value, $isChecked = false)
- {
- if ($isChecked)
- {
- echo "<input type=\"radio\" name=\"{$extern_name}\" value=\"$value\" checked=\"checked\"/>\n";
- }
- else
- {
- echo "<input type=\"radio\" name=\"{$extern_name}\" value=\"$value\" />\n";
- }
- }
-
- function checkBox($extern_name, $value, $isChecked = false)
- {
- if ($isChecked)
- {
- echo "<input type=\"checkbox\" name=\"{$extern_name}\" value=\"$value\" checked=\"checked\"/>\n";
- }
- else
- {
- echo "<input type=\"checkbox\" name=\"{$extern_name}\" value=\"$value\" />\n";
- }
- }
-
- function dropDown($extern_name, $values = array('None'), $select = null)
- {
- $selectIterator = 1;
-
- echo "<select name=\"{$extern_name}\">\n";
- foreach ($values as $option => $text)
- {
- if (!is_null($select) && $selectIterator !== (int)$select)
- {
- echo "<option value=\"{$option}\">{$text}</option>\n";
- }
- else
- {
- echo "<option value=\"{$option}\" selected=\"selected\">{$text}</option>\n";
- }
- $selectIterator++;
- }
- echo "</select>\n";
- }
-
- function textArea($extern_name, $rows = 10, $cols = 30, $value = null)
- {
- $value = filter_var($value, FILTER_SANITIZE_STRING);
- echo "<textarea name=\"{$extern_name}\" rows=\"$rows\" cols=\"$cols\">{$value}</textarea>\n";
- }
-}
-
+<?php + +abstract class Bayonet_Layout +{ + function OpenContent() + { + echo "<div class=\"contentBorder1\">"; + echo "<div class=\"contentBorder2\">"; + } + + function CloseContent() + { + echo "</div>"; + echo "</div>"; + } +} + +class Bayonet_Theme extends Bayonet_Layout +{ + static public $index; + static public $header; + static public $footer; + + static public $name; + static public $root_path; + static public $include_path; + static public $image_path; + static public $config_path; + static public $config; + static public $primary_css; + + static function init() + { + if (!isset($_GET['theme'])) + { + self::$name = Bayonet_Config::$ini['site']['theme']; + } + else + { + self::$name = $_GET['theme']; + } + + decho('Initializing theme variables for \'' . self::$name . '\''); + self::$root_path = dirname(BAYONET_ROOT) . '/themes/' . self::$name; + self::$include_path = self::$root_path . '/include'; + self::$image_path = self::$root_path . '/images'; + self::$primary_css = self::$include_path . '/primary.css'; + self::$config_path = self::$include_path . '/theme.ini'; + + if (!self::is_valid()) + { + die('Theme failed during initialization.'); + } + self::$config = parse_ini_file(self::$config_path, true); + + self::$index = self::$root_path . '/index.php'; + self::$header = self::$root_path . '/header.php'; + self::$footer = self::$root_path . '/footer.php'; + + //decho(get_class_vars(Bayonet_Theme)); //do not re-enable this + self::load(); + } + + static private function is_valid() + { + if (file_exists(self::$root_path) && file_exists(self::$include_path) && + file_exists(self::$config_path)) return true; + else return false; + } + + static function load() + { + global $db, $config; + decho("Loading theme: '" . self::$name . "'"); + require self::$index; + } +} + +class Bayonet_Config +{ + static $ini; + static function init() + { + decho('Parsing configuration data'); + if (file_exists(BAYONET_CONFIG)) + { + self::$ini = parse_ini_file(BAYONET_CONFIG, true); + decho(self::$ini); + } + else die(BAYONET_CONFIG . ' not found'); + } +} + +class Bayonet +{ + static function init() + { + global $db, $config; + Bayonet_Config::init(); + + // Set globally referenced configuration and database variables + $config = Bayonet_Config::$ini; + $db = new Bayonet_SQL(); + + //Connect to the MySQL server + $db->Connect($config['sql']['hostname'], $config['sql']['username'], $config['sql']['password']); + $db->Select_db($config['sql']['database']); + + decho('Initializing Bayonet'); + Bayonet_Theme::init(); + } +} + + +define('PASSWORD', true); +define('NO_PASSWORD', false); +define('CHECKED', true); + +class BayonetForm +{ + static public $request; + + public function __construct($action, $method) + { + $this->request = $_POST; + echo "<form action=\"$action\" method=\"$method\">\n"; + } + + public function __destruct() + { + echo "</form>\n"; + } + + function getKeyStates($keys) + { + $good = array(); + $bad = array(); + + if (!is_array($keys)) return array(); + + foreach ($keys as $key => $value) + { + if (!empty($value)) $good[$key] = $value; + else $bad[$key] = $value; + } + + $data = array('set' => $good, 'unset' => $bad); + + return $data; + } + + function verify($submit_key) + { + return $this->verifySubmit($submit_key); + } + + function verifySubmit($submit_key) + { + return isset($this->request[$submit_key]) ? true : false; + } + + function button($extern_name, $value, $text = "Button") + { + echo "<button name=\"{$extern_name}\" value=\"{$value}\">{$text}</button>\n"; + } + + function submitButton($extern_name, $value = "Submit") + { + echo "<input type=\"submit\" name=\"{$extern_name}\" value=\"{$value}\" />\n"; + } + + function reset($value = "Reset") + { + echo "<input type=\"reset\" value=\"{$value}\" />\n"; + } + + function textField($extern_name, $value = null, $isPassword = false, $size = null, + $max = null) + { + $type = 'text'; + if ($isPassword) $type = 'password'; + + $value = filter_var($value, FILTER_SANITIZE_STRING); + echo "<input type=\"{$type}\" name=\"{$extern_name}\" value=\"$value\" size=\"{$size}\" maxLength=\"{$max}\" />\n"; + } + + function radioButton($extern_name, $value, $isChecked = false) + { + if ($isChecked) + { + echo "<input type=\"radio\" name=\"{$extern_name}\" value=\"$value\" checked=\"checked\"/>\n"; + } + else + { + echo "<input type=\"radio\" name=\"{$extern_name}\" value=\"$value\" />\n"; + } + } + + function checkBox($extern_name, $value, $isChecked = false) + { + if ($isChecked) + { + echo "<input type=\"checkbox\" name=\"{$extern_name}\" value=\"$value\" checked=\"checked\"/>\n"; + } + else + { + echo "<input type=\"checkbox\" name=\"{$extern_name}\" value=\"$value\" />\n"; + } + } + + function dropDown($extern_name, $values = array('None'), $select = null) + { + $selectIterator = 1; + + echo "<select name=\"{$extern_name}\">\n"; + foreach ($values as $option => $text) + { + if (!is_null($select) && $selectIterator !== (int)$select) + { + echo "<option value=\"{$option}\">{$text}</option>\n"; + } + else + { + echo "<option value=\"{$option}\" selected=\"selected\">{$text}</option>\n"; + } + $selectIterator++; + } + echo "</select>\n"; + } + + function textArea($extern_name, $rows = 10, $cols = 30, $value = null) + { + $value = filter_var($value, FILTER_SANITIZE_STRING); + echo "<textarea name=\"{$extern_name}\" rows=\"$rows\" cols=\"$cols\">{$value}</textarea>\n"; + } +} + ?>
\ No newline at end of file diff --git a/include/functions.php b/include/functions.php index 109f11c..370ed9f 100644 --- a/include/functions.php +++ b/include/functions.php @@ -51,11 +51,13 @@ function bbcode_format ($str) '/\[url\=(.*?)\](.*?)\[\/url\]/is', '/\[align\=(.*?)\](.*?)\[\/align\]/is', '/\[size\=(.*?)\](.*?)\[\/size\]/is', - '/\[img\=(.*?)\](.*?)\[\/img\]/is', + '/\[img\](.*?)\[\/img\]/is', '/\[img align\=(.+?)\](.+?)\[\/img\]/is', '/\[mail\](.*?)\[\/mail\]/is', '/\[mail\=(.*?)\](.*?)\[\/mail\]/is', - '/\[list\](.*?)\[\/list\]/is' + '/\[list\](.*?)\[\/list\]/is', + '/\[list=1\](.*?)\[\/list\]/is', + '/\[\*\]/is' ); $simple_replace = array( @@ -75,13 +77,16 @@ function bbcode_format ($str) '<a href="$1">$2</a>', '<div style="text-align: $1">$2</align>', '<font style="font-size:$1px;">$2</font>', - '<img src="$1" alt="$2"/>', - '<img src=\"$2\" align=\"$1\" />', + '<img src="$1"/>', + '<img src="$2" align="$1" style="padding:5px;" />', '<a href="mailto:$1">$1</a>', '<a href="mailto:$1">$2</a>', - '<li style="list-style-position: inside; padding:10px">$1</li>' + '<ul class="listbullet">$1</ul>', + '<ol>$1</ol>', + '<li>' ); + $str = preg_replace ($simple_search, $simple_replace, $str); $str = nl2br($str); return $str; diff --git a/include/sql.class.php b/include/sql.class.php index c32de63..cb95a83 100644 --- a/include/sql.class.php +++ b/include/sql.class.php @@ -162,6 +162,12 @@ class Bayonet_SQL return mysqli_num_rows($result); } + + public function InsertID(){ + decho("Fetching insert id for auto increment"); + + return mysqli_insert_id($GLOBALS['___mysqli_ston']); + } } ?> @@ -1,19 +1,19 @@ -<?php
-
-/**
- * DO NOT MOVE THESE DEFINES
- */
-define('BAYONET_ROOT', basename(dirname('.')));
-define('BAYONET_INCLUDE', BAYONET_ROOT . '/include');
-define('BAYONET_CONFIG', BAYONET_ROOT . '/include/config.ini');
-
-require BAYONET_INCLUDE . '/debug.php';
-require BAYONET_INCLUDE . '/sql.class.php';
-require BAYONET_INCLUDE . '/functions.php';
-require_once BAYONET_INCLUDE . '/classes.php';
-
-/* Initialize Bayonet CMS */
-Bayonet::init();
-
-
+<?php + +/** + * DO NOT MOVE THESE DEFINES + */ +define('BAYONET_ROOT', basename(dirname('.'))); +define('BAYONET_INCLUDE', BAYONET_ROOT . '/include'); +define('BAYONET_CONFIG', BAYONET_ROOT . '/include/config.ini'); + +require BAYONET_INCLUDE . '/debug.php'; +require BAYONET_INCLUDE . '/sql.class.php'; +require BAYONET_INCLUDE . '/functions.php'; +require_once BAYONET_INCLUDE . '/classes.php'; + +/* Initialize Bayonet CMS */ +Bayonet::init(); + + ?>
\ No newline at end of file diff --git a/modules/admin/admin_functions.php b/modules/admin/admin_functions.php index 6c2b394..d0d54a8 100644 --- a/modules/admin/admin_functions.php +++ b/modules/admin/admin_functions.php @@ -1,152 +1,152 @@ -<?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>";
-}
- */
+<?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 index 0138839..2c7b166 100644 --- a/modules/admin/blocks/functions.php +++ b/modules/admin/blocks/functions.php @@ -1,173 +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");
- $blocks = $db->Fetch();
-
- 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.
- // {{{ XXX: FIXME -- Re-write this
- /*
- $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> <button name="cancel">No</button></th></tr>
- </table>
- </form>
- <?php
-}
-
-?>
+<?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"); + $blocks = $db->Fetch(); + + 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. + // {{{ XXX: FIXME -- Re-write this + /* + $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> <button name="cancel">No</button></th></tr> + </table> + </form> + <?php +} + +?> diff --git a/modules/admin/blocks/index.php b/modules/admin/blocks/index.php index 6dac3d2..8d63b6d 100644 --- a/modules/admin/blocks/index.php +++ b/modules/admin/blocks/index.php @@ -1,59 +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();
-
+<?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/index.php b/modules/admin/index.php index fc379ea..667dc6e 100644 --- a/modules/admin/index.php +++ b/modules/admin/index.php @@ -1,73 +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 )
- }
- } */
-
+<?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 index 2c66ff4..4fb687b 100644 --- a/modules/admin/operation.php +++ b/modules/admin/operation.php @@ -1,53 +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.");
-}
-
-
-*/
+<?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 index fc97ffc..f71f90f 100644 --- a/modules/admin/pages/functions.php +++ b/modules/admin/pages/functions.php @@ -1,227 +1,227 @@ -<?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`");
- $articles = $db->Fetch($result);
-
- 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.
- // {{{ XXX: FIXME -- Needs to be re-written
- /*
- $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;
- $pages = $db->Query("SELECT page_id,title FROM bayonet_pages");
-
- echo 'Select page: <select id="pagenames" onchange="gotoEditPage(this.id)">';
- echo '<option value="0">- - - - - - - -</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" /> View this Page','?load=page&id='.$page_id); ?></td>
- <td class="right"><?php echo LinkInternal('<img src="images/delete.gif" /> 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> <button name="cancel">No</button></th></tr>
- </table>
- </form>
- <?php
-}
-
-?>
+<?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`"); + $articles = $db->Fetch($result); + + 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. + // {{{ XXX: FIXME -- Needs to be re-written + /* + $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; + $pages = $db->Query("SELECT page_id,title FROM bayonet_pages"); + + echo 'Select page: <select id="pagenames" onchange="gotoEditPage(this.id)">'; + echo '<option value="0">- - - - - - - -</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" /> View this Page','?load=page&id='.$page_id); ?></td> + <td class="right"><?php echo LinkInternal('<img src="images/delete.gif" /> 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> <button name="cancel">No</button></th></tr> + </table> + </form> + <?php +} + +?> diff --git a/modules/admin/pages/index.php b/modules/admin/pages/index.php index 0fb6cff..cb36250 100644 --- a/modules/admin/pages/index.php +++ b/modules/admin/pages/index.php @@ -1,68 +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" /> Create a Page','?load=admin&op=pages&create=true'); ?>
- </td>
-
- <tr>
- </table>
- </fieldset>
-</div>
+<?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" /> Create a Page','?load=admin&op=pages&create=true'); ?> + </td> + + <tr> + </table> + </fieldset> +</div> diff --git a/modules/cu3er/config.xml b/modules/cu3er/config.xml new file mode 100644 index 0000000..6cfef6e --- /dev/null +++ b/modules/cu3er/config.xml @@ -0,0 +1,86 @@ +<cu3er> + <settings> + <auto_play> + <defaults symbol="linear" /> + <tweenIn x="5" y="5" width="630" height="10" tint="0xFFFFFF" alpha="0.5"/> + <tweenOver alpha="1"/> + </auto_play> + + <prev_button> + <tweenIn x="20" y="150" width="80" height="80" alpha="0" /> + <tweenOver alpha="0" /> + </prev_button> + + <next_button> + <tweenIn x="610" y="150" width="80" height="80" alpha="0" /> + <tweenOver alpha="0" /> + </next_button> + + <prev_symbol> + <defaults type="2" /> + <tweenIn x="25" y="150" alpha=".5" scaleX="2.0" scaleY="2.0" /> + <tweenOver time="0.15" x="30" scaleX="2.5" scaleY="2.5" /> + </prev_symbol> + + <next_symbol> + <defaults type="2" /> + <tweenIn x="615" y="150" alpha=".5" scaleX="2.0" scaleY="2.0" /> + <tweenOver time="0.15" x="620" scaleX="2.5" scaleY="2.5" /> + </next_symbol> + + <description> + <defaults + round_corners="0, 0, 0, 0" + + heading_font="Verdana" + heading_text_size="42" + heading_text_color="0xFFFFFF" + heading_text_margin="0, 0, 0,24" + + paragraph_font="Verdana" + paragraph_text_size="11" + paragraph_text_color="0xFFFFFF" + paragraph_text_margin="0, 0, 0, 24" + /> + <tweenIn x="0" y="220" width="640" height="100" alpha="0.15" /> + <tweenOver alpha="0.3"/> + </description> + + <transitions slicing="vertical" direction="down" duration="1.0" delay="0.2" cube_color="0x000000" /> + + </settings> + + + <slides> + + <slide> + <url>http://www.3rd-infantry-division.org/modules/cu3er/images/team2.png</url> + </slide> + + <transition direction="left"/> + + <slide> + <url>http://www.3rd-infantry-division.org/modules/cu3er/images/arma2.png</url> + <link target="_self">http://www.3rd-infantry-division.org/forums/index.php?board=13.0</link> + </slide> + + <transition duration="0.6" delay=".2" direction="down"/> + + <slide> + <url>http://www.3rd-infantry-division.org/modules/cu3er/images/agwc3.png</url> + </slide> + + <transition num="3" slicing="horizontal" direction="left" delay="0.05"/> + + <slide> + <url>http://www.3rd-infantry-division.org/modules/cu3er/images/recruitmentGT.png</url> + </slide> + + <transition num="3"/> + + <slide> + <url>http://www.3rd-infantry-division.org/modules/cu3er/images/arma2move.png</url> + </slide> + + </slides> +</cu3er>
\ No newline at end of file diff --git a/modules/cu3er/config2.xml b/modules/cu3er/config2.xml new file mode 100644 index 0000000..90db48a --- /dev/null +++ b/modules/cu3er/config2.xml @@ -0,0 +1,80 @@ +<?xml version="1.0" encoding="utf-8" ?> +<cu3er> + <settings> + + <auto_play> + <defaults symbol="linear" /> + <tweenIn x="5" y="5" width="6" height="1" tint="0xFFFFFF" alpha="0.5"/> + <tweenOver alpha="1"/> + </auto_play> + + <prev_button> + <tweenIn x="20" y="150" width="80" height="80" alpha="0" /> + <tweenOver alpha="0" /> + </prev_button> + + <next_button> + <tweenIn x="610" y="150" width="80" height="80" alpha="0" /> + <tweenOver alpha="0" /> + </next_button> + + + + <description> + <defaults + round_corners="0, 0, 0, 0" + + heading_font="Verdana" + heading_text_size="42" + heading_text_color="0xFFFFFF" + heading_text_margin="0, 0, 0,24" + + paragraph_font="Verdana" + paragraph_text_size="11" + paragraph_text_color="0xFFFFFF" + paragraph_text_margin="0, 0, 0, 24" + /> + <tweenIn x="0" y="220" width="640" height="100" alpha="0.15" /> + <tweenOver alpha="0.3"/> + </description> + + <transitions slicing="vertical" direction="down" duration="1.0" delay="0.2" cube_color="0x000000" /> + + </settings> + + + <slides> + + <slide> + <url>http://www.3rd-infantry-division.org/modules/cu3er/images/team2.png</url> + </slide> + + <transition direction="left"/> + + <slide> + <url>http://www.3rd-infantry-division.org/modules/cu3er/images/arma2.png</url> + <link target="_self">http://www.3rd-infantry-division.org/forums/index.php?board=13.0</link> + </slide> + + <transition duration="0.6" delay=".2" direction="down"/> + + <slide> + <url>http://www.3rd-infantry-division.org/modules/cu3er/images/agwc3.png</url> + <link target="_blank">http://www.armedglobalwarfare.com</link> + </slide> + + <transition num="3" slicing="horizontal" direction="left" delay="0.05"/> + + <slide> + <url>http://www.3rd-infantry-division.org/modules/cu3er/images/recruitmentGT.png</url> + </slide> + + <transition num="3"/> + + <slide> + <url>http://www.3rd-infantry-division.org/modules/cu3er/images/arma2move.png</url> + </slide> + + </slides> +</cu3er> + diff --git a/modules/cu3er/cu3er.swf b/modules/cu3er/cu3er.swf Binary files differnew file mode 100644 index 0000000..eac3a9e --- /dev/null +++ b/modules/cu3er/cu3er.swf diff --git a/modules/cu3er/cuber.html b/modules/cu3er/cuber.html new file mode 100644 index 0000000..c7eee14 --- /dev/null +++ b/modules/cu3er/cuber.html @@ -0,0 +1,25 @@ +<!-- STEP ONE: insert path to SWFObject JavaScript -->
+<script type="text/javascript" src="js/swfobject/swfobject.js"></script>
+
+<!-- STEP TWO: configure SWFObject JavaScript and embed CU3ER slider -->
+<script type="text/javascript">
+ var flashvars = {};
+ flashvars.xml = "config2.xml";
+ flashvars.font = "font.swf";
+ var attributes = {};
+ attributes.wmode = "transparent";
+ attributes.id = "slider";
+ swfobject.embedSWF("cu3er.swf", "cu3er-container", "640", "320", "9", "expressInstall.swf", flashvars, attributes);
+</script>
+<style type="text/css">
+<!--
+#cu3er-container {width:640px; outline:0;}
+-->
+</style>
+
+<!-- STEP THREE: insert CU3ER div container -->
+<div id="cu3er-container">
+ <a href="http://www.adobe.com/go/getflashplayer">
+ <img src="http://www.adobe.com/images/shared/download_buttons/get_flash_player.gif" alt="Get Adobe Flash player" />
+ </a>
+</div>
\ No newline at end of file diff --git a/modules/cu3er/demo.htm b/modules/cu3er/demo.htm new file mode 100644 index 0000000..8ff0064 --- /dev/null +++ b/modules/cu3er/demo.htm @@ -0,0 +1,35 @@ +<!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>CU3ER - demo!</title> + +<!-- STEP ONE: insert path to SWFObject JavaScript --> +<script type="text/javascript" src="js/swfobject/swfobject.js"></script> + +<!-- STEP TWO: configure SWFObject JavaScript and embed CU3ER slider --> +<script type="text/javascript"> + var flashvars = {}; + flashvars.xml = "config2.xml"; + flashvars.font = "font.swf"; + var attributes = {}; + attributes.wmode = "transparent"; + attributes.id = "slider"; + swfobject.embedSWF("cu3er.swf", "cu3er-container", "640", "320", "9", "expressInstall.swf", flashvars, attributes); +</script> +<style type="text/css"> +<!-- +body { margin: 5% auto; text-align:center;} +#cu3er-container {width:600px; outline:0;} +--> +</style> +</head> +<body> +<!-- STEP THREE: insert CU3ER div container --> +<div id="cu3er-container"> + <a href="http://www.adobe.com/go/getflashplayer"> + <img src="http://www.adobe.com/images/shared/download_buttons/get_flash_player.gif" alt="Get Adobe Flash player" /> + </a> +</div> +</body> +</html> diff --git a/modules/cu3er/images/agwc3.png b/modules/cu3er/images/agwc3.png Binary files differnew file mode 100644 index 0000000..7b6f9a7 --- /dev/null +++ b/modules/cu3er/images/agwc3.png diff --git a/modules/cu3er/images/arma2.png b/modules/cu3er/images/arma2.png Binary files differnew file mode 100644 index 0000000..94fab4a --- /dev/null +++ b/modules/cu3er/images/arma2.png diff --git a/modules/cu3er/images/arma2move.png b/modules/cu3er/images/arma2move.png Binary files differnew file mode 100644 index 0000000..6bffbae --- /dev/null +++ b/modules/cu3er/images/arma2move.png diff --git a/modules/cu3er/images/holidays.png b/modules/cu3er/images/holidays.png Binary files differnew file mode 100644 index 0000000..48a1c72 --- /dev/null +++ b/modules/cu3er/images/holidays.png diff --git a/modules/cu3er/images/newsite.png b/modules/cu3er/images/newsite.png Binary files differnew file mode 100644 index 0000000..b2d2b69 --- /dev/null +++ b/modules/cu3er/images/newsite.png diff --git a/modules/cu3er/images/recruitmentGT.png b/modules/cu3er/images/recruitmentGT.png Binary files differnew file mode 100644 index 0000000..c74ae8c --- /dev/null +++ b/modules/cu3er/images/recruitmentGT.png diff --git a/modules/cu3er/images/slide_1.jpg b/modules/cu3er/images/slide_1.jpg Binary files differnew file mode 100644 index 0000000..77706a2 --- /dev/null +++ b/modules/cu3er/images/slide_1.jpg diff --git a/modules/cu3er/images/slide_2.jpg b/modules/cu3er/images/slide_2.jpg Binary files differnew file mode 100644 index 0000000..3707266 --- /dev/null +++ b/modules/cu3er/images/slide_2.jpg diff --git a/modules/cu3er/images/slide_3.jpg b/modules/cu3er/images/slide_3.jpg Binary files differnew file mode 100644 index 0000000..c633d52 --- /dev/null +++ b/modules/cu3er/images/slide_3.jpg diff --git a/modules/cu3er/images/slide_4.jpg b/modules/cu3er/images/slide_4.jpg Binary files differnew file mode 100644 index 0000000..08bc870 --- /dev/null +++ b/modules/cu3er/images/slide_4.jpg diff --git a/modules/cu3er/images/slide_5.jpg b/modules/cu3er/images/slide_5.jpg Binary files differnew file mode 100644 index 0000000..2564999 --- /dev/null +++ b/modules/cu3er/images/slide_5.jpg diff --git a/modules/cu3er/images/team.png b/modules/cu3er/images/team.png Binary files differnew file mode 100644 index 0000000..fe307c1 --- /dev/null +++ b/modules/cu3er/images/team.png diff --git a/modules/cu3er/images/team2.png b/modules/cu3er/images/team2.png Binary files differnew file mode 100644 index 0000000..889a266 --- /dev/null +++ b/modules/cu3er/images/team2.png diff --git a/modules/cu3er/images/teamwork.png b/modules/cu3er/images/teamwork.png Binary files differnew file mode 100644 index 0000000..99f760b --- /dev/null +++ b/modules/cu3er/images/teamwork.png diff --git a/modules/cu3er/index.php b/modules/cu3er/index.php new file mode 100644 index 0000000..0e5202d --- /dev/null +++ b/modules/cu3er/index.php @@ -0,0 +1,35 @@ +<?php OpenContent(); ?>
+<!-- STEP ONE: insert path to SWFObject JavaScript -->
+<script type="text/javascript" src="modules/cu3er/js/swfobject/swfobject.js"></script>
+
+<!-- STEP TWO: configure SWFObject JavaScript and embed CU3ER slider -->
+<script type="text/javascript">
+ var flashvars = {};
+ flashvars.xml = "modules/cu3er/config2.xml";
+ flashvars.font = "font.swf";
+ var attributes = {};
+ attributes.wmode = "transparent";
+ attributes.id = "slider";
+ swfobject.embedSWF("modules/cu3er/cu3er.swf", "cu3er-container", "640", "320", "9", "modules/cu3er/js/swfobject/expressInstall.swf", flashvars, attributes);
+</script>
+<style type="text/css">
+<!--
+#cu3er-container {width:640px; outline:0;}
+-->
+</style>
+
+<!-- STEP THREE: insert CU3ER div container -->
+<div id="cu3er-container" style="background-color:black;">
+ <a href="http://www.adobe.com/go/getflashplayer">
+ <img src="http://www.adobe.com/images/shared/download_buttons/get_flash_player.gif" alt="Get Adobe Flash player" />
+ </a>
+</div>
+<?php CloseContent(); ?>
+
+<?//php include'cuber.html';
+
+/* <description>
+ <link target="_blank">http://www.3rd-infantry-division.org/forums/index.php?board=13.0</link>
+ <heading>Enlist Today!</heading>
+ <paragraph>Some text.</paragraph>
+ </description> */
\ No newline at end of file diff --git a/modules/cu3er/js/swfobject/expressInstall.swf b/modules/cu3er/js/swfobject/expressInstall.swf Binary files differnew file mode 100644 index 0000000..e972996 --- /dev/null +++ b/modules/cu3er/js/swfobject/expressInstall.swf diff --git a/modules/cu3er/js/swfobject/swfobject.js b/modules/cu3er/js/swfobject/swfobject.js new file mode 100644 index 0000000..9378c8f --- /dev/null +++ b/modules/cu3er/js/swfobject/swfobject.js @@ -0,0 +1,777 @@ +/*! SWFObject v2.2 <http://code.google.com/p/swfobject/> + is released under the MIT License <http://www.opensource.org/licenses/mit-license.php> +*/ + +var swfobject = function() { + + var UNDEF = "undefined", + OBJECT = "object", + SHOCKWAVE_FLASH = "Shockwave Flash", + SHOCKWAVE_FLASH_AX = "ShockwaveFlash.ShockwaveFlash", + FLASH_MIME_TYPE = "application/x-shockwave-flash", + EXPRESS_INSTALL_ID = "SWFObjectExprInst", + ON_READY_STATE_CHANGE = "onreadystatechange", + + win = window, + doc = document, + nav = navigator, + + plugin = false, + domLoadFnArr = [main], + regObjArr = [], + objIdArr = [], + listenersArr = [], + storedAltContent, + storedAltContentId, + storedCallbackFn, + storedCallbackObj, + isDomLoaded = false, + isExpressInstallActive = false, + dynamicStylesheet, + dynamicStylesheetMedia, + autoHideShow = true, + + /* Centralized function for browser feature detection + - User agent string detection is only used when no good alternative is possible + - Is executed directly for optimal performance + */ + ua = function() { + var w3cdom = typeof doc.getElementById != UNDEF && typeof doc.getElementsByTagName != UNDEF && typeof doc.createElement != UNDEF, + u = nav.userAgent.toLowerCase(), + p = nav.platform.toLowerCase(), + windows = p ? /win/.test(p) : /win/.test(u), + mac = p ? /mac/.test(p) : /mac/.test(u), + webkit = /webkit/.test(u) ? parseFloat(u.replace(/^.*webkit\/(\d+(\.\d+)?).*$/, "$1")) : false, // returns either the webkit version or false if not webkit + ie = !+"\v1", // feature detection based on Andrea Giammarchi's solution: http://webreflection.blogspot.com/2009/01/32-bytes-to-know-if-your-browser-is-ie.html + playerVersion = [0,0,0], + d = null; + if (typeof nav.plugins != UNDEF && typeof nav.plugins[SHOCKWAVE_FLASH] == OBJECT) { + d = nav.plugins[SHOCKWAVE_FLASH].description; + if (d && !(typeof nav.mimeTypes != UNDEF && nav.mimeTypes[FLASH_MIME_TYPE] && !nav.mimeTypes[FLASH_MIME_TYPE].enabledPlugin)) { // navigator.mimeTypes["application/x-shockwave-flash"].enabledPlugin indicates whether plug-ins are enabled or disabled in Safari 3+ + plugin = true; + ie = false; // cascaded feature detection for Internet Explorer + d = d.replace(/^.*\s+(\S+\s+\S+$)/, "$1"); + playerVersion[0] = parseInt(d.replace(/^(.*)\..*$/, "$1"), 10); + playerVersion[1] = parseInt(d.replace(/^.*\.(.*)\s.*$/, "$1"), 10); + playerVersion[2] = /[a-zA-Z]/.test(d) ? parseInt(d.replace(/^.*[a-zA-Z]+(.*)$/, "$1"), 10) : 0; + } + } + else if (typeof win.ActiveXObject != UNDEF) { + try { + var a = new ActiveXObject(SHOCKWAVE_FLASH_AX); + if (a) { // a will return null when ActiveX is disabled + d = a.GetVariable("$version"); + if (d) { + ie = true; // cascaded feature detection for Internet Explorer + d = d.split(" ")[1].split(","); + playerVersion = [parseInt(d[0], 10), parseInt(d[1], 10), parseInt(d[2], 10)]; + } + } + } + catch(e) {} + } + return { w3:w3cdom, pv:playerVersion, wk:webkit, ie:ie, win:windows, mac:mac }; + }(), + + /* Cross-browser onDomLoad + - Will fire an event as soon as the DOM of a web page is loaded + - Internet Explorer workaround based on Diego Perini's solution: http://javascript.nwbox.com/IEContentLoaded/ + - Regular onload serves as fallback + */ + onDomLoad = function() { + if (!ua.w3) { return; } + if ((typeof doc.readyState != UNDEF && doc.readyState == "complete") || (typeof doc.readyState == UNDEF && (doc.getElementsByTagName("body")[0] || doc.body))) { // function is fired after onload, e.g. when script is inserted dynamically + callDomLoadFunctions(); + } + if (!isDomLoaded) { + if (typeof doc.addEventListener != UNDEF) { + doc.addEventListener("DOMContentLoaded", callDomLoadFunctions, false); + } + if (ua.ie && ua.win) { + doc.attachEvent(ON_READY_STATE_CHANGE, function() { + if (doc.readyState == "complete") { + doc.detachEvent(ON_READY_STATE_CHANGE, arguments.callee); + callDomLoadFunctions(); + } + }); + if (win == top) { // if not inside an iframe + (function(){ + if (isDomLoaded) { return; } + try { + doc.documentElement.doScroll("left"); + } + catch(e) { + setTimeout(arguments.callee, 0); + return; + } + callDomLoadFunctions(); + })(); + } + } + if (ua.wk) { + (function(){ + if (isDomLoaded) { return; } + if (!/loaded|complete/.test(doc.readyState)) { + setTimeout(arguments.callee, 0); + return; + } + callDomLoadFunctions(); + })(); + } + addLoadEvent(callDomLoadFunctions); + } + }(); + + function callDomLoadFunctions() { + if (isDomLoaded) { return; } + try { // test if we can really add/remove elements to/from the DOM; we don't want to fire it too early + var t = doc.getElementsByTagName("body")[0].appendChild(createElement("span")); + t.parentNode.removeChild(t); + } + catch (e) { return; } + isDomLoaded = true; + var dl = domLoadFnArr.length; + for (var i = 0; i < dl; i++) { + domLoadFnArr[i](); + } + } + + function addDomLoadEvent(fn) { + if (isDomLoaded) { + fn(); + } + else { + domLoadFnArr[domLoadFnArr.length] = fn; // Array.push() is only available in IE5.5+ + } + } + + /* Cross-browser onload + - Based on James Edwards' solution: http://brothercake.com/site/resources/scripts/onload/ + - Will fire an event as soon as a web page including all of its assets are loaded + */ + function addLoadEvent(fn) { + if (typeof win.addEventListener != UNDEF) { + win.addEventListener("load", fn, false); + } + else if (typeof doc.addEventListener != UNDEF) { + doc.addEventListener("load", fn, false); + } + else if (typeof win.attachEvent != UNDEF) { + addListener(win, "onload", fn); + } + else if (typeof win.onload == "function") { + var fnOld = win.onload; + win.onload = function() { + fnOld(); + fn(); + }; + } + else { + win.onload = fn; + } + } + + /* Main function + - Will preferably execute onDomLoad, otherwise onload (as a fallback) + */ + function main() { + if (plugin) { + testPlayerVersion(); + } + else { + matchVersions(); + } + } + + /* Detect the Flash Player version for non-Internet Explorer browsers + - Detecting the plug-in version via the object element is more precise than using the plugins collection item's description: + a. Both release and build numbers can be detected + b. Avoid wrong descriptions by corrupt installers provided by Adobe + c. Avoid wrong descriptions by multiple Flash Player entries in the plugin Array, caused by incorrect browser imports + - Disadvantage of this method is that it depends on the availability of the DOM, while the plugins collection is immediately available + */ + function testPlayerVersion() { + var b = doc.getElementsByTagName("body")[0]; + var o = createElement(OBJECT); + o.setAttribute("type", FLASH_MIME_TYPE); + var t = b.appendChild(o); + if (t) { + var counter = 0; + (function(){ + if (typeof t.GetVariable != UNDEF) { + var d = t.GetVariable("$version"); + if (d) { + d = d.split(" ")[1].split(","); + ua.pv = [parseInt(d[0], 10), parseInt(d[1], 10), parseInt(d[2], 10)]; + } + } + else if (counter < 10) { + counter++; + setTimeout(arguments.callee, 10); + return; + } + b.removeChild(o); + t = null; + matchVersions(); + })(); + } + else { + matchVersions(); + } + } + + /* Perform Flash Player and SWF version matching; static publishing only + */ + function matchVersions() { + var rl = regObjArr.length; + if (rl > 0) { + for (var i = 0; i < rl; i++) { // for each registered object element + var id = regObjArr[i].id; + var cb = regObjArr[i].callbackFn; + var cbObj = {success:false, id:id}; + if (ua.pv[0] > 0) { + var obj = getElementById(id); + if (obj) { + if (hasPlayerVersion(regObjArr[i].swfVersion) && !(ua.wk && ua.wk < 312)) { // Flash Player version >= published SWF version: Houston, we have a match! + setVisibility(id, true); + if (cb) { + cbObj.success = true; + cbObj.ref = getObjectById(id); + cb(cbObj); + } + } + else if (regObjArr[i].expressInstall && canExpressInstall()) { // show the Adobe Express Install dialog if set by the web page author and if supported + var att = {}; + att.data = regObjArr[i].expressInstall; + att.width = obj.getAttribute("width") || "0"; + att.height = obj.getAttribute("height") || "0"; + if (obj.getAttribute("class")) { att.styleclass = obj.getAttribute("class"); } + if (obj.getAttribute("align")) { att.align = obj.getAttribute("align"); } + // parse HTML object param element's name-value pairs + var par = {}; + var p = obj.getElementsByTagName("param"); + var pl = p.length; + for (var j = 0; j < pl; j++) { + if (p[j].getAttribute("name").toLowerCase() != "movie") { + par[p[j].getAttribute("name")] = p[j].getAttribute("value"); + } + } + showExpressInstall(att, par, id, cb); + } + else { // Flash Player and SWF version mismatch or an older Webkit engine that ignores the HTML object element's nested param elements: display alternative content instead of SWF + displayAltContent(obj); + if (cb) { cb(cbObj); } + } + } + } + else { // if no Flash Player is installed or the fp version cannot be detected we let the HTML object element do its job (either show a SWF or alternative content) + setVisibility(id, true); + if (cb) { + var o = getObjectById(id); // test whether there is an HTML object element or not + if (o && typeof o.SetVariable != UNDEF) { + cbObj.success = true; + cbObj.ref = o; + } + cb(cbObj); + } + } + } + } + } + + function getObjectById(objectIdStr) { + var r = null; + var o = getElementById(objectIdStr); + if (o && o.nodeName == "OBJECT") { + if (typeof o.SetVariable != UNDEF) { + r = o; + } + else { + var n = o.getElementsByTagName(OBJECT)[0]; + if (n) { + r = n; + } + } + } + return r; + } + + /* Requirements for Adobe Express Install + - only one instance can be active at a time + - fp 6.0.65 or higher + - Win/Mac OS only + - no Webkit engines older than version 312 + */ + function canExpressInstall() { + return !isExpressInstallActive && hasPlayerVersion("6.0.65") && (ua.win || ua.mac) && !(ua.wk && ua.wk < 312); + } + + /* Show the Adobe Express Install dialog + - Reference: http://www.adobe.com/cfusion/knowledgebase/index.cfm?id=6a253b75 + */ + function showExpressInstall(att, par, replaceElemIdStr, callbackFn) { + isExpressInstallActive = true; + storedCallbackFn = callbackFn || null; + storedCallbackObj = {success:false, id:replaceElemIdStr}; + var obj = getElementById(replaceElemIdStr); + if (obj) { + if (obj.nodeName == "OBJECT") { // static publishing + storedAltContent = abstractAltContent(obj); + storedAltContentId = null; + } + else { // dynamic publishing + storedAltContent = obj; + storedAltContentId = replaceElemIdStr; + } + att.id = EXPRESS_INSTALL_ID; + if (typeof att.width == UNDEF || (!/%$/.test(att.width) && parseInt(att.width, 10) < 310)) { att.width = "310"; } + if (typeof att.height == UNDEF || (!/%$/.test(att.height) && parseInt(att.height, 10) < 137)) { att.height = "137"; } + doc.title = doc.title.slice(0, 47) + " - Flash Player Installation"; + var pt = ua.ie && ua.win ? "ActiveX" : "PlugIn", + fv = "MMredirectURL=" + win.location.toString().replace(/&/g,"%26") + "&MMplayerType=" + pt + "&MMdoctitle=" + doc.title; + if (typeof par.flashvars != UNDEF) { + par.flashvars += "&" + fv; + } + else { + par.flashvars = fv; + } + // IE only: when a SWF is loading (AND: not available in cache) wait for the readyState of the object element to become 4 before removing it, + // because you cannot properly cancel a loading SWF file without breaking browser load references, also obj.onreadystatechange doesn't work + if (ua.ie && ua.win && obj.readyState != 4) { + var newObj = createElement("div"); + replaceElemIdStr += "SWFObjectNew"; + newObj.setAttribute("id", replaceElemIdStr); + obj.parentNode.insertBefore(newObj, obj); // insert placeholder div that will be replaced by the object element that loads expressinstall.swf + obj.style.display = "none"; + (function(){ + if (obj.readyState == 4) { + obj.parentNode.removeChild(obj); + } + else { + setTimeout(arguments.callee, 10); + } + })(); + } + createSWF(att, par, replaceElemIdStr); + } + } + + /* Functions to abstract and display alternative content + */ + function displayAltContent(obj) { + if (ua.ie && ua.win && obj.readyState != 4) { + // IE only: when a SWF is loading (AND: not available in cache) wait for the readyState of the object element to become 4 before removing it, + // because you cannot properly cancel a loading SWF file without breaking browser load references, also obj.onreadystatechange doesn't work + var el = createElement("div"); + obj.parentNode.insertBefore(el, obj); // insert placeholder div that will be replaced by the alternative content + el.parentNode.replaceChild(abstractAltContent(obj), el); + obj.style.display = "none"; + (function(){ + if (obj.readyState == 4) { + obj.parentNode.removeChild(obj); + } + else { + setTimeout(arguments.callee, 10); + } + })(); + } + else { + obj.parentNode.replaceChild(abstractAltContent(obj), obj); + } + } + + function abstractAltContent(obj) { + var ac = createElement("div"); + if (ua.win && ua.ie) { + ac.innerHTML = obj.innerHTML; + } + else { + var nestedObj = obj.getElementsByTagName(OBJECT)[0]; + if (nestedObj) { + var c = nestedObj.childNodes; + if (c) { + var cl = c.length; + for (var i = 0; i < cl; i++) { + if (!(c[i].nodeType == 1 && c[i].nodeName == "PARAM") && !(c[i].nodeType == 8)) { + ac.appendChild(c[i].cloneNode(true)); + } + } + } + } + } + return ac; + } + + /* Cross-browser dynamic SWF creation + */ + function createSWF(attObj, parObj, id) { + var r, el = getElementById(id); + if (ua.wk && ua.wk < 312) { return r; } + if (el) { + if (typeof attObj.id == UNDEF) { // if no 'id' is defined for the object element, it will inherit the 'id' from the alternative content + attObj.id = id; + } + if (ua.ie && ua.win) { // Internet Explorer + the HTML object element + W3C DOM methods do not combine: fall back to outerHTML + var att = ""; + for (var i in attObj) { + if (attObj[i] != Object.prototype[i]) { // filter out prototype additions from other potential libraries + if (i.toLowerCase() == "data") { + parObj.movie = attObj[i]; + } + else if (i.toLowerCase() == "styleclass") { // 'class' is an ECMA4 reserved keyword + att += ' class="' + attObj[i] + '"'; + } + else if (i.toLowerCase() != "classid") { + att += ' ' + i + '="' + attObj[i] + '"'; + } + } + } + var par = ""; + for (var j in parObj) { + if (parObj[j] != Object.prototype[j]) { // filter out prototype additions from other potential libraries + par += '<param name="' + j + '" value="' + parObj[j] + '" />'; + } + } + el.outerHTML = '<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000"' + att + '>' + par + '</object>'; + objIdArr[objIdArr.length] = attObj.id; // stored to fix object 'leaks' on unload (dynamic publishing only) + r = getElementById(attObj.id); + } + else { // well-behaving browsers + var o = createElement(OBJECT); + o.setAttribute("type", FLASH_MIME_TYPE); + for (var m in attObj) { + if (attObj[m] != Object.prototype[m]) { // filter out prototype additions from other potential libraries + if (m.toLowerCase() == "styleclass") { // 'class' is an ECMA4 reserved keyword + o.setAttribute("class", attObj[m]); + } + else if (m.toLowerCase() != "classid") { // filter out IE specific attribute + o.setAttribute(m, attObj[m]); + } + } + } + for (var n in parObj) { + if (parObj[n] != Object.prototype[n] && n.toLowerCase() != "movie") { // filter out prototype additions from other potential libraries and IE specific param element + createObjParam(o, n, parObj[n]); + } + } + el.parentNode.replaceChild(o, el); + r = o; + } + } + return r; + } + + function createObjParam(el, pName, pValue) { + var p = createElement("param"); + p.setAttribute("name", pName); + p.setAttribute("value", pValue); + el.appendChild(p); + } + + /* Cross-browser SWF removal + - Especially needed to safely and completely remove a SWF in Internet Explorer + */ + function removeSWF(id) { + var obj = getElementById(id); + if (obj && obj.nodeName == "OBJECT") { + if (ua.ie && ua.win) { + obj.style.display = "none"; + (function(){ + if (obj.readyState == 4) { + removeObjectInIE(id); + } + else { + setTimeout(arguments.callee, 10); + } + })(); + } + else { + obj.parentNode.removeChild(obj); + } + } + } + + function removeObjectInIE(id) { + var obj = getElementById(id); + if (obj) { + for (var i in obj) { + if (typeof obj[i] == "function") { + obj[i] = null; + } + } + obj.parentNode.removeChild(obj); + } + } + + /* Functions to optimize JavaScript compression + */ + function getElementById(id) { + var el = null; + try { + el = doc.getElementById(id); + } + catch (e) {} + return el; + } + + function createElement(el) { + return doc.createElement(el); + } + + /* Updated attachEvent function for Internet Explorer + - Stores attachEvent information in an Array, so on unload the detachEvent functions can be called to avoid memory leaks + */ + function addListener(target, eventType, fn) { + target.attachEvent(eventType, fn); + listenersArr[listenersArr.length] = [target, eventType, fn]; + } + + /* Flash Player and SWF content version matching + */ + function hasPlayerVersion(rv) { + var pv = ua.pv, v = rv.split("."); + v[0] = parseInt(v[0], 10); + v[1] = parseInt(v[1], 10) || 0; // supports short notation, e.g. "9" instead of "9.0.0" + v[2] = parseInt(v[2], 10) || 0; + return (pv[0] > v[0] || (pv[0] == v[0] && pv[1] > v[1]) || (pv[0] == v[0] && pv[1] == v[1] && pv[2] >= v[2])) ? true : false; + } + + /* Cross-browser dynamic CSS creation + - Based on Bobby van der Sluis' solution: http://www.bobbyvandersluis.com/articles/dynamicCSS.php + */ + function createCSS(sel, decl, media, newStyle) { + if (ua.ie && ua.mac) { return; } + var h = doc.getElementsByTagName("head")[0]; + if (!h) { return; } // to also support badly authored HTML pages that lack a head element + var m = (media && typeof media == "string") ? media : "screen"; + if (newStyle) { + dynamicStylesheet = null; + dynamicStylesheetMedia = null; + } + if (!dynamicStylesheet || dynamicStylesheetMedia != m) { + // create dynamic stylesheet + get a global reference to it + var s = createElement("style"); + s.setAttribute("type", "text/css"); + s.setAttribute("media", m); + dynamicStylesheet = h.appendChild(s); + if (ua.ie && ua.win && typeof doc.styleSheets != UNDEF && doc.styleSheets.length > 0) { + dynamicStylesheet = doc.styleSheets[doc.styleSheets.length - 1]; + } + dynamicStylesheetMedia = m; + } + // add style rule + if (ua.ie && ua.win) { + if (dynamicStylesheet && typeof dynamicStylesheet.addRule == OBJECT) { + dynamicStylesheet.addRule(sel, decl); + } + } + else { + if (dynamicStylesheet && typeof doc.createTextNode != UNDEF) { + dynamicStylesheet.appendChild(doc.createTextNode(sel + " {" + decl + "}")); + } + } + } + + function setVisibility(id, isVisible) { + if (!autoHideShow) { return; } + var v = isVisible ? "visible" : "hidden"; + if (isDomLoaded && getElementById(id)) { + getElementById(id).style.visibility = v; + } + else { + createCSS("#" + id, "visibility:" + v); + } + } + + /* Filter to avoid XSS attacks + */ + function urlEncodeIfNecessary(s) { + var regex = /[\\\"<>\.;]/; + var hasBadChars = regex.exec(s) != null; + return hasBadChars && typeof encodeURIComponent != UNDEF ? encodeURIComponent(s) : s; + } + + /* Release memory to avoid memory leaks caused by closures, fix hanging audio/video threads and force open sockets/NetConnections to disconnect (Internet Explorer only) + */ + var cleanup = function() { + if (ua.ie && ua.win) { + window.attachEvent("onunload", function() { + // remove listeners to avoid memory leaks + var ll = listenersArr.length; + for (var i = 0; i < ll; i++) { + listenersArr[i][0].detachEvent(listenersArr[i][1], listenersArr[i][2]); + } + // cleanup dynamically embedded objects to fix audio/video threads and force open sockets and NetConnections to disconnect + var il = objIdArr.length; + for (var j = 0; j < il; j++) { + removeSWF(objIdArr[j]); + } + // cleanup library's main closures to avoid memory leaks + for (var k in ua) { + ua[k] = null; + } + ua = null; + for (var l in swfobject) { + swfobject[l] = null; + } + swfobject = null; + }); + } + }(); + + return { + /* Public API + - Reference: http://code.google.com/p/swfobject/wiki/documentation + */ + registerObject: function(objectIdStr, swfVersionStr, xiSwfUrlStr, callbackFn) { + if (ua.w3 && objectIdStr && swfVersionStr) { + var regObj = {}; + regObj.id = objectIdStr; + regObj.swfVersion = swfVersionStr; + regObj.expressInstall = xiSwfUrlStr; + regObj.callbackFn = callbackFn; + regObjArr[regObjArr.length] = regObj; + setVisibility(objectIdStr, false); + } + else if (callbackFn) { + callbackFn({success:false, id:objectIdStr}); + } + }, + + getObjectById: function(objectIdStr) { + if (ua.w3) { + return getObjectById(objectIdStr); + } + }, + + embedSWF: function(swfUrlStr, replaceElemIdStr, widthStr, heightStr, swfVersionStr, xiSwfUrlStr, flashvarsObj, parObj, attObj, callbackFn) { + var callbackObj = {success:false, id:replaceElemIdStr}; + if (ua.w3 && !(ua.wk && ua.wk < 312) && swfUrlStr && replaceElemIdStr && widthStr && heightStr && swfVersionStr) { + setVisibility(replaceElemIdStr, false); + addDomLoadEvent(function() { + widthStr += ""; // auto-convert to string + heightStr += ""; + var att = {}; + if (attObj && typeof attObj === OBJECT) { + for (var i in attObj) { // copy object to avoid the use of references, because web authors often reuse attObj for multiple SWFs + att[i] = attObj[i]; + } + } + att.data = swfUrlStr; + att.width = widthStr; + att.height = heightStr; + var par = {}; + if (parObj && typeof parObj === OBJECT) { + for (var j in parObj) { // copy object to avoid the use of references, because web authors often reuse parObj for multiple SWFs + par[j] = parObj[j]; + } + } + if (flashvarsObj && typeof flashvarsObj === OBJECT) { + for (var k in flashvarsObj) { // copy object to avoid the use of references, because web authors often reuse flashvarsObj for multiple SWFs + if (typeof par.flashvars != UNDEF) { + par.flashvars += "&" + k + "=" + flashvarsObj[k]; + } + else { + par.flashvars = k + "=" + flashvarsObj[k]; + } + } + } + if (hasPlayerVersion(swfVersionStr)) { // create SWF + var obj = createSWF(att, par, replaceElemIdStr); + if (att.id == replaceElemIdStr) { + setVisibility(replaceElemIdStr, true); + } + callbackObj.success = true; + callbackObj.ref = obj; + } + else if (xiSwfUrlStr && canExpressInstall()) { // show Adobe Express Install + att.data = xiSwfUrlStr; + showExpressInstall(att, par, replaceElemIdStr, callbackFn); + return; + } + else { // show alternative content + setVisibility(replaceElemIdStr, true); + } + if (callbackFn) { callbackFn(callbackObj); } + }); + } + else if (callbackFn) { callbackFn(callbackObj); } + }, + + switchOffAutoHideShow: function() { + autoHideShow = false; + }, + + ua: ua, + + getFlashPlayerVersion: function() { + return { major:ua.pv[0], minor:ua.pv[1], release:ua.pv[2] }; + }, + + hasFlashPlayerVersion: hasPlayerVersion, + + createSWF: function(attObj, parObj, replaceElemIdStr) { + if (ua.w3) { + return createSWF(attObj, parObj, replaceElemIdStr); + } + else { + return undefined; + } + }, + + showExpressInstall: function(att, par, replaceElemIdStr, callbackFn) { + if (ua.w3 && canExpressInstall()) { + showExpressInstall(att, par, replaceElemIdStr, callbackFn); + } + }, + + removeSWF: function(objElemIdStr) { + if (ua.w3) { + removeSWF(objElemIdStr); + } + }, + + createCSS: function(selStr, declStr, mediaStr, newStyleBoolean) { + if (ua.w3) { + createCSS(selStr, declStr, mediaStr, newStyleBoolean); + } + }, + + addDomLoadEvent: addDomLoadEvent, + + addLoadEvent: addLoadEvent, + + getQueryParamValue: function(param) { + var q = doc.location.search || doc.location.hash; + if (q) { + if (/\?/.test(q)) { q = q.split("?")[1]; } // strip question mark + if (param == null) { + return urlEncodeIfNecessary(q); + } + var pairs = q.split("&"); + for (var i = 0; i < pairs.length; i++) { + if (pairs[i].substring(0, pairs[i].indexOf("=")) == param) { + return urlEncodeIfNecessary(pairs[i].substring((pairs[i].indexOf("=") + 1))); + } + } + } + return ""; + }, + + // For internal usage only + expressInstallCallback: function() { + if (isExpressInstallActive) { + var obj = getElementById(EXPRESS_INSTALL_ID); + if (obj && storedAltContent) { + obj.parentNode.replaceChild(storedAltContent, obj); + if (storedAltContentId) { + setVisibility(storedAltContentId, true); + if (ua.ie && ua.win) { storedAltContent.style.display = "block"; } + } + if (storedCallbackFn) { storedCallbackFn(storedCallbackObj); } + } + isExpressInstallActive = false; + } + } + }; +}(); diff --git a/modules/cu3er/license.txt b/modules/cu3er/license.txt new file mode 100644 index 0000000..24f51bb --- /dev/null +++ b/modules/cu3er/license.txt @@ -0,0 +1,53 @@ +Copyright (c) 2010, Stefan Kovac +All rights reserved. + +By downloading CU3ER v0.9.2 - flash 3D slider, you agree to the following: + +Stefan Kovac grants you the non-exclusive, non-transferable license +to use CU3ER subject to the restrictions defined below. + + * You may use CU3ER in personal and / or commercial projects. + + * You may implement CU3ER in an unlimited number of websites and + offline presentations, as long as you are acting as the administrator + and / or developer for those websites and / or presentations. + + * You may deploy SWFs containing CU3ER as part of hired work for + a third party as long as the SWF is unique to said party and not + replicated / resold / redistributed as part of a template, + application or service to additional parties. + + * SWF containing CU3ER may not be embedded as part of a template, + application, and / or web site where stated template, application, + and/or web site is re-sold and / or re-distributed for independent + use by third parties, without specific prior written permission. + + * SWFs containing CU3ER may not be embedded in a template, content + management system, and / or online web service in a manner where the + SWF is replicated and used as a slideshow viewer for photos contributed + by more than one party. + + * CU3ER may not be sub-licensed or resold. + + * You agree not to decompile, reverse engineer, disassemble, or otherwise + determine or attempt to determine source code for the executable code + of CU3ER, and agrees not to permit or authorize anyone else to do so. + + * CU3ER redistribution must reproduce the above copyright notice, this + list of conditions and the disclaimer in the documentation and/or + other materials provided with the distribution. + + * Neither the name of CU3ER nor the name of it contributor (Stefan Kovac) + may be used to endorse or promote products associated with CU3ER without + specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY STEFAN KOVAC ''AS IS'' AND ANY +EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +DISCLAIMED. IN NO EVENT SHALL STEFAN KOVAC BE LIABLE FOR ANY +DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES +(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND +ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS +SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
\ No newline at end of file diff --git a/modules/download/files/MILPACS_RC1_b.zip b/modules/download/files/MILPACS_RC1_b.zip Binary files differnew file mode 100644 index 0000000..24b7dab --- /dev/null +++ b/modules/download/files/MILPACS_RC1_b.zip diff --git a/modules/download/files/MarneMessenger_1-1.pdf b/modules/download/files/MarneMessenger_1-1.pdf Binary files differnew file mode 100644 index 0000000..12bead4 --- /dev/null +++ b/modules/download/files/MarneMessenger_1-1.pdf diff --git a/modules/download/files/MarneMessenger_1-2.pdf b/modules/download/files/MarneMessenger_1-2.pdf Binary files differnew file mode 100644 index 0000000..0090c30 --- /dev/null +++ b/modules/download/files/MarneMessenger_1-2.pdf diff --git a/modules/download/files/MarneMessenger_2-1.pdf b/modules/download/files/MarneMessenger_2-1.pdf Binary files differnew file mode 100644 index 0000000..614e329 --- /dev/null +++ b/modules/download/files/MarneMessenger_2-1.pdf diff --git a/modules/download/files/MarneMessenger_2-2.pdf b/modules/download/files/MarneMessenger_2-2.pdf Binary files differnew file mode 100644 index 0000000..016ccf9 --- /dev/null +++ b/modules/download/files/MarneMessenger_2-2.pdf diff --git a/modules/download/files/Milpacs_RC2.zip b/modules/download/files/Milpacs_RC2.zip Binary files differnew file mode 100644 index 0000000..7546eda --- /dev/null +++ b/modules/download/files/Milpacs_RC2.zip diff --git a/modules/download/index.php b/modules/download/index.php index b819e8d..8cd1d99 100644 --- a/modules/download/index.php +++ b/modules/download/index.php @@ -1,134 +1,134 @@ -<?php
-/**
- * Bayonet Content Management System
- * Copyright (C) 2008 Joseph Hunkeler & Evan O'Connell
- *
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation, either version 3 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program. If not, see <http://www.gnu.org/licenses/>.
- */
-
-if(!defined("MODULE_FILE"))
-{
- die("Access denied...");
-}
-
-function getCategoryList()
-{
- global $db;
- $query = sprintf("SELECT category_id, title FROM bayonet_downloads_categories");
- $result = $db->Query($query);
- $categories = $db->Fetch($result);
-
- return $categories;
-}
-
-function getCategoryName($category)
-{
- global $db;
- if(!filter_var($category, FILTER_VALIDATE_INT))
- return array();
-
- $query = sprintf("SELECT category_id, title FROM bayonet_downloads_categories WHERE category_id = %d", (int)$category);
- $result = $db->Query($query);
- $data = $db->FetchRow($result);
-
- return $data['title'];
- //return is_array($data) ? $data : array();
-}
-
-function getCategoryFiles($category)
-{
- global $db;
- $query = sprintf("SELECT ca.category_id, ca.title AS category, dl.name, dl.filename, dl.description FROM bayonet_downloads_categories AS ca LEFT OUTER JOIN bayonet_downloads AS dl ON dl.category_id = ca.category_id WHERE ca.category_id = %d", (int)$category);
-
- $result = $db->Query($query);
- $downloads = $db->FetchArray($result);
- decho('downloads data');
- decho($downloads);
- decho('downloads data done');
-
- return $downloads;
-}
-
-global $db;
-$downloads = NULL;
-$download_relative_path = "modules/" . basename(dirname(__FILE__)) . "/files/";
-$download_absolute_path = dirname(__FILE__) . "/files/";
-
-$category = $_GET['category'];
-if(isset($category) && !filter_var($category, FILTER_VALIDATE_INT))
-{
- ReportHack("Purposely invalid category entry.");
- return;
-}
-
-$downloads = getCategoryFiles($category);
-decho($downloads);
-
-OpenContent();
-echo "<div class=\"contentHeading\">Categories</div>\n";
-echo "<div class=\"content\">\n";
-
-$categoryList = getCategoryList();
-
- foreach($categoryList as $categoryListItem)
- {
- echo "<p>";
- echo LinkModule("download", "&category={$categoryListItem['category_id']}",$categoryListItem['title']);
- echo "</p>\n";
- }
-
-
-echo "</div>\n</div>\n";
-CloseContent();
-
-echo "<br/>"; //spacer between div tags
-
-if(isset($category))
-{
- OpenContent();
- echo "<div class=\"contentHeading\">" . getCategoryName($category) . "</div>\n";
- echo "<div class=\"content\">\n";
-
- OpenContent();
- echo "<div class=\"contentHeading\">Files</div>\n";
- echo "<div class=\"content\">\n";
-
- if(empty($downloads))
- {
- echo "No downloads available.\n";
- return;
- }
-
- foreach($downloads as $file)
- {
- $download_full_path = $download_absolute_path . $file['filename'];
-
- if(!file_exists($download_full_path)) $broken = "(Broken link detected)";
- echo "<p>";
- echo LinkInternal($file['name'], $file['filename'], $download_relative_path) . " $broken<br/>\n";
- echo "<b>Filename:</b> {$file['filename']}<br/>\n";
- printf("<b>Size:</b> %.2fKB<br/>\n", filesize($download_full_path) / 1024);
- echo "<b>MD5 Hash:</b> " . md5_file($download_full_path) . "<br/>\n";
- echo "<b>Description:</b> {$file['description']}<br/>\n";
- echo "</p>";
-
- }
- //logQueueFlush(FORCE);
-
- echo "</div>\n</div>";
- echo "</div>\n</div>";
-}
- CloseContent();
-CloseContent();
-?>
+<?php +/** + * Bayonet Content Management System + * Copyright (C) 2008 Joseph Hunkeler & Evan O'Connell + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see <http://www.gnu.org/licenses/>. + */ + +if(!defined("MODULE_FILE")) +{ + die("Access denied..."); +} + +function getCategoryList() +{ + global $db; + $query = sprintf("SELECT category_id, title FROM bayonet_downloads_categories"); + $result = $db->Query($query); + $categories = $db->Fetch($result); + + return $categories; +} + +function getCategoryName($category) +{ + global $db; + if(!filter_var($category, FILTER_VALIDATE_INT)) + return array(); + + $query = sprintf("SELECT category_id, title FROM bayonet_downloads_categories WHERE category_id = %d", (int)$category); + $result = $db->Query($query); + $data = $db->FetchRow($result); + + return $data['title']; + //return is_array($data) ? $data : array(); +} + +function getCategoryFiles($category) +{ + global $db; + $query = sprintf("SELECT ca.category_id, ca.title AS category, dl.name, dl.filename, dl.description FROM bayonet_downloads_categories AS ca LEFT OUTER JOIN bayonet_downloads AS dl ON dl.category_id = ca.category_id WHERE ca.category_id = %d", (int)$category); + + $result = $db->Query($query); + $downloads = $db->FetchArray($result); + decho('downloads data'); + decho($downloads); + decho('downloads data done'); + + return $downloads; +} + +global $db; +$downloads = NULL; +$download_relative_path = "modules/" . basename(dirname(__FILE__)) . "/files/"; +$download_absolute_path = dirname(__FILE__) . "/files/"; + +$category = $_GET['category']; +if(isset($category) && !filter_var($category, FILTER_VALIDATE_INT)) +{ + ReportHack("Purposely invalid category entry."); + return; +} + +$downloads = getCategoryFiles($category); +decho($downloads); + +OpenContent(); +echo "<div class=\"contentHeading\">Categories</div>\n"; +echo "<div class=\"content\">\n"; + +$categoryList = getCategoryList(); + + foreach($categoryList as $categoryListItem) + { + echo "<p>"; + echo LinkModule("download", "&category={$categoryListItem['category_id']}",$categoryListItem['title']); + echo "</p>\n"; + } + + +echo "</div>\n</div>\n"; +CloseContent(); + +echo "<br/>"; //spacer between div tags + +if(isset($category)) +{ + OpenContent(); + echo "<div class=\"contentHeading\">" . getCategoryName($category) . "</div>\n"; + echo "<div class=\"content\">\n"; + + OpenContent(); + echo "<div class=\"contentHeading\">Files</div>\n"; + echo "<div class=\"content\">\n"; + + if(empty($downloads)) + { + echo "No downloads available.\n"; + return; + } + + foreach($downloads as $file) + { + $download_full_path = $download_absolute_path . $file['filename']; + + if(!file_exists($download_full_path)) $broken = "(Broken link detected)"; + echo "<p>"; + echo LinkInternal($file['name'], $file['filename'], $download_relative_path) . " $broken<br/>\n"; + echo "<b>Filename:</b> {$file['filename']}<br/>\n"; + printf("<b>Size:</b> %.2fKB<br/>\n", filesize($download_full_path) / 1024); + echo "<b>MD5 Hash:</b> " . md5_file($download_full_path) . "<br/>\n"; + echo "<b>Description:</b> {$file['description']}<br/>\n"; + echo "</p>"; + + } + //logQueueFlush(FORCE); + + echo "</div>\n</div>"; + echo "</div>\n</div>"; +} + CloseContent(); +CloseContent(); +?> diff --git a/modules/index/index.php b/modules/index/index.php index 54c8dbd..83b542c 100644 --- a/modules/index/index.php +++ b/modules/index/index.php @@ -10,7 +10,7 @@ define('INDEX_MODULE', true); -$result = $db->Query("SELECT `dir_name` FROM `bayonet_modules` ORDER BY `weight` ASC"); +$result = $db->Query("SELECT `dir_name` FROM `bayonet_modules` WHERE `status` = 'Active' ORDER BY `weight` ASC"); $modules = $db->Fetch($result); foreach($modules as $module) { diff --git a/modules/news/functions.php b/modules/news/functions.php index f3505df..67e9b43 100644 --- a/modules/news/functions.php +++ b/modules/news/functions.php @@ -130,10 +130,11 @@ function getNumOfComments($id){ function getNews($id = NULL, $limit = NULL, $index = 0){ 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 ". + $query = "SELECT n.news_id, n.title, n.message, n.date, n.edited, n.category_id, u.username AS author, e.username AS eauthor, 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 "; + "LEFT OUTER JOIN `bayonet_users` AS u ON u.user_id = n.author_id ". + "LEFT OUTER JOIN `bayonet_users` AS e ON e.user_id = n.edited_id "; if(isset($id)){ $query = $query."WHERE n.news_id = '$id' "; }else{ @@ -155,7 +156,7 @@ function getNews($id = NULL, $limit = NULL, $index = 0){ * Function that takes an array of news and displays it as html * @param data - associative array of news from the database */ -function displayNews($data){ +function displayNews($data, $short = false){ date_default_timezone_set("America/New_York"); @@ -182,7 +183,19 @@ function displayNews($data){ </div> <div class="content"> <img src="modules/news/categories/<?php echo $news['catimage']; ?>" alt="<?php echo $news['catname']; ?>" align="right" /> - <?php echo bbcode_format($news['message']); ?> + <?php + if($short) { + echo substr(bbcode_format($news['message']), 0, 1000)."..."; + echo '<br /><br /><a href="?load=news&id='. $news['news_id'] .'">Continue reading.</a>'; + } else { + echo bbcode_format($news['message']); + } + ?> +<?php + if(!is_null($news['eauthor'])){ + echo "<br /><div style=\"text-align:right; font-size: 10px; font-style:italic;\">Last edit: ".date('F j, Y, g:i a T', strtotime($news['edited']))." by ".$news['eauthor']."</div>"; + } +?> </div> <div class="contentFooter"> <table width="100%"> @@ -190,7 +203,7 @@ function displayNews($data){ <td style="text-align:left;"> View Comments: <a href="<?php echo $_SERVER['PHP_SELF']; ?>?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 g:i a T', strtotime($news['date'])); ?></td> + <td style="text-align:right;">Posted: <?php echo date('D F j, Y, g:i a T', strtotime($news['date'])); ?></td> </tr> </table> </div> diff --git a/modules/news/index.php b/modules/news/index.php index 1dfd98a..47688be 100644 --- a/modules/news/index.php +++ b/modules/news/index.php @@ -28,6 +28,7 @@ include 'modules/news/functions.php'; $logged_id = 2; if(!defined('INDEX_MODULE')){ + define('BLOCK_RIGHT_DISABLE', true); $page_num = 1; $page_num = $_GET['page']; //get variable for page number @@ -50,10 +51,11 @@ if(isset($_GET['id'])) } else { - $news = getNews(null, $limit, $index); - displayNews($news); - OpenContent(); + if(defined('INDEX_MODULE')){ + $news = getNews(null, $limit, $index); + displayNews($news, true); + OpenContent(); ?> <div style="float:right;"> <a href="?load=news">Read All</a> @@ -61,6 +63,26 @@ else <?php }else{ + + $news = getNews(null, $limit, $index); + + OpenContent(); + if($page_num > 0) + echo " <a href=\"?load=news&page={$page_num}\">More Recent News</a>"; + if(count($news) == $limit){ +?> + <div style="float:right;"> + <a href="?load=news&page=<?php echo ($page_num+2); ?>">Older News</a> + </div> + <div class="clear"></div> +<?php + } + + CloseContent(); + echo "<br />"; + displayNews($news); + OpenContent(); + if($page_num > 0) echo " <a href=\"?load=news&page={$page_num}\">More Recent News</a>"; diff --git a/modules/newsreel/index.php b/modules/newsreel/index.php index f45f2f5..3caa86b 100644 --- a/modules/newsreel/index.php +++ b/modules/newsreel/index.php @@ -1,6 +1,7 @@ <!-- START News Reel --> <link rel="stylesheet" type="text/css" href="modules/newsreel/style.css" media="screen"/> <?php OpenContent(); ?> +<div class="content" style="padding: 0px; color: white;"> <script type="text/javascript"> var current = "0"; @@ -92,8 +93,10 @@ 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" /> + + <a href="http://www.3rd-infantry-division.org/forums/index.php?board=13.0"><img src="modules/newsreel/slides/<?php echo $startSRC; ?>" name="myBanner" alt="newsreel" style="padding:0px;" /></a> + +</div> <table border="0" cellspacing="0" cellpadding="0" style="height:21px;" width="100%"> <tr> <?php @@ -108,6 +111,6 @@ $y=0; ?> </tr> </table> -</div></div> + <?php CloseContent(); ?> <!-- END News Reel -->
\ No newline at end of file diff --git a/modules/newsreel/slides/agwc3.png b/modules/newsreel/slides/agwc3.png Binary files differnew file mode 100644 index 0000000..7b6f9a7 --- /dev/null +++ b/modules/newsreel/slides/agwc3.png diff --git a/modules/newsreel/slides/arma2.png b/modules/newsreel/slides/arma2.png Binary files differnew file mode 100644 index 0000000..94fab4a --- /dev/null +++ b/modules/newsreel/slides/arma2.png diff --git a/modules/newsreel/slides/decade.png b/modules/newsreel/slides/decade.png Binary files differnew file mode 100644 index 0000000..0ba39aa --- /dev/null +++ b/modules/newsreel/slides/decade.png diff --git a/modules/newsreel/slides/drilltimes.png b/modules/newsreel/slides/drilltimes.png Binary files differnew file mode 100644 index 0000000..497b406 --- /dev/null +++ b/modules/newsreel/slides/drilltimes.png diff --git a/modules/newsreel/slides/holidays.png b/modules/newsreel/slides/holidays.png Binary files differnew file mode 100644 index 0000000..48a1c72 --- /dev/null +++ b/modules/newsreel/slides/holidays.png diff --git a/modules/newsreel/slides/joinus.png b/modules/newsreel/slides/joinus.png Binary files differnew file mode 100644 index 0000000..950a2bc --- /dev/null +++ b/modules/newsreel/slides/joinus.png diff --git a/modules/newsreel/slides/leadership.png b/modules/newsreel/slides/leadership.png Binary files differnew file mode 100644 index 0000000..52730a4 --- /dev/null +++ b/modules/newsreel/slides/leadership.png diff --git a/modules/newsreel/slides/team.png b/modules/newsreel/slides/team.png Binary files differnew file mode 100644 index 0000000..fe307c1 --- /dev/null +++ b/modules/newsreel/slides/team.png diff --git a/modules/newsreel/slides/team2.png b/modules/newsreel/slides/team2.png Binary files differnew file mode 100644 index 0000000..889a266 --- /dev/null +++ b/modules/newsreel/slides/team2.png diff --git a/modules/page/index.php b/modules/page/index.php index 5b943ce..aeba18a 100644 --- a/modules/page/index.php +++ b/modules/page/index.php @@ -18,6 +18,7 @@ */ define("MODULE_FAIL", "You cannot access this module directly.<br/>\n",true); +define('BLOCK_RIGHT_DISABLE', true); if(!defined("MODULE_FILE")) { diff --git a/modules/rudi/header.php b/modules/rudi/header.php index 47c5ffa..7ea6723 100644 --- a/modules/rudi/header.php +++ b/modules/rudi/header.php @@ -1,6 +1,10 @@ -<html> -<head> -<title>RUDI</title> -<!-- <link rel="stylesheet" type="text/css" href="includes/rudi.css" /> --> -</head> -<body> +<?php OpenContent(); ?> +<div class="content" style="text-align:center"> + <div class="inline" style="margin:0px 20px 0px 20px;"><?php echo LinkModule('rudi',NULL,'Roster'); ?></div> + <div class="inline" style="margin:0px 20px 0px 20px;"><?php echo LinkModule('rudi','&show=awards','Awards & Medals'); ?></div> + <div class="inline" style="margin:0px 20px 0px 20px;"><?php echo LinkModule('rudi','&show=weapons','Weapons'); ?></div> + <div class="inline" style="margin:0px 20px 0px 20px;"><?php echo LinkModule('rudi','&show=ranks','Ranks'); ?></div> + <div class="clear"></div> +</div> +<?php CloseContent(); ?> +<br />
\ No newline at end of file diff --git a/modules/rudi/images/medals/CIB_1st.gif b/modules/rudi/images/medals/CIB_1st.gif Binary files differnew file mode 100644 index 0000000..eb218ec --- /dev/null +++ b/modules/rudi/images/medals/CIB_1st.gif diff --git a/modules/rudi/images/medals/CIB_2nd.gif b/modules/rudi/images/medals/CIB_2nd.gif Binary files differnew file mode 100644 index 0000000..d4fd78e --- /dev/null +++ b/modules/rudi/images/medals/CIB_2nd.gif diff --git a/modules/rudi/images/medals/CIB_3rd.gif b/modules/rudi/images/medals/CIB_3rd.gif Binary files differnew file mode 100644 index 0000000..2ddf96a --- /dev/null +++ b/modules/rudi/images/medals/CIB_3rd.gif diff --git a/modules/rudi/images/medals/CoD2.gif b/modules/rudi/images/medals/CoD2.gif Binary files differnew file mode 100644 index 0000000..8e936a0 --- /dev/null +++ b/modules/rudi/images/medals/CoD2.gif diff --git a/modules/rudi/images/medals/CoD2.jpg b/modules/rudi/images/medals/CoD2.jpg Binary files differnew file mode 100644 index 0000000..099ca27 --- /dev/null +++ b/modules/rudi/images/medals/CoD2.jpg diff --git a/modules/rudi/images/medals/DUC.jpg b/modules/rudi/images/medals/DUC.jpg Binary files differnew file mode 100644 index 0000000..566f81b --- /dev/null +++ b/modules/rudi/images/medals/DUC.jpg diff --git a/modules/rudi/images/medals/SM.gif b/modules/rudi/images/medals/SM.gif Binary files differnew file mode 100644 index 0000000..ac59604 --- /dev/null +++ b/modules/rudi/images/medals/SM.gif diff --git a/modules/rudi/images/medals/SS.gif b/modules/rudi/images/medals/SS.gif Binary files differnew file mode 100644 index 0000000..a488adc --- /dev/null +++ b/modules/rudi/images/medals/SS.gif diff --git a/modules/rudi/images/medals/afem.jpg b/modules/rudi/images/medals/afem.jpg Binary files differnew file mode 100644 index 0000000..6b0324c --- /dev/null +++ b/modules/rudi/images/medals/afem.jpg diff --git a/modules/rudi/images/medals/arma2duc.jpg b/modules/rudi/images/medals/arma2duc.jpg Binary files differnew file mode 100644 index 0000000..bf4bfcc --- /dev/null +++ b/modules/rudi/images/medals/arma2duc.jpg diff --git a/modules/rudi/images/medals/cib1.png b/modules/rudi/images/medals/cib1.png Binary files differnew file mode 100644 index 0000000..d96bf80 --- /dev/null +++ b/modules/rudi/images/medals/cib1.png diff --git a/modules/rudi/images/medals/cib2.png b/modules/rudi/images/medals/cib2.png Binary files differnew file mode 100644 index 0000000..ba6f8dd --- /dev/null +++ b/modules/rudi/images/medals/cib2.png diff --git a/modules/rudi/images/medals/cib3.png b/modules/rudi/images/medals/cib3.png Binary files differnew file mode 100644 index 0000000..abc2215 --- /dev/null +++ b/modules/rudi/images/medals/cib3.png diff --git a/modules/rudi/images/medals/cib4.png b/modules/rudi/images/medals/cib4.png Binary files differnew file mode 100644 index 0000000..d511343 --- /dev/null +++ b/modules/rudi/images/medals/cib4.png diff --git a/modules/rudi/images/medals/cod4unitcit.jpg b/modules/rudi/images/medals/cod4unitcit.jpg Binary files differnew file mode 100644 index 0000000..aad4498 --- /dev/null +++ b/modules/rudi/images/medals/cod4unitcit.jpg diff --git a/modules/rudi/images/medals/dsm.jpg b/modules/rudi/images/medals/dsm.jpg Binary files differindex b90e927..7cf0978 100644 --- a/modules/rudi/images/medals/dsm.jpg +++ b/modules/rudi/images/medals/dsm.jpg diff --git a/modules/rudi/images/medals/eib.jpg b/modules/rudi/images/medals/eib.jpg Binary files differnew file mode 100644 index 0000000..e8b5f59 --- /dev/null +++ b/modules/rudi/images/medals/eib.jpg diff --git a/modules/rudi/images/medals/eib.png b/modules/rudi/images/medals/eib.png Binary files differnew file mode 100644 index 0000000..909f057 --- /dev/null +++ b/modules/rudi/images/medals/eib.png diff --git a/modules/rudi/images/medals/expert.gif b/modules/rudi/images/medals/expert.gif Binary files differnew file mode 100644 index 0000000..b00bc76 --- /dev/null +++ b/modules/rudi/images/medals/expert.gif diff --git a/modules/rudi/images/medals/oak_leaf_clusters.gif b/modules/rudi/images/medals/oak_leaf_clusters.gif Binary files differnew file mode 100644 index 0000000..376ef8c --- /dev/null +++ b/modules/rudi/images/medals/oak_leaf_clusters.gif diff --git a/modules/rudi/images/medals/pass.gif b/modules/rudi/images/medals/pass.gif Binary files differnew file mode 100644 index 0000000..58d305f --- /dev/null +++ b/modules/rudi/images/medals/pass.gif diff --git a/modules/rudi/images/medals/sniper_qual.gif b/modules/rudi/images/medals/sniper_qual.gif Binary files differnew file mode 100644 index 0000000..9d51310 --- /dev/null +++ b/modules/rudi/images/medals/sniper_qual.gif diff --git a/modules/rudi/images/medals/sniper_qual.jpg b/modules/rudi/images/medals/sniper_qual.jpg Binary files differnew file mode 100644 index 0000000..1e19720 --- /dev/null +++ b/modules/rudi/images/medals/sniper_qual.jpg diff --git a/modules/rudi/images/medals/success.gif b/modules/rudi/images/medals/success.gif Binary files differnew file mode 100644 index 0000000..d3fca80 --- /dev/null +++ b/modules/rudi/images/medals/success.gif diff --git a/modules/rudi/images/medals/valor_device.gif b/modules/rudi/images/medals/valor_device.gif Binary files differnew file mode 100644 index 0000000..3a68d96 --- /dev/null +++ b/modules/rudi/images/medals/valor_device.gif diff --git a/modules/rudi/images/medals/valor_device.jpg b/modules/rudi/images/medals/valor_device.jpg Binary files differnew file mode 100644 index 0000000..facff6f --- /dev/null +++ b/modules/rudi/images/medals/valor_device.jpg diff --git a/modules/rudi/images/ranks/tiny/1LT.png b/modules/rudi/images/ranks/tiny/1LT.png Binary files differnew file mode 100644 index 0000000..83b6ab1 --- /dev/null +++ b/modules/rudi/images/ranks/tiny/1LT.png diff --git a/modules/rudi/images/ranks/tiny/1SG.png b/modules/rudi/images/ranks/tiny/1SG.png Binary files differnew file mode 100644 index 0000000..4d9e872 --- /dev/null +++ b/modules/rudi/images/ranks/tiny/1SG.png diff --git a/modules/rudi/images/ranks/tiny/2LT.png b/modules/rudi/images/ranks/tiny/2LT.png Binary files differnew file mode 100644 index 0000000..00df3a7 --- /dev/null +++ b/modules/rudi/images/ranks/tiny/2LT.png diff --git a/modules/rudi/images/ranks/tiny/CPL.png b/modules/rudi/images/ranks/tiny/CPL.png Binary files differnew file mode 100644 index 0000000..b9dd559 --- /dev/null +++ b/modules/rudi/images/ranks/tiny/CPL.png diff --git a/modules/rudi/images/ranks/tiny/CPT.png b/modules/rudi/images/ranks/tiny/CPT.png Binary files differnew file mode 100644 index 0000000..2c83daf --- /dev/null +++ b/modules/rudi/images/ranks/tiny/CPT.png diff --git a/modules/rudi/images/ranks/tiny/CW2.png b/modules/rudi/images/ranks/tiny/CW2.png Binary files differnew file mode 100644 index 0000000..43367ae --- /dev/null +++ b/modules/rudi/images/ranks/tiny/CW2.png diff --git a/modules/rudi/images/ranks/tiny/CW3.png b/modules/rudi/images/ranks/tiny/CW3.png Binary files differnew file mode 100644 index 0000000..7ec90e4 --- /dev/null +++ b/modules/rudi/images/ranks/tiny/CW3.png diff --git a/modules/rudi/images/ranks/tiny/CW4.png b/modules/rudi/images/ranks/tiny/CW4.png Binary files differnew file mode 100644 index 0000000..91db1a3 --- /dev/null +++ b/modules/rudi/images/ranks/tiny/CW4.png diff --git a/modules/rudi/images/ranks/tiny/LTC.png b/modules/rudi/images/ranks/tiny/LTC.png Binary files differnew file mode 100644 index 0000000..5a82ff1 --- /dev/null +++ b/modules/rudi/images/ranks/tiny/LTC.png diff --git a/modules/rudi/images/ranks/tiny/MSG.png b/modules/rudi/images/ranks/tiny/MSG.png Binary files differnew file mode 100644 index 0000000..d045260 --- /dev/null +++ b/modules/rudi/images/ranks/tiny/MSG.png diff --git a/modules/rudi/images/ranks/tiny/PFC.png b/modules/rudi/images/ranks/tiny/PFC.png Binary files differnew file mode 100644 index 0000000..cf7e41b --- /dev/null +++ b/modules/rudi/images/ranks/tiny/PFC.png diff --git a/modules/rudi/images/ranks/tiny/PV2.png b/modules/rudi/images/ranks/tiny/PV2.png Binary files differnew file mode 100644 index 0000000..6e2fa3c --- /dev/null +++ b/modules/rudi/images/ranks/tiny/PV2.png diff --git a/modules/rudi/images/ranks/tiny/SFC.png b/modules/rudi/images/ranks/tiny/SFC.png Binary files differnew file mode 100644 index 0000000..ec74e80 --- /dev/null +++ b/modules/rudi/images/ranks/tiny/SFC.png diff --git a/modules/rudi/images/ranks/tiny/SGT.png b/modules/rudi/images/ranks/tiny/SGT.png Binary files differnew file mode 100644 index 0000000..fe5e441 --- /dev/null +++ b/modules/rudi/images/ranks/tiny/SGT.png diff --git a/modules/rudi/images/ranks/tiny/SPC.png b/modules/rudi/images/ranks/tiny/SPC.png Binary files differnew file mode 100644 index 0000000..1d991f3 --- /dev/null +++ b/modules/rudi/images/ranks/tiny/SPC.png diff --git a/modules/rudi/images/ranks/tiny/SSG.png b/modules/rudi/images/ranks/tiny/SSG.png Binary files differnew file mode 100644 index 0000000..956951e --- /dev/null +++ b/modules/rudi/images/ranks/tiny/SSG.png diff --git a/modules/rudi/images/ranks/tiny/WO1.png b/modules/rudi/images/ranks/tiny/WO1.png Binary files differnew file mode 100644 index 0000000..eb6f347 --- /dev/null +++ b/modules/rudi/images/ranks/tiny/WO1.png diff --git a/modules/rudi/images/uniform/ACoia.png b/modules/rudi/images/uniform/ACoia.png Binary files differindex 0e70357..e22cdd2 100644 --- a/modules/rudi/images/uniform/ACoia.png +++ b/modules/rudi/images/uniform/ACoia.png diff --git a/modules/rudi/images/uniform/ACourter.png b/modules/rudi/images/uniform/ACourter.png Binary files differnew file mode 100644 index 0000000..c422930 --- /dev/null +++ b/modules/rudi/images/uniform/ACourter.png diff --git a/modules/rudi/images/uniform/ADodge.png b/modules/rudi/images/uniform/ADodge.png Binary files differnew file mode 100644 index 0000000..77c9526 --- /dev/null +++ b/modules/rudi/images/uniform/ADodge.png diff --git a/modules/rudi/images/uniform/AHernandez.png b/modules/rudi/images/uniform/AHernandez.png Binary files differnew file mode 100644 index 0000000..c118b76 --- /dev/null +++ b/modules/rudi/images/uniform/AHernandez.png diff --git a/modules/rudi/images/uniform/AKlassen.png b/modules/rudi/images/uniform/AKlassen.png Binary files differnew file mode 100644 index 0000000..7051ae2 --- /dev/null +++ b/modules/rudi/images/uniform/AKlassen.png diff --git a/modules/rudi/images/uniform/ASherman.png b/modules/rudi/images/uniform/ASherman.png Binary files differnew file mode 100644 index 0000000..57facd0 --- /dev/null +++ b/modules/rudi/images/uniform/ASherman.png diff --git a/modules/rudi/images/uniform/AZanesco.png b/modules/rudi/images/uniform/AZanesco.png Binary files differnew file mode 100644 index 0000000..e38c659 --- /dev/null +++ b/modules/rudi/images/uniform/AZanesco.png diff --git a/modules/rudi/images/uniform/BMorgan.png b/modules/rudi/images/uniform/BMorgan.png Binary files differnew file mode 100644 index 0000000..010bac0 --- /dev/null +++ b/modules/rudi/images/uniform/BMorgan.png diff --git a/modules/rudi/images/uniform/BSegal.png b/modules/rudi/images/uniform/BSegal.png Binary files differindex 1c9c0f2..0428ed2 100644 --- a/modules/rudi/images/uniform/BSegal.png +++ b/modules/rudi/images/uniform/BSegal.png diff --git a/modules/rudi/images/uniform/BWhiting.png b/modules/rudi/images/uniform/BWhiting.png Binary files differnew file mode 100644 index 0000000..f9e754e --- /dev/null +++ b/modules/rudi/images/uniform/BWhiting.png diff --git a/modules/rudi/images/uniform/DHolson.png b/modules/rudi/images/uniform/DHolson.png Binary files differindex b372cf5..91b5e9e 100644 --- a/modules/rudi/images/uniform/DHolson.png +++ b/modules/rudi/images/uniform/DHolson.png diff --git a/modules/rudi/images/uniform/DKillian.png b/modules/rudi/images/uniform/DKillian.png Binary files differnew file mode 100644 index 0000000..eb6cb67 --- /dev/null +++ b/modules/rudi/images/uniform/DKillian.png diff --git a/modules/rudi/images/uniform/EOConnell.png b/modules/rudi/images/uniform/EOConnell.png Binary files differindex 9e46bfd..f9fd55d 100644 --- a/modules/rudi/images/uniform/EOConnell.png +++ b/modules/rudi/images/uniform/EOConnell.png diff --git a/modules/rudi/images/uniform/GTownsend.png b/modules/rudi/images/uniform/GTownsend.png Binary files differindex 6d6f314..b3e6c0b 100644 --- a/modules/rudi/images/uniform/GTownsend.png +++ b/modules/rudi/images/uniform/GTownsend.png diff --git a/modules/rudi/images/uniform/INewton.png b/modules/rudi/images/uniform/INewton.png Binary files differnew file mode 100644 index 0000000..02aa620 --- /dev/null +++ b/modules/rudi/images/uniform/INewton.png diff --git a/modules/rudi/images/uniform/JCiciotti.png b/modules/rudi/images/uniform/JCiciotti.png Binary files differnew file mode 100644 index 0000000..29b5722 --- /dev/null +++ b/modules/rudi/images/uniform/JCiciotti.png diff --git a/modules/rudi/images/uniform/JHiggins.jpg b/modules/rudi/images/uniform/JHiggins.jpg Binary files differnew file mode 100644 index 0000000..122bd3c --- /dev/null +++ b/modules/rudi/images/uniform/JHiggins.jpg diff --git a/modules/rudi/images/uniform/JHiggins.png b/modules/rudi/images/uniform/JHiggins.png Binary files differnew file mode 100644 index 0000000..c468434 --- /dev/null +++ b/modules/rudi/images/uniform/JHiggins.png diff --git a/modules/rudi/images/uniform/JMagers.png b/modules/rudi/images/uniform/JMagers.png Binary files differnew file mode 100644 index 0000000..aaeeb0e --- /dev/null +++ b/modules/rudi/images/uniform/JMagers.png diff --git a/modules/rudi/images/uniform/JMelnyk.png b/modules/rudi/images/uniform/JMelnyk.png Binary files differindex 111291c..8f7178f 100644 --- a/modules/rudi/images/uniform/JMelnyk.png +++ b/modules/rudi/images/uniform/JMelnyk.png diff --git a/modules/rudi/images/uniform/JMervau.png b/modules/rudi/images/uniform/JMervau.png Binary files differnew file mode 100644 index 0000000..d7d80bc --- /dev/null +++ b/modules/rudi/images/uniform/JMervau.png diff --git a/modules/rudi/images/uniform/JSchroeder.png b/modules/rudi/images/uniform/JSchroeder.png Binary files differnew file mode 100644 index 0000000..7556027 --- /dev/null +++ b/modules/rudi/images/uniform/JSchroeder.png diff --git a/modules/rudi/images/uniform/KGrimes.png b/modules/rudi/images/uniform/KGrimes.png Binary files differindex db03b87..35aa4cb 100644 --- a/modules/rudi/images/uniform/KGrimes.png +++ b/modules/rudi/images/uniform/KGrimes.png diff --git a/modules/rudi/images/uniform/KOlson.png b/modules/rudi/images/uniform/KOlson.png Binary files differnew file mode 100644 index 0000000..89e7f00 --- /dev/null +++ b/modules/rudi/images/uniform/KOlson.png diff --git a/modules/rudi/images/uniform/LTrimble.png b/modules/rudi/images/uniform/LTrimble.png Binary files differindex 3d8f2b6..3ec56da 100644 --- a/modules/rudi/images/uniform/LTrimble.png +++ b/modules/rudi/images/uniform/LTrimble.png diff --git a/modules/rudi/images/uniform/MAbballe.png b/modules/rudi/images/uniform/MAbballe.png Binary files differnew file mode 100644 index 0000000..596d551 --- /dev/null +++ b/modules/rudi/images/uniform/MAbballe.png diff --git a/modules/rudi/images/uniform/MCampeau.png b/modules/rudi/images/uniform/MCampeau.png Binary files differnew file mode 100644 index 0000000..c5711b7 --- /dev/null +++ b/modules/rudi/images/uniform/MCampeau.png diff --git a/modules/rudi/images/uniform/MLula.png b/modules/rudi/images/uniform/MLula.png Binary files differindex a674bc2..2b7feb0 100644 --- a/modules/rudi/images/uniform/MLula.png +++ b/modules/rudi/images/uniform/MLula.png diff --git a/modules/rudi/images/uniform/MMark.png b/modules/rudi/images/uniform/MMark.png Binary files differindex ed5ae93..063d1f8 100644 --- a/modules/rudi/images/uniform/MMark.png +++ b/modules/rudi/images/uniform/MMark.png diff --git a/modules/rudi/images/uniform/PBurris.png b/modules/rudi/images/uniform/PBurris.png Binary files differindex f64736d..c3546fd 100644 --- a/modules/rudi/images/uniform/PBurris.png +++ b/modules/rudi/images/uniform/PBurris.png diff --git a/modules/rudi/images/uniform/PPederson.png b/modules/rudi/images/uniform/PPederson.png Binary files differindex c5743f9..33b98be 100644 --- a/modules/rudi/images/uniform/PPederson.png +++ b/modules/rudi/images/uniform/PPederson.png diff --git a/modules/rudi/images/uniform/PRadziwonowicz.png b/modules/rudi/images/uniform/PRadziwonowicz.png Binary files differnew file mode 100644 index 0000000..46e60f4 --- /dev/null +++ b/modules/rudi/images/uniform/PRadziwonowicz.png diff --git a/modules/rudi/images/uniform/RECRUIT.png b/modules/rudi/images/uniform/RECRUIT.png Binary files differnew file mode 100644 index 0000000..3f9a97b --- /dev/null +++ b/modules/rudi/images/uniform/RECRUIT.png diff --git a/modules/rudi/images/uniform/RLeahy.png b/modules/rudi/images/uniform/RLeahy.png Binary files differindex 1c36abf..99d0c0d 100644 --- a/modules/rudi/images/uniform/RLeahy.png +++ b/modules/rudi/images/uniform/RLeahy.png diff --git a/modules/rudi/images/uniform/RStewart.png b/modules/rudi/images/uniform/RStewart.png Binary files differnew file mode 100644 index 0000000..a1c4e8a --- /dev/null +++ b/modules/rudi/images/uniform/RStewart.png diff --git a/modules/rudi/images/uniform/SCorsaro.png b/modules/rudi/images/uniform/SCorsaro.png Binary files differindex 1895adf..33373cf 100644 --- a/modules/rudi/images/uniform/SCorsaro.png +++ b/modules/rudi/images/uniform/SCorsaro.png diff --git a/modules/rudi/images/uniform/SDayton.png b/modules/rudi/images/uniform/SDayton.png Binary files differnew file mode 100644 index 0000000..8638b96 --- /dev/null +++ b/modules/rudi/images/uniform/SDayton.png diff --git a/modules/rudi/images/uniform/TKleiber.png b/modules/rudi/images/uniform/TKleiber.png Binary files differnew file mode 100644 index 0000000..27ed4b5 --- /dev/null +++ b/modules/rudi/images/uniform/TKleiber.png diff --git a/modules/rudi/images/uniform/TMichaels.png b/modules/rudi/images/uniform/TMichaels.png Binary files differnew file mode 100644 index 0000000..4935871 --- /dev/null +++ b/modules/rudi/images/uniform/TMichaels.png diff --git a/modules/rudi/images/uniform/TMoore.png b/modules/rudi/images/uniform/TMoore.png Binary files differnew file mode 100644 index 0000000..eceda1e --- /dev/null +++ b/modules/rudi/images/uniform/TMoore.png diff --git a/modules/rudi/images/uniform/ZBarrett.png b/modules/rudi/images/uniform/ZBarrett.png Binary files differindex c9d106b..1954d8f 100644 --- a/modules/rudi/images/uniform/ZBarrett.png +++ b/modules/rudi/images/uniform/ZBarrett.png diff --git a/modules/rudi/includes/common.class.php b/modules/rudi/includes/common.class.php index 2112853..0d5e63e 100644 --- a/modules/rudi/includes/common.class.php +++ b/modules/rudi/includes/common.class.php @@ -2,6 +2,7 @@ define('RUDI_PROFILE_SMALL', true); define('RUDI_PROFILE_BIG', false); +define('RUDI_ROSTER_RESERVES', 12); class Soldier { @@ -444,21 +445,61 @@ class RUDI_Common */ protected function getCombatRecord($member_id) { + $data = NULL; $query = sprintf( - "SELECT c.date, c.status, u1.name, u1.website, u.war_id " + "SELECT s.title, s.date, s.status, u1.name, u1.website, s.war_id, s.home_score, s.visit_score " ."FROM rudi_combat_record AS c " - ."RIGHT OUTER JOIN rudi_war_stats AS u ON u.visit_unit_id = c.visitor_id " - ."RIGHT OUTER JOIN rudi_war_units AS u1 ON u1.name " - ."LEFT OUTER JOIN rudi_unit_members AS m ON m.member_id = c.member_id " - ."WHERE c.member_id = %d ORDER BY c.date DESC ", + ."RIGHT OUTER JOIN rudi_war_stats AS s ON s.war_id = c.war_id " + ."RIGHT OUTER JOIN rudi_war_units AS u1 ON u1.visitor_id = s.visit_unit_id " + ."WHERE c.member_id = %d ORDER BY s.date DESC ", (int)$member_id); $result = $this->db->Query($query); + $data = $this->db->FetchObject($result,'CombatRecord'); return $data; } + + /** + * RUDI_Common::getUnitArr() + * + * @param member_id $mID + * @return an array of the member's units orders from Team - Unit with name, id, & leader + */ + function getUnitArr($mID){ + $unitArr = array(); + + $result = $this->db->Query("SELECT * FROM `rudi_unit_members` WHERE `member_id` = $mID LIMIT 1"); + $member = $this->db->FetchRow($result); + $curUnit = $member['cunit_id']; + + $i = 0; + + $subOf = $curUnit; + while($subOf != 0){ + $unitID = $subOf; + $result = $this->db->Query("SELECT * FROM `rudi_combat_units` WHERE `unit_id` = $subOf LIMIT 1"); + $data = $this->db->fetch($result); + foreach($data as $units){ + $subOf = $units['detachment']; + $leader = $units['leader_id']; + $name = $units['name']; + } + + $unitArr[$i]['unit_id'] = $unitID; + $unitArr[$i]['leader_id'] = $leader; + $unitArr[$i]['name'] = $name; + + + // echo "Unit ID: ".$unitArr[$i]['unit_id']."<br />Name: ".$unitArr[$i]['name']."<br />Leader ID: ".$unitArr[$i]['leader_id']."<br /><br />"; + + $i++; + } + + return array_reverse($unitArr); + } /** * RUDI_Core::getSuperiorUnit() @@ -557,6 +598,7 @@ class RUDI_Common protected function getSuperiorTrue($id) { $superior =& $this->data[$id]->superior; //Reference only the data we need to use + $name =& $this->data[$id]->name; $leader = NULL; //Set the return value to null @@ -577,6 +619,48 @@ class RUDI_Common return $leader; } + /** + * RUDI_Core::getSuperior($unit_id) + * + * @param mixed $unit_id + * @return + */ + protected function getSuperior($id) + { + $leader = NULL; + $unit_id = $this->data[$id]->unit_id; + + $result = $this->db->Query("SELECT `leader_id`, `detachment` FROM `rudi_combat_units` WHERE `unit_id` = '$unit_id' LIMIT 1"); + $row = $this->db->FetchRow($result); + + $detachment = $row['detachment']; + $leader_id = $row['leader_id']; + if($leader_id == $id){ + $leader_id = 0; + } + while($leader_id == 0){ + if($detachment == 0){ + break; + } + $result = $this->db->Query("SELECT `leader_id`, `detachment` FROM `rudi_combat_units` WHERE `unit_id` = '$detachment' LIMIT 1"); + $row = $this->db->FetchRow($result); + $detachment = $row['detachment']; + $leader_id = $row['leader_id']; + } + + if($leader_id != 0){ + $result = $this->db->Query("SELECT CONCAT(r.shortname, ' ', m.last_name) AS name FROM rudi_unit_members AS m LEFT OUTER JOIN rudi_ranks AS r ON r.rank_id = m.rank_id WHERE m.member_id = '$leader_id' LIMIT 1"); + $row = $this->db->FetchRow($result); + + $leader->name = $row['name']; + $leader->leader_id = $leader_id; + } + + return $leader; + } + + + /** * RUDI_Core::getUnit() * @@ -667,17 +751,34 @@ class RUDI_Common * @param int $leader_id */ public function printRoster($unit_id, $leader_id){ + $num = 0; foreach($this->data as $member){ - if($member->unit_id == $unit_id && $member->status_id < 4){ -?> - <tr> + if($member->unit_id == $unit_id && $member->status_id < 3){ + decho($member); + if($num%2==0){ + echo "<tr>"; + } + else { + echo '<tr class="high">'; + } + ?> <!-- Rank --> - <td class="roster"><img src="<?php echo "modules/rudi/images/ranks/small/{$member->rank_short}.png"; ?>" alt="<?php echo $member->rank_short; ?>" /></td> + <td class="roster"> + <?php + if(file_exists("modules/rudi/images/ranks/tiny/{$member->rank_short}.png")){ + echo "<img src=\"modules/rudi/images/ranks/tiny/{$member->rank_short}.png\" alt=\"{$member->rank_short}\" />"; + }else{ + //echo $member->rank_short; + } + ?> + </td> <!-- Name --> - <td class="roster"><a class="rudi_roster" href="?load=rudi&profile=<?php echo $member->member_id ?>"><?php echo $member->last_name . ', ' . $member->first_name; ?></a></td> + <td class="roster"><a class="rosterlink" href="?load=rudi&profile=<?php echo $member->member_id ?>"><?php echo $member->rank_long . ' ' . $member->first_name . ' ' . $member->last_name; ?></a></td> <!-- Roles --> <td class="roster"> + <?php echo $member->role_name; ?> <?php + /* decho(count($member->Roles) . ' roles attached to: ' . $member->last_name); for($role = 0; $role < count($member->Roles); ++$role) { @@ -688,9 +789,9 @@ class RUDI_Common echo $member->Roles[$role]->role_name; if($role < count($member->Roles) - 1) echo ', '; - echo ' '; + //echo ' '; } - } + } */ ?> </td> <!-- Weapon --> @@ -698,10 +799,135 @@ class RUDI_Common <!-- Status --> <td class="roster"><?php echo $member->status; ?></td> </tr> -<?php - } +<?php $num++; + } + } - } + } + + /** + * RUDI_Core::printReserves() + * + */ + public function printReserves(){ + $num = 0; + foreach($this->data as $member){ + if($member->status_id == 3 || $member->unit_id == RUDI_ROSTER_RESERVES){ + decho($member); + + if($num == 0) + echo "<tr><th colspan=\"5\">Reserves</th></tr>"; + + if($num%2==0){ + echo "<tr>"; + } + else { + echo '<tr class="high">'; + } + ?> + <!-- Rank --> + <td class="roster"> + <?php + if(file_exists("modules/rudi/images/ranks/tiny/{$member->rank_short}.png")){ + echo "<img src=\"modules/rudi/images/ranks/tiny/{$member->rank_short}.png\" alt=\"{$member->rank_short}\" />"; + }else{ + //echo $member->rank_short; + } + ?> + </td> + <!-- Name --> + <td class="roster"><a class="rosterlink" href="?load=rudi&profile=<?php echo $member->member_id ?>"><?php echo $member->rank_long . ' ' . $member->first_name . ' ' . $member->last_name; ?></a></td> + <!-- Roles --> + <td class="roster"> + <?php echo $member->role_name; ?> + <?php + /* + decho(count($member->Roles) . ' roles attached to: ' . $member->last_name); + for($role = 0; $role < count($member->Roles); ++$role) + { + if($member->Roles[$role]->role_name) + { + //decho($role . " = (" . $member->Roles[$role]->role_name . ")"); + + echo $member->Roles[$role]->role_name; + if($role < count($member->Roles) - 1) echo ', '; + + //echo ' '; + } + } */ + ?> + </td> + <!-- Weapon --> + <td class="roster"><?php echo $member->weapon_model; ?></td> + <!-- Status --> + <td class="roster"><?php echo $member->status; ?></td> + </tr> +<?php $num++; + } + + } + } + + /** + * RUDI_Core::printPastRoster() + * + */ + public function printPastRoster(){ + decho($this->data); + $num=0; + foreach($this->data as $member){ + if($member->status_id >= 4){ + decho($member); +?> +<?php if($num%2==0){ + echo "<tr>"; + } + else { + echo '<tr class="high">'; + } + ?> + <!-- Rank --> + <td class="roster"> +<?php + if(file_exists("modules/rudi/images/ranks/tiny/{$member->rank_short}.png")){ + echo "<img src=\"modules/rudi/images/ranks/tiny/{$member->rank_short}.png\" alt=\"{$member->rank_short}\" />"; + }else{ + //echo $member->rank_short; + } +?> + </td> + <!-- Name --> + <td><a class="rosterlink" href="?load=rudi&profile=<?php echo $member->member_id ?>"><?php echo $member->rank_long . ' ' . $member->first_name . ' ' . $member->last_name; ?></a></td> + <!-- Roles --> + <td class="roster"> + <?php echo $member->role_name; ?> +<?php + /* decho(count($member->Roles) . ' roles attached to: ' . $member->last_name); + for($role = 0; $role < count($member->Roles); ++$role) + { + if($member->Roles[$role]->role_name) + { + //decho($role . " = (" . $member->Roles[$role]->role_name . ")"); + + echo $member->Roles[$role]->role_name; + if($role < count($member->Roles) - 1) echo ', '; + + //echo ' '; + } + } */ +?> + </td> + <!-- Weapon --> + <td class="roster"><?php echo $this->getDiffTime($member->date_enlisted, $member->date_discharged); ?></td> + <!-- Status --> + <td class="roster"><?php echo $member->status; ?></td> + </tr> +<?php + $num++; + } + + } + } /** * RUDI_Core::displayUnitsRec() * @@ -711,8 +937,13 @@ class RUDI_Common $result = $this->db->Query("SELECT * FROM `rudi_combat_units` WHERE `detachment` = '$unit_id' ORDER BY `weight`"); $row = $this->db->FetchObject($result,'UnitInfo'); foreach($row as $unit){ - echo "<tr><th colspan=\"5\">{$unit->name} : {$unit->callsign}</th></tr>"; - $this->printRoster($unit->unit_id, $unit->leader_id); + $num = 0; + $check = $this->db->Query("SELECT `member_id` FROM `rudi_unit_members` WHERE `cunit_id` = '$unit->unit_id' AND `date_discharged` IS NULL LIMIT 1"); + $num = $this->db->Rows($check); + if($num >= 1 && $unit->unit_id != RUDI_ROSTER_RESERVES){ + echo "<tr><th colspan=\"5\">{$unit->name} : {$unit->callsign}</th></tr>"; + $this->printRoster($unit->unit_id, $unit->leader_id); + } $this->displayUnitsRec($unit->unit_id); } } @@ -742,6 +973,9 @@ class RUDI_Common ."m.location_city, " ."m.location_province, " ."m.primary_mos, " + ."m.points, " + ."m.drillcount, " + ."m.attendcount, " ."r.rank_id, " ."r.image AS rank_image, " ."r.longname AS rank_long, " @@ -759,9 +993,14 @@ class RUDI_Common ."t.team_id, " ."t.name AS team_name, " ."t.leader_id AS team_leader_id, " + ."ro.role_id, " + ."ro.name AS role_name, " ."w.weapon_id, " ."w.manufacturer AS weapon_manufacturer, " ."w.model AS weapon_model, " + ."w2.weapon_id, " + ."w2.manufacturer AS weapon2_manufacturer, " + ."w2.model AS weapon2_model, " ."co.country_id, " ."co.name AS country_name, " ."co.image AS country_image, " @@ -780,7 +1019,9 @@ class RUDI_Common ."FROM rudi_unit_members AS m " ."LEFT OUTER JOIN rudi_weapons AS w ON w.weapon_id = m.weapon_id " - ."LEFT OUTER JOIN rudi_units AS u ON u.unit_id = m.unit_id " + ."LEFT OUTER JOIN rudi_weapons AS w2 ON w2.weapon_id = m.weapon2_id " + ."LEFT OUTER JOIN rudi_roles AS ro ON ro.role_id = m.role_id " + ."LEFT OUTER JOIN rudi_combat_units AS u ON u.unit_id = m.cunit_id " ."LEFT OUTER JOIN rudi_squads AS s ON s.squad_id = m.squad_id " ."LEFT OUTER JOIN rudi_teams AS t ON t.team_id = m.team_id " ."LEFT OUTER JOIN rudi_platoons AS p ON p.platoon_id = m.platoon_id " @@ -799,6 +1040,7 @@ class RUDI_Common ."m.status_id, " ."m.date_promotion, " ."m.date_enlisted, " + ."m.date_discharged, " ."m.primary_mos, " ."r.rank_id, " ."r.image AS rank_image, " @@ -816,6 +1058,8 @@ class RUDI_Common ."st.status_id, " ."t.team_id, " ."t.name AS team_name, " + ."ro.role_id, " + ."ro.name AS role_name, " ."w.weapon_id, " ."w.manufacturer AS weapon_manufacturer, " ."w.model AS weapon_model, " @@ -825,6 +1069,7 @@ class RUDI_Common ."FROM rudi_unit_members AS m " ."LEFT OUTER JOIN rudi_weapons AS w ON w.weapon_id = m.weapon_id " + ."LEFT OUTER JOIN rudi_roles AS ro ON ro.role_id = m.role_id " ."LEFT OUTER JOIN rudi_combat_units AS u ON u.unit_id = m.cunit_id " ."LEFT OUTER JOIN rudi_squads AS s ON s.squad_id = m.squad_id " ."LEFT OUTER JOIN rudi_teams AS t ON t.team_id = m.team_id " @@ -848,22 +1093,24 @@ class RUDI_Common { $count = $member->member_id; $this->data[$member->member_id] = $member; - $this->data[$count]->Roles = $this->getRoles($member->member_id,$member->rank_id); + /* $this->data[$count]->Roles = $this->getRoles($member->member_id,$member->rank_id); if(is_object($this->data[$count]->Roles)) { $this->data[$count]->Roles = array((object)$nothing); - } + } */ if($query_t != RUDI_PROFILE_SMALL) { $this->data[$count]->service_record = $this->getServiceRecord($member->member_id); $this->data[$count]->award_record = $this->getAwardRecord($member->member_id); $this->data[$count]->combat_record = $this->getCombatRecord($member->member_id); - $this->data[$count]->superior->unit = $this->getSuperiorUnit($member->unit_id); + //$this->data[$count]->superior_next = $this->getSuperiorTrue($member->member_id); + $this->data[$count]->superior = $this->getSuperior($member->member_id); + $this->data[$count]->superior->unit = $this->getSuperiorUnit($member->unit_id); $this->data[$count]->superior->platoon = $this->getSuperiorPlatoon($member->platoon_id); $this->data[$count]->superior->squad = $this->getSuperiorSquad($member->squad_id); $this->data[$count]->superior->team = $this->getSuperiorTeam($member->team_id); - $this->data[$count]->superior_next = $this->getSuperiorTrue($member->member_id); + $this->data[$count]->superior_next = $this->getSuperiorTrue($member->member_id); } $count++; } @@ -876,7 +1123,7 @@ class RUDI_Common $query = "SELECT a.award_id, a.image, a.name, a.description, a.class_id, c.name AS class_name " ."FROM rudi_awards AS a " ."LEFT OUTER JOIN rudi_award_classes AS c ON c.class_id = a.class_id " - ."ORDER BY c.class_id, a.award_id ASC"; + ."ORDER BY a.weight, c.class_id, a.award_id ASC"; $result = $this->db->Query($query); $row = $this->db->FetchObject($result,'Award'); return $row; @@ -890,6 +1137,16 @@ class RUDI_Common return $row; } + protected function getWeapons($order = "") + { + $query = "SELECT weapon_id, manufacturer, model, role, caliber FROM rudi_weapons"; + $query = $query ." ". $order; + $result = $this->db->Query($query); + $row = $this->db->Fetch($result); + return $row; + } + + protected function getRanks() { $query = "SELECT rank_id, shortname, longname, image FROM rudi_ranks WHERE active = 1 ORDER BY weight DESC"; diff --git a/modules/rudi/includes/information.class.php b/modules/rudi/includes/information.class.php index 2632675..d34c4aa 100644 --- a/modules/rudi/includes/information.class.php +++ b/modules/rudi/includes/information.class.php @@ -1,34 +1,34 @@ -<?php
-
-class RUDI_Information extends RUDI_Common
-{
- public function __construct()
- {
- global $db;
- $this->db = $db;
- }
-
- public function Unit($unit_id)
- {
- $query = sprintf("SELECT leader_id, name, logo, url, creed, bio
- FROM rudi_units
- WHERE unit_id = %d", (int)$unit_id);
- $result = $this->db->Query($query);
- $unit = $this->db->FetchObject($result, 'UnitInfo', true);
- return $unit;
- }
-
- public function Platoon($unit_id, $platoon_id)
- {
- $query = sprintf("SELECT leader_id, name, logo, creed, bio
- FROM rudi_platoons
- WHERE unit_id = %d AND platoon_id = %d", (int)$unit_id, (int)$platoon_id);
- $result = $this->db->Query($query);
- $platoon = $this->db->FetchObject($result, 'UnitInfo', true);
- decho($platoon);
-
- return $platoon;
- }
-}
-
+<?php + +class RUDI_Information extends RUDI_Common +{ + public function __construct() + { + global $db; + $this->db = $db; + } + + public function Unit($unit_id) + { + $query = sprintf("SELECT leader_id, name, logo, url, creed, bio + FROM rudi_units + WHERE unit_id = %d", (int)$unit_id); + $result = $this->db->Query($query); + $unit = $this->db->FetchObject($result, 'UnitInfo', true); + return $unit; + } + + public function Platoon($unit_id, $platoon_id) + { + $query = sprintf("SELECT leader_id, name, logo, creed, bio + FROM rudi_platoons + WHERE unit_id = %d AND platoon_id = %d", (int)$unit_id, (int)$platoon_id); + $result = $this->db->Query($query); + $platoon = $this->db->FetchObject($result, 'UnitInfo', true); + decho($platoon); + + return $platoon; + } +} + ?>
\ No newline at end of file diff --git a/modules/rudi/includes/rudi.css b/modules/rudi/includes/rudi.css index 8c4ebf2..1eececd 100644 --- a/modules/rudi/includes/rudi.css +++ b/modules/rudi/includes/rudi.css @@ -1,25 +1,22 @@ -table.rudi { - /* background: green; */ -} /* -table{ +table.rudi{ border:1px solid #000; } -tr{ +table.rudi tr{ border:1px solid #000; } -th{ +table.rudi th{ padding:5px; border:1px solid #000; -} +} -td{ +table.rudi td{ text-align:center; padding:2px; border:1px solid #000; -} */ +}*/ table.rudi td.data{ text-align:left; @@ -36,17 +33,19 @@ table.rudi th { table.rudi td { text-align:center; vertical-align: middle; - /* border: 1px solid #a1a1a1; */ + /*border: 1px solid #a1a1a1;*/ } -table.rudi td.roster { + +/*table.rudi td.roster { text-align:center; vertical-align: middle; border: 1px solid #a1a1a1; -} + height: 40px; +}*/ table.rudi th.header { - /* table has a 5px padding so everything is 10px bigger than these values */ + /*table has a 5px padding so everything is 10px bigger than these values*/ width:100px; height:19px; color: #FFF; @@ -54,7 +53,8 @@ table.rudi th.header { border: 1px solid #666; font-family: arial, helvetica, sans-serif; font-size:12px; -} +} + table.rudi td.info { color: #333; @@ -64,8 +64,54 @@ table.rudi td.info { border: 1px solid #666; font-family: arial, helvetica, sans-serif; font-size:12px; -} +} #thin { border:1px outset #333; } + + table.rudiroster { + font-family: verdana; + font-size: 10px; + width: 850px; + text-align: center; + color: #2c2921; + /*background-color: #b0aea2;*/ + background-color: #6b675c; + } + + .rudiroster th { + background-color: #575551; + color: white; + } + .rudiroster td { + font-size: 10px; + height: 25px; + } + .rudiroster tr { + height: 25px; + /*background-color: #78756c;*/ + background-color: #d6d6d6; + } + .rudiroster tr.unfilled { + background-color: #7e7e7e; + color: #9d9d9d; + } + table.rudiroster td img { + padding:0px; + } + + tr.null { + height: 10px; + } + + .rudiroster tr.high { + /* background-color: #898577; */ + background-color: #e4e6e8; + } + + a.rosterlink, a.rosterlink:hover, a.rosterlink:visited { + font-size: 10px; + color: #2c2921; + text-decoration: none; + }
\ No newline at end of file diff --git a/modules/rudi/index.php b/modules/rudi/index.php index 995c90d..4550ad7 100644 --- a/modules/rudi/index.php +++ b/modules/rudi/index.php @@ -1,11 +1,14 @@ <link rel="stylesheet" type="text/css" href="modules/rudi/includes/rudi.css" media="screen"/> <?php -//include 'header.php'; + + include 'header.php'; + //include 'includes/debug.php'; //require 'includes/sql.class.php'; include_once 'includes/common.class.php'; include_once 'includes/drills.class.php'; include_once 'includes/information.class.php'; +define('BLOCK_RIGHT_DISABLE', true); OpenContent(); echo "<div class=\"contentHeading\">RUDI: Realism Unit Data Interface</div>"; @@ -66,7 +69,14 @@ class RUDI_Gateway extends RUDI_Common //$this->drills = $this->getDrills($_GET['id']); $drills = new RUDI_Drills($_GET['id']); include 'views/view.drills.php'; - break; + break; + case 'points': + $this->Update(); + include 'views/view.points.php'; + break; + case 'weapons': + include 'views/view.weapons.php'; + break; } echo "</td></tr>"; CloseTable(); diff --git a/modules/rudi/views/view.awards.php b/modules/rudi/views/view.awards.php index 5039e56..0a17005 100644 --- a/modules/rudi/views/view.awards.php +++ b/modules/rudi/views/view.awards.php @@ -1,4 +1,4 @@ -<?php //define('BLOCK_RIGHT_DISABLE','block_right_disable'); ?> +<?php define('BLOCK_RIGHT_DISABLE','block_right_disable'); ?> <?php $medals_path = $this->images_path . "/medals/"; ?> <html> diff --git a/modules/rudi/views/view.information.php b/modules/rudi/views/view.information.php index a62ba8a..d017564 100644 --- a/modules/rudi/views/view.information.php +++ b/modules/rudi/views/view.information.php @@ -1,20 +1,20 @@ -<?php
-$unit_id = $_GET['unit_id'];
-$platoon_id = $_GET['platoon_id'];
-switch($_GET['info'])
-{
- case 'unit':
- if(isset($unit_id))
- include_once 'view.unit.php';
- break;
-
- case 'platoon':
- if(isset($unit_id, $platoon_id))
- include_once 'view.platoon.php';
- break;
-
- default:
- ReportError('Invalid info entry');
- return;
-}
+<?php +$unit_id = $_GET['unit_id']; +$platoon_id = $_GET['platoon_id']; +switch($_GET['info']) +{ + case 'unit': + if(isset($unit_id)) + include_once 'view.unit.php'; + break; + + case 'platoon': + if(isset($unit_id, $platoon_id)) + include_once 'view.platoon.php'; + break; + + default: + ReportError('Invalid info entry'); + return; +} ?>
\ No newline at end of file diff --git a/modules/rudi/views/view.platoon.php b/modules/rudi/views/view.platoon.php index dbbb455..4ee60dc 100644 --- a/modules/rudi/views/view.platoon.php +++ b/modules/rudi/views/view.platoon.php @@ -1,22 +1,22 @@ -<?php $data = $info->Platoon($unit_id, $platoon_id); ?>
-
-<table align="center">
- <tr>
- <th> </th>
- <td><img src="<?php echo '/cms/modules/rudi/images/units/' . $data->logo; ?>" alt="<?php echo $data->logo; ?>"/></td>
- </tr>
- <tr>
- <th width="25%">Platoon</th>
- <td><?php echo $data->name; ?></td>
- </tr>
- <tr>
- <th>Creed</th>
- <td><?php echo $data->creed; ?></td>
- </tr>
- <tr>
- <th valign="top">Biography</th>
- <td><?php echo $data->bio; ?></td>
- </tr>
-</table>
-
+<?php $data = $info->Platoon($unit_id, $platoon_id); ?> + +<table align="center"> + <tr> + <th> </th> + <td><img src="<?php echo '/cms/modules/rudi/images/units/' . $data->logo; ?>" alt="<?php echo $data->logo; ?>"/></td> + </tr> + <tr> + <th width="25%">Platoon</th> + <td><?php echo $data->name; ?></td> + </tr> + <tr> + <th>Creed</th> + <td><?php echo $data->creed; ?></td> + </tr> + <tr> + <th valign="top">Biography</th> + <td><?php echo $data->bio; ?></td> + </tr> +</table> + <?php decho($data); ?>
\ No newline at end of file diff --git a/modules/rudi/views/view.points.php b/modules/rudi/views/view.points.php new file mode 100644 index 0000000..bf6c2b6 --- /dev/null +++ b/modules/rudi/views/view.points.php @@ -0,0 +1,35 @@ +<h3>Points Ticker:</h3>
+<table width="100%" class="rudi" cellspacing="0">
+
+ <tr>
+ <!-- Table header -->
+ <th class="header">Rank</th>
+ <th class="header">Name</th>
+ <th class="header">Points</th>
+ <th class="header">Missed Count</th>
+ <th class="header">Attended Count</th>
+ </tr>
+<?php
+ $num = 0;
+ foreach($this->data as $member){
+ if($member->status_id < 4){
+ if($num %2 == 0){
+ echo '<tr style="background-color:#D4D4D4; height:30px;">';
+ }else{
+ echo '<tr style="height:30px;">';
+ }
+?>
+ <td><?php echo $member->rank_short; ?></td>
+ <td><?php echo $member->first_name." ".$member->last_name; ?></td>
+ <td><?php echo $member->points; ?></td>
+ <td><?php echo $member->drillcount; ?></td>
+ <td><?php echo $member->attendcount; ?></td>
+ </tr>
+
+<?php
+ $num++;
+ }
+ }
+
+?>
+</table>
\ No newline at end of file diff --git a/modules/rudi/views/view.profile.php b/modules/rudi/views/view.profile.php index 6135ea4..97adead 100644 --- a/modules/rudi/views/view.profile.php +++ b/modules/rudi/views/view.profile.php @@ -1,10 +1,14 @@ <?php //define('BLOCK_RIGHT_DISABLE','block_right_disable'); $member =& $this->data[$_GET['profile']]; -$uniform_image = $member->first_name[0].str_replace(array("'", "\""), "", $member->last_name).".png"; +$uniform_image = "modules/rudi/images/uniform/".$member->first_name[0].str_replace(array("'", "\""), "", $member->last_name).".png"; decho($member); define('BLOCK_RIGHT_DISABLE', true); + +$arrUnits = $this->getUnitArr($_GET['profile']); +decho($arrUnits); ?> + <style type="text/css"> @@ -15,7 +19,13 @@ define('BLOCK_RIGHT_DISABLE', true); <th class="header">Viewing Profile of: <?php echo $member->rank_long . " " . $member->first_name . " " . $member->last_name; ?></th> </tr> <tr> - <td><center><img src="modules/rudi/images/uniform/<?php echo $uniform_image; ?>" /> </center></td> + <td><center> +<?php + if(file_exists($uniform_image)){ + echo '<img src="'.$uniform_image.'" />'; + } +?> + </center></td> </tr> <tr> <td><table width="100%" border="0" cellpadding="1"> @@ -23,11 +33,18 @@ define('BLOCK_RIGHT_DISABLE', true); <td width="20%"> <table width="100%" border="0" cellpadding="5" align="center" style="border: 0px;"> <tr> - <td><center><?php echo $member->primary_mos; ?></center></td> + <td><center><span style="font-weight: bold; font-size: 16px; font-family: arial;"><?php echo $member->primary_mos; ?></span></center></td> </tr> <tr> - <td><center><img src="modules/rudi/images/ranks/large/<?php echo $member->rank_image; ?>" /> </center></td> - </tr> + <td><center> + <?php + if(file_exists("modules/rudi/images/ranks/large/{$member->rank_image}")){ + echo "<img src=\"modules/rudi/images/ranks/large/{$member->rank_image}\" alt=\"{$member->rank_short}\" />"; + }else{ + echo $member->rank_short; + } + ?> + </center></td></tr> <tr> <td><center><img src="modules/rudi/images/flags/<?php echo $member->country_image; ?>" /> </center></td> </tr> @@ -38,12 +55,12 @@ define('BLOCK_RIGHT_DISABLE', true); <tr> <th class="header" scope="row">Location</th> <td class="info"><?php echo $this->evalData($member->location); ?> </td> - <th class="header">Superior</th> + <th class="header">Reports To</th> <td class="info"><?php - if(!is_null($member->superior_next->leader_id)) - echo "<a href=\"?load=rudi&profile={$member->superior_next->leader_id}\">"; + if(!is_null($member->superior->leader_id)) + echo "<a href=\"?load=rudi&profile={$member->superior->leader_id}\">"; - echo $this->evalData($member->superior_next->name); + echo $this->evalData($member->superior->name); echo "</a> "; ?> </td> @@ -52,23 +69,27 @@ define('BLOCK_RIGHT_DISABLE', true); <th class="header" scope="row">Status</th> <td class="info"><?php echo $this->evalData($member->status); ?> </td> <th class="header">Position</th> - <td class="info"><?php echo $this->evalData($member->position); ?> </td> + <td class="info"><?php echo $this->evalData($member->role_name); ?> </td> </tr> <tr> <th class="header" scope="row">Unit</th> - <td class="info"><?php echo $this->evalData($member->unit_name); ?> </td> + <td class="info"><?php echo $this->evalData($arrUnits[0]['name']); ?> </td> <th class="header">Weapon</th> - <td class="info"><?php echo $this->evalData($member->weapon_name); ?> </td> + <td class="info"><?php echo $this->evalData($member->weapon_model); ?> + <?php if($member->weapon2_model != NULL) + echo "/ ".$member->weapon2_model; + ?> + </td> </tr> <tr> <th class="header" scope="row">Platoon</th> - <td class="info"><?php echo $this->evalData($member->platoon_name); ?> </td> + <td class="info"><?php echo $this->evalData($arrUnits[1]['name']); ?> </td> <th class="header" scope="row">Enlisted</th> <td class="info"><?php echo $this->evalData($member->enlist_date); ?> </td> </tr> <tr> <th class="header" scope="row">Squad</th> - <td class="info"><?php echo $this->evalData($member->squad_name); ?> </td> + <td class="info"><?php echo $this->evalData($arrUnits[2]['name']); ?> </td> <th class="header">Time In Service</th> <?php if($member->discharge_date): ?> <td class="info"><?php echo $this->getDiffTime($member->enlist_date_st, $member->discharge_date); ?> </td> @@ -79,7 +100,7 @@ define('BLOCK_RIGHT_DISABLE', true); </tr> <tr> <th class="header">Team</th> - <td class="info"><?php echo $this->evalData($member->team_name); ?> </td> + <td class="info"><?php echo $this->evalData($arrUnits[3]['name']); ?> </td> <th class="header">Time In Grade</th> <?php if($member->discharge_date): ?> <td class="info"><?php echo $this->getDiffTime($member->promo_date_st, $member->discharge_date); ?> </td> @@ -122,7 +143,7 @@ define('BLOCK_RIGHT_DISABLE', true); <?php foreach($member->service_record as $record): ?> <tr> <th class="header" width="25%"><?php echo date('M j, Y', strtotime($record->date_added)); ?> </th> - <td><?php echo $record->record_note; ?> </td> + <td style="text-align:left; padding-left: 10px;"><?php echo $record->record_note; ?> </td> </tr> <?php endforeach; ?> <?php endif; ?> @@ -142,9 +163,9 @@ define('BLOCK_RIGHT_DISABLE', true); <?php foreach($member->award_record as $record): ?> <tr> <th class="header" width="25%"><?php echo date('M j, Y', strtotime($record->date_added)); ?> </th> - <td ><?php echo $this->evalData($record->award_name); ?> </td> + <td style="text-align:left; padding-left: 10px;" ><?php echo $this->evalData($record->award_name); ?> </td> <td style="vertical-align:middle;"><center><img src="modules/rudi/images/medals/<?php echo $record->image; ?>"/></center></td> - <td width="40%"><?php echo $record->record_note; ?> </td> + <td width="40%" style="text-align:left; padding-left: 10px;"><?php echo $record->record_note; ?> </td> </tr> <?php endforeach; ?> <?php endif; ?> @@ -155,7 +176,7 @@ define('BLOCK_RIGHT_DISABLE', true); <table width="100%" border="0" cellpadding="1" id="thin"> <tr> - <th class="header" scope="col" colspan="3">Combat Record</th> + <th class="header" scope="col" colspan="4">Combat Record</th> </tr> <tr> <?php if($this->evalData($member->combat_record)):?> @@ -163,9 +184,10 @@ define('BLOCK_RIGHT_DISABLE', true); <?php else:?> <?php foreach($member->combat_record as $record): ?> <tr> - <th class="header" width="25%"><?php echo date('M j, Y', strtotime($record->date_added)); ?> </th> + <th class="header" width="25%"><?php echo date('M j, Y', strtotime($record->date)); ?> </th> <td><a href="<?php echo $record->website; ?>"><?php echo $record->name; ?></a> </td> - <td><?php echo $record->status; ?> </td> + <td><?php echo $record->title; ?> </td> + <td><?php echo $record->status . ' '. $record->home_score . '-' . $record->visit_score; ?> </td> </tr> <?php endforeach; ?> <?php endif; ?> diff --git a/modules/rudi/views/view.roster.php b/modules/rudi/views/view.roster.php index c0ee92d..6d7d14f 100644 --- a/modules/rudi/views/view.roster.php +++ b/modules/rudi/views/view.roster.php @@ -1,23 +1,59 @@ -<table width="100%" class="rudi">
-<?php
- $result = $this->db->query("SELECT * FROM `rudi_combat_units` WHERE `detachment` = 0");
- $row = $this->db->fetch($result);
- foreach($row as $unit){
- echo "<tr><th colspan=\"5\">{$unit['name']} : {$unit['callsign']}</th></tr>";
-?>
- <tr>
- <!-- Table header -->
- <th class="header">Rank</th>
- <th class="header">Name</th>
- <th class="header">Role</th>
- <th class="header">Weapon</th>
- <th class="header">Status</th>
- </tr>
-<?php
- $this->printRoster($unit['unit_id'], $unit['leader_id']);
- $this->displayUnitsRec($unit['unit_id']);
- }
-
-?>
-</table>
-
+<div style="text-align: center"> +<?php + + echo LinkInternal('Active Roster','?load=rudi'); + echo ' '.LinkInternal('Past Member Roster','?load=rudi&select=past').'<br /><br />'; + +?> +</div> +<center> +<table width="100%" cellspacing="1" cellpadding="0" class="rudiroster"> +<?php + + if(isset($_GET['select']) && $_GET['select'] == "past"){ + +?> + <tr><th colspan="5">Past Members Roster</th></tr> + <tr> + <!-- Table header --> + <th class="header" width="90px">Rank</th> + <th class="header" width="280px">Name</th> + <th class="header" width="174px">Role</th> + <th class="header" width="160px">Time in Service</th> + <th class="header" width="140px">Status</th> + </tr> +<?php + $this->printPastRoster(); + + }else { + + $result = $this->db->query("SELECT * FROM `rudi_combat_units` WHERE `detachment` = 0"); + $row = $this->db->fetch($result); + foreach($row as $unit){ + $unit_id = $unit['unit_id']; + decho("SELECT `member_id` FROM `rudi_unit_members` WHERE `cunit_id` = '$unit_id' AND `date_discharged` IS NULL LIMIT 1"); + $num = 0; + $check = $this->db->Query("SELECT `member_id` FROM `rudi_unit_members` WHERE `cunit_id` = '$unit_id' AND `date_discharged` IS NULL LIMIT 1"); + $num = $this->db->Rows($check); + if($num >= 1){ + echo "<tr><th colspan=\"5\">{$unit['name']} : {$unit['callsign']}</th></tr>"; +?> + <tr> + <!-- Table header --> + <th class="header" width="90px">Rank</th> + <th class="header" width="300px">Name</th> + <th class="header" width="214px">Role</th> + <th class="header" width="120px">Weapon</th> + <th class="header" width="120px">Status</th> + </tr> +<?php + $this->printRoster($unit['unit_id'], $unit['leader_id']); + $this->displayUnitsRec($unit['unit_id']); + } + } + $this->printReserves(); + } + +?> +</table> +</center> diff --git a/modules/rudi/views/view.unit.php b/modules/rudi/views/view.unit.php index fcc66ac..4e85e29 100644 --- a/modules/rudi/views/view.unit.php +++ b/modules/rudi/views/view.unit.php @@ -1,22 +1,22 @@ -<?php $data = $info->Unit($unit_id); ?>
-
-<table align="center">
- <tr>
- <th> </th>
- <td><img src="<?php echo '/cms/modules/rudi/images/units/' . $data->logo; ?>" alt="<?php echo $data->logo; ?>"/></td>
- </tr>
- <tr>
- <th width="25%">Unit</th>
- <td><?php echo $data->name; ?></td>
- </tr>
- <tr>
- <th>Creed</th>
- <td><?php echo $data->creed; ?></td>
- </tr>
- <tr>
- <th valign="top">Biography</th>
- <td><?php echo $data->bio; ?></td>
- </tr>
-</table>
-
+<?php $data = $info->Unit($unit_id); ?> + +<table align="center"> + <tr> + <th> </th> + <td><img src="<?php echo '/cms/modules/rudi/images/units/' . $data->logo; ?>" alt="<?php echo $data->logo; ?>"/></td> + </tr> + <tr> + <th width="25%">Unit</th> + <td><?php echo $data->name; ?></td> + </tr> + <tr> + <th>Creed</th> + <td><?php echo $data->creed; ?></td> + </tr> + <tr> + <th valign="top">Biography</th> + <td><?php echo $data->bio; ?></td> + </tr> +</table> + <?php decho($data); ?>
\ No newline at end of file diff --git a/modules/rudi/views/view.weapons.php b/modules/rudi/views/view.weapons.php new file mode 100644 index 0000000..2cb033c --- /dev/null +++ b/modules/rudi/views/view.weapons.php @@ -0,0 +1,70 @@ +<?php define('BLOCK_RIGHT_DISABLE','block_right_disable'); ?>
+<?php $medals_path = $this->images_path . "/medals/"; ?>
+
+<html>
+<head>
+ <title>Awards and Medals</title>
+
+<style type="text/css">
+/*th.header {
+ width:175px;
+ background:#333;
+}
+
+td.rudi {
+ text-align: center;
+ vertical-align: middle;
+} */
+</style>
+
+</head>
+<body>
+
+<?php $weapons = $this->getWeapons("ORDER BY role ASC, caliber ASC, model ASC"); ?>
+<center>
+<table class="rudiroster" cellspacing="1" cellpadding="0" align="center">
+<tr><th width="250px">Model</th><th width="250px">Caliber</th><th width="250px">Role</th></tr>
+ <?php
+ $num=0;
+ $role = "Assault";
+ foreach($weapons as $weapon){
+ if($role != $weapon['role']){
+ echo '<tr class="null" style="height:3px;"></tr>';
+ }
+ if($num%2==0)
+ echo '<tr class="high">';
+ else
+ echo "<tr>";
+ echo "<td>".$weapon['model']."</td><td>".$weapon['caliber']."</td><td>".$weapon['role']."</td></tr>";
+ $role = $weapon['role'];
+ $num++;
+ }
+
+ ?>
+
+</table>
+</center>
+<!-- grr wtf
+ <table align="center" style="width: 100%;">
+ <tr>
+ <th scope="col" class="header" style="width:1px;">Image</th>
+ <th scope="col" class="header" style="width:1px;">Award</th>
+ <th scope="col" class="header">Description</th>
+ </tr>
+
+
+ <?php //foreach($this->awards as $award): ?>
+
+ <tr>
+ <td align='center' class="rudi"><img src="/rudi/images/medals/<?php //echo $award->image; ?>"></img> </td>
+ <td align='center' class="rudi"><?php //echo $award->name; ?> </td>
+ <td align='left'><?php //echo wordwrap($award->description,80,"<br/>"); ?> </td>
+ </tr>
+
+ <?php //endforeach; ?>
+
+
+ </table>
+-->
+</body>
+</html>
\ No newline at end of file diff --git a/themes/default/images/add.gif b/themes/default/images/add.gif Binary files differnew file mode 100644 index 0000000..836dbf2 --- /dev/null +++ b/themes/default/images/add.gif diff --git a/themes/default/images/addnewarticle.png b/themes/default/images/addnewarticle.png Binary files differnew file mode 100644 index 0000000..0e29960 --- /dev/null +++ b/themes/default/images/addnewarticle.png diff --git a/themes/default/images/addnewpage.png b/themes/default/images/addnewpage.png Binary files differnew file mode 100644 index 0000000..c60c68c --- /dev/null +++ b/themes/default/images/addnewpage.png diff --git a/themes/default/images/annoucement.png b/themes/default/images/annoucement.png Binary files differnew file mode 100644 index 0000000..c70591d --- /dev/null +++ b/themes/default/images/annoucement.png diff --git a/themes/default/images/announcement.png b/themes/default/images/announcement.png Binary files differnew file mode 100644 index 0000000..c70591d --- /dev/null +++ b/themes/default/images/announcement.png diff --git a/themes/default/images/arrowleft.png b/themes/default/images/arrowleft.png Binary files differnew file mode 100644 index 0000000..502ae41 --- /dev/null +++ b/themes/default/images/arrowleft.png diff --git a/themes/default/images/arrowright.png b/themes/default/images/arrowright.png Binary files differnew file mode 100644 index 0000000..ddd163b --- /dev/null +++ b/themes/default/images/arrowright.png diff --git a/themes/default/images/bayonetLogo.png b/themes/default/images/bayonetLogo.png Binary files differnew file mode 100644 index 0000000..4183a88 --- /dev/null +++ b/themes/default/images/bayonetLogo.png diff --git a/themes/default/images/blockbackground.jpg b/themes/default/images/blockbackground.jpg Binary files differnew file mode 100644 index 0000000..ea6c7d3 --- /dev/null +++ b/themes/default/images/blockbackground.jpg diff --git a/themes/default/images/calendar.png b/themes/default/images/calendar.png Binary files differnew file mode 100644 index 0000000..86b9861 --- /dev/null +++ b/themes/default/images/calendar.png diff --git a/themes/default/images/delete.gif b/themes/default/images/delete.gif Binary files differnew file mode 100644 index 0000000..4e2a37f --- /dev/null +++ b/themes/default/images/delete.gif diff --git a/themes/default/images/dicon.png b/themes/default/images/dicon.png Binary files differnew file mode 100644 index 0000000..e9323cb --- /dev/null +++ b/themes/default/images/dicon.png diff --git a/themes/default/images/dlaxlogo.png b/themes/default/images/dlaxlogo.png Binary files differnew file mode 100644 index 0000000..b4991ae --- /dev/null +++ b/themes/default/images/dlaxlogo.png diff --git a/themes/default/images/editfiles.png b/themes/default/images/editfiles.png Binary files differnew file mode 100644 index 0000000..500e206 --- /dev/null +++ b/themes/default/images/editfiles.png diff --git a/themes/default/images/editpage.png b/themes/default/images/editpage.png Binary files differnew file mode 100644 index 0000000..ab3fd58 --- /dev/null +++ b/themes/default/images/editpage.png diff --git a/themes/default/images/error.gif b/themes/default/images/error.gif Binary files differnew file mode 100644 index 0000000..cb1fcbe --- /dev/null +++ b/themes/default/images/error.gif diff --git a/themes/default/images/error.png b/themes/default/images/error.png Binary files differnew file mode 100644 index 0000000..5bc1824 --- /dev/null +++ b/themes/default/images/error.png diff --git a/themes/default/images/file_doc.png b/themes/default/images/file_doc.png Binary files differnew file mode 100644 index 0000000..b1da1ef --- /dev/null +++ b/themes/default/images/file_doc.png diff --git a/themes/default/images/file_pdf.png b/themes/default/images/file_pdf.png Binary files differnew file mode 100644 index 0000000..500e206 --- /dev/null +++ b/themes/default/images/file_pdf.png diff --git a/themes/default/images/file_rtf.png b/themes/default/images/file_rtf.png Binary files differnew file mode 100644 index 0000000..39304c1 --- /dev/null +++ b/themes/default/images/file_rtf.png diff --git a/themes/default/images/file_word.png b/themes/default/images/file_word.png Binary files differnew file mode 100644 index 0000000..3011f00 --- /dev/null +++ b/themes/default/images/file_word.png diff --git a/themes/default/images/hgrad.png b/themes/default/images/hgrad.png Binary files differnew file mode 100644 index 0000000..86daf8b --- /dev/null +++ b/themes/default/images/hgrad.png diff --git a/themes/default/images/larrow.png b/themes/default/images/larrow.png Binary files differnew file mode 100644 index 0000000..554b6e9 --- /dev/null +++ b/themes/default/images/larrow.png diff --git a/themes/default/images/leftshadow.png b/themes/default/images/leftshadow.png Binary files differnew file mode 100644 index 0000000..1f32159 --- /dev/null +++ b/themes/default/images/leftshadow.png diff --git a/themes/default/images/limericklax.png b/themes/default/images/limericklax.png Binary files differnew file mode 100644 index 0000000..1a565ea --- /dev/null +++ b/themes/default/images/limericklax.png diff --git a/themes/default/images/logo.jpg b/themes/default/images/logo.jpg Binary files differnew file mode 100644 index 0000000..cfe19c2 --- /dev/null +++ b/themes/default/images/logo.jpg diff --git a/themes/default/images/lvgrad.png b/themes/default/images/lvgrad.png Binary files differnew file mode 100644 index 0000000..487d7e3 --- /dev/null +++ b/themes/default/images/lvgrad.png diff --git a/themes/default/images/navbackground.jpg b/themes/default/images/navbackground.jpg Binary files differnew file mode 100644 index 0000000..93ffece --- /dev/null +++ b/themes/default/images/navbackground.jpg diff --git a/themes/default/images/navbg.png b/themes/default/images/navbg.png Binary files differnew file mode 100644 index 0000000..00a8f88 --- /dev/null +++ b/themes/default/images/navbg.png diff --git a/themes/default/images/navigation.png b/themes/default/images/navigation.png Binary files differnew file mode 100644 index 0000000..739c95f --- /dev/null +++ b/themes/default/images/navigation.png diff --git a/themes/default/images/navspacer.png b/themes/default/images/navspacer.png Binary files differnew file mode 100644 index 0000000..cdc8cb4 --- /dev/null +++ b/themes/default/images/navspacer.png diff --git a/themes/default/images/news_header.png b/themes/default/images/news_header.png Binary files differnew file mode 100644 index 0000000..00861bf --- /dev/null +++ b/themes/default/images/news_header.png diff --git a/themes/default/images/nvgrad.png b/themes/default/images/nvgrad.png Binary files differnew file mode 100644 index 0000000..5e4c05c --- /dev/null +++ b/themes/default/images/nvgrad.png diff --git a/themes/default/images/photogallery.png b/themes/default/images/photogallery.png Binary files differnew file mode 100644 index 0000000..a161a55 --- /dev/null +++ b/themes/default/images/photogallery.png diff --git a/themes/default/images/photoleft.png b/themes/default/images/photoleft.png Binary files differnew file mode 100644 index 0000000..f4eb3af --- /dev/null +++ b/themes/default/images/photoleft.png diff --git a/themes/default/images/photoright.png b/themes/default/images/photoright.png Binary files differnew file mode 100644 index 0000000..16a251b --- /dev/null +++ b/themes/default/images/photoright.png diff --git a/themes/default/images/rarrow.png b/themes/default/images/rarrow.png Binary files differnew file mode 100644 index 0000000..9a272d9 --- /dev/null +++ b/themes/default/images/rarrow.png diff --git a/themes/default/images/rightshadow.png b/themes/default/images/rightshadow.png Binary files differnew file mode 100644 index 0000000..bc970f0 --- /dev/null +++ b/themes/default/images/rightshadow.png diff --git a/themes/default/images/sandbackground.jpg b/themes/default/images/sandbackground.jpg Binary files differnew file mode 100644 index 0000000..2a2d800 --- /dev/null +++ b/themes/default/images/sandbackground.jpg diff --git a/themes/default/images/spacer.png b/themes/default/images/spacer.png Binary files differnew file mode 100644 index 0000000..f187f4a --- /dev/null +++ b/themes/default/images/spacer.png diff --git a/themes/default/images/vgrad.png b/themes/default/images/vgrad.png Binary files differnew file mode 100644 index 0000000..e7a96e8 --- /dev/null +++ b/themes/default/images/vgrad.png diff --git a/themes/default/images/view.gif b/themes/default/images/view.gif Binary files differnew file mode 100644 index 0000000..52cbddb --- /dev/null +++ b/themes/default/images/view.gif diff --git a/themes/default/images/xoma_logo.jpg b/themes/default/images/xoma_logo.jpg Binary files differnew file mode 100644 index 0000000..36914ff --- /dev/null +++ b/themes/default/images/xoma_logo.jpg diff --git a/themes/default/include/functions.php b/themes/default/include/functions.php new file mode 100644 index 0000000..4a401fd --- /dev/null +++ b/themes/default/include/functions.php @@ -0,0 +1,40 @@ +<?php + + /* EVERY THEME SHOULD HAVE THIS FILE WITH THE FUNCTIONS OPENCONTENT() & CLOSECONTENT() */ + + /** + * OpenContent() + * Opens a Bayonet site content block. + * @return + */ + function OpenContent() + { + echo "<div class=\"contentBorder1\">"; + echo "<div class=\"contentBorder2\">"; + } + + /** + * CloseContent() + * Closes a Bayonet site content block. + * @return + */ + function CloseContent() + { + echo "</div>"; + echo "</div>"; + } + + function OpenBlock($title = 'New Block') + { + OpenContent(); + echo "<div class=\"contentHeading\">{$title}</div>"; + echo "<div class=\"content\">"; + } + + function CloseBlock() + { + echo "</div>"; + CloseContent(); + } + +?>
\ No newline at end of file diff --git a/themes/default/include/style_bbcode.css b/themes/default/include/style_bbcode.css index 7299c06..05333f9 100644 --- a/themes/default/include/style_bbcode.css +++ b/themes/default/include/style_bbcode.css @@ -1,71 +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;
-}
+.bold { + font-weight: bold; +} + +.italics { + font-style: italic; +} + +.underline { + text-decoration: underline; +} + +.strikethrough { + text-decoration: line-through; +} + +.overline { + text-decoration: overline; +} + +.quotecodeheader { + font-family: Verdana, arial, helvetica, sans-serif; + font-size: 12px; + font-weight: bold; +} + +.codebody { + background-color: #FFFFFF; + font-family: Courier new, courier, mono; + font-size: 12px; + color: #006600; + border: 1px solid #BFBFBF; +} + +.quotebody { + background-color: #FFFFFF; + font-family: Courier new, courier, mono; + font-size: 12px; + color: #660002; + border: 1px solid #BFBFBF; +} + +.listbullet { + list-style-type: disc; + list-style-position: inside; +} + +.listdecimal { + list-style-type: decimal; + list-style-position: inside; +} + +.listlowerroman { + list-style-type: lower-roman; + list-style-position: inside; +} + +.listupperroman { + list-style-type: upper-roman; + list-style-position: inside; +} + +.listloweralpha { + list-style-type: lower-alpha; + list-style-position: inside; +} + +.listupperalpha { + list-style-type: upper-alpha; + list-style-position: inside; +} diff --git a/themes/gttheme/footer.php b/themes/gttheme/footer.php new file mode 100644 index 0000000..72ddb3a --- /dev/null +++ b/themes/gttheme/footer.php @@ -0,0 +1,64 @@ +<?php +/** + * Bayonet Content Management System + * Copyright (C) 2008 Joseph Hunkeler + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see <http://www.gnu.org/licenses/>. + */ + +$phpversion = preg_replace('/[a-z-]/', '', phpversion()); +$mtime = explode(' ', microtime()); +$totaltime = $mtime[0] + $mtime[1] - $starttime; +$debug_output = sprintf("Page generated in %.3f seconds | Memory: real(%.3fmb) peak(%.3fmb) | PHP: %s<br/>Connections: %d | Queries: %d | Fetches: %d | Frees: %d<br/>\n", + $totaltime, ((float)memory_get_usage()/1024/1024), ((float)memory_get_peak_usage()/1024/1024), $phpversion, $db_connections, $db_queries, $db_fetches, $db_frees); +?> + +<div class="footer"> + + <br /> + <span class="footer-text"> + All logos and trademarks on this site are property of their respective owner. The comments are property of their posters, all the rest © 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 stripslashes($config['product']['copyright']); ?><br /> +<?php if($config['debug']['enabled']) echo $debug_output ?><br /> + +<a href="http://www.dreamhost.com/r.cgi?145892" target="_blank"><img src="http://www.dreamhost.com/images/rewards/80x15-e.png" /></a><br /><br /> + +</div> + +<?php + if($config['debug']['enabled']){ + logQueueFlush(); + } +?> + +<script type="text/javascript"> +var gaJsHost = (("https:" == document.location.protocol) ? "https://ssl." : "http://www."); +document.write(unescape("%3Cscript src='" + gaJsHost + "google-analytics.com/ga.js' type='text/javascript'%3E%3C/script%3E")); +</script> +<script type="text/javascript"> +try{ +var pageTracker = _gat._getTracker("UA-3253447-1"); +pageTracker._trackPageview(); +} catch(err) {} +</script> + +</body> +</html> +<?php ob_flush();?> + diff --git a/themes/gttheme/header.php b/themes/gttheme/header.php new file mode 100644 index 0000000..76dc2f9 --- /dev/null +++ b/themes/gttheme/header.php @@ -0,0 +1,40 @@ +<?php +/** + * Bayonet Content Management System + * Copyright (C) 2008 Joseph Hunkeler + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see <http://www.gnu.org/licenses/>. + */ + +global $config; +ob_start(); +$starttime = explode(' ', microtime()); +$starttime = $starttime[1] + $starttime[0]; +?> + +<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" + "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> +<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en-US" lang="en-US" dir="ltr"> + +<head> +<title>3rd Infantry Division - 8 years strong - ArmaII Unit</title> +<meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/> +<?php if(isset($config['site']['favicon'])): ?> +<!--<link rel="shortcut icon" href="<?php echo $config['site']['favicon']; ?>" type="image/x-icon" />--> +<link rel="shortcut icon" href="<?php echo $config['site']['favicon']; ?>" type="image/png" /> +<?php endif; ?> +<link rel="stylesheet" type="text/css" href="<?php echo self::$primary_css; ?>" media="screen"/> +</head> + +<body>
\ No newline at end of file diff --git a/themes/gttheme/images/Medal.png b/themes/gttheme/images/Medal.png Binary files differnew file mode 100644 index 0000000..1d9974b --- /dev/null +++ b/themes/gttheme/images/Medal.png diff --git a/themes/gttheme/images/add.gif b/themes/gttheme/images/add.gif Binary files differnew file mode 100644 index 0000000..836dbf2 --- /dev/null +++ b/themes/gttheme/images/add.gif diff --git a/themes/gttheme/images/addnewarticle.png b/themes/gttheme/images/addnewarticle.png Binary files differnew file mode 100644 index 0000000..0e29960 --- /dev/null +++ b/themes/gttheme/images/addnewarticle.png diff --git a/themes/gttheme/images/addnewpage.png b/themes/gttheme/images/addnewpage.png Binary files differnew file mode 100644 index 0000000..c60c68c --- /dev/null +++ b/themes/gttheme/images/addnewpage.png diff --git a/themes/gttheme/images/annoucement.png b/themes/gttheme/images/annoucement.png Binary files differnew file mode 100644 index 0000000..c70591d --- /dev/null +++ b/themes/gttheme/images/annoucement.png diff --git a/themes/gttheme/images/announcement.png b/themes/gttheme/images/announcement.png Binary files differnew file mode 100644 index 0000000..c70591d --- /dev/null +++ b/themes/gttheme/images/announcement.png diff --git a/themes/gttheme/images/arrowleft.png b/themes/gttheme/images/arrowleft.png Binary files differnew file mode 100644 index 0000000..502ae41 --- /dev/null +++ b/themes/gttheme/images/arrowleft.png diff --git a/themes/gttheme/images/arrowright.png b/themes/gttheme/images/arrowright.png Binary files differnew file mode 100644 index 0000000..ddd163b --- /dev/null +++ b/themes/gttheme/images/arrowright.png diff --git a/themes/gttheme/images/background.jpg b/themes/gttheme/images/background.jpg Binary files differnew file mode 100644 index 0000000..e96f267 --- /dev/null +++ b/themes/gttheme/images/background.jpg diff --git a/themes/gttheme/images/banner.jpg b/themes/gttheme/images/banner.jpg Binary files differnew file mode 100644 index 0000000..854561b --- /dev/null +++ b/themes/gttheme/images/banner.jpg diff --git a/themes/gttheme/images/bayonetLogo.png b/themes/gttheme/images/bayonetLogo.png Binary files differnew file mode 100644 index 0000000..4183a88 --- /dev/null +++ b/themes/gttheme/images/bayonetLogo.png diff --git a/themes/gttheme/images/blockbackground.jpg b/themes/gttheme/images/blockbackground.jpg Binary files differnew file mode 100644 index 0000000..ea6c7d3 --- /dev/null +++ b/themes/gttheme/images/blockbackground.jpg diff --git a/themes/gttheme/images/calendar.png b/themes/gttheme/images/calendar.png Binary files differnew file mode 100644 index 0000000..86b9861 --- /dev/null +++ b/themes/gttheme/images/calendar.png diff --git a/themes/gttheme/images/delete.gif b/themes/gttheme/images/delete.gif Binary files differnew file mode 100644 index 0000000..4e2a37f --- /dev/null +++ b/themes/gttheme/images/delete.gif diff --git a/themes/gttheme/images/editfiles.png b/themes/gttheme/images/editfiles.png Binary files differnew file mode 100644 index 0000000..500e206 --- /dev/null +++ b/themes/gttheme/images/editfiles.png diff --git a/themes/gttheme/images/editpage.png b/themes/gttheme/images/editpage.png Binary files differnew file mode 100644 index 0000000..ab3fd58 --- /dev/null +++ b/themes/gttheme/images/editpage.png diff --git a/themes/gttheme/images/error.gif b/themes/gttheme/images/error.gif Binary files differnew file mode 100644 index 0000000..cb1fcbe --- /dev/null +++ b/themes/gttheme/images/error.gif diff --git a/themes/gttheme/images/error.png b/themes/gttheme/images/error.png Binary files differnew file mode 100644 index 0000000..5bc1824 --- /dev/null +++ b/themes/gttheme/images/error.png diff --git a/themes/gttheme/images/file_doc.png b/themes/gttheme/images/file_doc.png Binary files differnew file mode 100644 index 0000000..b1da1ef --- /dev/null +++ b/themes/gttheme/images/file_doc.png diff --git a/themes/gttheme/images/file_pdf.png b/themes/gttheme/images/file_pdf.png Binary files differnew file mode 100644 index 0000000..500e206 --- /dev/null +++ b/themes/gttheme/images/file_pdf.png diff --git a/themes/gttheme/images/file_rtf.png b/themes/gttheme/images/file_rtf.png Binary files differnew file mode 100644 index 0000000..39304c1 --- /dev/null +++ b/themes/gttheme/images/file_rtf.png diff --git a/themes/gttheme/images/file_word.png b/themes/gttheme/images/file_word.png Binary files differnew file mode 100644 index 0000000..3011f00 --- /dev/null +++ b/themes/gttheme/images/file_word.png diff --git a/themes/gttheme/images/headingbg.jpg b/themes/gttheme/images/headingbg.jpg Binary files differnew file mode 100644 index 0000000..3597c21 --- /dev/null +++ b/themes/gttheme/images/headingbg.jpg diff --git a/themes/gttheme/images/hgrad.png b/themes/gttheme/images/hgrad.png Binary files differnew file mode 100644 index 0000000..86daf8b --- /dev/null +++ b/themes/gttheme/images/hgrad.png diff --git a/themes/gttheme/images/larrow.png b/themes/gttheme/images/larrow.png Binary files differnew file mode 100644 index 0000000..554b6e9 --- /dev/null +++ b/themes/gttheme/images/larrow.png diff --git a/themes/gttheme/images/leftshadow.png b/themes/gttheme/images/leftshadow.png Binary files differnew file mode 100644 index 0000000..1f32159 --- /dev/null +++ b/themes/gttheme/images/leftshadow.png diff --git a/themes/gttheme/images/logo.jpg b/themes/gttheme/images/logo.jpg Binary files differnew file mode 100644 index 0000000..8b59067 --- /dev/null +++ b/themes/gttheme/images/logo.jpg diff --git a/themes/gttheme/images/lvgrad.png b/themes/gttheme/images/lvgrad.png Binary files differnew file mode 100644 index 0000000..487d7e3 --- /dev/null +++ b/themes/gttheme/images/lvgrad.png diff --git a/themes/gttheme/images/navbackground.jpg b/themes/gttheme/images/navbackground.jpg Binary files differnew file mode 100644 index 0000000..93ffece --- /dev/null +++ b/themes/gttheme/images/navbackground.jpg diff --git a/themes/gttheme/images/navbg.jpg b/themes/gttheme/images/navbg.jpg Binary files differnew file mode 100644 index 0000000..9bd90ce --- /dev/null +++ b/themes/gttheme/images/navbg.jpg diff --git a/themes/gttheme/images/navbg.png b/themes/gttheme/images/navbg.png Binary files differnew file mode 100644 index 0000000..00a8f88 --- /dev/null +++ b/themes/gttheme/images/navbg.png diff --git a/themes/gttheme/images/navigation.png b/themes/gttheme/images/navigation.png Binary files differnew file mode 100644 index 0000000..739c95f --- /dev/null +++ b/themes/gttheme/images/navigation.png diff --git a/themes/gttheme/images/navspacer.png b/themes/gttheme/images/navspacer.png Binary files differnew file mode 100644 index 0000000..cdc8cb4 --- /dev/null +++ b/themes/gttheme/images/navspacer.png diff --git a/themes/gttheme/images/news_header.png b/themes/gttheme/images/news_header.png Binary files differnew file mode 100644 index 0000000..00861bf --- /dev/null +++ b/themes/gttheme/images/news_header.png diff --git a/themes/gttheme/images/nvgrad.png b/themes/gttheme/images/nvgrad.png Binary files differnew file mode 100644 index 0000000..5e4c05c --- /dev/null +++ b/themes/gttheme/images/nvgrad.png diff --git a/themes/gttheme/images/photogallery.png b/themes/gttheme/images/photogallery.png Binary files differnew file mode 100644 index 0000000..a161a55 --- /dev/null +++ b/themes/gttheme/images/photogallery.png diff --git a/themes/gttheme/images/photoleft.png b/themes/gttheme/images/photoleft.png Binary files differnew file mode 100644 index 0000000..f4eb3af --- /dev/null +++ b/themes/gttheme/images/photoleft.png diff --git a/themes/gttheme/images/photoright.png b/themes/gttheme/images/photoright.png Binary files differnew file mode 100644 index 0000000..16a251b --- /dev/null +++ b/themes/gttheme/images/photoright.png diff --git a/themes/gttheme/images/rarrow.png b/themes/gttheme/images/rarrow.png Binary files differnew file mode 100644 index 0000000..9a272d9 --- /dev/null +++ b/themes/gttheme/images/rarrow.png diff --git a/themes/gttheme/images/rightshadow.png b/themes/gttheme/images/rightshadow.png Binary files differnew file mode 100644 index 0000000..bc970f0 --- /dev/null +++ b/themes/gttheme/images/rightshadow.png diff --git a/themes/gttheme/images/sandbackground.jpg b/themes/gttheme/images/sandbackground.jpg Binary files differnew file mode 100644 index 0000000..2a2d800 --- /dev/null +++ b/themes/gttheme/images/sandbackground.jpg diff --git a/themes/gttheme/images/spacer.png b/themes/gttheme/images/spacer.png Binary files differnew file mode 100644 index 0000000..f187f4a --- /dev/null +++ b/themes/gttheme/images/spacer.png diff --git a/themes/gttheme/images/vgrad.png b/themes/gttheme/images/vgrad.png Binary files differnew file mode 100644 index 0000000..e7a96e8 --- /dev/null +++ b/themes/gttheme/images/vgrad.png diff --git a/themes/gttheme/images/view.gif b/themes/gttheme/images/view.gif Binary files differnew file mode 100644 index 0000000..52cbddb --- /dev/null +++ b/themes/gttheme/images/view.gif diff --git a/themes/gttheme/include/functions.php b/themes/gttheme/include/functions.php new file mode 100644 index 0000000..4a401fd --- /dev/null +++ b/themes/gttheme/include/functions.php @@ -0,0 +1,40 @@ +<?php + + /* EVERY THEME SHOULD HAVE THIS FILE WITH THE FUNCTIONS OPENCONTENT() & CLOSECONTENT() */ + + /** + * OpenContent() + * Opens a Bayonet site content block. + * @return + */ + function OpenContent() + { + echo "<div class=\"contentBorder1\">"; + echo "<div class=\"contentBorder2\">"; + } + + /** + * CloseContent() + * Closes a Bayonet site content block. + * @return + */ + function CloseContent() + { + echo "</div>"; + echo "</div>"; + } + + function OpenBlock($title = 'New Block') + { + OpenContent(); + echo "<div class=\"contentHeading\">{$title}</div>"; + echo "<div class=\"content\">"; + } + + function CloseBlock() + { + echo "</div>"; + CloseContent(); + } + +?>
\ No newline at end of file diff --git a/themes/gttheme/include/primary.css b/themes/gttheme/include/primary.css new file mode 100644 index 0000000..025b0fc --- /dev/null +++ b/themes/gttheme/include/primary.css @@ -0,0 +1,286 @@ + /********************************* + ** Layout Styles ** + *********************************/ + div.container { + width: 990px; + position: relative; + /* width: 1000px; */ + color: #000000; + margin: auto auto; + text-align: left; /* IE 5 fix */ + } + div.banner { + /* width: 990px; */ + text-align:center; + /* margin: auto auto; */ + } + img.head_medal { + position: absolute; + left: 26px; + top: -42px; + } + div.nav { + /*width: 990px; */ + height: 24px; + background: #284c75; + background-image:url('../images/navbg.jpg'); + color: #000000; + text-align:center; + /* margin: auto auto; */ + font-size:14px; + line-height: 24px; + border: 3px solid black; + border-top: 1px solid black; + } + table.main { + /*background-image:url('../images/sandbackground.jpg'); */ + padding: 0px; + color:#ffffff; + width:990px; + /*width: 1134px; */ + /* width: 1234px; */ + margin: auto auto; + /* background-color:#a3a2a0; */ + } + + table.main td { + /* color:white; */ + } + td.midcol { + width: 644px; + background-color:transparent; + vertical-align:top; + } + td.rightcol { + vertical-align:top; + } + td.leftcol { + width: 275px; + vertical-align:top; + } + div.footer { + text-align:center; + font-family:verdana; + font-size:10pt; + color:#5e5e5e; + background-color:#333333; + border-top: 1px solid #5e5e5e; + } + + /********************************* + ** Content Styles ** + *********************************/ + div.contentBorder1 { + background-color:white; + border: 1px solid #000; /*#3666ba;*/ + } + div.contentBorder2 { + background-color:white; + border:1px solid #000; /* 333 */ + } + div.contentHeading { + background-image:url(../images/headingbg.jpg); + background-repeat:repeat-x; + background-color:#112f50; + border: 0px solid black; + border-bottom: 2px solid black; + height:25px; + line-height: 25px; + padding-left:10px; + padding-right:10px; + color:white; + } + div.content { + padding:10px; + color:#333333; + /*background-color:#383838; + color:white; */ + background-color:#f1f1f1; + } + div.content img { + padding:10px; + } + div.contentFooter { + border-top:1px solid #333333; + background-color:#a4a4a4; + color:white; + padding-left:5px; + padding-right:5px; + } + span.footer-text { + font-size: 10px; + } + + .clear { + clear: both; + } + + /********************************* + ** Nav Links Styles ** + *********************************/ + table.navLinks a, table.navLinks a:visited, table.navLinks a:active { + background-color:transparent; + color:white; + font-family:verdana; + font-size:11px; + font-weight:bold; + text-decoration:none; + } + + table.navLinks a:hover, table.navLinks a:visited:hover { + background-color:transparent; + color:#d2d2d2; + font-size:11px; + font-weight:bold; + text-decoration:none; + } + + table.navLinks { + height:25px; + } + + table.navLinks td { + border-right: 1px solid #213f61; + vertical-align:middle; + } + + /********************************* + ** Misc. Styles ** + *********************************/ + + h1, h2, h3, h4, h5, h6 { + font-family: Helvetica, Arial, sans-serif; + font-weight: normal; + } + table, tr, td { + padding:0px; + border:0px; + margin:0px + } + body, td, div { + font-size:10pt; + /* color:black; */ + font-family:verdana; + font-weight:normal; + } + a, a:visited, a:active { + background-color:transparent; + color:#3666ba; + font-family:verdana; + font-size:12px; + text-decoration:none; + } + + a:hover, a:visited:hover { + background-color:transparent; + color:#3666ba; + font-family:verdana; + font-size:12px; + text-decoration:underline; + } + a.rudi_roster, a.rudi_roster:visited, a.rudi_roster:active, a.rudi_roster:hover { + color:#2b5bae; + } + body { + background-color:#091a34; + background-image: url('../images/Background.jpg'); + background-position: top center; + background-attachment: fixed; + margin:0; + margin-top: 15px; + padding:0; + text-align:left; + } + a img { + border:0px; + } + form { + margin:0; + } + tr.rownorm{ + background-color:white; + + } + tr.rowhigh{ + background-color:#e0e0e0; + } + /* photo gallery styles */ + .photoleft{ + background-image:url("../images/photoleft.png"); + background-repeat:repeat-y; + text-align:center; + width:49px; + } + .photoright{ + background-image:url("../images/photoright.png"); + background-repeat:repeat-y; + text-align:center; + width:49px; + } + /* end photo gallery styles */ + + /* stuff we might need in order to add drop shadows */ + + div.topbar { + height:25px; + text-align:center; + background-color:black; + font-family:verdana; + font-size:10pt; + color:#797e4f; + } + div.botbar { + height:50px; + padding:5px; + text-align:center; + background-color:black; + font-family:verdana; + font-size:10pt; + } + /* may need these two when we add the background images back */ + .leftbar { + /* background-image:url("../images/leftshadow.png"); */ + background-repeat: + repeat-y; + width:50px; + } + .rightbar { + /* background-image:url("../images/rightshadow.png"); */ + background-repeat: + repeat-y; + width:15px; + } + + .fl-left{ + float:left; + } + + .fl-right{ + float:right; + } + + .clear { + clear:both; + } + + .inline { + display: inline; + } + + .left{ + text-align:left; + } + .right{ + text-align:right; + } + .center{ + text-align:center; + } + .title{ + font-size:14px; + font-weight:bold; + font-family:arial; + } + +@import "style_bbcode.css" + diff --git a/themes/gttheme/include/style_bbcode.css b/themes/gttheme/include/style_bbcode.css new file mode 100644 index 0000000..05333f9 --- /dev/null +++ b/themes/gttheme/include/style_bbcode.css @@ -0,0 +1,71 @@ +.bold { + font-weight: bold; +} + +.italics { + font-style: italic; +} + +.underline { + text-decoration: underline; +} + +.strikethrough { + text-decoration: line-through; +} + +.overline { + text-decoration: overline; +} + +.quotecodeheader { + font-family: Verdana, arial, helvetica, sans-serif; + font-size: 12px; + font-weight: bold; +} + +.codebody { + background-color: #FFFFFF; + font-family: Courier new, courier, mono; + font-size: 12px; + color: #006600; + border: 1px solid #BFBFBF; +} + +.quotebody { + background-color: #FFFFFF; + font-family: Courier new, courier, mono; + font-size: 12px; + color: #660002; + border: 1px solid #BFBFBF; +} + +.listbullet { + list-style-type: disc; + list-style-position: inside; +} + +.listdecimal { + list-style-type: decimal; + list-style-position: inside; +} + +.listlowerroman { + list-style-type: lower-roman; + list-style-position: inside; +} + +.listupperroman { + list-style-type: upper-roman; + list-style-position: inside; +} + +.listloweralpha { + list-style-type: lower-alpha; + list-style-position: inside; +} + +.listupperalpha { + list-style-type: upper-alpha; + list-style-position: inside; +} diff --git a/themes/gttheme/include/theme.ini b/themes/gttheme/include/theme.ini new file mode 100644 index 0000000..223cd14 --- /dev/null +++ b/themes/gttheme/include/theme.ini @@ -0,0 +1,2 @@ +[author]
+name = "Joseph Hunkeler"
\ No newline at end of file diff --git a/themes/gttheme/index.php b/themes/gttheme/index.php new file mode 100644 index 0000000..b5ac212 --- /dev/null +++ b/themes/gttheme/index.php @@ -0,0 +1,61 @@ +<?php +/** + * Bayonet Conent Management System + * Copyright (C) Joseph Hunkeler & Evan O'Connell + * + * Purpose of this software is to allow users to manage their website + * with ease and without needing to have any coding knowledge in order + * to maintain it. Visit [link] for any updates or feedback. + */ + +/* Begin try/catch block */ +try { + +/* Setup error handing callbacks */ +ob_start("fatal_error_handler"); +set_error_handler("handle_error"); + +require_once self::$root_path . '/include/functions.php'; + +include self::$header; +//session_start(); +?> + +<div class="container"> + +<!-- banner --> + <div class="banner"><img src="<?php echo self::$image_path . '/Medal.png'; ?>" class="head_medal" /><a href="index.php"><img src="<?php echo self::$image_path . '/banner.jpg'; ?>" alt="3rd Infantry Division - ArmAII Unit" /></a></div> +<!-- navigation --> + <div class="nav"><?php require_once self::$root_path . '/navigation.php'; ?></div> + +<!-- content --> +<table border="0" cellspacing="15px" cellpadding="0" class="main" width="100%"> + <tr> + <td class="midcol"> + <?php require_once 'modules.php'; ?> + </td> + + <!-- block area RIGHT --> + <?php if(!defined('BLOCK_RIGHT_DISABLE')): ?> + <td class="rightcol"> + <?php GetBlocks(BLOCK_RIGHT); ?> + </td> + <?php endif; ?> + + </tr> +</table> + +</div> +<?php include self::$footer; ?> +<?php +/* Flushing is needed by the error handler */ +ob_end_flush(); + +} //try ^^ +catch(Exception $e) +{ + ReportError( + "<style>td.short{width:100%;}</style><table style=\"width:0;\"><tr><th>Code</th>" . "<td class=\"short\">" . $e->getCode() . "</td>" . "</tr><tr><th>In File</th>" . "<td class=\"short\">" . $e->getFile() . "</td>" . "</tr></table>" . $e->getLine() . " - " . $e->getMessage() . "<br/>" + ); +} +?> diff --git a/themes/gttheme/navigation.php b/themes/gttheme/navigation.php new file mode 100644 index 0000000..5765712 --- /dev/null +++ b/themes/gttheme/navigation.php @@ -0,0 +1,24 @@ +<?php +/** + * Bayonet Conent Management System + * Copyright (C) Joseph Hunkeler & Evan O'Connell + * + * Purpose of this software is to allow users to manage their website + * with ease and without needing to have any coding knowledge in order + * to maintain it. Visit www.eodesign.com/cms for any updates or feedback. + */ + ?> +<table border="0" cellspacing="0" class="navLinks"> + <tr> + <td> <a href="index.php">HOME</a> </td> +<?php + + $result = $db->Query("SELECT * FROM `bayonet_navigation` ORDER BY `weight`"); + $nav = $db->Fetch($result); + + foreach ($nav as $link) { + echo '<td> <a href="' . str_replace('&', '&', $link['link']) . '">' . strtoupper($link['title']) . '</a> </td>'; + } + ?> + </tr> +</table> diff --git a/themes/new/footer.php b/themes/new/footer.php new file mode 100644 index 0000000..0aab911 --- /dev/null +++ b/themes/new/footer.php @@ -0,0 +1,57 @@ +<?php +/** + * Bayonet Content Management System + * Copyright (C) 2008 Joseph Hunkeler + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see <http://www.gnu.org/licenses/>. + */ + +$phpversion = preg_replace('/[a-z-]/', '', phpversion()); +$mtime = explode(' ', microtime()); +$totaltime = $mtime[0] + $mtime[1] - $starttime; +$debug_output = sprintf("Page generated in %.3f seconds | Memory: real(%.3fmb) peak(%.3fmb) | PHP: %s<br/>Connections: %d | Queries: %d | Fetches: %d | Frees: %d<br/>\n", + $totaltime, ((float)memory_get_usage()/1024/1024), ((float)memory_get_peak_usage()/1024/1024), $phpversion, $db_connections, $db_queries, $db_fetches, $db_frees); +?> + +<div id="footerContainer"> +<div id="footer"> + + +<?php echo $config['product']['name'] . ' ' . $config['product']['version'] . ' ' . $config['product']['release'] ?><br /> +<?php echo $config['product']['copyright']; ?><span style="float:right;"><a href="admin/">Admin</a></span><br /> +<?php if($config['debug']['enabled']) echo $debug_output ?><br /> + + +<div class="clear"></div> +</div><!--end footer--> +</div><!--end footerContainer--> + +<div id="bottomBarContainer"> + <div id="bottomBar"> + <div id="copyright">All logos and trademarks on this site are property of their respective owner. The comments are property of their posters, all the rest © 2001-<?php echo date('Y'); ?> 3rd Infantry Division. <a href="http://www.dreamhost.com/r.cgi?145892" target="_blank"><img src="http://www.dreamhost.com/images/rewards/80x15-e.png" /></a></div> + </div><!--end bottomBar--> +</div><!--end bottomBarContainer--> + +<?php + if($config['debug']['enabled']){ + logQueueFlush(); + } +?> + + + +</body> +</html> +<?php ob_flush();?> +
\ No newline at end of file diff --git a/themes/new/header.php b/themes/new/header.php new file mode 100644 index 0000000..353a083 --- /dev/null +++ b/themes/new/header.php @@ -0,0 +1,55 @@ +<?php +/** + * Bayonet Content Management System + * Copyright (C) 2008 Joseph Hunkeler + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see <http://www.gnu.org/licenses/>. + */ + +global $config; +ob_start(); +$starttime = explode(' ', microtime()); +$starttime = $starttime[1] + $starttime[0]; +?> + +<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" + "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> +<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en-US" lang="en-US" dir="ltr"> + +<head> +<title>Bayonet CMS Default Theme</title> +<meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/> +<?php if(isset($config['site']['favicon'])): ?> +<!--<link rel="shortcut icon" href="<?php echo $config['site']['favicon']; ?>" type="image/x-icon" />--> +<link rel="shortcut icon" href="<?php echo $config['site']['favicon']; ?>" type="image/png" /> +<?php endif; ?> +<link rel="stylesheet" type="text/css" href="<?php echo self::$primary_css; ?>" media="screen"/> + + +<script type="text/javascript" src="functions.js"></script> + +<!-- jQuery --> +<script type="text/javascript" src="markitup/jquery.pack.js"></script> +<!-- markItUp! --> +<script type="text/javascript" src="markitup/markitup/jquery.markitup.pack.js"></script> +<!-- markItUp! toolbar settings --> +<script type="text/javascript" src="markitup/markitup/sets/bbcode/set.js"></script> +<!-- markItUp! skin --> +<link rel="stylesheet" type="text/css" href="markitup/markitup/skins/markitup/style.css" /> +<!-- markItUp! toolbar skin --> +<link rel="stylesheet" type="text/css" href="markitup/markitup/sets/bbcode/style.css" /> + +</head> + +<body>
\ No newline at end of file diff --git a/themes/new/images/active_nav_bg.jpg b/themes/new/images/active_nav_bg.jpg Binary files differnew file mode 100644 index 0000000..402bbe7 --- /dev/null +++ b/themes/new/images/active_nav_bg.jpg diff --git a/themes/new/images/btn_collapse.gif b/themes/new/images/btn_collapse.gif Binary files differnew file mode 100644 index 0000000..4f875e8 --- /dev/null +++ b/themes/new/images/btn_collapse.gif diff --git a/themes/new/images/content_tile.jpg b/themes/new/images/content_tile.jpg Binary files differnew file mode 100644 index 0000000..3d292c5 --- /dev/null +++ b/themes/new/images/content_tile.jpg diff --git a/themes/new/images/footer_tile.jpg b/themes/new/images/footer_tile.jpg Binary files differnew file mode 100644 index 0000000..6e3f2ba --- /dev/null +++ b/themes/new/images/footer_tile.jpg diff --git a/themes/new/images/footerwidget_bg.jpg b/themes/new/images/footerwidget_bg.jpg Binary files differnew file mode 100644 index 0000000..3f4da4a --- /dev/null +++ b/themes/new/images/footerwidget_bg.jpg diff --git a/themes/new/images/footerwidget_border.jpg b/themes/new/images/footerwidget_border.jpg Binary files differnew file mode 100644 index 0000000..5b3bcfb --- /dev/null +++ b/themes/new/images/footerwidget_border.jpg diff --git a/themes/new/images/header_tile.png b/themes/new/images/header_tile.png Binary files differnew file mode 100644 index 0000000..be956a5 --- /dev/null +++ b/themes/new/images/header_tile.png diff --git a/themes/new/images/header_tile_ie6.gif b/themes/new/images/header_tile_ie6.gif Binary files differnew file mode 100644 index 0000000..9b15b1a --- /dev/null +++ b/themes/new/images/header_tile_ie6.gif diff --git a/themes/new/images/logo-trans.png b/themes/new/images/logo-trans.png Binary files differnew file mode 100644 index 0000000..87b6cf9 --- /dev/null +++ b/themes/new/images/logo-trans.png diff --git a/themes/new/images/nav_a.gif b/themes/new/images/nav_a.gif Binary files differnew file mode 100644 index 0000000..531cced --- /dev/null +++ b/themes/new/images/nav_a.gif diff --git a/themes/new/images/search_btn.jpg b/themes/new/images/search_btn.jpg Binary files differnew file mode 100644 index 0000000..3f8ba67 --- /dev/null +++ b/themes/new/images/search_btn.jpg diff --git a/themes/new/images/w (1).png b/themes/new/images/w (1).png Binary files differnew file mode 100644 index 0000000..2dae5d3 --- /dev/null +++ b/themes/new/images/w (1).png diff --git a/themes/new/images/w.png b/themes/new/images/w.png Binary files differnew file mode 100644 index 0000000..e0bf686 --- /dev/null +++ b/themes/new/images/w.png diff --git a/themes/new/images/widget_bg.jpg b/themes/new/images/widget_bg.jpg Binary files differnew file mode 100644 index 0000000..c704d59 --- /dev/null +++ b/themes/new/images/widget_bg.jpg diff --git a/themes/new/include/functions.php b/themes/new/include/functions.php new file mode 100644 index 0000000..ec2e6e2 --- /dev/null +++ b/themes/new/include/functions.php @@ -0,0 +1,34 @@ +<?php + + /* EVERY THEME SHOULD HAVE THIS FILE WITH THE FUNCTIONS OPENCONTENT() & CLOSECONTENT() */ + + /** + * OpenContent() + * Opens a Bayonet site content block. + * @return + */ + function OpenContent() + { + echo "OPEN CONTENT<br />"; + } + + /** + * CloseContent() + * Closes a Bayonet site content block. + * @return + */ + function CloseContent() + { + echo "CLOSE CONTENT<br />"; + } + + function OpenBlock($title = 'New Block') + { + echo "<h2 class=\"widgettitle\"><span>{$title}</span></h2>"; + } + + function CloseBlock() + { + } + +?>
\ No newline at end of file diff --git a/themes/new/include/primary.css b/themes/new/include/primary.css new file mode 100644 index 0000000..94a4c28 --- /dev/null +++ b/themes/new/include/primary.css @@ -0,0 +1,115 @@ +/* -----BODY STUFF----- */ +body {height:auto; width:auto; font-family:'Arial', Sans-Serif; color:#333; margin:0; padding:0; background: #b8b8b8; +line-height:1.7em; padding:0; margin:0; font-size: 13px;} + +/*--- P TAG STUFF ---*/ +p {font-size: 12px; line-height: 1.7em;} +.entry{ } + + +#sidebar h2.widgettitle {padding: 0; margin: 0; font-size: 12px; text-transform: uppercase; color: #555; border: 1px solid #ebebeb; font-weight: normal;} +#sidebar h2.widgettitle span {padding: 8px; display: block; border: 1px solid #fff; font-weight: normal; background: url('../images/widget_bg.jpg') repeat-x center;} + + + +/* -----A TAG STUFF----- */ +a {text-decoration:none;} +a:hover {text-decoration:underline;} + + +/* -----PAGE STUFF----- */ +#contentContainer {width: 100%; background: #f5f5f5 url('../images/content_tile.jpg') repeat-y center; border: 1px solid #fff; border-width:0 0 1px;} +#content {padding:30px 0 0; margin:0 auto; width:960px; background: #f8f8f8;} +#main {width:640px; float: left; padding:0; margin: 0; overflow: hidden; line-height: 1.5em;} +#main-full {width:100%; float: left; padding:0; margin: 0; overflow: hidden; line-height: 1.5em;} +#sidebar {float: right; margin: 0; overflow: hidden; width: 290px;} + +/*---------HEADER STUFF-----------*/ +#headerContainer {width: 100%; background: #4B72A6 url('../images/header_tile.png') repeat-x;} +#header {height:259px; margin:0 auto; width:960px; position: relative; color:white;} +#topBarContainer {width: 100%; background-color:black;} +#topBar {width:960px; height: 42px; color: #eee; font-size: 10px; margin:0 auto;} +#topBar #today {padding: 13px 0 0;} +#logo {margin: 0; padding: 41px 0 0;} +#logo a {margin: 0; padding: 0; display: block; height: 86px; width: 601px; overflow: hidden; background: url('../images/logo-trans.png') no-repeat; text-indent: -999px;} +#navigation {padding:0;margin:0; width: 100%; height: 42px; position: absolute; bottom: 0; _bottom:-1px; left:0; z-index:6000;} + +/*--------FOOTER STUFF--------*/ +#footerContainer {width: 100%; background: #b8b8b8 url('../images/footer_tile.jpg') repeat-y center; border: 1px solid #9c9c9c; border-width: 1px 0 0;} +#footer {padding:20px 0 0; margin:0 auto; width:960px; clear:both;} +#footer a {color:#fff;} +#bottomBarContainer {width: 100%; background: #1a1a1a;} +#bottomBar {width:960px; margin: 0 auto; height: 53px; color: #eee;} +#bottomBar #copyright {font-size: 10px; margin:0; padding:20px 0 0;} +#bottomBar #socialbuttons {float: right; font-size: 10px; padding:20px 0 0; text-transform: uppercase; letter-spacing: 1px;} +#bottomBar #socialbuttons a {color: #fff;} + +/*-------MAIN NAVIGATION STUFF--------*/ +#menu {padding: 0; margin:0; list-style:none; position:relative; width:100%; z-index: 4000;} +#menu li {list-style:none; padding:0; margin:0; position:relative; float: left; line-height: 42px;} +#menu li a {margin: 0; padding: 0 13px; display: block; line-height: 42px; color: #fff; text-transform: uppercase; font-size: 12px;} +#menu li a:hover {text-decoration: none; background: url('../images/active_nav_bg.jpg') repeat-x; color: #999;} +#menu li ul {margin:0; padding:0; list-style:none; display:none; position:absolute; width:200px; z-index:3000; top:41px; _top:42px;/*IE6 fix*/ left: -1px; background: #F8F8F8; border: 1px solid #ddd; border-width: 0 1px 1px;} +#menu li ul li {margin:0; position:relative; border: 1px solid #fff; border-width: 0 1px 1px; border-top:1px solid #ebebeb; line-height: 20px; padding:0;} +#menu li ul li a {padding:0 10px; margin:0; width:178px; color: #999; font-size: 12px; line-height: 30px;} +#menu li ul li a:hover {background: none; color: #555;} +#menu li ul li ul {position:absolute;top:-1px; left:199px; margin:0; z-index: 2000;} +#menu li:hover ul ul, +#menu li:hover ul ul ul, +#menu li:hover ul ul ul ul {display:none;} +#menu li:hover ul, +#menu li li:hover ul, +#menu li li li:hover ul, +#menu li li li li:hover ul {display:block;} +#menu li.current_page_item, #menu li.current-cat {background: url('../images/active_nav_bg.jpg') repeat-x;} +#menu li li.current_page_item, #menu li li.current-cat {background:none;} +#menu li.current_page_item a, #menu li.current-cat a {color: #555;} + +/* -----SEARCH STUFF----- */ +#searchform #s {width:200px; padding: 5px;} +#searchform #searchsubmit {cursor: pointer; padding:5px;} +#searchform #searchsubmit:hover {text-decoration: none;} + +#searcher {float: right; padding:2px 0 0;} +#searcher #searchform #s {font-size:9px; width:200px; padding: 3px; background: #1f1f1f; border: 1px solid #3b3b3b; color: #bbb; text-transform: uppercase; margin: 0 4px 0 0;} +#searcher #searchform #searchsubmit { +cursor: pointer; +padding:0px; +width: 38px; +height: 22px; +background: transparent url('../images/search_btn.jpg') no-repeat 0 2px !important; +border: none; +overflow: hidden; +text-indent: -999px; +line-height: 0; +} + + +/*---FORM STUFF---*/ +input, textarea {padding: 5px;} +input {width:170px; margin:5px 0 0 0; } +textarea {width:100%;} +input[type="submit"] {padding:5px 0; cursor: pointer;} + +/* -----UNIVERSAL STUFF----- */ +code {font:1.1em 'Courier New', Courier, Fixed;} +acronym,abbr,span.caps {font-size:.9em;letter-spacing:.07em;cursor:help;} +p img {max-width:100%;padding:0;} +img.centered {display:block;margin:0 auto;} +img.alignright {display:inline;margin:0 0 10px 10px;} +img.alignleft {display:inline;margin:0 10px 10px 0;} +.alignright {float:right;} +.alignleft {float:left;} +acronym.abbr {border-bottom:1px dashed #999;} +blockquote {padding-left:20px;margin:15px;} +blockquote cite {display:block;margin:5px 0 0;} +.center {text-align:center;} +hr {display:none;} +a img {border:none;} +img#wpstats {width:0;height:0;border:none;overflow:hidden;padding:0;} +#hideme {visibility:hidden;} +.hidden {visibility: hidden; display: none;} +.rssSummary {padding-bottom:15px;} +.clear {clear: both;} +p.clear {height:1px; width:1px; margin:0; padding:0;} +.hide {display: none;}
\ No newline at end of file diff --git a/themes/new/include/style_bbcode.css b/themes/new/include/style_bbcode.css new file mode 100644 index 0000000..05333f9 --- /dev/null +++ b/themes/new/include/style_bbcode.css @@ -0,0 +1,71 @@ +.bold { + font-weight: bold; +} + +.italics { + font-style: italic; +} + +.underline { + text-decoration: underline; +} + +.strikethrough { + text-decoration: line-through; +} + +.overline { + text-decoration: overline; +} + +.quotecodeheader { + font-family: Verdana, arial, helvetica, sans-serif; + font-size: 12px; + font-weight: bold; +} + +.codebody { + background-color: #FFFFFF; + font-family: Courier new, courier, mono; + font-size: 12px; + color: #006600; + border: 1px solid #BFBFBF; +} + +.quotebody { + background-color: #FFFFFF; + font-family: Courier new, courier, mono; + font-size: 12px; + color: #660002; + border: 1px solid #BFBFBF; +} + +.listbullet { + list-style-type: disc; + list-style-position: inside; +} + +.listdecimal { + list-style-type: decimal; + list-style-position: inside; +} + +.listlowerroman { + list-style-type: lower-roman; + list-style-position: inside; +} + +.listupperroman { + list-style-type: upper-roman; + list-style-position: inside; +} + +.listloweralpha { + list-style-type: lower-alpha; + list-style-position: inside; +} + +.listupperalpha { + list-style-type: upper-alpha; + list-style-position: inside; +} diff --git a/themes/new/include/theme.ini b/themes/new/include/theme.ini new file mode 100644 index 0000000..34bd055 --- /dev/null +++ b/themes/new/include/theme.ini @@ -0,0 +1,2 @@ +[author]
+name = "Evan O'Connell"
\ No newline at end of file diff --git a/themes/new/index.php b/themes/new/index.php new file mode 100644 index 0000000..17bbc46 --- /dev/null +++ b/themes/new/index.php @@ -0,0 +1,84 @@ +<?php +/** + * Bayonet Conent Management System + * Copyright (C) Joseph Hunkeler & Evan O'Connell + * + * Purpose of this software is to allow users to manage their website + * with ease and without needing to have any coding knowledge in order + * to maintain it. Visit [link] for any updates or feedback. + */ + +/* Begin try/catch block */ +try { + +/* Setup error handing callbacks */ +ob_start("fatal_error_handler"); +set_error_handler("handle_error"); + +require_once self::$root_path . '/include/functions.php'; + +include self::$header; +//session_start(); +?> +<div id="headerContainer"> + + <div id="header"> + <div id="topBar"> + <div id="searcher"><form method="get" id="searchform" action=""> + <label class="hidden" for="s">Search for:</label> + <input type="text" value="Search Site" onfocus="this.value=''; this.onfocus=null;" name="s" id="s" /> + <input type="submit" id="searchsubmit" value="GO!" /> + + </form></div> + <div id="today"><?php //echo date('l | F jS, Y'); ?></div> + </div><!--end topBar--> + <h1>Bayonet CMS</h1><!--end logo--> + + + <div id="navigation"> + <?php require_once self::$root_path . '/navigation.php'; ?> + </div><!--end navigation--> + + </div><!--end header--> +</div><!--end headerContainer--> + +<div id="contentContainer"> + <div id="content"> + +<?php if(!defined('BLOCK_RIGHT_DISABLE')): ?> + <div id="main"> + <?php require_once 'modules.php'; ?> + </div><!--end main--> + + <!-- block area RIGHT --> + + <div id="sidebar"> + <?php GetBlocks(BLOCK_RIGHT); ?> + + </div><!--end sidebar--> +<?php endif; ?> +<?php if(defined('BLOCK_RIGHT_DISABLE')): ?> + <div id="main-full"> + THIS IS SOME MAIN TEXT + <?php require_once 'modules.php'; ?> + </div><!--end main--> +<?php endif; ?> + + +<div class="clear"></div> +</div><!--end content--> +</div><!--end contentContainer--> + +<?php include self::$footer; ?> +<?php +/* Flushing is needed by the error handler */ +ob_end_flush(); + +} //try ^^ +catch(Exception $e) +{ + ReportError( + "<style>td.short{width:100%;}</style><table style=\"width:0;\"><tr><th>Code</th>" . "<td class=\"short\">" . $e->getCode() . "</td>" . "</tr><tr><th>In File</th>" . "<td class=\"short\">" . $e->getFile() . "</td>" . "</tr></table>" . $e->getLine() . " - " . $e->getMessage() . "<br/>" + ); +} +?>
\ No newline at end of file diff --git a/themes/new/navigation.php b/themes/new/navigation.php new file mode 100644 index 0000000..45bcdf9 --- /dev/null +++ b/themes/new/navigation.php @@ -0,0 +1,22 @@ +<?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. + */ + ?> + <ul id="menu"> + <li class="current_page_item"><a href="index.php">HOME</a></li> +<?php + + $result = $db->Query("SELECT * FROM `bayonet_navigation` ORDER BY `weight`"); + $nav = $db->Fetch($result); + + foreach ($nav as $link) { + echo '<li class="page_item"><a href="' . str_replace('&', '&', $link['link']) . '">' . strtoupper($link['title']) . '</a></li>'; + } + ?> + </ul><!--end dropmenu-->
\ No newline at end of file diff --git a/themes/throwback/footer.php b/themes/throwback/footer.php new file mode 100644 index 0000000..72ddb3a --- /dev/null +++ b/themes/throwback/footer.php @@ -0,0 +1,64 @@ +<?php +/** + * Bayonet Content Management System + * Copyright (C) 2008 Joseph Hunkeler + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see <http://www.gnu.org/licenses/>. + */ + +$phpversion = preg_replace('/[a-z-]/', '', phpversion()); +$mtime = explode(' ', microtime()); +$totaltime = $mtime[0] + $mtime[1] - $starttime; +$debug_output = sprintf("Page generated in %.3f seconds | Memory: real(%.3fmb) peak(%.3fmb) | PHP: %s<br/>Connections: %d | Queries: %d | Fetches: %d | Frees: %d<br/>\n", + $totaltime, ((float)memory_get_usage()/1024/1024), ((float)memory_get_peak_usage()/1024/1024), $phpversion, $db_connections, $db_queries, $db_fetches, $db_frees); +?> + +<div class="footer"> + + <br /> + <span class="footer-text"> + All logos and trademarks on this site are property of their respective owner. The comments are property of their posters, all the rest © 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 stripslashes($config['product']['copyright']); ?><br /> +<?php if($config['debug']['enabled']) echo $debug_output ?><br /> + +<a href="http://www.dreamhost.com/r.cgi?145892" target="_blank"><img src="http://www.dreamhost.com/images/rewards/80x15-e.png" /></a><br /><br /> + +</div> + +<?php + if($config['debug']['enabled']){ + logQueueFlush(); + } +?> + +<script type="text/javascript"> +var gaJsHost = (("https:" == document.location.protocol) ? "https://ssl." : "http://www."); +document.write(unescape("%3Cscript src='" + gaJsHost + "google-analytics.com/ga.js' type='text/javascript'%3E%3C/script%3E")); +</script> +<script type="text/javascript"> +try{ +var pageTracker = _gat._getTracker("UA-3253447-1"); +pageTracker._trackPageview(); +} catch(err) {} +</script> + +</body> +</html> +<?php ob_flush();?> + diff --git a/themes/throwback/header.php b/themes/throwback/header.php new file mode 100644 index 0000000..76dc2f9 --- /dev/null +++ b/themes/throwback/header.php @@ -0,0 +1,40 @@ +<?php +/** + * Bayonet Content Management System + * Copyright (C) 2008 Joseph Hunkeler + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see <http://www.gnu.org/licenses/>. + */ + +global $config; +ob_start(); +$starttime = explode(' ', microtime()); +$starttime = $starttime[1] + $starttime[0]; +?> + +<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" + "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> +<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en-US" lang="en-US" dir="ltr"> + +<head> +<title>3rd Infantry Division - 8 years strong - ArmaII Unit</title> +<meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/> +<?php if(isset($config['site']['favicon'])): ?> +<!--<link rel="shortcut icon" href="<?php echo $config['site']['favicon']; ?>" type="image/x-icon" />--> +<link rel="shortcut icon" href="<?php echo $config['site']['favicon']; ?>" type="image/png" /> +<?php endif; ?> +<link rel="stylesheet" type="text/css" href="<?php echo self::$primary_css; ?>" media="screen"/> +</head> + +<body>
\ No newline at end of file diff --git a/themes/throwback/images/Medal.png b/themes/throwback/images/Medal.png Binary files differnew file mode 100644 index 0000000..1d9974b --- /dev/null +++ b/themes/throwback/images/Medal.png diff --git a/themes/throwback/images/acu_bg.jpg b/themes/throwback/images/acu_bg.jpg Binary files differnew file mode 100644 index 0000000..550cd82 --- /dev/null +++ b/themes/throwback/images/acu_bg.jpg diff --git a/themes/throwback/images/add.gif b/themes/throwback/images/add.gif Binary files differnew file mode 100644 index 0000000..836dbf2 --- /dev/null +++ b/themes/throwback/images/add.gif diff --git a/themes/throwback/images/arrowleft.png b/themes/throwback/images/arrowleft.png Binary files differnew file mode 100644 index 0000000..502ae41 --- /dev/null +++ b/themes/throwback/images/arrowleft.png diff --git a/themes/throwback/images/arrowright.png b/themes/throwback/images/arrowright.png Binary files differnew file mode 100644 index 0000000..ddd163b --- /dev/null +++ b/themes/throwback/images/arrowright.png diff --git a/themes/throwback/images/background.jpg b/themes/throwback/images/background.jpg Binary files differnew file mode 100644 index 0000000..e96f267 --- /dev/null +++ b/themes/throwback/images/background.jpg diff --git a/themes/throwback/images/banner.jpg b/themes/throwback/images/banner.jpg Binary files differnew file mode 100644 index 0000000..702a361 --- /dev/null +++ b/themes/throwback/images/banner.jpg diff --git a/themes/throwback/images/blockbackground.jpg b/themes/throwback/images/blockbackground.jpg Binary files differnew file mode 100644 index 0000000..ea6c7d3 --- /dev/null +++ b/themes/throwback/images/blockbackground.jpg diff --git a/themes/throwback/images/contentbg.png b/themes/throwback/images/contentbg.png Binary files differnew file mode 100644 index 0000000..2c13089 --- /dev/null +++ b/themes/throwback/images/contentbg.png diff --git a/themes/throwback/images/delete.gif b/themes/throwback/images/delete.gif Binary files differnew file mode 100644 index 0000000..4e2a37f --- /dev/null +++ b/themes/throwback/images/delete.gif diff --git a/themes/throwback/images/error.gif b/themes/throwback/images/error.gif Binary files differnew file mode 100644 index 0000000..cb1fcbe --- /dev/null +++ b/themes/throwback/images/error.gif diff --git a/themes/throwback/images/error.png b/themes/throwback/images/error.png Binary files differnew file mode 100644 index 0000000..5bc1824 --- /dev/null +++ b/themes/throwback/images/error.png diff --git a/themes/throwback/images/headingbg.jpg b/themes/throwback/images/headingbg.jpg Binary files differnew file mode 100644 index 0000000..3fdc664 --- /dev/null +++ b/themes/throwback/images/headingbg.jpg diff --git a/themes/throwback/images/hgrad.png b/themes/throwback/images/hgrad.png Binary files differnew file mode 100644 index 0000000..86daf8b --- /dev/null +++ b/themes/throwback/images/hgrad.png diff --git a/themes/throwback/images/larrow.png b/themes/throwback/images/larrow.png Binary files differnew file mode 100644 index 0000000..554b6e9 --- /dev/null +++ b/themes/throwback/images/larrow.png diff --git a/themes/throwback/images/leftshadow.png b/themes/throwback/images/leftshadow.png Binary files differnew file mode 100644 index 0000000..1f32159 --- /dev/null +++ b/themes/throwback/images/leftshadow.png diff --git a/themes/throwback/images/logo.jpg b/themes/throwback/images/logo.jpg Binary files differnew file mode 100644 index 0000000..8b59067 --- /dev/null +++ b/themes/throwback/images/logo.jpg diff --git a/themes/throwback/images/lvgrad.png b/themes/throwback/images/lvgrad.png Binary files differnew file mode 100644 index 0000000..487d7e3 --- /dev/null +++ b/themes/throwback/images/lvgrad.png diff --git a/themes/throwback/images/navbackground.jpg b/themes/throwback/images/navbackground.jpg Binary files differnew file mode 100644 index 0000000..93ffece --- /dev/null +++ b/themes/throwback/images/navbackground.jpg diff --git a/themes/throwback/images/navbg.jpg b/themes/throwback/images/navbg.jpg Binary files differnew file mode 100644 index 0000000..04bf7a8 --- /dev/null +++ b/themes/throwback/images/navbg.jpg diff --git a/themes/throwback/images/navspacer.jpg b/themes/throwback/images/navspacer.jpg Binary files differnew file mode 100644 index 0000000..cc6d8fa --- /dev/null +++ b/themes/throwback/images/navspacer.jpg diff --git a/themes/throwback/images/navspacer.png b/themes/throwback/images/navspacer.png Binary files differnew file mode 100644 index 0000000..01b0ac9 --- /dev/null +++ b/themes/throwback/images/navspacer.png diff --git a/themes/throwback/images/news_header.png b/themes/throwback/images/news_header.png Binary files differnew file mode 100644 index 0000000..00861bf --- /dev/null +++ b/themes/throwback/images/news_header.png diff --git a/themes/throwback/images/nvgrad.png b/themes/throwback/images/nvgrad.png Binary files differnew file mode 100644 index 0000000..5e4c05c --- /dev/null +++ b/themes/throwback/images/nvgrad.png diff --git a/themes/throwback/images/photoleft.png b/themes/throwback/images/photoleft.png Binary files differnew file mode 100644 index 0000000..f4eb3af --- /dev/null +++ b/themes/throwback/images/photoleft.png diff --git a/themes/throwback/images/photoright.png b/themes/throwback/images/photoright.png Binary files differnew file mode 100644 index 0000000..16a251b --- /dev/null +++ b/themes/throwback/images/photoright.png diff --git a/themes/throwback/images/rightshadow.png b/themes/throwback/images/rightshadow.png Binary files differnew file mode 100644 index 0000000..bc970f0 --- /dev/null +++ b/themes/throwback/images/rightshadow.png diff --git a/themes/throwback/images/sandbackground.jpg b/themes/throwback/images/sandbackground.jpg Binary files differnew file mode 100644 index 0000000..2a2d800 --- /dev/null +++ b/themes/throwback/images/sandbackground.jpg diff --git a/themes/throwback/images/spacer.png b/themes/throwback/images/spacer.png Binary files differnew file mode 100644 index 0000000..f187f4a --- /dev/null +++ b/themes/throwback/images/spacer.png diff --git a/themes/throwback/images/vgrad.png b/themes/throwback/images/vgrad.png Binary files differnew file mode 100644 index 0000000..e7a96e8 --- /dev/null +++ b/themes/throwback/images/vgrad.png diff --git a/themes/throwback/images/view.gif b/themes/throwback/images/view.gif Binary files differnew file mode 100644 index 0000000..52cbddb --- /dev/null +++ b/themes/throwback/images/view.gif diff --git a/themes/throwback/include/functions.php b/themes/throwback/include/functions.php new file mode 100644 index 0000000..afcd130 --- /dev/null +++ b/themes/throwback/include/functions.php @@ -0,0 +1,38 @@ +<?php + + /* EVERY THEME SHOULD HAVE THIS FILE WITH THE FUNCTIONS OPENCONTENT() & CLOSECONTENT() */ + + /** + * OpenContent() + * Opens a Bayonet site content block. + * @return + */ + function OpenContent() + { + echo "<div class=\"contentBorder\">"; + } + + /** + * CloseContent() + * Closes a Bayonet site content block. + * @return + */ + function CloseContent() + { + echo "</div>"; + } + + function OpenBlock($title = 'New Block') + { + OpenContent(); + echo "<div class=\"contentHeading\">{$title}</div>"; + echo "<div class=\"content\">"; + } + + function CloseBlock() + { + echo "</div>"; + CloseContent(); + } + +?>
\ No newline at end of file diff --git a/themes/throwback/include/primary.css b/themes/throwback/include/primary.css new file mode 100644 index 0000000..c02a3ff --- /dev/null +++ b/themes/throwback/include/primary.css @@ -0,0 +1,278 @@ + /********************************* + ** Layout Styles ** + *********************************/ + div.container { + width: 990px; + position: relative; + /* width: 1000px; */ + color: #000000; + margin: auto auto; + text-align: left; /* IE 5 fix */ + } + div.banner { + /* width: 990px; */ + text-align:center; + /* margin: auto auto; */ + } + div.nav { + /*width: 990px; */ + height: 25px; + line-height: 23px; + background-color: #284c75; + background-image:url('../images/navbg.jpg'); + color: #000000; + text-align:center; + /* margin: auto auto; */ + font-size:14px; + border-top: 1px solid black; + } + table.main { + background-image:url('../images/acu_bg.jpg'); + padding: 0px; + color:#ffffff; + width:990px; + /*width: 1134px; */ + /* width: 1234px; */ + margin: auto auto; + /* background-color:#a3a2a0; */ + } + + table.main td { + /* color:white; */ + } + td.midcol { + width: 644px; + background-color:transparent; + vertical-align:top; + } + td.rightcol { + vertical-align:top; + } + td.leftcol { + width: 275px; + vertical-align:top; + } + div.footer { + text-align:center; + font-family:verdana; + font-size:10pt; + color:#5e5e5e; + background-color:#333333; + border-top: 1px solid #5e5e5e; + } + + /********************************* + ** Content Styles ** + *********************************/ + div.contentBorder { + border: 1px solid #070707; /*#3666ba;*/ + } + div.contentBorder2 { + background-color:white; + /*border:1px solid #000; /* 333 */ + } + div.contentHeading { + background-image:url(../images/headingbg.jpg); + background-repeat:repeat-x; + background-color:#112f50; + border: 0px solid black; + height:25px; + line-height: 25px; + padding-left:10px; + padding-right:10px; + color:white; + } + div.content { + padding:10px; + color: #CCC; + /*background-color:#383838; + color:white; */ + /*background-color:#f1f1f1;*/ + background-image: url(../images/contentbg.png); + border: 1px solid #3b3b3b; + } + div.content img { + padding:10px; + } + div.contentFooter { + border-top:1px solid #333333; + background-color:#a4a4a4; + color:white; + padding-left:5px; + padding-right:5px; + } + span.footer-text { + font-size: 10px; + } + + .clear { + clear: both; + } + + /********************************* + ** Nav Links Styles ** + *********************************/ + div.nav a, div.nav a:visited, div.nav a:active { + background-color:transparent; + color:white; + font-family:verdana; + font-size:11px; + font-weight:bold; + text-decoration:none; + } + + div.nav a:hover, div.nav 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-left: 1px solid #404040; + border-right: 1px solid #000000;*/ + vertical-align:middle; + } + + /********************************* + ** Misc. Styles ** + *********************************/ + + h1, h2, h3, h4, h5, h6 { + font-family: Helvetica, Arial, sans-serif; + font-weight: normal; + } + table, tr, td { + padding:0px; + border:0px; + margin:0px + } + body, td, div { + font-size:11px; + /* color:black; */ + font-family: Tahoma, Verdana, Arial; + font-weight: normal; + } + a, a:visited, a:active { + background-color:transparent; + /*color:#3666ba;*/ + color:#CCC; + text-decoration:none; + } + + a:hover, a:visited:hover { + background-color:transparent; + /*color:#3666ba;*/ + color:#CCC; + text-decoration:underline; + } + a.rudi_roster, a.rudi_roster:visited, a.rudi_roster:active, a.rudi_roster:hover { + color:#2b5bae; + } + body { + background-color: black; + /*background-image: url('../images/Background.jpg');*/ + background-position: top center; + background-attachment: fixed; + margin:0; + padding:0; + text-align:left; + } + a img { + border:0px; + } + form { + margin:0; + } + tr.rownorm{ + background-color:white; + + } + tr.rowhigh{ + background-color:#e0e0e0; + } + /* photo gallery styles */ + .photoleft{ + background-image:url("../images/photoleft.png"); + background-repeat:repeat-y; + text-align:center; + width:49px; + } + .photoright{ + background-image:url("../images/photoright.png"); + background-repeat:repeat-y; + text-align:center; + width:49px; + } + /* end photo gallery styles */ + + /* stuff we might need in order to add drop shadows */ + + div.topbar { + height:25px; + text-align:center; + background-color:black; + font-family:verdana; + font-size:10pt; + color:#797e4f; + } + div.botbar { + height:50px; + padding:5px; + text-align:center; + background-color:black; + font-family:verdana; + font-size:10pt; + } + /* may need these two when we add the background images back */ + .leftbar { + /* background-image:url("../images/leftshadow.png"); */ + background-repeat: + repeat-y; + width:50px; + } + .rightbar { + /* background-image:url("../images/rightshadow.png"); */ + background-repeat: + repeat-y; + width:15px; + } + + .fl-left{ + float:left; + } + + .fl-right{ + float:right; + } + + .clear { + clear:both; + } + + .inline { + display: inline; + } + + .left{ + text-align:left; + } + .right{ + text-align:right; + } + .center{ + text-align:center; + } + .title{ + font-size:14px; + font-weight:bold; + font-family:arial; + } + +@import "style_bbcode.css" + diff --git a/themes/throwback/include/style_bbcode.css b/themes/throwback/include/style_bbcode.css new file mode 100644 index 0000000..05333f9 --- /dev/null +++ b/themes/throwback/include/style_bbcode.css @@ -0,0 +1,71 @@ +.bold { + font-weight: bold; +} + +.italics { + font-style: italic; +} + +.underline { + text-decoration: underline; +} + +.strikethrough { + text-decoration: line-through; +} + +.overline { + text-decoration: overline; +} + +.quotecodeheader { + font-family: Verdana, arial, helvetica, sans-serif; + font-size: 12px; + font-weight: bold; +} + +.codebody { + background-color: #FFFFFF; + font-family: Courier new, courier, mono; + font-size: 12px; + color: #006600; + border: 1px solid #BFBFBF; +} + +.quotebody { + background-color: #FFFFFF; + font-family: Courier new, courier, mono; + font-size: 12px; + color: #660002; + border: 1px solid #BFBFBF; +} + +.listbullet { + list-style-type: disc; + list-style-position: inside; +} + +.listdecimal { + list-style-type: decimal; + list-style-position: inside; +} + +.listlowerroman { + list-style-type: lower-roman; + list-style-position: inside; +} + +.listupperroman { + list-style-type: upper-roman; + list-style-position: inside; +} + +.listloweralpha { + list-style-type: lower-alpha; + list-style-position: inside; +} + +.listupperalpha { + list-style-type: upper-alpha; + list-style-position: inside; +} diff --git a/themes/throwback/include/theme.ini b/themes/throwback/include/theme.ini new file mode 100644 index 0000000..34bd055 --- /dev/null +++ b/themes/throwback/include/theme.ini @@ -0,0 +1,2 @@ +[author]
+name = "Evan O'Connell"
\ No newline at end of file diff --git a/themes/throwback/index.php b/themes/throwback/index.php new file mode 100644 index 0000000..bfcab58 --- /dev/null +++ b/themes/throwback/index.php @@ -0,0 +1,61 @@ +<?php +/** + * Bayonet Conent Management System + * Copyright (C) Joseph Hunkeler & Evan O'Connell + * + * Purpose of this software is to allow users to manage their website + * with ease and without needing to have any coding knowledge in order + * to maintain it. Visit [link] for any updates or feedback. + */ + +/* Begin try/catch block */ +try { + +/* Setup error handing callbacks */ +ob_start("fatal_error_handler"); +set_error_handler("handle_error"); + +require_once self::$root_path . '/include/functions.php'; + +include self::$header; +//session_start(); +?> + +<div class="container"> + +<!-- banner --> + <div class="banner"><a href="index.php"><img src="<?php echo self::$image_path . '/banner.jpg'; ?>" alt="3rd Infantry Division - ArmAII Unit" /></a></div> +<!-- navigation --> + <div class="nav"><?php require_once self::$root_path . '/navigation.php'; ?></div> + +<!-- content --> +<table border="0" cellspacing="15px" cellpadding="0" class="main" width="100%"> + <tr> + <td class="midcol"> + <?php require_once 'modules.php'; ?> + </td> + + <!-- block area RIGHT --> + <?php if(!defined('BLOCK_RIGHT_DISABLE')): ?> + <td class="rightcol"> + <?php GetBlocks(BLOCK_RIGHT); ?> + </td> + <?php endif; ?> + + </tr> +</table> + +</div> +<?php include self::$footer; ?> +<?php +/* Flushing is needed by the error handler */ +ob_end_flush(); + +} //try ^^ +catch(Exception $e) +{ + ReportError( + "<style>td.short{width:100%;}</style><table style=\"width:0;\"><tr><th>Code</th>" . "<td class=\"short\">" . $e->getCode() . "</td>" . "</tr><tr><th>In File</th>" . "<td class=\"short\">" . $e->getFile() . "</td>" . "</tr></table>" . $e->getLine() . " - " . $e->getMessage() . "<br/>" + ); +} +?> diff --git a/themes/throwback/navigation.php b/themes/throwback/navigation.php new file mode 100644 index 0000000..ac81b6b --- /dev/null +++ b/themes/throwback/navigation.php @@ -0,0 +1,21 @@ +<?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. + */ + ?> + <a href="index.php">HOME</a> +<?php + + $result = $db->Query("SELECT * FROM `bayonet_navigation` ORDER BY `weight`"); + $nav = $db->Fetch($result); + + foreach ($nav as $link) { + echo ' <a href="' . str_replace('&', '&', $link['link']) . '">' . strtoupper($link['title']) . '</a> '; + //echo '<img src="'.self::$image_path.'/navspacer.png" />'; + } +?> |