aboutsummaryrefslogtreecommitdiff
path: root/admin/news
diff options
context:
space:
mode:
authorjhunkeler <jhunkeler@c5b2fb0a-d05d-0410-98c8-828840a80ff6>2009-12-24 16:39:09 -0500
committerjhunkeler <jhunkeler@c5b2fb0a-d05d-0410-98c8-828840a80ff6>2009-12-24 16:39:09 -0500
commit44a18f3e13077138af782f96cffb39294bca6283 (patch)
treeb273725cb63b4eb54725953997a3496a3e552bfe /admin/news
parentc2f9018513eb8d61721382a18055bcded2ca7551 (diff)
downloadbayonetcms-44a18f3e13077138af782f96cffb39294bca6283.tar.gz
(OC) fixed some display stuff for the debug console
git-svn-id: http://svn.3rd-infantry-division.org/testing/branches/Bayonet CMS v2@398 c5b2fb0a-d05d-0410-98c8-828840a80ff6
Diffstat (limited to 'admin/news')
-rw-r--r--admin/news/functions.php25
-rw-r--r--admin/news/index.php7
2 files changed, 30 insertions, 2 deletions
diff --git a/admin/news/functions.php b/admin/news/functions.php
index f98c4e2..1f9e34a 100644
--- a/admin/news/functions.php
+++ b/admin/news/functions.php
@@ -16,6 +16,29 @@
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
+date_default_timezone_set("America/New_York");
+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 ".
+ "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");
+ while($row = $db->Fetch($result)){
+
+ $newsBody = $row['message'];
+ echo "<a href=\"?op=news&edit={$row['news_id']}\">";
+ echo "<span class=\"bold\">{$row['title']}</span>&nbsp;|&nbsp;<span class=\"blue\">{$row['catname']}</span>&nbsp;&nbsp;<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: {$row['author']} on ".date('D M j, Y g:i a T', strtotime($row['date']));
+ echo '<br /><br />';
+ }
+}
function EditNews($news_id){
@@ -31,7 +54,7 @@ function EditNews($news_id){
$row = $db->Fetch($result);
?>
- <h3>Edit Event</h3>
+ <h3>Edit News</h3>
<form action="<?php $_SERVER['PHP_SELF']?>" method="post">
<table>
<tr><th>Author</th><td><?php SelectAuthor($row['author_id']); ?></td></tr>
diff --git a/admin/news/index.php b/admin/news/index.php
index 43baf81..ec78089 100644
--- a/admin/news/index.php
+++ b/admin/news/index.php
@@ -19,7 +19,8 @@
?>
<div style="text-align:left;"><h2>- Manage News</h2></div>
- -Everything needs to be completed.
+ -Add/Edit(-)/Delete news
+ -Add/Edit/Delete categories
<?php
if(!defined("ADMIN_FILE"))
@@ -36,6 +37,10 @@ if(isset($_GET['edit'])){
$news_id = $_GET['edit'];
EditNews($news_id);
}
+else{
+ ListNews();
+}
+
?>