From 07253dc75c69cf585ad39a218f3f2cf97b773987 Mon Sep 17 00:00:00 2001 From: jhunkeler Date: Sat, 26 Dec 2009 20:02:05 +0000 Subject: commit before joe fucks shit git-svn-id: http://svn.3rd-infantry-division.org/testing/branches/Bayonet CMS v2@401 c5b2fb0a-d05d-0410-98c8-828840a80ff6 --- admin/admins/functions.php | 12 ++++++++---- admin/pages/functions.php | 4 ++-- blocks/donations/index.php | 8 ++++---- blocks/mini_calendar/index.php | 4 +++- includes/debug.php | 6 +++--- includes/functions.php | 43 ++++++++++++++++++++++++++++-------------- index.php | 4 ++-- modules/download/index.php | 6 +++--- modules/index/index.php | 4 ++-- modules/news/functions.php | 10 +++++----- modules/newsreel/index.php | 6 +++--- modules/page/index.php | 10 +++++----- 12 files changed, 69 insertions(+), 48 deletions(-) diff --git a/admin/admins/functions.php b/admin/admins/functions.php index 68b9bc7..8987322 100644 --- a/admin/admins/functions.php +++ b/admin/admins/functions.php @@ -43,7 +43,7 @@ function ListAdmins() { global $db; - $result = $db->Query("SELECT `user_id`, `username`, `level` FROM `bayonet_users` ORDER BY `level` DESC"); + $result = $db->Query("SELECT `user_id`, `username`, `level` FROM `bayonet_users` ORDER BY `level` DESC, `username` ASC"); while(($rows = $db->fetch($result))!=false) { $admins[] = $rows; @@ -51,9 +51,13 @@ $num = 1; OpenTable("300px"); - echo "UsernameLevel"; + echo "UsernameLevel"; foreach($admins as $admin) { + if($admin['level'] != $level){ + $level = $admin['level']; + echo "
"; + } echo "{$num}.{$admin['username']}{$admin['level']}"; $num++; } @@ -127,10 +131,10 @@
- + - + diff --git a/blocks/mini_calendar/index.php b/blocks/mini_calendar/index.php index 6516646..c67df9a 100644 --- a/blocks/mini_calendar/index.php +++ b/blocks/mini_calendar/index.php @@ -1,3 +1,5 @@ - \ No newline at end of file + + + \ No newline at end of file diff --git a/includes/debug.php b/includes/debug.php index 1a5dcb1..c67ee9c 100644 --- a/includes/debug.php +++ b/includes/debug.php @@ -101,7 +101,7 @@ function logQueueFlush($force = false) static $log_message_last_count = 0; static $next = false; - OpenTable(); + OpenContent(); echo "
Bayonet Debug Messages
"; echo "
"; foreach($log_message_queue as $message) @@ -143,8 +143,8 @@ function logQueueFlush($force = false) ++$messageCount; } - echo "
"; - CloseTable(); + echo ""; + CloseContent(); } /* diff --git a/includes/functions.php b/includes/functions.php index 6238ec4..f0fe60e 100644 --- a/includes/functions.php +++ b/includes/functions.php @@ -29,7 +29,7 @@ function bbcode_format ($str) { $str = htmlentities($str); $str = strip_tags($str); - $str = wordwrap($str,100,"\n",true); + //$str = wordwrap($str,100,"\n",true); $simple_search = array( '/\[b\](.*?)\[\/b\]/is', @@ -247,7 +247,8 @@ function LinkList($array) */ function LinkModule($module_name,$args = NULL,$link_name) { - return "{$link_name}"; + + return "{$link_name}"; } /** @@ -297,29 +298,43 @@ if(!defined("CALLED_FROM_ADMIN")) { /** * OpenTable() - * * Begins a Bayonet site table. - * * @return */ function OpenTable() { //width="100%" is important. Otherwise all of our tables will be text width. - //echo "
Username:
Username:*
First Name:
Last Name:
Email Address:
Email Address:*
Level: diff --git a/admin/pages/functions.php b/admin/pages/functions.php index c4d4369..15b1f0c 100644 --- a/admin/pages/functions.php +++ b/admin/pages/functions.php @@ -377,9 +377,9 @@ function DeletePage($page_id) ?> - + - +
Are you SURE you want to delete the page titled: ''?
All articles attached to this page will be deleted as well.
Are you SURE you want to delete the page titled: ''?
All articles attached to this page will be deleted as well.
   
