<?php
# ************** LICENCE ****************
/*
	Copyright (c) PORTANEO.

	This file is part of COLLABORATION SUITE of POSH http://sourceforge.net/projects/posh/.

	POSH 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

	POSH 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 Posh.  If not, see <http://www.gnu.org/licenses/>.
*/
# ***************************************
# Add network news feed
# !! be careful, this file must be saved under uft8 format, and display an e accentuated here : éàèù
# ***************************************

/**
*
* \brief Add network news feed
*
* @param  (String) type : news feed type 1=article 2=rss article shared 3=widget shared 4=portal shared 5=comments 6=status 7=trackback
* @param  (String) title : news feed title
* @param  (int) access : public 0 / private 1
* @param  (String) link : original URL of the news
*
*   return xml file
*
*  \relatesalso
*   enterprise.js
*  $p.network.addNews
*
* !! be careful, this file must be saved under uft8 format, and display an e accentuated here : é
*
**/

$folder="";
$not_access=1;
$isScript=true;
$isPortal=false;
$pagename="portal/scr_network_news.php";
$granted="I";
//includes
require_once('includes.php');
require_once('../l10n/'.__LANG.'/lang.php');
require_once('../db_layer/'.__DBTYPE.'/enterprise.php');
require_once('../includes/xml.inc.php');

$type = isset($_POST["type"])?$_POST["type"]:1;
$title = isset($_POST["title"])?$_POST["title"]:"";
$link = isset($_POST["link"])?$_POST["link"]:"";
$access = isset($_POST["access"])?$_POST["access"]:0;

$file=new xmlFile();

$file->header();

$DB->execute($xmlnetworknews_insertNews,$DB->escape($_SESSION['user_id']),$DB->quote($type),$DB->noHTML($title),$DB->noHTML($link),$DB->quote($access));
$chk=$DB->nbAffected();

$file->status($chk);

$file->footer();
?>