From 0077cb99704fe863cf731fc5cab792af2ede96c2 Mon Sep 17 00:00:00 2001 From: Joseph Hunkeler Date: Sun, 17 Apr 2011 20:13:07 -0400 Subject: Backporting retarded amount of changes outside of version control --- modules/news/functions.php | 23 ++++++++++++++++++----- 1 file changed, 18 insertions(+), 5 deletions(-) (limited to 'modules/news/functions.php') 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){
<?php echo $news['catname']; ?> - +
Continue reading.'; + } else { + echo bbcode_format($news['message']); + } + ?> +
Last edit: ".date('F j, Y, g:i a T', strtotime($news['edited']))." by ".$news['eauthor']."
"; + } +?>
@@ -190,7 +203,7 @@ function displayNews($data){ - +
View Comments: Comments Posted on: Posted:
-- cgit