diff --git a/blocks/donations/index.php b/blocks/donations/index.php index 8695f68..4deb5dc 100644 --- a/blocks/donations/index.php +++ b/blocks/donations/index.php @@ -2,11 +2,11 @@
- - - - + + +
\n"; - echo "
"; - echo "
"; + echo "
\n"; } /** * CloseTable() - * * Closes a Bayonet site table. - * * @return */ function CloseTable() { //echo "
"; + } + + /** + * OpenContent() + * Begins a Bayonet site table. + * @return + */ + function OpenContent() + { + echo "
"; + echo "
"; + } + + /** + * CloseContent() + * Closes a Bayonet site table. + * @return + */ + function CloseContent() + { echo "
"; echo "
"; } @@ -327,7 +342,7 @@ if(!defined("CALLED_FROM_ADMIN")) function OpenBlock($title = 'New Block') { - OpenTable(); + OpenContent(); echo "
{$title}
"; echo "
"; } @@ -335,7 +350,7 @@ function OpenBlock($title = 'New Block') function CloseBlock() { echo "
"; - CloseTable(); + CloseContent(); } static $error_stack_messages = array(); //global stack of errors accumulated throughout execution @@ -375,9 +390,9 @@ function handle_error ($errno, $errstr, $errfile, $errline) function ReportError($message) { //WriteLog($message,BAYONET_LOG_ERROR); - OpenTable(); + OpenContent(); echo "
Error Message
{$message}
"; - CloseTable(); + CloseContent(); } /** @@ -587,7 +602,7 @@ function GetBlocks($position = BLOCK_LEFT) if(file_exists($load)) { OpenBlock($block['title']); - include $load; + include_once $load; CloseBlock(); decho("'{$block['dir_name']}' block loaded"); } diff --git a/index.php b/index.php index 4f6d84b..e2d34ed 100644 --- a/index.php +++ b/index.php @@ -38,13 +38,13 @@ include 'header.php'; - + diff --git a/modules/download/index.php b/modules/download/index.php index 1fa99e5..300bd46 100644 --- a/modules/download/index.php +++ b/modules/download/index.php @@ -26,13 +26,13 @@ $download = NULL; $download_relative_path = "modules/" . basename(dirname(__FILE__)) . "/files/"; $download_absolute_path = dirname(__FILE__) . "/files/"; -$result = $db->Query("SELECT uid, name, description, filename FROM bayonet_downloads"); +$result = $db->Query("SELECT `file_id`, `name`, `description`, `filename` FROM `bayonet_downloads`"); while(($row = $db->Fetch($result)) !== false) { $download[] = $row; } -OpenTable(); +OpenContent(); echo "
Downloads
"; echo "
"; foreach($download as $file) @@ -59,7 +59,7 @@ decho($download); echo "
"; -CloseTable(); +CloseContent(); ?> \ No newline at end of file diff --git a/modules/index/index.php b/modules/index/index.php index b7554b7..7d23bc6 100644 --- a/modules/index/index.php +++ b/modules/index/index.php @@ -26,9 +26,9 @@ } else { - OpenTable(); + OpenContent(); ReportError("Cannot load module '{$module}' directory.
\n"); - CloseTable(); + CloseContent(); } echo "
"; } diff --git a/modules/news/functions.php b/modules/news/functions.php index ee4345d..b76a53e 100644 --- a/modules/news/functions.php +++ b/modules/news/functions.php @@ -49,7 +49,7 @@ function getNewsComments($id){ function displayComments($data){ date_default_timezone_set("America/New_York"); - OpenTable(); + OpenContent(); ?>
@@ -104,7 +104,7 @@ function displayComments($data){ commentForm(); - CloseTable(); + CloseContent(); } /** @@ -164,7 +164,7 @@ function displayNews($data){ { $numComments = getNumOfComments($news['news_id']); - OpenTable(); ?> + OpenContent(); ?>
- +
@@ -190,7 +190,7 @@ function displayNews($data){ "; } } @@ -245,7 +245,7 @@ function commentForm(){ ?>

- + diff --git a/modules/newsreel/index.php b/modules/newsreel/index.php index f0b9d73..0a986c2 100644 --- a/modules/newsreel/index.php +++ b/modules/newsreel/index.php @@ -1,5 +1,5 @@ - +