aboutsummaryrefslogtreecommitdiff
path: root/blocks
diff options
context:
space:
mode:
authorjhunkeler <jhunkeler@c5b2fb0a-d05d-0410-98c8-828840a80ff6>2009-12-20 13:38:08 -0500
committerjhunkeler <jhunkeler@c5b2fb0a-d05d-0410-98c8-828840a80ff6>2009-12-20 13:38:08 -0500
commitbe4f83cd2a17a0ec05f5bce50c91befaafaa6e0c (patch)
tree6f20672cf5df66044b3fa9dd71fc3bcdc484abe6 /blocks
parent1a619f2638a4f77fb8ea9557edeefb883d8c06f8 (diff)
downloadbayonetcms-be4f83cd2a17a0ec05f5bce50c91befaafaa6e0c.tar.gz
Test.
git-svn-id: http://svn.3rd-infantry-division.org/testing/branches/Bayonet CMS v2@376 c5b2fb0a-d05d-0410-98c8-828840a80ff6
Diffstat (limited to 'blocks')
-rw-r--r--blocks/donations/index.php13
-rw-r--r--blocks/mini_calendar/functions.php301
-rw-r--r--blocks/mini_calendar/index.php3
-rw-r--r--blocks/mini_calendar/scripts.js0
-rw-r--r--blocks/mini_calendar/style.css96
-rw-r--r--blocks/rss_agw/index.php29
-rw-r--r--blocks/rss_agw/rssreader.php161
-rw-r--r--blocks/rss_agw/style.css17
-rw-r--r--blocks/server_monitor/index.php16
-rw-r--r--blocks/soldier_info/index.php25
-rw-r--r--blocks/tsviewer/index.php18
11 files changed, 679 insertions, 0 deletions
diff --git a/blocks/donations/index.php b/blocks/donations/index.php
new file mode 100644
index 0000000..8695f68
--- /dev/null
+++ b/blocks/donations/index.php
@@ -0,0 +1,13 @@
+<table align="center" width="98%">
+<tr><td id="block">
+<center>
+<form action="https://www.paypal.com/cgi-bin/webscr" method="post">
+<input type="hidden" name="cmd" value="_s-xclick">
+<input type="image" src="https://www.paypal.com/en_US/i/btn/btn_donateCC_LG.gif" border="0" name="submit" alt="PayPal - The safer, easier way to pay online!">
+<img alt="" border="0" src="https://www.paypal.com/en_US/i/scr/pixel.gif" width="1" height="1">
+<input type="hidden" name="encrypted" value="-----BEGIN PKCS7-----MIIHV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w0BCQEWDXJlQHBheXBhbC5jb20CAQAwCQYFKw4DAhoFAKBdMBgGCSqGSIb3DQEJAzELBgkqhkiG9w0BBwEwHAYJKoZIhvcNAQkFMQ8XDTA4MDYyNDE5NDA1NFowIwYJKoZIhvcNAQkEMRYEFHwgOr66usJFr7worL1HLbU+ZewlMA0GCSqGSIb3DQEBAQUABIGAmyDx3eQWeqd/E0JJaEzLwigGno2dPPdncgs7XWE7vYS5JKm22uUsfrxUlKhhEBDQ8tmh9UvErNKZPrW2WJN0lcTVcc01jHVKnBQt6btAE/FRKM+aIC8dLnFj2gVnuNVVmbcaK9ep5mn4+/TrCymeEomAwuLT9yYcptzZb99/Ccc=-----END PKCS7-----
+">
+</form>
+</center>
+</td></tr>
+</table>
diff --git a/blocks/mini_calendar/functions.php b/blocks/mini_calendar/functions.php
new file mode 100644
index 0000000..06ce910
--- /dev/null
+++ b/blocks/mini_calendar/functions.php
@@ -0,0 +1,301 @@
+<?php
+/**
+ * Bayonet Content Management System
+ * Copyright (C) 2008 Joseph Hunkeler & Evan O'Connell
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+
+/**
+ * Note to anyone feeling the need to edit this file...
+ * You MUST declare $db as global inside your functions in order access MySQL from here.
+ */
+
+ /**
+ * SelectDate($date)
+ * Function for outputing an html form for selecting a month day and year
+ * @param date - formatted date string yyyy-mm-dd (optional)
+ */
+ function SelectDate($date = NULL){
+
+ //function for adding to the db in sql 'datetime' format
+ //$date = date("Y-m-d h:i:s", mktime(8, 30, 0, 10, 26, 2009));
+ //$date = "2009-11-2";
+ //echo $date."<br />";
+ //function for parsing our date format into an array
+ //echo "<pre>";
+ $date_arr = date_parse($date); //returns an associative array $array['year']
+ //print_r($date_arr);
+ //echo "</pre>";
+ //echo $date_arr['year']." ".$date_arr['month']." ".$date_arr['day']."<br />";;
+
+ //List Months
+ echo '<select name="month">';
+ for($m = 1;$m <= 12; $m++){
+ $month = date("F", mktime(0, 0, 0, $m));
+ if($date_arr['month'] == $m)
+ echo "<option value='$m' selected=\"selected\">$month</option>";
+ else
+ echo "<option value='$m'>$month</option>";
+ }
+ echo "</select>";
+
+ //List Days
+ echo '<select name="day">';
+ for($d = 1;$d <= 31; $d++){
+ if($date_arr['day'] == $d)
+ echo "<option value='$d' selected=\"selected\">$d</option>";
+ else
+ echo "<option value='$d'>$d</option>";
+ }
+ echo "</select>";
+
+ //List Years [CurYear, CurYear+5]
+ echo '<select name="year">';
+ $y = date('Y', time());
+ $max = $y+5;
+ for(;$y<$max; $y++){
+ if($date_arr['year'] == $y)
+ echo "<option value='$y' selected=\"selected\">$y</option>";
+ else
+ echo "<option value='$y'>$y</option>";
+ }
+ echo "</select>";
+
+ }
+
+ function ListEvents($date){
+
+ global $db;
+
+?>
+ <table width="100%"><tr><td>
+ <h3>Events for: <?php echo date_format(date_create($date),'F jS, Y'); ?></h3>
+ </td><td align="right">
+ <a href="?op=calendar&create=true&date=<?php echo $date; ?>"><img src="images/add.gif" /> Add New Event</a>
+ </td></tr></table>
+<?php
+
+ echo "<table width=\"100%\">";
+
+ $result = $db->Query("SELECT * FROM bayonet_events WHERE `date` = '$date' ORDER BY `time`");
+ while(($row = $db->Fetch($result))!=false)
+ {
+ $tmp = true;
+
+ $datetime = date_create($date.' '.$row['time']);
+ $time = date_format($datetime, 'g:ia'); //gets time in hour:minutes am|pm
+?>
+
+<tr>
+ <td><strong><?php echo $time." - ".$row['title']; ?></strong></td>
+ <td><span style="border:1px solid black;background-color:#<?php echo $row['color'];?>;">&nbsp;&nbsp;&nbsp;&nbsp;</span></td>
+ <td>
+ <a href="?op=calendar&month=<?php echo $_GET['month']; ?>&year=<?php echo $_GET['year']; ?>&edit=<?php echo $row['event_id'];?>">Edit</a>
+ &nbsp;|&nbsp;
+ <a href="?op=calendar&delete=<?php echo $row['event_id']; ?>">Delete</a>
+ </td>
+</tr>
+<tr>
+ <td><?php echo BBCode($row['text']); ?><br /><br /></td>
+</tr>
+
+<tr>
+ <td colspan="2" style="border-top:1px solid black;"><br /></td>
+</tr>
+<?php
+ }
+
+ if(!isset($tmp))
+ echo "<tr><td>There are no events posted for this day.</td></tr>";
+
+ echo "</table>";
+
+ }
+
+
+ /**
+ * PrintCalendar() - prints the calendar with events
+ */
+ function PrintCalendar(){
+
+ $date = time();
+ date_default_timezone_set("America/New_York"); //EASTERN TIME ZONE
+
+ //GET values for month and year
+ $month = "";
+ $year = "";
+ //$month = $_GET['month'];
+ //$year = $_GET['year'];
+
+ $useCurDate = true;
+
+ //check to makes sure month and year are in the desired ranges
+ if(!empty($month) && !empty($year) && $month > 0 && $month < 13 && $year > 1990){
+ $useCurDate = false;
+ }
+ //check to see if the get variables are for todays month
+ if($month == date('n', $date) && $year == date('Y', $date)){
+ $useCurDate = true;
+ }
+
+ //use current date unless GET values are set
+ if($useCurDate)
+ {
+ $day = date('d', $date);
+ $today = date('j', $date);
+ $month = date('m', $date);
+ $monthNum = date('n', $date);
+ $year = date('Y', $date);
+ }
+ else
+ {
+ $monthNum = $month;
+ //if GET values are equal to curdate, set $today
+ if($year == date('Y', $date) && $monthNum == date('n', $date))
+ $today = date('j', $date);
+ else
+ $today = 0;
+ }
+
+ /* Accounts for the last couple days from the previous months */
+ $first_day = mktime(0,0,0,$monthNum, 1, $year);
+
+ $title = date('F', $first_day);
+
+ $day_of_week = date('D', $first_day);
+
+ switch($day_of_week){
+ case "Sun": $blank = 0; break;
+ case "Mon": $blank = 1; break;
+ case "Tue": $blank = 2; break;
+ case "Wed": $blank = 3; break;
+ case "Thu": $blank = 4; break;
+ case "Fri": $blank = 5; break;
+ case "Sat": $blank = 6; break;
+ }
+
+ /* calculates the days in the current month */
+ $days_in_month = cal_days_in_month(0, $monthNum, $year);
+
+ //makes sure that previous year is not year 0
+ if($monthNum == 1){
+ $previous_month = 12;
+ $previous_year = $year-1;
+ }else{
+ $previous_month = $monthNum-1;
+ $previous_year = $year;
+ }
+ //makes sure the next year is not year 13
+ if($monthNum == 12){
+ $next_month = 1;
+ $next_year = $year+1;
+ }else{
+ $next_month = $monthNum+1;
+ $next_year = $year;
+ }
+ ?>
+ <center>
+ <table class="calendar" style="background-color:white;" cellspacing="1" cellpadding="0">
+ <tr style="background-color:#999999; height:27px;">
+ <td colspan="50" style="vertical-align:middle; text-align:center;">
+ <!-- <a href="?op=calendar&month=<?php echo $previous_month.'&year='.$previous_year; ?>"><<</a> -->
+ <!-- Month Name and Year -->
+ &nbsp;&nbsp;<span class="monthTitle"><?php echo strtoupper($title).' '.$year; ?></span>&nbsp;&nbsp;
+ <!-- <a href="?op=calendar&month=<?php echo $next_month.'&year='.$next_year; ?>">>></a> -->
+ </td>
+ </tr>
+
+ <tr>
+ <th class="weekday">Sun</th><th class="weekday">Mon</th><th class="weekday">Tue</th><th class="weekday">Wed</th>
+ <th class="weekday">Thu</th><th class="weekday">Fri</th><th class="weekday">Sat</th>
+ </tr>
+
+ <tr>
+ <?php
+
+ $day_count = 1; //holds the current day of the week 1-7
+ $day_num = 1; //holds the current day of the month 1-31
+
+ $days_monthbefore = cal_days_in_month(0, $previous_month, $year);
+ //prints the numbers of days for the previous month
+ while($blank > 0){
+ $blank = $blank-1;
+ $days_before = $days_monthbefore-$blank;
+ echo '<td class="cal_notmonth">'.$days_before.'</td>'; //'.$days_before.'</td>';
+ $day_count++;
+ }
+
+ //loop printing each day of the CURRENT month ONLY
+ while($day_num <= $days_in_month){
+
+ if($day_count==1 || $day_count==7){
+ echo '<td class="cal_weekend">'; //weekends
+ }else{
+ echo '<td class="cal_weekday">'; //weekdays
+ }
+
+ $sqlDate = $year.'-'.$monthNum.'-'.$day_num; //old way NOT unix
+
+ //checks to see if the current day has events
+ $isEvent=false;
+
+ global $db;
+ $result = $db->Query("SELECT title,color FROM `bayonet_events` WHERE `date` = '$sqlDate' LIMIT 1");
+ while(($row = $db->Fetch($result))!=false)
+ {
+ $isEvent = true;
+ }
+
+ if($day_num == $today && $isEvent==true){
+ echo '<div class="eventtoday">'.$day_num.'</div>';
+ }else if($day_num == $today && $isEvent==false){
+ echo '<div class="monthtoday">'.$day_num.'</div>';
+ }else if($day_num != $today && $isEvent==true){
+ echo '<div class="event" id="event'.$day_num.'" onmouseover="highlightEvent(this.id)" onmouseout="normEvent(this.id)">';
+ echo $day_num;
+ echo '</div>';
+ }else{
+ echo $day_num;
+ }
+
+ echo '</td>';
+
+ $day_num++;
+ $day_count++;
+
+ if($day_count > 7){
+ echo '</tr><tr>';
+ $day_count = 1;
+ }
+ }
+
+ $days_after = 1;
+ //loop for printing the days for the next month
+ while($day_count > 1 && $day_count <=7){
+ echo '<td class="cal_notmonth">'.$days_after.'</td>'; //'.$days_after.'</td>';
+ $days_after++;
+ $day_count++;
+ }
+
+ ?>
+
+ </tr>
+ </table>
+ </center>
+<?php
+
+ }
+
+ ?> \ No newline at end of file
diff --git a/blocks/mini_calendar/index.php b/blocks/mini_calendar/index.php
new file mode 100644
index 0000000..6516646
--- /dev/null
+++ b/blocks/mini_calendar/index.php
@@ -0,0 +1,3 @@
+<link rel="stylesheet" type="text/css" href="blocks/mini_calendar/style.css" media="screen"/>
+<?php include 'blocks/mini_calendar/functions.php'; ?>
+<?php PrintCalendar(); ?> \ No newline at end of file
diff --git a/blocks/mini_calendar/scripts.js b/blocks/mini_calendar/scripts.js
new file mode 100644
index 0000000..e69de29
--- /dev/null
+++ b/blocks/mini_calendar/scripts.js
diff --git a/blocks/mini_calendar/style.css b/blocks/mini_calendar/style.css
new file mode 100644
index 0000000..72898ee
--- /dev/null
+++ b/blocks/mini_calendar/style.css
@@ -0,0 +1,96 @@
+/* START>> CALENDAR STYLES*/
+ .monthTitle{
+ color:black;
+ text-align:center;
+ font-size:12px;
+ font-weight:bold;
+ font-family:arial;
+ }
+ td.weekday {
+ width:40px;
+ height:20px;
+ background-color:#cb2121;
+ color:green;
+ text-align:center;
+ font-size:10px;
+ font-weight:bold;
+ }
+ th.weekday {
+ width:40px;
+ height:29px;
+ background-color:white;
+ color:black;
+ text-align:center;
+ font-size:11px;
+ font-weight:bold;
+ }
+ .monthday {
+ width:40px;
+ height:20px;
+ background-color:#aea2a2;
+ color:white;
+ text-align:left;
+ font-size:10pt;
+ font-weight:bold;
+
+ }
+ .monthtoday {
+ width:38px;
+ height:38px;
+ /* background-color:#3666ba; */
+ color:#225eac;
+ text-align:center;
+ font-size:14px;
+ font-weight:bold;
+ border:1px solid #333333;
+ }
+ .event {
+ width:38px;
+ height:38px;
+ background-color:#225eac;
+ text-align:center;
+ border:1px solid #333333;
+ }
+ table.calendar a, table.calendar a:visited, table.calendar a:active, table.calendar a:hover {
+ color:white;
+ }
+ .eventtoday{
+ width:38px;
+ height:38px;
+ background-color:#225eac;
+ color:#ef8e25;
+ text-align:center;
+ font-size:14px;
+ font-weight:bold;
+ border:1px solid #333333;
+ }
+ td.cal_weekday {
+ width:40px;
+ height:40px;
+ background-color:#a1a1a1;
+ vertical-align:top;
+ color:#eeeeee;
+ font-family:arial;
+ text-align:center;
+ font-size:14px;
+ }
+ td.cal_weekend {
+ width:40px;
+ height:40px;
+ background-color:#8f8f8f;
+ vertical-align:top;
+ color:#eeeeee;
+ font-family:arial;
+ text-align:center;
+ font-size:14px;
+ }
+ td.cal_notmonth {
+ width:40px;
+ height:40px;
+ background-color:#6e6e6e;
+ vertical-align:top;
+ color:#d4d4d4;
+ text-align:left;
+ font-size:11px;
+ }
+/* END>> CALENDAR STYLES */ \ No newline at end of file
diff --git a/blocks/rss_agw/index.php b/blocks/rss_agw/index.php
new file mode 100644
index 0000000..83c3ff1
--- /dev/null
+++ b/blocks/rss_agw/index.php
@@ -0,0 +1,29 @@
+<link rel="stylesheet" type="text/css" href="blocks/rss_agw/style.css" media="screen"/>
+<?php
+
+ include 'rssreader.php';
+
+ $rss = new rss_php;
+
+ $rss->load('http://www.armedglobalwarfare.com/index.php?type=rss;action=.xml;limit=30');
+
+ $items = $rss->getItems(); #returns all rss items
+
+ $numFeeds = 0;
+ echo "<div class=\"rss\" >";
+ foreach($items as $story){
+ if($story['category']=="Tournament Announcements"){
+ $numFeeds++;
+ echo "<a href=\"{$story['link']}\" target=\"_blank\"><span class=\"title\">{$story['title']}</span></a><br />
+ <span class=\"date\">{$story['pubDate']}</span><br />
+ {$story['description']}<br /><br />";
+ }
+ }
+ if(!$numFeeds){
+ echo "No new updates for this news feed.";
+ }
+ echo "</div>";
+ // echo "<pre>";
+ //print_r($items);
+ // echo "</pre>";
+?>
diff --git a/blocks/rss_agw/rssreader.php b/blocks/rss_agw/rssreader.php
new file mode 100644
index 0000000..41fa238
--- /dev/null
+++ b/blocks/rss_agw/rssreader.php
@@ -0,0 +1,161 @@
+<?php
+/*
+ RSS_PHP - the PHP DOM based RSS Parser
+ Author: <rssphp.net>
+ Published: 200801 :: blacknet :: via rssphp.net
+
+ RSS_PHP is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY.
+
+ Usage:
+ See the documentation at http://rssphp.net/documentation
+ Examples:
+ Can be found online at http://rssphp.net/examples
+*/
+
+class rss_php {
+
+ public $document;
+ public $channel;
+ public $items;
+
+/****************************
+ public load methods
+***/
+ # load RSS by URL
+ public function load($url=false, $unblock=true) {
+ if($url) {
+ if($unblock) {
+ $this->loadParser(file_get_contents($url, false, $this->randomContext()));
+ } else {
+ $this->loadParser(file_get_contents($url));
+ }
+ }
+ }
+ # load raw RSS data
+ public function loadRSS($rawxml=false) {
+ if($rawxml) {
+ $this->loadParser($rawxml);
+ }
+ }
+
+/****************************
+ public load methods
+ @param $includeAttributes BOOLEAN
+ return array;
+***/
+ # return full rss array
+ public function getRSS($includeAttributes=false) {
+ if($includeAttributes) {
+ return $this->document;
+ }
+ return $this->valueReturner();
+ }
+ # return channel data
+ public function getChannel($includeAttributes=false) {
+ if($includeAttributes) {
+ return $this->channel;
+ }
+ return $this->valueReturner($this->channel);
+ }
+ # return rss items
+ public function getItems($includeAttributes=false) {
+ if($includeAttributes) {
+ return $this->items;
+ }
+ return $this->valueReturner($this->items);
+ }
+
+/****************************
+ internal methods
+***/
+ private function loadParser($rss=false) {
+ if($rss) {
+ $this->document = array();
+ $this->channel = array();
+ $this->items = array();
+ $DOMDocument = new DOMDocument;
+ $DOMDocument->strictErrorChecking = false;
+ $DOMDocument->loadXML($rss);
+ $this->document = $this->extractDOM($DOMDocument->childNodes);
+ }
+ }
+
+ private function valueReturner($valueBlock=false) {
+ if(!$valueBlock) {
+ $valueBlock = $this->document;
+ }
+ foreach($valueBlock as $valueName => $values) {
+ if(isset($values['value'])) {
+ $values = $values['value'];
+ }
+ if(is_array($values)) {
+ $valueBlock[$valueName] = $this->valueReturner($values);
+ } else {
+ $valueBlock[$valueName] = $values;
+ }
+ }
+ return $valueBlock;
+ }
+
+ private function extractDOM($nodeList,$parentNodeName=false) {
+ $itemCounter = 0;
+ foreach($nodeList as $values) {
+ if(substr($values->nodeName,0,1) != '#') {
+ if($values->nodeName == 'item') {
+ $nodeName = $values->nodeName.':'.$itemCounter;
+ $itemCounter++;
+ } else {
+ $nodeName = $values->nodeName;
+ }
+ $tempNode[$nodeName] = array();
+ if($values->attributes) {
+ for($i=0;$values->attributes->item($i);$i++) {
+ $tempNode[$nodeName]['properties'][$values->attributes->item($i)->nodeName] = $values->attributes->item($i)->nodeValue;
+ }
+ }
+ if(!$values->firstChild) {
+ $tempNode[$nodeName]['value'] = $values->textContent;
+ } else {
+ $tempNode[$nodeName]['value'] = $this->extractDOM($values->childNodes, $values->nodeName);
+ }
+ if(in_array($parentNodeName, array('channel','rdf:RDF'))) {
+ if($values->nodeName == 'item') {
+ $this->items[] = $tempNode[$nodeName]['value'];
+ } elseif(!in_array($values->nodeName, array('rss','channel'))) {
+ $this->channel[$values->nodeName] = $tempNode[$nodeName];
+ }
+ }
+ } elseif(substr($values->nodeName,1) == 'text') {
+
+ $tempValue = trim(preg_replace('/\s\s+/',' ',str_replace("\n",' ', $values->textContent)));
+ if($tempValue) {
+ $tempNode = $tempValue;
+ }
+ } elseif(substr($values->nodeName,1) == 'cdata-section'){
+ $tempNode = $values->textContent;
+ }
+ }
+ return $tempNode;
+ }
+
+ private function randomContext() {
+ $headerstrings = array();
+ $headerstrings['User-Agent'] = 'Mozilla/5.0 (Windows; U; Windows NT 5.'.rand(0,2).'; en-US; rv:1.'.rand(2,9).'.'.rand(0,4).'.'.rand(1,9).') Gecko/2007'.rand(10,12).rand(10,30).' Firefox/2.0.'.rand(0,1).'.'.rand(1,9);
+ $headerstrings['Accept-Charset'] = rand(0,1) ? 'en-gb,en;q=0.'.rand(3,8) : 'en-us,en;q=0.'.rand(3,8);
+ $headerstrings['Accept-Language'] = 'en-us,en;q=0.'.rand(4,6);
+ $setHeaders = 'Accept: text/xml,application/xml,application/xhtml+xml,text/html;q=0.9,text/plain;q=0.8,image/png,*/*;q=0.5'."\r\n".
+ 'Accept-Charset: '.$headerstrings['Accept-Charset']."\r\n".
+ 'Accept-Language: '.$headerstrings['Accept-Language']."\r\n".
+ 'User-Agent: '.$headerstrings['User-Agent']."\r\n";
+ $contextOptions = array(
+ 'http'=>array(
+ 'method'=>"GET",
+ 'header'=>$setHeaders
+ )
+ );
+ return stream_context_create($contextOptions);
+ }
+
+}
+
+?> \ No newline at end of file
diff --git a/blocks/rss_agw/style.css b/blocks/rss_agw/style.css
new file mode 100644
index 0000000..0bc6e81
--- /dev/null
+++ b/blocks/rss_agw/style.css
@@ -0,0 +1,17 @@
+ .rss img {
+ display: none;
+ }
+ .rss span.title{
+ font-size: 16px;
+ font-weight: bold;
+ /* text-decoration:underline; */
+ }
+
+ .rss span.date{
+ font-family: 'Trebuchet MS', Trebuchet, Verdana, sans-serif;
+ font-size: 11px;
+ text-transform: uppercase;
+ font-weight:bold;
+ text-align: center;
+ letter-spacing: 2px;
+ } \ No newline at end of file
diff --git a/blocks/server_monitor/index.php b/blocks/server_monitor/index.php
new file mode 100644
index 0000000..791a5b2
--- /dev/null
+++ b/blocks/server_monitor/index.php
@@ -0,0 +1,16 @@
+<?php
+
+$feed = fopen("http://module.game-monitor.com/216.245.211.59:28910/data/server.php","r");
+$tmp = fgets($feed);
+$server = unserialize($tmp);
+
+OpenBlock("Game Server");
+echo "<div style=\"margin:5px;\">\n
+<a href=\"{$server->link}\">{$server->name}</a><br/>\n
+IP: {$server->ip}:{$server->port}<br/>\n
+Players: {$server->player}/{$server->maxplayer}<br/>\n
+</td></tr>\n
+</div>\n";
+CloseBlock();
+
+?> \ No newline at end of file
diff --git a/blocks/soldier_info/index.php b/blocks/soldier_info/index.php
new file mode 100644
index 0000000..f40f528
--- /dev/null
+++ b/blocks/soldier_info/index.php
@@ -0,0 +1,25 @@
+ <center>
+
+ Your IP: <?php echo $_SERVER['REMOTE_ADDR']; ?><br />
+<?php
+ if ($logged_in == 'true'){
+ echo '<img src="'.$avatar.'" alt="'.$logged_username.'"/><br /><br />'.$postnum.' post(s)<br /><br />
+ </center>
+
+
+ Welcome, '.$logged_username.' <br />
+ <a href="logout.php"><img src="images/arrow-blk.gif" border="0" alt="" />&nbsp;Logout</a><br />';
+ }
+ else{
+ echo 'Welcome Guest.<br />
+ </center>
+ <br />';
+ }
+ if ($logged_in == 'true'){
+ echo'<hr />
+ <img src="images/email-y.gif" />Private Messages <br />
+ <img src="images/email-r.gif" />Unread: <a href="forums/private.php">'.$pm_unread.'</a><br />
+ <img src="images/email-g.gif" />Total: <a href="forums/private.php">'.$pm_total.'</a><br /><hr />';
+ }
+?>
+ </center> \ No newline at end of file
diff --git a/blocks/tsviewer/index.php b/blocks/tsviewer/index.php
new file mode 100644
index 0000000..cee0be4
--- /dev/null
+++ b/blocks/tsviewer/index.php
@@ -0,0 +1,18 @@
+<?php
+
+OpenBlock("Teamspeak Server");
+
+echo "<div style=\"margin: 5px;\">\n";
+////until it works again i'm going to have this here...
+//echo "TSViewer is not working.";
+//echo "</div>\n";
+//CloseBlock();
+//return; //die
+
+?>
+
+<script language="javascript" type="text/javascript" src="http://www.tsviewer.com/ts_viewer_pur.php?ID=58659&bg=transparent&type=eeeeee&type_size=11&type_family=1&info=1&channels=0&users=1&js=1&type_s_weight=normal&type_s_style=normal&type_s_variant=normal&type_s_decoration=none&type_s_weight_h=normal&type_s_style_h=normal&type_s_variant_h=normal&type_s_decoration_h=none&type_i_weight=normal&type_i_style=normal&type_i_variant=normal&type_i_decoration=none&type_i_weight_h=normal&type_i_style_h=normal&type_i_variant_h=normal&type_i_decoration_h=none&type_c_weight=normal&type_c_style=normal&type_c_variant=normal&type_c_decoration=none&type_c_weight_h=normal&type_c_style_h=normal&type_c_variant_h=normal&type_c_decoration_h=none&type_u_weight=normal&type_u_style=normal&type_u_variant=normal&type_u_decoration=none&type_u_weight_h=normal&type_u_style_h=normal&type_u_variant_h=normal&type_u_decoration_h=none&cflags=0"></script><NOSCRIPT>Enable JavaScript to see TeamSpeak Viewer or click <a href="http://www.tsviewer.com/index.php?page=ts_viewer&ID=58659">here</a>.</NOSCRIPT>
+
+<?php
+echo "</div>\n";
+CloseBlock(); ?>