aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorjhunkeler <jhunkeler@c5b2fb0a-d05d-0410-98c8-828840a80ff6>2009-12-28 12:12:53 -0500
committerjhunkeler <jhunkeler@c5b2fb0a-d05d-0410-98c8-828840a80ff6>2009-12-28 12:12:53 -0500
commit6b07955476a9932b247df678ec19a6b0ddaf440d (patch)
treef8badab82ef54a74641cebc6bff043662f1184ca
parent5c0c6135a304fa13c5a26d8c2801dda5420316ad (diff)
downloadbayonetcms-6b07955476a9932b247df678ec19a6b0ddaf440d.tar.gz
(OC)
phased out BBCode() and added the extras to bbcode_format() condensed the style sheets. git-svn-id: http://svn.3rd-infantry-division.org/testing/branches/Bayonet CMS v2@406 c5b2fb0a-d05d-0410-98c8-828840a80ff6
-rw-r--r--blocks/mini_calendar/functions.php618
-rw-r--r--includes/functions.php22
-rw-r--r--modules/news/functions.php28
-rw-r--r--modules/newsreel/index.php9
-rw-r--r--style.css224
5 files changed, 367 insertions, 534 deletions
diff --git a/blocks/mini_calendar/functions.php b/blocks/mini_calendar/functions.php
index 0dee840..968c7af 100644
--- a/blocks/mini_calendar/functions.php
+++ b/blocks/mini_calendar/functions.php
@@ -1,310 +1,310 @@
-<?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,date,time FROM `bayonet_events` WHERE `date` = '$sqlDate' ORDER BY `date` DESC");
- while(($row = $db->Fetch($result))!=false)
- {
- $isEvent = true;
- if($day_num == $today){
- $todaysEvents[] = $row;
- }
- }
- 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
- //list events for today
- if(count($todaysEvents)>0){
- echo "<h3>Today's Events</h3>";
- foreach($todaysEvents as $event){
- $time = date("g:i a", strtotime($event['date']." ".$event['time']));
- echo "<span style=\"background-color: {$event['color']}\">&nbsp;&nbsp;</span>&nbsp;{$event['title']} @ {$time}<br />";
- }
- }
- }
-
+<?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_format($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,date,time FROM `bayonet_events` WHERE `date` = '$sqlDate' ORDER BY `date` DESC");
+ while(($row = $db->Fetch($result))!=false)
+ {
+ $isEvent = true;
+ if($day_num == $today){
+ $todaysEvents[] = $row;
+ }
+ }
+ 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
+ //list events for today
+ if(count($todaysEvents)>0){
+ echo "<h3>Today's Events</h3>";
+ foreach($todaysEvents as $event){
+ $time = date("g:i a", strtotime($event['date']." ".$event['time']));
+ echo "<span style=\"background-color: {$event['color']}\">&nbsp;&nbsp;</span>&nbsp;{$event['title']} @ {$time}<br />";
+ }
+ }
+ }
+
?> \ No newline at end of file
diff --git a/includes/functions.php b/includes/functions.php
index 4db70c5..05d6457 100644
--- a/includes/functions.php
+++ b/includes/functions.php
@@ -35,45 +35,51 @@ function bbcode_format ($str)
'/\[b\](.*?)\[\/b\]/is',
'/\[i\](.*?)\[\/i\]/is',
'/\[u\](.*?)\[\/u\]/is',
+ '/\[s\](.+?)\[\/s\]/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',
'/\[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'
);
$simple_replace = array(
'<strong>$1</strong>',
'<em>$1</em>',
'<u>$1</u>',
+ '<span class="strikethrough">$1</span>',
'<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">$1</a>',
'<a href="$1">$2</a>',
- '<align="$1">$2</align>',
+ '<div style="text-align: $1">$2</align>',
'<font style="font-size:$1px;">$2</font>',
- '<img src="$1" alt="$2"/>'
+ '<img src="$1" alt="$2"/>',
+ '<img src=\"$2\" align=\"$1\" />',
+ '<a href="mailto:$1">$1</a>',
+ '<a href="mailto:$1">$2</a>'
);
- $order = array("\r\n", "\n", "\r");
- $replace = "\n<br/>";
$str = preg_replace ($simple_search, $simple_replace, $str);
- $str = str_ireplace($order,$replace,$str);
+ $str = nl2br($str);
return $str;
}
diff --git a/modules/news/functions.php b/modules/news/functions.php
index bd901aa..22952af 100644
--- a/modules/news/functions.php
+++ b/modules/news/functions.php
@@ -93,7 +93,7 @@ function displayComments($data){
<div class="single_comment">
<img src="modules/news/images/comment_arrow.png" class="comment_arrow" />
- <p> <?php echo BBCode($comment['message']); ?></p>
+ <p> <?php echo bbcode_format($comment['message']); ?></p>
</div>
@@ -145,17 +145,6 @@ function getNews($id = NULL){
$result = $db->Query($query);
$data = $db->Fetch($result);
- //decho($data);
- // {{{ XXX: FIXME -- Re-write
- /*
- while(($row = $db->Fetch($result)) != false)
- {
- $data[] = $row;
- }
-
- $db->Free($result);
- */
- // }}}
return $data;
}
@@ -173,7 +162,7 @@ function displayNews($data){
foreach($data as $news)
{
$numComments = getNumOfComments($news['news_id']);
- //echo "<pre>".print_r($news,true)."</pre>";
+
OpenContent(); ?>
<div class="contentHeading">
@@ -186,7 +175,7 @@ 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($news['message']); ?>
+ <?php echo bbcode_format($news['message']); ?>
</div>
<div class="contentFooter">
<table width="100%">
@@ -223,17 +212,6 @@ function commentForm(){
$cur_user_id = 0; //testing variable, until i get the login system working for this
$logged_in = false;
- // {{{ XXX: FIXME -- Re-write this
- /*
- $result = $db->Query("SELECT `username`, `avatar` FROM `mybb_users` WHERE `uid` = '$cur_user_id' LIMIT 1");
- while(($row = $db->Fetch($result)) != false)
- {
- $username = $row['username'];
- $avatar = $row['avatar'];
- $logged_in = true;
- }
- */
- // }}}
?>
<a name="add"></a>
<h2>Add Your Comment</h2>
diff --git a/modules/newsreel/index.php b/modules/newsreel/index.php
index 70b9958..f45f2f5 100644
--- a/modules/newsreel/index.php
+++ b/modules/newsreel/index.php
@@ -1,4 +1,5 @@
<!-- START News Reel -->
+<link rel="stylesheet" type="text/css" href="modules/newsreel/style.css" media="screen"/>
<?php OpenContent(); ?>
<script type="text/javascript">
@@ -96,13 +97,7 @@ window.onload = init_Slides; //starts the reels movement
<table border="0" cellspacing="0" cellpadding="0" style="height:21px;" width="100%">
<tr>
<?php
-$y=0; /*
- $get_slidenav = mysql_query("SELECT * FROM `bayonet_newsreel` WHERE `visible`= 1 ORDER BY `weight` ASC LIMIT 0, 6");
- while($echo_slidenav = mysql_fetch_array($get_slidenav)){
-
- echo '<td id="'.$y.'" width="'.$width.'%" class="slidenav" onclick="nextSlide(this.id,true)" onmouseover="mouseOverBG(this.id)" onmouseout="mouseOutBG(this.id)">'.$echo_slidenav['title'].'</td>';
- $y++;
- } */
+$y=0;
$result = $db->Query("SELECT * FROM `bayonet_newsreel` WHERE `visible`= 1 ORDER BY `weight` ASC LIMIT 0, 6");
$row = $db->Fetch($result);
diff --git a/style.css b/style.css
index b5492ef..0939050 100644
--- a/style.css
+++ b/style.css
@@ -2,34 +2,18 @@
** Layout Styles **
*********************************/
div.container {
- /* width:990px;
- margin: 0px auto 0px auto;
- text-align:center; */
- /* background-image:url('images/sandbackground.jpg');
- background-repeat: repeat;*/
width: 990px;
color: #000000;
margin: auto auto;
text-align: left; /* IE 5 fix */
}
div.banner {
- /* width:800px;
- height:125px;
- text-align:center;
- vertical-align:middle;
- background-color:#202020; */
width: 990px;
background: #fff;
color: #000000;
margin: auto auto;
}
div.nav {
- /*
- height:19px;
- text-align:center;
- vertical-align:top;
- background-color:blue; */
- /* background-image:url("images/navbg.png"); */
width: 990px;
height: 28px;
background: #284c75;
@@ -49,12 +33,12 @@
table.main td {
/* color:white; */
}
- .leftcol {
+ td.leftcol {
width:644px;
background-color:transparent;
vertical-align:top;
}
- .rightcol {
+ td.rightcol {
vertical-align:top;
}
div.footer {
@@ -135,26 +119,13 @@
}
/*********************************
- ** Nav Links Styles **
+ ** Misc. Styles **
*********************************/
h1, h2, h3, h4, h5, h6 {
font-family: Helvetica, Arial, sans-serif;
font-weight: normal;
}
-
- .leftbar {
- /* background-image:url("images/leftshadow.png"); */
- background-repeat:
- repeat-y;
- width:50px;
- }
- .rightbar {
- /* background-image:url("images/rightshadow.png"); */
- background-repeat:
- repeat-y;
- width:15px;
- }
table, tr, td {
padding:0px;
border:0px;
@@ -181,112 +152,15 @@
font-size:12px;
text-decoration:underline;
}
- a.admin, a.admin:visited, a.admin:active {
-
- color:#e3c70b;
- font-size:16px;
- text-decoration:none;
- }
- a.admin:hover, a.admin:visited:hover {
-
- color:#b90000;
- font-size:16px;
- text-decoration:none;
- }
body {
background-color:#091a34;
margin:0;
padding:0;
text-align:left;
}
-
-/* div.content {
- width:800px;
- min-height:570px;
- background-color:white;
- } */
- div.topbar {
- height:25px;
- text-align:center;
- background-color:black;
- font-family:verdana;
- font-size:10pt;
- color:#797e4f;
- }
- div.botbar {
- height:50px;
- padding:5px;
- text-align:center;
- background-color:black;
- font-family:verdana;
- font-size:10pt;
- }
- .footertext {
- color:blue;
- }
- div.announcement {
- color:black;
- padding:7px;
- }
- .navspacer {
- text-align:center;
- width:20px;
- }
- table.slideshow {
- border-top:1px #ffffff solid;
- background-image:url(slidebg.png);
- vertical-align:baseline;
- width:100%;
- height:100%;
- }
- table.slideshow td {
- color:white;
- }
- .slidenav {
- text-align:center;
- font-size:11pt;
- line-height: 1.4;
- background-image:url("modules/newsreel/images/slidenavbg.png");
- vertical-align:text-bottom;
- border-right:1px solid #333333;
- }
a img {
border:0px;
}
- table.cleartable td {
- background-color:transparent;
- }
- table.wide-table {
- width:100%;
- background-color: yellow;
- }
- div.maincontent {
- color:black;
- width:766px;
- padding:15px;
- padding-bottom:5px;
- text-align:left;
- }
- div.maincontent-news {
- width:663px;
- padding:15px;
- padding-top:5px;
- padding-bottom:5px;
- }
- input {
- /*background-color:black; */
- /*color:#575757; */
- /*border:1px solid #575757;*/
- }
- input.input {
- background-color:black;
- width:119px;
- border:1px solid #575757;
- margin-bottom:5px;
- color:#575757;
- padding:3px;
- font-family:verdana;
- }
div.submitbutton {
text-align:right;
margin-bottom:0;
@@ -295,62 +169,6 @@
form {
margin:0;
}
- p.contentp {
- margin-top:0;
- }
- p.contentpc {
- margin-top:0;
- text-align:center;
- }
- table.options {
- width:100%;
- /*text-align:right;*/
- vertical-align:middle;
- /*background-color: #a1a1a1;*/
- border-top: 1px solid #a1a1a1;
- border-left: 1px solid #a1a1a1;
- border-bottom: 1px solid #a1a1a1;
- }
- table.options th {
- background-color:#666666;
- color:white;
- height:17px;
- font-size:10px;
- font-weight:bold;
- text-align:center;
- }
- table.options td {
- background-color:transparent;
- border-right: 1px solid #a1a1a1;
- border-top: 1px solid #a1a1a1;
- padding:3px;
- font-size:10px;
- vertical-align:middle;
- color:black;
- }
- table.options td a, table.options td a:visited {
- font-weight:bold;
- font-size:10px;
- color:#333333;
- }
- table.options td a:hover, table.options td a.visited:hover {
- font-weight:bold;
- font-size:10px;
- color:#333333;
- }
- table.options td a.highlight, table.options td a.highlight:visited {
- font-weight:bold;
- font-size:10px;
- color:#474747;
- }
- table.options td a.highlight:hover, table.options td a.highlight.visited:hover {
- font-weight:bold;
- font-size:10px;
- color:#474747;
- }
- table.options tr {
-
- }
tr.rownorm{
background-color:white;
@@ -358,6 +176,7 @@
tr.rowhigh{
background-color:#e0e0e0;
}
+ /* photo gallery styles */
.photoleft{
background-image:url("images/photoleft.png");
background-repeat:repeat-y;
@@ -370,6 +189,41 @@
text-align:center;
width:49px;
}
+ /* end photo gallery styles */
+
+ /* stuff we might need in order to add drop shadows */
+
+ div.topbar {
+ height:25px;
+ text-align:center;
+ background-color:black;
+ font-family:verdana;
+ font-size:10pt;
+ color:#797e4f;
+ }
+ div.botbar {
+ height:50px;
+ padding:5px;
+ text-align:center;
+ background-color:black;
+ font-family:verdana;
+ font-size:10pt;
+ }
+ /* may need these two when we add the background images back */
+ .leftbar {
+ /* background-image:url("images/leftshadow.png"); */
+ background-repeat:
+ repeat-y;
+ width:50px;
+ }
+ .rightbar {
+ /* background-image:url("images/rightshadow.png"); */
+ background-repeat:
+ repeat-y;
+ width:15px;
+ }
+
+
.left{
text-align:left;
}