|
|
<?php
/*
This file is part of NukeEvent.
NukeEvent 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 2 of the License, or
any later version.
NukeEvent 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 Foobar; if not, write to the Free Software
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
/**
* This is the News Module for Nuke-Event.
* This File Displays an overview of the Articles
* @package news
* @author $Author: xeniac $
* @version $Revision: 1.11 $
*/
neGetLang($neModuleName);
neGetConfig($neModuleName);
/**
* load the common Functions for the News Module.
*/
require_once ('modules/news/news_functions.php');
//==Main Routine================================================================
if (isset($_POST['article_id'])) {
$intId= (int) $_POST['article_id'];
} elseif (isset($_GET['id'])) {
$intId= (int) $_GET['id'];
}
if (isset($_GET['topic'])) {
$intTopic= (int) $_GET['topic'];
} else {
$intTopic = null;
}
if (isset($_GET['start'])) {
$intStart= (int) $_GET['start'];
} else {
$intStart = 0;
}
if (NE_MODULE_LOADER == 'admin.php' and empty($neOp)) {
$neOp= 'admin_news';
}
//administrative operations
if ($neSession->isAdmin($neModuleName)) {
require_once ('modules/news/admin_functions.php');
switch ($neOp) {
case 'activate_article' :
submitEditArticle($_POST);
activateArticle($intId);
neRedirect(NE_MODULE_LOADER."?mod=news&op=admin_news");
die();
break;
case 'deactivate_article' :
submitEditArticle($_POST);
deactivateArticle($intId);
neRedirect(NE_MODULE_LOADER."?mod=news&op=admin_news");
die();
break;
case 'delete_article' :
if ($_POST['confirm'] == 1) {
deleteArticle($intId);
neRedirect(NE_MODULE_LOADER.'?mod=news&op=admin_news');
} else {
showDeleteQuestion($intId);
}
die();
break;
case 'submit_edit' :
submitEditArticle($_POST);
neRedirect("admin.php?mod=news&op=admin_news");
die();
break;
case 'edit_article' :
require_once ('modules/news/article_functions.php');
editArticle($intId);
die();
break;
case 'admin_news' :
adminNews();
die();
break;
//Functions for article related hyperlinks
case 'add_link' :
require_once ('modules/news/link_functions.php');
addLink($intId, $_POST['link_name'], $_POST['link_url']);
die();
break;
case 'delete_link' :
require_once ('modules/news/link_functions.php');
deleteLink($intId, $_GET['article']);
die();
break;
case 'edit_links' :
require_once ('modules/news/link_functions.php');
editLinks($intId);
die();
break;
}
}
//operations to write new articles
if (($neConfig['news']['allow_user_post'] and $neSession -> isLoggedIn()) OR ($neSession -> isAdmin($neModuleName))) {
require_once('modules/news/article_functions.php');
switch ($neOp) {
case 'preview' :
previewArticle($_POST);
die();
break;
case 'new' :
require_once('modules/news/article_functions.php');
newArticle($_POST);
die();
break;
case 'submit_add' :
require_once('modules/news/article_functions.php');
submitNewArticle($_POST);
die();
break;
}
}
//operations to generate RSS Feeds
if ($neConfig['news']['rssfeeds']) {
switch ($neOp) {
case 'show_rss' :
require_once ('modules/news/news_rssfeed.php');
showRss($intTopic);
die();
break;
}
}
//standard operations (always accessable)
switch ($neOp) {
case 'show_article' :
require_once ('modules/news/article_functions.php');
showArticle($intId);
break;
default :
require ('modules/news/news_index.php');
displayIndex($intTopic,$intStart);
break;
}
?>
|