Index: extensions/NBC_News/trunk/NewsOnIndex.php
===================================================================
--- extensions/NBC_News/trunk/NewsOnIndex.php	(revision 5179)
+++ extensions/NBC_News/trunk/NewsOnIndex.php	(revision 5179)
@@ -0,0 +1,135 @@
+<?php
+
+global $user, $template, $lang, $conf, $im_priority;
+
+if (!defined('PHPWG_ROOT_PATH')) die('Hacking attempt!');
+
+include_once(NBC_NEWS_PATH.'include/constants.php');
+include_once(NBC_NEWS_PATH.'include/functions_news.inc.php');
+load_language('plugin.lang', NBC_NEWS_PATH);
+  
+
+$template->set_filenames(array('NewsOnIndex' => NBC_NEWS_PATH.'template/NewsOnIndex.tpl'));
+
+
+
+$conf_nbc_News = explode(";" ,$conf['nbc_News']);
+$conf['nb_news_homepage'] = $conf_nbc_News[0];
+$conf['nb_news_page'] = $conf_nbc_News[1];
+$conf['nb_news_page_option'] = explode("," ,$conf_nbc_News[2]);
+
+
+
+
+$user['forbidden_news'] = calculate_news_permissions($user['id']);
+
+$query = '
+  SELECT n.id AS new_id
+    , n.date
+    , n.author
+  FROM '.NEWS_TABLE.' AS n
+  WHERE n.id NOT IN ('.$user['forbidden_news'].')
+  ORDER BY date DESC
+  LIMIT '.$conf['nb_news_homepage'].'
+  ;';
+  
+$result = pwg_query($query);
+
+$start=0;
+
+while ($row = mysql_fetch_array($result))
+{
+  if ($start == 0)
+    $template->assign('news', array(
+     'U_NEWS' => NBC_NEWS_PATH.'news.php'
+    ));
+
+	$new_id = $row['new_id'];
+
+	//get the news translation
+	$query = '
+	SELECT id AS news_translation_id,language,title,content
+		FROM '.NEWS_TRANSLATION_TABLE.'
+		WHERE new_id = '.$new_id.'
+	';
+	
+	$no_news_translation=false;
+	
+	$subresult = pwg_query($query.'AND language = \''.$user['language'].'\';');
+	$subrow = mysql_fetch_array($subresult);
+		
+	//there is a no translation for the user language
+	if (empty($subrow))
+	{
+		$no_news_translation=true;
+	
+		$research = pwg_query('SELECT language FROM '.USER_INFOS_TABLE.' WHERE user_id = '.$conf['guest_id'].';');
+		$defaultlanguage = mysql_fetch_array($research);
+
+		//get the default translation	
+		$subresult = pwg_query($query.'AND language = \''.$defaultlanguage['language'].'\';');
+		$subrow = mysql_fetch_array($subresult);
+			
+		//there is no translation for the default language
+		if (empty($subrow))
+		{
+			//get the first translation			
+			$subresult = pwg_query($query.'LIMIT 1;');
+			$subrow = mysql_fetch_array($subresult);
+		}		
+	}
+
+	$message=$subrow['content'];
+ 
+  $read_more=(strlen($message)!=strlen($subrow['content']));
+
+	$template->assign(
+		'news.a_news',
+		array(
+			'NEWS_AUTHOR'=>$row['author'],
+			'NEWS_DATE'=>format_date($row['date'],'mysql_datetime',true),
+			'TITLE'=>$subrow['title'],
+			'CONTENT'=>$message
+	));
+	
+
+	//there is no tranlstation for this news
+	if ($no_news_translation)
+	{
+		$template->assign('news.a_news.no_news_translation', array());
+	}
+	
+	//news has been cuted
+	if ($read_more)
+	{
+		$template->assign(
+			'news.a_news.read_more',
+			array(
+				'URL' => add_url_params(__FILE__, array(
+          'nb_news_page' => '1',
+          'start' => $start,
+        )),
+			)
+		);
+	}
+	
+	$start++;
+}
+
+
+
+if (isset($im_priority))
+{
+  $insert_before = $im_priority['NewsOnIndex'] < $im_priority['Categories'] ? '<div class="titrePage">' : '</div> <!-- content -->';
+}
+else 
+{
+  $insert_before = $conf_nbc_News[0] == 'on' ? '<div class="titrePage">' : '</div> <!-- content -->';
+}
+
+//$template->loadfile('index');
+$template->uncompiled_code['index'] = str_replace($insert_before, '{NEWSONINDEX_CONTENT}' . $insert_before, $template->uncompiled_code['index']);
+
+$template->assign_var_from_handle('NEWSONINDEX_CONTENT', 'NewsOnIndex');
+
+?>
Index: extensions/NBC_News/trunk/admin/index.php
===================================================================
--- extensions/NBC_News/trunk/admin/index.php	(revision 5179)
+++ extensions/NBC_News/trunk/admin/index.php	(revision 5179)
@@ -0,0 +1,33 @@
+<?php
+// +-----------------------------------------------------------------------+
+// | PhpWebGallery - a PHP based picture gallery                           |
+// | Copyright (C) 2002-2003 Pierrick LE GALL - pierrick@phpwebgallery.net |
+// | Copyright (C) 2003-2007 PhpWebGallery Team - http://phpwebgallery.net |
+// +-----------------------------------------------------------------------+
+// | file          : $Id: index.php 1912 2007-03-16 06:30:07Z rub $
+// | last update   : $Date: 2007-03-16 07:30:07 +0100 (ven, 16 mar 2007) $
+// | last modifier : $Author: rub $
+// | revision      : $Revision: 1912 $
+// +-----------------------------------------------------------------------+
+// | This program 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                                          |
+// |                                                                       |
+// | This program 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 this program; if not, write to the Free Software           |
+// | Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, |
+// | USA.                                                                  |
+// +-----------------------------------------------------------------------+
+
+// Recursive call
+$url = '../';
+header( 'Request-URI: '.$url );
+header( 'Content-Location: '.$url );
+header( 'Location: '.$url );
+exit();
+?>
Index: extensions/NBC_News/trunk/admin/news_admin.php
===================================================================
--- extensions/NBC_News/trunk/admin/news_admin.php	(revision 5179)
+++ extensions/NBC_News/trunk/admin/news_admin.php	(revision 5179)
@@ -0,0 +1,829 @@
+<?php
+
+global $user, $lang, $conf, $errors, $template, $page;
+
+if (!defined('PHPWG_ROOT_PATH')) die('Hacking attempt!');
+// +-----------------------------------------------------------------------+
+// | Check Access and exit when user status is not ok                      |
+// +-----------------------------------------------------------------------+
+check_status(ACCESS_ADMINISTRATOR);
+
+//ini_set('error_reporting', E_ALL);
+//ini_set('display_errors', true);
+
+include_once (PHPWG_ROOT_PATH.'admin/include/tabsheet.class.php');
+include_once (PHPWG_ROOT_PATH.'include/functions.inc.php');
+include_once (PHPWG_ROOT_PATH.'/include/constants.php');
+include_once (NBC_NEWS_PATH.'include/constants.php');
+include_once (NBC_NEWS_PATH.'include/functions_news.inc.php');
+
+load_language('plugin.lang', NBC_NEWS_PATH);
+
+$my_base_url = get_admin_plugin_menu_link(__FILE__);
+
+$conf_nbc_News = explode(";" , $conf['nbc_News']);
+$conf['nb_news_homepage'] = $conf_nbc_News[0];
+$conf['nb_news_page'] = $conf_nbc_News[1];
+$conf['nb_news_page_option'] = explode("," ,$conf_nbc_News[2]);
+
+
+// +-----------------------------------------------------------------------+
+// |                            Tabssheet                                  |
+// +-----------------------------------------------------------------------+
+if (!isset($_GET['tab']))
+	$page['tab'] = 'NewsAdmin';
+else
+  $page['tab'] = $_GET['tab'];
+
+$tabsheet = new tabsheet();
+$tabsheet->add('NewsAdmin',
+               l10n('title_admin_news'),
+               $my_base_url.'&amp;tab=NewsAdmin');
+$tabsheet->add('Users',
+               l10n('title_users'),
+               $my_base_url.'&amp;tab=Users');
+$tabsheet->add('Groups',
+               l10n('title_groups'),
+               $my_base_url.'&amp;tab=Groups');
+$tabsheet->add('Config',
+               l10n('config'),
+               $my_base_url.'&amp;tab=Config');
+$tabsheet->select($page['tab']);
+$tabsheet->assign();
+
+$page['NewsAdmin'] = array();
+$error = array();
+
+
+// +-----------------------------------------------------------------------+
+// |                            Tabssheet select                           |
+// +-----------------------------------------------------------------------+
+
+switch ($page['tab'])
+{
+// *************************************************************************
+// +-----------------------------------------------------------------------+
+// |                             NewsAdmin                                 |
+// +-----------------------------------------------------------------------+
+// *************************************************************************
+  case 'NewsAdmin':
+  
+  $page_news_admin = get_admin_plugin_menu_link(dirname(__FILE__).'/news_admin.php');
+
+  // detection of the start news to display
+  if ( !isset( $_GET['start'] )
+       or !is_numeric( $_GET['start'] )
+       or ( is_numeric( $_GET['start'] ) and $_GET['start'] < 0 ) )
+  {
+    $page['start'] = 0;
+  }
+  else
+  {
+    $page['start'] = $_GET['start'];
+  }
+  
+  // detection of the number of news to display per page
+  if ( !isset( $_GET['nb_news_page'] ) or !is_numeric( $_GET['nb_news_page'] ) or ( is_numeric( $_GET['nb_news_page'] ) and $_GET['nb_news_page'] < 0 ) )
+  {
+    $page['nb_news_page'] = $conf['nb_news_page'];
+  }
+  else
+  {
+    $page['nb_news_page'] = $_GET['nb_news_page'];
+  }
+  
+  // +-----------------------------------------------------------------------+
+  // |                           news management                             |
+  // +-----------------------------------------------------------------------+
+  
+  //
+  // GET
+  //
+  
+  //delete a translation
+  if ( isset($_GET['action']) and ($_GET['action']=='delt') and isset($_GET['idt']) and is_numeric($_GET['idt']) and !is_adviser() )
+  {
+    //get new_id
+    $query = '
+    SELECT new_id
+      FROM '.NEWS_TRANSLATION_TABLE.'
+      WHERE id = \''.$_GET['idt'].'\'
+    ;';
+    $result = pwg_query($query);
+    $row = mysql_fetch_array($result);
+    $new_id=$row['new_id'];
+    
+    //delete news_translation
+  	$query = '
+    DELETE FROM '.NEWS_TRANSLATION_TABLE.'
+    WHERE id = \''.$_GET['idt'].'\'
+    ;';
+    pwg_query($query);
+  
+    //get others translations of the news
+    $query = '
+    SELECT id
+    FROM '.NEWS_TRANSLATION_TABLE.'
+    WHERE new_id = \''.$new_id.'\'
+    ;';
+    $result = pwg_query($query);
+  
+    //if there is no others translations, delete the news
+    if (mysql_num_rows ($result) <= 0)
+    {
+      $query = '
+      DELETE FROM '.NEWS_TABLE.'
+      WHERE id = \''.$new_id.'\'
+      ;';
+      pwg_query($query);
+    
+    	$query = '
+      DELETE FROM '.NEWS_TRANSLATION_TABLE.'
+      WHERE new_id = \''.$new_id.'\'
+      ;';
+      pwg_query($query);
+    
+      $query = '
+      DELETE FROM '.NEWS_GROUP_ACCESS_TABLE.'
+      WHERE new_id = \''.$new_id.'\'
+      ;';
+      pwg_query($query);
+    
+      $query = '
+      DELETE FROM '.NEWS_USER_ACCESS_TABLE.'
+      WHERE new_id = \''.$new_id.'\'
+      ;';
+      pwg_query($query);
+    
+      $query = '
+      DELETE FROM '.NEWS_GROUP_REFUSED_TABLE.'
+      WHERE new_id = \''.$new_id.'\'
+      ;';
+      pwg_query($query);
+    
+      $query = '
+      DELETE FROM '.NEWS_USER_REFUSED_TABLE.'
+      WHERE new_id = \''.$new_id.'\'
+      ;';
+      pwg_query($query);
+    
+      // information message
+      array_push($page['infos'], $lang['news_deleted']);
+    }
+    else
+    {
+  	  // information message
+      array_push($page['infos'], $lang['translation_deleted']);
+    }
+  }
+  //delete a news
+  else if ( isset($_GET['action']) and ($_GET['action']=='deln') and isset($_GET['idn']) and is_numeric($_GET['idn']) and !is_adviser() )
+  {
+    $query = '
+    DELETE FROM '.NEWS_TABLE.'
+    WHERE id = \''.$_GET['idn'].'\'
+    ;';
+    pwg_query($query);
+  
+  	$query = '
+    DELETE FROM '.NEWS_TRANSLATION_TABLE.'
+    WHERE new_id = \''.$_GET['idn'].'\'
+    ;';
+    pwg_query($query);
+  
+    $query = '
+    DELETE FROM '.NEWS_GROUP_ACCESS_TABLE.'
+    WHERE new_id = \''.$_GET['idn'].'\'
+    ;';
+    pwg_query($query);
+  
+    $query = '
+    DELETE FROM '.NEWS_USER_ACCESS_TABLE.'
+    WHERE new_id = \''.$_GET['idn'].'\'
+    ;';
+    pwg_query($query);
+  
+    $query = '
+    DELETE FROM '.NEWS_GROUP_REFUSED_TABLE.'
+    WHERE new_id = \''.$_GET['idn'].'\'
+    ;';
+    pwg_query($query);
+  
+    $query = '
+    DELETE FROM '.NEWS_USER_REFUSED_TABLE.'
+    WHERE new_id = \''.$_GET['idn'].'\'
+    ;';
+    pwg_query($query);
+  
+    // information message
+    array_push($page['infos'], $lang['news_deleted']);
+  }
+  //
+  // POST
+  //
+  
+  //add translation
+  if (isset($_POST['addt']) and isset( $_POST['content'] ) and !empty($_POST['content']) and !is_adviser() )
+  {
+    $message=$_POST['content'];
+  
+    $query = '
+    INSERT INTO '.NEWS_TRANSLATION_TABLE.'
+    (new_id, language, title, content) VALUES (
+    '.$_POST['idn'].',
+    \''.$_POST['language'].'\',
+    \''.$_POST['title'].'\',
+    \''.$message.'\'
+    );';
+    pwg_query( $query );
+  
+    // information message
+    array_push($page['infos'], $lang['translation_added']);
+  }
+  //mod translation
+  else if (isset($_POST['modt']) and isset( $_POST['content'] ) and !empty($_POST['content']) and !is_adviser() )
+  {
+    $message=$_POST['content'];
+  
+    $query = '
+    UPDATE '.NEWS_TRANSLATION_TABLE.'
+    SET language=\''.$_POST['language'].'\',
+    title=\''.$_POST['title'].'\',
+    content=\''.$message.'\'
+    WHERE id=\''.$_POST['idt'].'\'
+    ;';
+    pwg_query( $query );
+  
+    // information message
+    array_push($page['infos'], $lang['translation_altered']);		
+  }
+  //add news
+  else if (isset($_POST['addn']) and isset( $_POST['content'] ) and !empty($_POST['content']) and !is_adviser() )
+  {
+    $message=$_POST['content'];
+  
+    $query = '
+    INSERT INTO '.NEWS_TABLE.'
+    (date, author) VALUES (
+    NOW(),
+    \''.$_POST['author'].'\'
+    );';
+    pwg_query( $query );
+  
+    $query = '
+    INSERT INTO '.NEWS_TRANSLATION_TABLE.'
+    (new_id, language, title, content) VALUES (
+    LAST_INSERT_ID(),
+    \''.$_POST['language'].'\',
+    \''.$_POST['title'].'\',
+    \''.$message.'\'
+    );';
+    pwg_query( $query );
+  //  \''.htmlspecialchars($_POST['title'], ENT_QUOTES).'\',
+  
+    // information message
+    array_push($page['infos'], $lang['news_added']);
+  
+    $page['start']=0;
+  }
+  else if (isset($_POST['change_status_submit']) and isset($_POST['idn']) and !is_adviser() )
+  {
+    $query = '
+    SELECT *
+      FROM '.NEWS_TABLE.'
+      WHERE id=\''.$_POST['idn'].'\'
+    ;';
+    
+    $result = pwg_query($query);
+    $row = mysql_fetch_array($result);
+  
+    $status = ($row['status']=='private')?'public':'private';
+    
+    $query = '
+    UPDATE '.NEWS_TABLE.'
+    SET status=\''.$status.'\'
+    WHERE id=\''.$_POST['idn'].'\'
+    ;';
+    pwg_query( $query );
+  
+    // information message
+    array_push($page['infos'], $lang['news_status_changed'].$lang[$status]);
+  }
+  
+  
+  
+  // +-----------------------------------------------------------------------+
+  // |                       page header and options                         |
+  // +-----------------------------------------------------------------------+
+
+  $template->assign(
+    array(
+      'F_ACTION' => add_url_params($page_news_admin, array()),
+      'U_POST_NEWS' => add_url_params($page_news_admin, array('action' => 'addn')),
+      /*'U_HELP' => PHPWG_ROOT_PATH.'popuphelp.php?page=news_admin',*/
+      'U_NEWS' => add_url_params($page_news_admin, array(
+        'nb_news_page' => $page['nb_news_page'],
+        'start' => $page['start'],
+        )
+      ),
+    )
+  );
+  
+   // +-----------------------------------------------------------------------+
+  // |                        DISPLAY FORMS                                  |
+  // +-----------------------------------------------------------------------+
+  
+  //
+  //display form to add news
+  //
+  if (isset($_GET['action']) and $_GET['action']=='addn')
+  {
+     //donne le titre ajouter une news dans h2
+    
+    $template->assign('new_news',array());
+    //get every languages
+    $available_lang=get_languages();
+    
+  	$lang_select=news_language_select($available_lang,$user['language']);
+  
+  	$template->assign(
+      'form',
+      array(
+        'AUTHOR'=>$user['username'],
+        'LANG_SELECT'=>$lang_select,
+        'SUBMIT_NAME' =>'addn'
+      )
+    );	
+  }
+  
+  //
+  //display form to add a translation
+  //
+  else if (isset($_GET['action']) and $_GET['action']=='addt' and isset($_GET['idn']) and is_numeric($_GET['idn'])
+  )
+  {
+    //donne le titre ajouter une news dans h2
+    
+    $template->assign('news_translation',array());
+      
+    //get every languages
+    $available_lang=get_languages();
+    $not_translated_languages=$available_lang;
+  
+    //display author and date
+    $query = '
+    SELECT DISTINCT(id) AS new_id, date, author
+      FROM '.NEWS_TABLE.'
+      WHERE id=\''.$_GET['idn'].'\'
+    ;';
+    
+    $result = pwg_query($query);
+    $row = mysql_fetch_array($result);
+    
+    $template->assign(
+      'news',
+      array(
+        'NEWS_AUTHOR'=>$row['author'],
+        'NEWS_DATE'=>format_date($row['date'],'mysql_datetime',true),
+      )
+    );
+        
+    //display the news translations
+    $query = '
+    SELECT id AS news_translation_id,language,title,content
+      FROM '.NEWS_TRANSLATION_TABLE.'
+      WHERE new_id = \''.$_GET['idn'].'\'
+    ;';
+  
+    $subresult = pwg_query($query);
+    
+    while ($subrow = mysql_fetch_array($subresult))
+    {
+      //ready for bbcode
+      $message=preg_replace('/\:[0-9a-z\:]+\]/si', ']', $subrow['content']);
+      $message = str_replace("\n", "\n<br />\n", $message);
+      
+      $template->assign(
+        'news.news_translation',
+        array(
+          'TITLE'=>$subrow['title'],
+          'CONTENT'=>$message,
+          'LANG_TITLE' => ucwords($available_lang[$subrow['language']]),
+        )
+      );    
+      
+      //delete language from not translated languages table
+      $keys_indexes=array_flip(array_keys($not_translated_languages));
+      array_splice ($not_translated_languages, $keys_indexes[$subrow['language']],1);
+    }
+        
+  	$lang_select=news_language_select($not_translated_languages,$user['language']);
+  
+    $template->assign(
+      'form',
+      array(
+        'new_id'=>$_GET['idn'],
+        'LANG_SELECT'=>$lang_select,
+        'SUBMIT_NAME' =>'addt'
+      )
+    ); 
+  }
+  
+  //
+  //display form to alter a translation
+  //
+  else if (isset($_GET['action']) and $_GET['action']=='modt' and isset($_GET['idt']) and is_numeric($_GET['idt']))
+  {
+    //donne le titre edit news dans h2
+    
+    $template->assign('title_edit_news',array());
+    //get every languages
+    $available_lang=get_languages();
+    $not_translated_languages=$available_lang;
+       
+    //get the news translation
+    $query = '
+    SELECT id AS news_translation_id,language,title,content,new_id
+     FROM '.NEWS_TRANSLATION_TABLE.'
+     WHERE id = \''.$_GET['idt'].'\'
+    ;';
+  
+    $result = pwg_query($query);
+    $row = mysql_fetch_array($result);
+  
+    //
+    //display author and date
+    //
+    $query = '
+    SELECT DISTINCT(id) AS new_id, date, author
+     FROM '.NEWS_TABLE.'
+     WHERE id=\''.$row['new_id'].'\'
+    ;';
+  
+    $subresult = pwg_query($query);
+    $subrow = mysql_fetch_array($subresult);
+   
+    //
+   //display the news translations
+   //
+    $query = '
+    SELECT id AS news_translation_id,language,title,content
+     FROM '.NEWS_TRANSLATION_TABLE.'
+     WHERE new_id = \''.$row['new_id'].'\'
+     AND id!=\''.$_GET['idt'].'\'
+    ;';
+
+    while ($subrow = mysql_fetch_array($subresult))
+    {
+      //if ($_GET['idt']!=$subrow['news_translation_id'])
+      //{
+      $message=preg_replace('/\:[0-9a-z\:]+\]/si', ']', $subrow['content']);
+      $message = str_replace("\n", "\n<br />\n", $message);
+          
+      $template->assign(
+        'news.news_translation',
+        array(
+          'TITLE'=>$subrow['title'],
+          'CONTENT'=>$message,
+          'LANG_TITLE' => ucwords($available_lang[$subrow['language']]),
+        )
+      );    
+  
+      //delete language from not translated languages table
+      $keys_indexes=array_flip(array_keys($not_translated_languages));
+      array_splice ($not_translated_languages, $keys_indexes[$subrow['language']],1);
+    }
+  
+    $query = '
+    SELECT *
+      FROM '.NEWS_TRANSLATION_TABLE.'
+      WHERE id = \''.$_GET['idt'].'\'
+    ;';
+  
+    $category = mysql_fetch_array( pwg_query( $query ) );
+    $form_action = add_url_params($page_news_admin, array('new_id' => $_GET['idt']));
+    
+    //get every languages
+    $lang_select=news_language_select($not_translated_languages,$row['language']);
+    
+    $message=preg_replace('/\:[0-9a-z\:]+\]/si', ']', $row['content']);
+
+    $template->assign(
+      'form',
+      array(
+        'NEWS_TRANSLATION_ID'=>$_GET['idt'],
+        'LANG_SELECT'=>$lang_select,
+        'TITLE'=> $row['title'],
+        'CONTENT'=> $message,
+        'SUBMIT_NAME' =>'modt',
+      )
+    );
+  }
+    
+  //
+  // display news
+  //
+  else
+  {
+    $template->assign('adminnews',array());
+  
+    // +-----------------------------------------------------------------------+
+    // |               news per pages & nav bar display                        |
+    // +-----------------------------------------------------------------------+
+    
+    //get number of news
+  
+    // Nombre de news
+    $query = '
+  		SELECT COUNT(DISTINCT(id)) as nb_news
+  		FROM '.NEWS_TABLE.'
+  	;';		
+  	
+    $result = pwg_query($query);
+  
+    $row = mysql_fetch_array($result);
+    $page['nb_news']=$row['nb_news'];
+  
+    //display number of news per page link
+    
+    $template->assign('adminnews.news_per_page',array());
+      
+    foreach ($conf['nb_news_page_option'] as $option)
+    {
+      $template->assign(
+        'adminnews.news_per_page.nb_option',
+        array(
+          'OPTION' => $option,
+          'T_STYLE' => ($option == $page['nb_news_page'])?'text-decoration:underline;':'',
+          'U_OPTION' => add_url_params($page_news_admin, array('nb_news_page' => $option)),
+        )
+      );
+    }
+    
+    //display nav bar
+    $page['navigation_bar'] = create_navigation_bar( add_url_params($page_news_admin, array('nb_news_page' => $page['nb_news_page'])), $page['nb_news'],$page['start'],$page['nb_news_page'], false );
+    
+    $template->assign(
+      'adminnews.navigation',
+      array(
+        'NAV_BAR' => $page['navigation_bar']
+      )
+    );
+    
+    // +-----------------------------------------------------------------------+
+    // |                          last news display                            |
+    // +-----------------------------------------------------------------------+
+    
+    //get every languages
+    $available_lang=get_languages();
+  
+    $query = '
+  		SELECT DISTINCT(id) AS new_id, date, author, status
+  		FROM '.NEWS_TABLE.'
+  		ORDER BY date DESC
+  		LIMIT '.$page['start'].','.$page['nb_news_page'].'		
+  	;';
+  
+    $result = pwg_query($query);
+  
+    while ($row = mysql_fetch_array($result))
+    {
+      $new_id = $row['new_id'];
+  
+      $template->assign(
+      'news',
+        array(
+          'NEWS_AUTHOR' => $row['author'],
+          'NEWS_DATE'   => format_date($row['date'],'mysql_datetime',true),
+          'STATUS_NEWS' => $lang[$row['status']],
+          'NEW_ID'      => $row['new_id'],
+          'U_NEWS_DELETE' => add_url_params($page_news_admin, array(
+            'action' => 'deln',
+            'idn' => $row['new_id'],
+          )),
+      )
+      );
+    
+      //get the news translation
+      $query = '
+      SELECT id AS news_translation_id,language,title,content
+        FROM '.NEWS_TRANSLATION_TABLE.'
+        WHERE new_id = \''.$new_id.'\'
+      ';
+      
+      $no_news_translation = false;
+      
+      //get every translations				
+      $subresult = pwg_query($query);
+  
+      $not_translated_languages=$available_lang;
+          
+      //show every translation
+      while ($subrow = mysql_fetch_array($subresult))
+      {
+        $message=$subrow['content'];
+          
+        $template->assign(
+          'news.news_translation',
+          array(
+            'TITLE'=>$subrow['title'],
+            'CONTENT'=>$message,
+            'LANG_TITLE' => ucwords($subrow['language']),
+            'U_MODIFY' => add_url_params($page_news_admin, array(
+              'action' => 'modt',
+              'idt' => $subrow['news_translation_id'],
+            )),
+            'U_DELETE' => add_url_params($page_news_admin, array(
+              'action' => 'delt',
+              'idt' => $subrow['news_translation_id'],
+            )),
+          )
+        );	
+  
+        //delete language from not translated languages table
+        //$keys_indexes=array_flip(array_keys($not_translated_languages));
+        //array_splice ($not_translated_languages, $keys_indexes[$subrow['language']],1);
+      }
+  
+      //news not translated in every languages
+      if (count($not_translated_languages) > 0)
+      {
+        $template->assign(
+          'news.translate',
+          array(
+            'ICONPATH' => NBC_NEWS_PATH . 'template/icon',
+            'U_TRANSLATE' => add_url_params($page_news_admin, array(
+              'action' => 'addt',
+              'idn' => $new_id,
+            )),
+          )
+        );
+      }
+        
+      if ($row['status'] == 'private')
+      {	
+        $template->assign(
+          'news.perm',
+          array(
+            'U_PERM' => add_url_params(get_admin_plugin_menu_link(dirname(__FILE__).'/news_perm.php'), array('new_id' => $new_id)),
+          )
+        );
+      }
+    }
+  }
+
+// +-----------------------------------------------------------------------+
+// |                             errors display                            |
+// +-----------------------------------------------------------------------+
+  if (isset ($errors) and count($errors) != 0)
+  {
+	  $template->assign('errors',array());
+	  foreach ($errors as $error)
+	  {
+		  array_push($page['errors'], $error);
+		}
+	}  
+
+// +-----------------------------------------------------------------------+
+// |                           templates display                           |
+// +-----------------------------------------------------------------------+
+  $template->set_filenames(array('news' => dirname(__FILE__) . '/template/news_admin.tpl'));
+  //$template->set_filename('news', dirname(__FILE__) . '/template/news_admin.tpl');
+  $template->assign_var_from_handle('ADMIN_CONTENT', 'news');
+
+  break;
+
+// *************************************************************************
+// +-----------------------------------------------------------------------+
+// |                             Users                                     |
+// +-----------------------------------------------------------------------+
+// *************************************************************************
+  case 'Users':
+  
+  $query = '
+  SELECT id, username
+    FROM '.USERS_TABLE.'
+    ORDER BY username ASC
+  ;';
+  $result = pwg_query($query);
+  
+  $num = 0;
+  while ($row = mysql_fetch_array($result))
+  {
+    
+    $template->assign(
+      'user',
+      array(
+        'CLASS' => ($num++ % 2 == 1) ? 'row2' : 'row1',
+        'NAME' => $row['username'],
+        'U_PERM' => add_url_params(get_admin_plugin_menu_link(dirname(__FILE__).'/news_user_perm.php'), array('user_id' => $row['id'])),
+        )
+      );
+  }
+
+  $template->assign(
+    array(
+      'U_HELP' => PHPWG_ROOT_PATH.'popuphelp.php?page=news_users',
+    )
+  );	
+
+  $template->set_filenames(array('news_user_list' => NBC_NEWS_PATH.'template/admin/news_user_list.tpl'));    
+  $template->assign_var_from_handle('ADMIN_CONTENT', 'news_user_list');
+
+  break;
+
+// *************************************************************************
+// +-----------------------------------------------------------------------+
+// |                             Groups                                    |
+// +-----------------------------------------------------------------------+
+// *************************************************************************
+  case 'Groups':
+  
+  $template->set_filenames(array('news_group_list' => NBC_NEWS_PATH . 'template/admin/news_group_list.tpl'));
+
+  $query = '
+  SELECT id, name
+    FROM '.GROUPS_TABLE.'
+    ORDER BY name ASC
+  ;';
+  $result = pwg_query($query);
+  
+  $num = 0;
+  while ($row = mysql_fetch_array($result))
+  {
+    $query = '
+  SELECT COUNT(*)
+    FROM '.USER_GROUP_TABLE.'
+    WHERE group_id = '.$row['id'].'
+  ;';
+    list($counter) = mysql_fetch_row(pwg_query($query));
+    
+    $template->assign(
+      'group',
+      array(
+        'CLASS' => ($num++ % 2 == 1) ? 'row2' : 'row1',
+        'NAME' => $row['name'],
+        'MEMBERS' => sprintf(l10n('%d members'), $counter),
+        'U_MEMBERS' => PHPWG_ROOT_PATH.'admin.php?page=user_list&amp;group='.$row['id'],
+        'U_PERM' => add_url_params(get_admin_plugin_menu_link(dirname(__FILE__).'/news_group_perm.php'), array('group_id' => $row['id'])),
+        )
+      );
+  }
+  
+  $template->assign(
+    array(
+      'U_HELP' => PHPWG_ROOT_PATH.'popuphelp.php?page=news_groups',
+    )
+  );	
+
+  $template->assign_var_from_handle('ADMIN_CONTENT', 'news_group_list');
+
+  break;
+
+// *************************************************************************
+// +-----------------------------------------------------------------------+
+// |                             Users                                     |
+// +-----------------------------------------------------------------------+
+// *************************************************************************
+  case 'Config':
+  $template->set_filenames(array('news_config' => NBC_NEWS_PATH . 'template/admin/news_config.tpl'));
+
+  $conf_nbc_News = explode(";" , $conf['nbc_News']);
+
+  if ( isset($_POST['submit']) and !is_adviser() )
+  {
+    $conf_nbc_News = array(
+      str_replace("\'", "'", $_POST['nb_homepage']),
+      str_replace("\'", "'", $_POST['nb_page']),
+      str_replace("\'", "'", $_POST['nb_page_option']),
+    );
+  
+    $newconf_nbc_News = implode (";" , $conf_nbc_News);
+    
+    $query = '
+      UPDATE '.CONFIG_TABLE.'
+      SET value="'.$newconf_nbc_News.'"
+      WHERE param="nbc_News"
+      LIMIT 1';
+    pwg_query($query);
+  
+    // information message
+    array_push($page['infos'], $lang['nbc_news_save_config']);
+  }
+
+  $template->assign(
+    array(
+      //'U_HELP' => PHPWG_ROOT_PATH.'popuphelp.php?page=news_config',
+      'NBC_News_F_ACTION' => add_url_params($page_news_admin, array('tab' => 'Config')),
+      'nb_homepage_CONTENT' => $conf_nbc_News[0],
+      'nb_page_CONTENT' => $conf_nbc_News[1],
+      'nb_page_option_CONTENT' => $conf_nbc_News[2],
+    )
+  );	
+    
+  $template->assign_var_from_handle('ADMIN_CONTENT', 'news_config');
+  
+  break;
+
+}
+?>
Index: extensions/NBC_News/trunk/admin/news_group_perm.php
===================================================================
--- extensions/NBC_News/trunk/admin/news_group_perm.php	(revision 5179)
+++ extensions/NBC_News/trunk/admin/news_group_perm.php	(revision 5179)
@@ -0,0 +1,187 @@
+<?php
+
+global $user, $template, $lang, $conf, $page;
+
+if (!defined('PHPWG_ROOT_PATH')) die('Hacking attempt!');
+
+include_once(NBC_NEWS_PATH.'include/constants.php');
+include_once(NBC_NEWS_PATH.'include/functions_news.inc.php');
+include(get_language_filepath('plugin.lang.php', NBC_NEWS_PATH));
+  
+
+
+// Gestion des onglets
+include_once(PHPWG_ROOT_PATH . 'admin/include/functions_tabsheet.inc.php');
+
+$page['tab'] = 'Groups';
+
+$page_news_admin = get_admin_plugin_menu_link(dirname(__FILE__).'/news_admin.php');
+
+$page['tabsheet'] = array(
+    'NewsAdmin' => array('caption' => l10n('title_admin_news'), 'url' => add_url_params($page_news_admin, array('tab' => 'NewsAdmin'))),
+    'Users' => array('caption' => l10n('title_users'), 'url' => add_url_params($page_news_admin, array('tab' => 'Users'))),
+    'Groups' => array('caption' => l10n('title_groups'), 'url' => add_url_params($page_news_admin, array('tab' => 'Groups'))),
+    'Config' => array('caption' => l10n('config'), 'url' => add_url_params($page_news_admin, array('tab' => 'Config'))),
+    );
+
+$page['tabsheet'][$page['tab']]['selected'] = true;
+template_assign_tabsheet();
+
+
+  
+include_once(PHPWG_ROOT_PATH.'admin/include/functions.php');
+
+// +-----------------------------------------------------------------------+
+// | Check Access and exit when user status is not ok                      |
+// +-----------------------------------------------------------------------+
+check_status(ACCESS_ADMINISTRATOR);
+
+// +-----------------------------------------------------------------------+
+// |                            variables init                             |
+// +-----------------------------------------------------------------------+
+
+if (isset($_GET['group_id']) and is_numeric($_GET['group_id']))
+{
+  $page['group'] = $_GET['group_id'];
+}
+else
+{
+  echo l10n('group_id URL parameter is missing');
+  exit();
+}
+
+
+// +-----------------------------------------------------------------------+
+// |                                updates                                |
+// +-----------------------------------------------------------------------+
+
+if (isset($_POST['falsify']) and isset($_POST['news_true']) and count($_POST['news_true']) > 0 and !is_adviser() )
+{
+  // if you forbid access to a news
+  $query = '
+    DELETE FROM '.NEWS_GROUP_ACCESS_TABLE.'
+    WHERE group_id = '.$page['group'].'
+    AND new_id IN ('.implode(',', $_POST['news_true']).')
+    ;';
+  
+  pwg_query($query);
+}
+else if (isset($_POST['falsify']) and isset($_POST['news_refuse']) and count($_POST['news_refuse']) > 0 and !is_adviser() )
+{
+  // if you forbid access to a news
+  $query = '
+    DELETE FROM '.NEWS_GROUP_REFUSED_TABLE.'
+    WHERE group_id = '.$page['group'].'
+    AND new_id IN ('.implode(',', $_POST['news_refuse']).')
+    ;';
+  
+  pwg_query($query);
+}
+else if (isset($_POST['trueify']) and isset($_POST['news_false']) and count($_POST['news_false']) > 0 and !is_adviser() )
+{
+  $inserts = array();
+
+  foreach ($_POST['news_false'] as $to_autorize_id)
+  {
+    array_push($inserts, array('group_id' => $page['group'],
+                               'new_id' => $to_autorize_id));
+  }
+
+  mass_inserts(NEWS_GROUP_ACCESS_TABLE, array('group_id','new_id'), $inserts);
+}
+else if (isset($_POST['refusify']) and isset($_POST['news_false']) and count($_POST['news_false']) > 0 and !is_adviser() )
+{
+  $inserts = array();
+
+  foreach ($_POST['news_false'] as $to_refuse_id)
+  {
+    array_push($inserts, array('group_id' => $page['group'],
+                               'new_id' => $to_refuse_id));
+  }
+
+  mass_inserts(NEWS_GROUP_REFUSED_TABLE, array('group_id','new_id'), $inserts);
+}
+
+
+// +-----------------------------------------------------------------------+
+// |                             template init                             |
+// +-----------------------------------------------------------------------+
+
+$template->set_filenames(
+  array(
+    'news_admin_perm' => NBC_NEWS_PATH . 'template/admin/news_admin_perm.tpl',
+    'news_double_select' => NBC_NEWS_PATH . 'template/admin/news_double_select.tpl'
+    )
+  );
+
+$template->assign_vars(
+  array(
+    'TITLE' => sprintf(l10n('Manage permissions for group "%s"'), get_groupname($page['group'])),
+    'U_HELP' => PHPWG_ROOT_PATH.'popuphelp.php?page=news_group_perm',
+    'F_ACTION' => add_url_params(get_admin_plugin_menu_link(dirname(__FILE__).'/news_group_perm.php'), array('group_id' => $page['group'])), 
+  )
+);
+
+// only private news are listed
+$query_refuse = '
+  SELECT nt.id, nt.title, nt.new_id
+  FROM '.NEWS_TRANSLATION_TABLE.' as nt 
+  INNER JOIN '.NEWS_GROUP_REFUSED_TABLE.' as ngd ON nt.new_id = ngd.new_id
+  INNER JOIN '.NEWS_TABLE.' as n ON n.id = nt.new_id
+  WHERE n.status = \'private\'
+  AND ngd.group_id = '.$page['group'].'
+  ORDER BY nt.new_id;';
+  
+display_select_news_wrapper($query_refuse,array(),'news_option_refuse');
+
+$result = pwg_query($query_refuse);
+
+$refused_ids = array();
+
+while ($row = mysql_fetch_array($result))
+{
+  array_push($refused_ids, $row['new_id']);
+}
+
+$query_true = '
+  SELECT nt.id, nt.title, nt.new_id
+  FROM '.NEWS_TRANSLATION_TABLE.' as nt 
+  INNER JOIN '.NEWS_GROUP_ACCESS_TABLE.' as nga ON nt.new_id = nga.new_id
+  INNER JOIN '.NEWS_TABLE.' as n ON n.id = nt.new_id
+  WHERE n.status = \'private\'
+  AND nga.group_id = '.$page['group'];
+$query_true .= (count($refused_ids) > 0) ? ' AND nt.new_id NOT IN ('.implode(',', $refused_ids).')' : '';
+$query_true .= ' ORDER BY nt.new_id;';
+
+display_select_news_wrapper($query_true,array(),'news_option_true');
+
+$result = pwg_query($query_true);
+
+$authorized_ids = array();
+
+while ($row = mysql_fetch_array($result))
+{
+  array_push($authorized_ids, $row['new_id']);
+}
+
+
+$query_false = '
+  SELECT nt.id, nt.title, nt.new_id
+  FROM '.NEWS_TRANSLATION_TABLE.' as nt
+  INNER JOIN '.NEWS_TABLE.' as n ON n.id = nt.new_id
+  WHERE n.status = \'private\'';
+$query_false.= (count($refused_ids) > 0) ? ' AND nt.new_id NOT IN ('.implode(',', $refused_ids).')': '';
+$query_false.= (count($authorized_ids) > 0)? ' AND nt.new_id NOT IN ('.implode(',', $authorized_ids).')' : '';
+$query_false.= ' ORDER BY nt.new_id;';
+
+display_select_news_wrapper($query_false,array(),'news_option_false');
+
+
+// +-----------------------------------------------------------------------+
+// |                           html code display                           |
+// +-----------------------------------------------------------------------+
+
+$template->assign_var_from_handle('NEWS_DOUBLE_SELECT', 'news_double_select');
+$template->assign_var_from_handle('ADMIN_CONTENT', 'news_admin_perm');
+
+?>
Index: extensions/NBC_News/trunk/admin/news_perm.php
===================================================================
--- extensions/NBC_News/trunk/admin/news_perm.php	(revision 5179)
+++ extensions/NBC_News/trunk/admin/news_perm.php	(revision 5179)
@@ -0,0 +1,516 @@
+<?php
+
+global $user, $template, $lang, $conf, $page;
+
+if (!defined('PHPWG_ROOT_PATH')) die('Hacking attempt!');
+
+include_once(NBC_NEWS_PATH.'include/constants.php');
+include_once(NBC_NEWS_PATH.'include/functions_news.inc.php');
+include(get_language_filepath('plugin.lang.php', NBC_NEWS_PATH));
+  
+
+
+// Gestion des onglets
+include_once(PHPWG_ROOT_PATH . 'admin/include/functions_tabsheet.inc.php');
+
+$page['tab'] = 'NewsAdmin';
+
+$page_news_admin = get_admin_plugin_menu_link(dirname(__FILE__).'/news_admin.php');
+
+$page['tabsheet'] = array(
+    'NewsAdmin' => array('caption' => l10n('title_admin_news'), 'url' => add_url_params($page_news_admin, array('tab' => 'NewsAdmin'))),
+    'Users' => array('caption' => l10n('title_users'), 'url' => add_url_params($page_news_admin, array('tab' => 'Users'))),
+    'Groups' => array('caption' => l10n('title_groups'), 'url' => add_url_params($page_news_admin, array('tab' => 'Groups'))),
+    'Config' => array('caption' => l10n('config'), 'url' => add_url_params($page_news_admin, array('tab' => 'Config'))),
+    );
+
+$page['tabsheet'][$page['tab']]['selected'] = true;
+template_assign_tabsheet();
+
+
+
+// +-----------------------------------------------------------------------+
+// |                       variable initialization                         |
+// +-----------------------------------------------------------------------+
+
+// if the news is not correct (not numeric, not private)
+if (isset($_GET['new_id']) and is_numeric($_GET['new_id']))
+{
+  $query = '
+SELECT status
+  FROM '.NEWS_TABLE.' as n
+  WHERE n.id = '.$_GET['new_id'].'
+;';
+  list($status) = mysql_fetch_array(pwg_query($query));
+  
+  if ('private' == $status)
+  {
+    $page['new_id'] = $_GET['new_id'];
+  }
+}
+
+if (!isset($page['new_id']))
+{
+  $query = '
+SELECT id
+  FROM '.NEWS_TABLE.'
+  WHERE status = \'private\'
+  LIMIT 0,1
+;';
+
+  list($page['new_id']) = mysql_fetch_array(pwg_query($query));
+}
+
+// +-----------------------------------------------------------------------+
+// |                           form submission                             |
+// +-----------------------------------------------------------------------+
+
+if (isset($_POST) and false)
+{
+  echo '<pre>';
+  print_r($_POST);
+  echo '</pre>';
+}
+
+if ( isset($_POST['deny_granted_groups_submit'])
+     and isset($_POST['deny_groups'])
+     and count($_POST['deny_groups']) > 0
+     and !is_adviser() )
+{
+  // if you forbid access to a news
+  $query = '
+DELETE
+  FROM '.NEWS_GROUP_ACCESS_TABLE.'
+  WHERE group_id IN ('.implode(',', $_POST['deny_groups']).')
+    AND new_id = '.$page['new_id'].'
+;';
+  pwg_query($query);
+}
+else if (isset($_POST['deny_refused_groups_submit'])
+         and isset($_POST['refuse_groups'])
+         and count($_POST['refuse_groups']) > 0
+        and !is_adviser() )
+{
+  // if you forbid access to a news
+  $query = '
+DELETE
+  FROM '.NEWS_GROUP_REFUSED_TABLE.'
+  WHERE group_id IN ('.implode(',', $_POST['refuse_groups']).')
+    AND new_id = '.$page['new_id'].'
+;';
+  pwg_query($query);
+}
+else if (isset($_POST['grant_groups_submit'])
+         and isset($_POST['grant_groups'])
+         and count($_POST['grant_groups']) > 0
+         and !is_adviser() )
+{
+  $inserts = array();
+  
+  foreach ($_POST['grant_groups'] as $group_id)
+  {
+    array_push($inserts, array('group_id' => $group_id,
+                               'new_id' => $page['new_id']));
+  }
+
+  mass_inserts(NEWS_GROUP_ACCESS_TABLE, array('group_id','new_id'), $inserts);
+}
+else if (isset($_POST['refuse_groups_submit'])
+         and isset($_POST['grant_groups'])
+         and count($_POST['grant_groups']) > 0
+         and !is_adviser() )
+{
+  $inserts = array();
+  
+  foreach ($_POST['grant_groups'] as $group_id)
+  {
+    array_push($inserts, array('group_id' => $group_id,
+                               'new_id' => $page['new_id']));
+  }
+
+  mass_inserts(NEWS_GROUP_REFUSED_TABLE, array('group_id','new_id'), $inserts);
+}
+else if (isset($_POST['deny_granted_users_submit'])
+         and isset($_POST['deny_users'])
+         and count($_POST['deny_users']) > 0
+         and !is_adviser() )
+{
+  // if you forbid access to a news
+  $query = '
+DELETE
+  FROM '.NEWS_USER_ACCESS_TABLE.'
+  WHERE user_id IN ('.implode(',', $_POST['deny_users']).')
+    AND new_id = '.$page['new_id'].'
+;';
+  pwg_query($query);
+}
+else if (isset($_POST['deny_refused_users_submit'])
+         and isset($_POST['refuse_users'])
+         and count($_POST['refuse_users']) > 0
+         and !is_adviser() )
+{
+  // if you forbid access to a news
+  $query = '
+DELETE
+  FROM '.NEWS_USER_REFUSED_TABLE.'
+  WHERE user_id IN ('.implode(',', $_POST['refuse_users']).')
+    AND new_id = '.$page['new_id'].'
+;';
+  pwg_query($query);
+}
+else if (isset($_POST['grant_users_submit'])
+         and isset($_POST['grant_users'])
+         and count($_POST['grant_users']) > 0
+         and !is_adviser() )
+{
+  $inserts = array();
+  
+  foreach ($_POST['grant_users'] as $user_id)
+  {
+    array_push($inserts, array('user_id' => $user_id,
+                               'new_id' => $page['new_id']));
+  }
+
+  mass_inserts(NEWS_USER_ACCESS_TABLE, array('user_id','new_id'), $inserts);
+}
+else if (isset($_POST['refuse_users_submit'])
+         and isset($_POST['grant_users'])
+         and count($_POST['grant_users']) > 0
+         and !is_adviser() )
+{
+  $inserts = array();
+  
+  foreach ($_POST['grant_users'] as $user_id)
+  {
+    array_push($inserts, array('user_id' => $user_id,
+                               'new_id' => $page['new_id']));
+  }
+
+  mass_inserts(NEWS_USER_REFUSED_TABLE, array('user_id','new_id'), $inserts);
+}
+else if (isset($_POST['refuse_indirect_users_submit'])
+         and isset($_POST['grant_indirect_users'])
+         and count($_POST['grant_indirect_users']) > 0
+         and !is_adviser() )
+{
+  $inserts = array();
+  
+  foreach ($_POST['grant_indirect_users'] as $user_id)
+  {
+    array_push($inserts, array('user_id' => $user_id,
+                               'new_id' => $page['new_id']));
+  }
+
+  mass_inserts(NEWS_USER_REFUSED_TABLE, array('user_id','new_id'), $inserts);
+}
+
+// +-----------------------------------------------------------------------+
+// |                       template initialization                         |
+// +-----------------------------------------------------------------------+
+
+$template->set_filenames(array('news_perm' => NBC_NEWS_PATH . 'template/admin/news_perm.tpl'));
+
+  $query = '
+SELECT nt.title
+  FROM '.NEWS_TRANSLATION_TABLE.' as nt
+  INNER JOIN '.NEWS_TABLE.' as n ON n.id = nt.new_id
+  WHERE nt.new_id = '.$page['new_id'].'
+  AND nt.language = \''.$user['language'].'\'
+;';
+  $result = pwg_query($query);
+
+$row = mysql_fetch_array($result);
+
+$template->assign_vars(
+  array(
+    'NEWS_NAV' => '[ '.$page['new_id'].'] - '.$row['title'],
+    'U_HELP' => PHPWG_ROOT_PATH.'popuphelp.php?page=news_perm',
+    'F_ACTION' => add_url_params(get_admin_plugin_menu_link(dirname(__FILE__).'/news_perm.php'), array('new_id' => $page['new_id'])),
+    )
+  );
+
+// +-----------------------------------------------------------------------+
+// |                          form construction                            |
+// +-----------------------------------------------------------------------+
+
+// groups denied are the groups not granted. So we need to find all groups
+// minus groups granted to find groups denied.
+
+$groups = array();
+
+// -- Modif Nicco pour ordonner par name
+$query = '
+SELECT id, name
+  FROM '.GROUPS_TABLE.'
+  ORDER BY name
+;';
+// -- Modif Nicco pour ordonner par name
+$result = pwg_query($query);
+
+while ($row = mysql_fetch_array($result))
+{
+  $groups[$row['id']] = $row['name'];
+}
+
+// -- Modif Nicco pour ordonner par name
+$query = '
+SELECT ngdt.group_id, gt.name
+  FROM '.NEWS_GROUP_REFUSED_TABLE.' as ngdt, '.GROUPS_TABLE.' as gt
+  WHERE ngdt.new_id = '.$page['new_id'].'
+  AND ngdt.group_id = gt.id
+  ORDER BY gt.name
+;';
+// -- Modif Nicco pour ordonner par name
+
+$group_refused_ids = array_from_query($query, 'group_id');
+
+// groups refused to access the category
+foreach ($group_refused_ids as $group_id)
+{
+  $template->assign_block_vars(
+    'group_refused',
+    array(
+      'NAME'=>$groups[$group_id],
+      'ID'=>$group_id
+      )
+    );
+}
+
+// -- Modif Nicco pour ordonner par name
+$query = '
+SELECT ngat.group_id, gt.name
+  FROM '.NEWS_GROUP_ACCESS_TABLE.' as ngat, '.GROUPS_TABLE.' as gt
+  WHERE ngat.new_id = '.$page['new_id'].'
+  AND ngat.group_id = gt.id
+  ORDER BY gt.name
+;';
+// -- Modif Nicco pour ordonner par name
+
+$group_granted_ids = array_from_query($query, 'group_id');
+
+// groups granted to access the news
+foreach ($group_granted_ids as $group_id)
+{
+  $template->assign_block_vars(
+    'group_granted',
+    array(
+      'NAME'=>$groups[$group_id],
+      'ID'=>$group_id
+      )
+    );
+}
+
+// groups denied
+foreach (array_diff(array_keys($groups), array_merge($group_granted_ids, $group_refused_ids)) as $group_id)
+{
+  $template->assign_block_vars(
+    'group_denied',
+    array(
+      'NAME'=>$groups[$group_id],
+      'ID'=>$group_id
+      )
+    );
+}
+
+// users...
+$users = array();
+
+$query = '
+SELECT '.$conf['user_fields']['id'].' AS id,
+       '.$conf['user_fields']['username'].' AS username
+  FROM '.USERS_TABLE.'
+  ORDER BY username
+;';
+$result = pwg_query($query);
+while($row = mysql_fetch_array($result))
+{
+  $users[$row['id']] = $row['username'];
+}
+
+
+$query = '
+SELECT nud.user_id, u.username
+  FROM '.NEWS_USER_REFUSED_TABLE.' as nud, '.USERS_TABLE.' as u
+  WHERE new_id = '.$page['new_id'].'
+  AND nud.user_id = u.id
+  ORDER BY u.username
+;';
+
+$user_refused_direct_ids = array_from_query($query, 'user_id');
+
+foreach ($user_refused_direct_ids as $user_id)
+{
+  $template->assign_block_vars(
+    'user_refused',
+    array(
+      'NAME'=>$users[$user_id],
+      'ID'=>$user_id
+      )
+    );
+}
+
+$user_refused_indirect_ids = array();
+if (count($group_refused_ids) > 0)
+{
+  $refused_groups = array();
+
+  $query = '
+SELECT ug.user_id, ug.group_id, u.username
+  FROM '.USER_GROUP_TABLE.' as ug, '.USERS_TABLE.' as u
+  WHERE group_id IN ('.implode(',', $group_refused_ids).')
+  AND ug.user_id = u.id
+  ORDER BY u.username 
+';
+  $result = pwg_query($query);
+  while ($row = mysql_fetch_array($result))
+  {
+    if (!isset($refused_groups[$row['group_id']]))
+    {
+      $refused_groups[$row['group_id']] = array();
+    }
+    array_push($refused_groups[$row['group_id']], $row['user_id']);
+  }
+
+  $user_refused_by_group_ids = array();
+
+  foreach ($refused_groups as $group_users)
+  {
+    $user_refused_by_group_ids = array_merge($user_refused_by_group_ids,
+                                             $group_users);
+  }
+  $user_refused_by_group_ids = array_unique($user_refused_by_group_ids);
+ 
+ 
+  $user_refused_indirect_ids = array_diff($user_refused_by_group_ids,
+                                          $user_refused_direct_ids);
+
+  foreach ($user_refused_indirect_ids as $user_id)
+  {
+    $group = '';
+   
+    foreach ($refused_groups as $group_id => $group_users)
+    {
+      if (in_array($user_id, $group_users))
+      {
+        $group = $groups[$group_id];
+        break;
+      }
+    }
+
+    $template->assign_block_vars(
+      'user_refused_indirect',
+      array(
+        'NAME'=>$users[$user_id],
+        'GROUP'=>$group
+        )
+      );
+  }
+}
+
+
+
+$query = '
+SELECT nuat.user_id, ut.username
+  FROM '.NEWS_USER_ACCESS_TABLE.' as nuat, '.USERS_TABLE.' as ut
+  WHERE new_id = '.$page['new_id'].'
+  AND nuat.user_id = ut.id
+  ORDER BY ut.username
+;';
+$user_granted_direct_ids = array_diff(array_from_query($query, 'user_id'), $user_refused_indirect_ids, $user_refused_direct_ids);
+
+foreach ($user_granted_direct_ids as $user_id)
+{
+  $template->assign_block_vars(
+    'user_granted',
+    array(
+      'NAME'=>$users[$user_id],
+      'ID'=>$user_id
+      )
+    );
+}
+
+$user_granted_indirect_ids = array();
+if (count($group_granted_ids) > 0)
+{
+  $granted_groups = array();
+
+  $query = '
+SELECT ugt.user_id, ugt.group_id, ut.username
+  FROM '.USER_GROUP_TABLE.' as ugt, '.USERS_TABLE.' as ut
+  WHERE group_id IN ('.implode(',', $group_granted_ids).')
+  AND ugt.user_id = ut.id
+  ORDER BY ut.username 
+';
+  $result = pwg_query($query);
+  while ($row = mysql_fetch_array($result))
+  {
+    if (!isset($granted_groups[$row['group_id']]) or isset($refused_groups[$row['group_id']]))
+    {
+      $granted_groups[$row['group_id']] = array();
+    }
+    array_push($granted_groups[$row['group_id']], $row['user_id']);
+  }
+
+  $user_granted_by_group_ids = array();
+
+  foreach ($granted_groups as $group_users)
+  {
+    $user_granted_by_group_ids = array_merge($user_granted_by_group_ids,
+                                             $group_users);
+  }
+  $user_granted_by_group_ids = array_unique($user_granted_by_group_ids);
+ 
+ 
+  $user_granted_indirect_ids = array_diff($user_granted_by_group_ids,
+                                          $user_granted_direct_ids,
+                                          $user_refused_indirect_ids,
+                                          $user_refused_direct_ids);
+
+  foreach ($user_granted_indirect_ids as $user_id)
+  {
+    $group = '';
+   
+    foreach ($granted_groups as $group_id => $group_users)
+    {
+      if (in_array($user_id, $group_users))
+      {
+        $group = $groups[$group_id];
+        break;
+      }
+    }
+
+    $template->assign_block_vars(
+      'user_granted_indirect',
+      array(
+        'ID'=>$user_id,
+        'NAME'=>$users[$user_id],
+        'GROUP'=>$group
+        )
+      );
+  }
+}
+
+$user_denied_ids = array_diff(array_keys($users),
+                              $user_granted_indirect_ids,
+                              $user_granted_direct_ids,
+                              $user_refused_indirect_ids,
+                              $user_refused_direct_ids);
+
+foreach ($user_denied_ids as $user_id)
+{
+  $template->assign_block_vars(
+    'user_denied',
+    array(
+      'NAME'=>$users[$user_id],
+      'ID'=>$user_id
+      )
+    );
+}
+
+
+// +-----------------------------------------------------------------------+
+// |                           sending html code                           |
+// +-----------------------------------------------------------------------+
+$template->assign_var_from_handle('ADMIN_CONTENT', 'news_perm');
+
+?>
Index: extensions/NBC_News/trunk/admin/news_user_perm.php
===================================================================
--- extensions/NBC_News/trunk/admin/news_user_perm.php	(revision 5179)
+++ extensions/NBC_News/trunk/admin/news_user_perm.php	(revision 5179)
@@ -0,0 +1,261 @@
+<?php
+
+global $user, $template, $lang, $conf, $page;
+
+if (!defined('PHPWG_ROOT_PATH')) die('Hacking attempt!');
+
+include_once(NBC_NEWS_PATH.'include/constants.php');
+include_once(NBC_NEWS_PATH.'include/functions_news.inc.php');
+include(get_language_filepath('plugin.lang.php', NBC_NEWS_PATH));
+  
+
+
+// Gestion des onglets
+include_once(PHPWG_ROOT_PATH . 'admin/include/functions_tabsheet.inc.php');
+
+$page['tab'] = 'Users';
+
+$page_news_admin = get_admin_plugin_menu_link(dirname(__FILE__).'/news_admin.php');
+
+$page['tabsheet'] = array(
+    'NewsAdmin' => array('caption' => l10n('title_admin_news'), 'url' => add_url_params($page_news_admin, array('tab' => 'NewsAdmin'))),
+    'Users' => array('caption' => l10n('title_users'), 'url' => add_url_params($page_news_admin, array('tab' => 'Users'))),
+    'Groups' => array('caption' => l10n('title_groups'), 'url' => add_url_params($page_news_admin, array('tab' => 'Groups'))),
+    'Config' => array('caption' => l10n('config'), 'url' => add_url_params($page_news_admin, array('tab' => 'Config'))),
+    );
+
+$page['tabsheet'][$page['tab']]['selected'] = true;
+template_assign_tabsheet();
+
+
+  
+include_once(PHPWG_ROOT_PATH.'admin/include/functions.php');
+
+// +-----------------------------------------------------------------------+
+// | Check Access and exit when user status is not ok                      |
+// +-----------------------------------------------------------------------+
+check_status(ACCESS_ADMINISTRATOR);
+
+// +-----------------------------------------------------------------------+
+// |                            variables init                             |
+// +-----------------------------------------------------------------------+
+
+if (isset($_GET['user_id']) and is_numeric($_GET['user_id']))
+{
+  $page['user'] = $_GET['user_id'];
+}
+else
+{
+  echo l10n('user_id URL parameter is missing');
+  exit();
+}
+
+// +-----------------------------------------------------------------------+
+// |                                updates                                |
+// +-----------------------------------------------------------------------+
+
+if ( isset($_POST['falsify']) and isset($_POST['news_true']) and count($_POST['news_true']) > 0 and !is_adviser() )
+{
+  // if you forbid access to a news for group authorized
+  $query = '
+    DELETE FROM '.NEWS_USER_ACCESS_TABLE.'
+    WHERE user_id = '.$page['user'].'
+    AND new_id IN ('.implode(',', $_POST['news_true']).')
+    ;';
+  pwg_query($query);
+}
+else if (isset($_POST['falsify']) and isset($_POST['news_refuse']) and count($_POST['news_refuse']) > 0 and !is_adviser() )
+{
+  // if you refuse access to a news for group refused
+  $query = '
+    DELETE FROM '.NEWS_USER_REFUSED_TABLE.'
+    WHERE user_id = '.$page['user'].'
+    AND new_id IN ('.implode(',', $_POST['news_refuse']).')
+    ;';
+  pwg_query($query);
+}
+else if (isset($_POST['trueify']) and isset($_POST['news_false']) and count($_POST['news_false']) > 0 and !is_adviser() )
+{
+  $inserts = array();
+
+  foreach ($_POST['news_false'] as $to_autorize_id)
+  {
+    array_push($inserts, array('user_id' => $page['user'],
+                               'new_id' => $to_autorize_id));
+  }
+
+  mass_inserts(NEWS_USER_ACCESS_TABLE, array('user_id','new_id'), $inserts);
+}
+else if (isset($_POST['refusify']) and isset($_POST['news_false']) and count($_POST['news_false']) > 0 and !is_adviser() )
+{
+  $inserts = array();
+
+  foreach ($_POST['news_false'] as $to_refuse_id)
+  {
+    array_push($inserts, array('user_id' => $page['user'],
+                               'new_id' => $to_refuse_id));
+  }
+
+  mass_inserts(NEWS_USER_REFUSED_TABLE, array('user_id','new_id'), $inserts);
+}
+
+
+// +-----------------------------------------------------------------------+
+// |                             template init                             |
+// +-----------------------------------------------------------------------+
+
+$template->set_filenames(
+  array(
+    'news_admin_perm' => NBC_NEWS_PATH . 'template/admin/news_admin_perm.tpl',
+    'news_double_select' => NBC_NEWS_PATH . 'template/admin/news_double_select.tpl'
+    )
+  );
+
+$template->assign_vars(
+  array(
+    'TITLE' => sprintf(l10n('Manage permissions for user "%s"'), get_username($page['user'])),
+    'U_HELP' => PHPWG_ROOT_PATH.'popuphelp.php?page=news_user_perm',
+    'F_ACTION' => add_url_params(get_admin_plugin_menu_link(dirname(__FILE__).'/news_user_perm.php'), array('user_id' => $page['user'])), 
+    )
+  );
+
+// retrieve news ids refused to the groups the user belongs to
+$group_refused = array();
+
+$query = '
+  SELECT DISTINCT nt.id, nt.title , nt.new_id
+  FROM '.NEWS_TRANSLATION_TABLE.' AS nt
+  INNER JOIN '.NEWS_GROUP_REFUSED_TABLE.' AS ngr ON nt.new_id = ngr.new_id
+  INNER JOIN '.USER_GROUP_TABLE.' AS ug ON ug.group_id = ngr.group_id
+  WHERE ug.user_id = '.$page['user'].'
+  ORDER BY nt.new_id
+  ;';
+$result = pwg_query($query);
+
+if (mysql_num_rows($result) > 0)
+{
+  $template->assign_block_vars('groups_refused', array());
+
+  $news = array();
+
+  while ($row = mysql_fetch_array($result))
+  {
+    array_push($news, $row);
+    array_push($group_refused, $row['new_id']);
+  }
+
+  foreach ($news as $new)
+  {
+    $template->assign_block_vars(
+      'groups_refused.news',
+      array(
+        'NAME' => '['.$new['new_id'].'] - '.$new['title']
+        )
+      );
+  }
+}
+
+// only private news are listed
+$query_refuse = '
+  SELECT nt.id, nt.title, nt.new_id 
+  FROM '.NEWS_TRANSLATION_TABLE.' as nt 
+  INNER JOIN '.NEWS_USER_REFUSED_TABLE.' as nur ON nt.new_id = nur.new_id
+  INNER JOIN '.NEWS_TABLE.' as n ON n.id = nt.new_id
+  WHERE n.status = \'private\'
+  AND nur.user_id = '.$page['user'];
+$query_refuse .= (count($group_refused) > 0) ? ' AND nt.new_id NOT IN ('.implode(',', $group_refused).')' : '';
+$query_refuse .= ' ORDER BY nt.new_id;';
+
+display_select_news_wrapper($query_refuse,array(),'news_option_refuse');
+
+$result = pwg_query($query_refuse);
+
+$refused_ids = array();
+
+while ($row = mysql_fetch_array($result))
+{
+  array_push($refused_ids, $row['new_id']);
+}
+
+// retrieve news ids authorized to the groups the user belongs to
+$group_authorized = array();
+
+$query = '
+  SELECT DISTINCT nt.id, nt.title, nt.new_id
+  FROM '.USER_GROUP_TABLE.' AS ug
+  INNER JOIN '.NEWS_GROUP_ACCESS_TABLE.' AS nga ON ug.group_id = nga.group_id
+  INNER JOIN '.NEWS_TRANSLATION_TABLE.' AS nt ON nt.new_id = nga.new_id
+  WHERE ug.user_id = '.$page['user'];
+$query .= (count($group_refused) > 0) ? ' AND nt.new_id NOT IN ('.implode(',', $group_refused).')' : '';
+$query .= (count($refused_ids) > 0) ? ' AND nt.new_id NOT IN ('.implode(',', $refused_ids).')' : '';
+$query .= ' ORDER BY nt.new_id;';
+
+$result = pwg_query($query);
+
+if (mysql_num_rows($result) > 0)
+{
+  $template->assign_block_vars('groups_authorized', array());
+
+  $news = array();
+
+  while ($row = mysql_fetch_array($result))
+  {
+    array_push($news, $row);
+    array_push($group_authorized, $row['new_id']);
+  }
+  
+  foreach ($news as $new)
+  {
+    $template->assign_block_vars(
+      'groups_authorized.news',
+      array(
+        'NAME' => '['.$new['new_id'].'] - '.$new['title']
+        )
+      );
+  }
+}
+
+$query_true = '
+  SELECT nt.id, nt.title, nt.new_id
+  FROM '.NEWS_TRANSLATION_TABLE.' as nt 
+  INNER JOIN '.NEWS_USER_ACCESS_TABLE.' as nua ON nt.new_id = nua.new_id
+  INNER JOIN '.NEWS_TABLE.' as n ON n.id = nt.new_id
+  WHERE n.status = \'private\'
+  AND nua.user_id = '.$page['user'];
+$query_true .= (count($group_refused) > 0) ? ' AND nt.new_id NOT IN ('.implode(',', $group_refused).')' : '';
+$query_true .= (count($refused_ids) > 0) ? ' AND nt.new_id NOT IN ('.implode(',', $refused_ids).')' : '';
+$query_true .= (count($group_authorized) > 0) ? ' AND nt.new_id NOT IN ('.implode(',', $group_authorized).')' : '';
+$query_true .= ' ORDER BY nt.new_id;';
+
+display_select_news_wrapper($query_true,array(),'news_option_true');
+
+$result = pwg_query($query_true);
+
+$authorized_ids = array();
+
+while ($row = mysql_fetch_array($result))
+{
+  array_push($authorized_ids, $row['new_id']);
+}
+
+$query_false = '
+  SELECT nt.id, nt.title, nt.new_id
+  FROM '.NEWS_TRANSLATION_TABLE.' as nt
+  INNER JOIN '.NEWS_TABLE.' as n ON n.id = nt.new_id
+  WHERE n.status = \'private\'';
+$query_false .= (count($group_refused) > 0) ? ' AND nt.new_id NOT IN ('.implode(',', $group_refused).')': '';
+$query_false .= (count($refused_ids) > 0) ? ' AND nt.new_id NOT IN ('.implode(',', $refused_ids).')' : '';
+$query_false .= (count($group_authorized) > 0) ? ' AND nt.new_id NOT IN ('.implode(',', $group_authorized).')' : '';
+$query_false .= (count($authorized_ids) > 0) ? ' AND nt.new_id NOT IN ('.implode(',', $authorized_ids).')' : '';
+$query_false .= ' ORDER BY nt.new_id;';
+
+display_select_news_wrapper($query_false,array(),'news_option_false');
+
+
+// +-----------------------------------------------------------------------+
+// |                           sending html code                           |
+// +-----------------------------------------------------------------------+
+
+$template->assign_var_from_handle('NEWS_DOUBLE_SELECT', 'news_double_select');
+$template->assign_var_from_handle('ADMIN_CONTENT', 'news_admin_perm');
+?>
Index: extensions/NBC_News/trunk/admin/template/index.php
===================================================================
--- extensions/NBC_News/trunk/admin/template/index.php	(revision 5179)
+++ extensions/NBC_News/trunk/admin/template/index.php	(revision 5179)
@@ -0,0 +1,33 @@
+<?php
+// +-----------------------------------------------------------------------+
+// | PhpWebGallery - a PHP based picture gallery                           |
+// | Copyright (C) 2002-2003 Pierrick LE GALL - pierrick@phpwebgallery.net |
+// | Copyright (C) 2003-2007 PhpWebGallery Team - http://phpwebgallery.net |
+// +-----------------------------------------------------------------------+
+// | file          : $Id: index.php 1912 2007-03-16 06:30:07Z rub $
+// | last update   : $Date: 2007-03-16 07:30:07 +0100 (ven, 16 mar 2007) $
+// | last modifier : $Author: rub $
+// | revision      : $Revision: 1912 $
+// +-----------------------------------------------------------------------+
+// | This program 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                                          |
+// |                                                                       |
+// | This program 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 this program; if not, write to the Free Software           |
+// | Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, |
+// | USA.                                                                  |
+// +-----------------------------------------------------------------------+
+
+// Recursive call
+$url = '../';
+header( 'Request-URI: '.$url );
+header( 'Content-Location: '.$url );
+header( 'Location: '.$url );
+exit();
+?>
Index: extensions/NBC_News/trunk/admin/template/news_admin.tpl
===================================================================
--- extensions/NBC_News/trunk/admin/template/news_admin.tpl	(revision 5179)
+++ extensions/NBC_News/trunk/admin/template/news_admin.tpl	(revision 5179)
@@ -0,0 +1,150 @@
+<div class="titrePage">
+  <h2>{'title_admin_news'|@translate}</h2>
+</div>
+
+<div>
+      <a href="{$OPTION}" style="{$T_STYLE}">{$OPTION}</a>
+    {'news_per_page'|@translate}
+    ]
+  <!-- END news_per_page -->
+  <!-- BEGIN navigation -->
+    <br>
+    {$NAV_BAR}
+    <br>
+  <!-- END navigation -->
+</div>
+
+<br>
+[ <a href="{$U_POST_NEWS}">{'post_news'|@translate}</a> ]
+<!-- END adminnews -->
+
+
+
+<!-- BEGIN news -->
+<form action="{$News_F_ACTION}" method="post" id="newsform">
+  <table class="tableNews1" >
+    <tr>
+      <td class="tablecompact">
+        <table class="tablecompact" style="width:100%">
+          <tr>
+            <td align="left">
+              <input type="hidden" name="idn" value="{$NEW_ID}" />
+              <input type="submit" name="change_status_submit" value="{'news_change_status_submit'|@translate}" class="bouton" {$TAG_INPUT_ENABLED} > ==> <strong>{'conf_access'|@translate} : {$STATUS_NEWS}
+            </td>
+            <td align="right">
+
+	            <!-- BEGIN translate -->
+                <a href="{$U_TRANSLATE}" title="{'post_translation'|@translate}"><img src="{$pwg_root}{$ICONPATH}/traduire.png" alt="{'post_translation'|@translate}" ></a> 
+	            <!-- END translate -->
+	            <!-- BEGIN perm -->
+                <a href="{$U_PERM}" title="{'Manage_permissions_for_a_news'|@translate}" ><img src="{$ROOT_URL}{$themeconf.icon_dir}/category_permissions.png" class="button" alt="{'Manage_permissions_for_a_news'|@translate}" ></a>
+	            <!-- END perm -->
+            </td>
+          </tr>
+        </table>
+      </td>
+    </tr>
+
+    <tr>
+      <td>    
+        <!-- BEGIN news_translation -->
+          <table class="tableNews1" >
+            <tr class="row1">
+              <td class="tablecompact">
+                <table class="tableNews2">
+                    <tr class="newsThrow">
+                      <td class="newsTitle">
+                        <span class="newsLanguage">{$LANG_TITLE} -></span>
+                        {$TITLE}
+                      </td>
+                      <td class="newsInfo">
+                        <span class="newsAuthor">{$NEWS_AUTHOR}</span> - <span class="newsDate">{$NEWS_DATE}</span>
+                      </td>
+                    </tr>
+                    <tr>
+                      <td class="newsContent" colspan="2">
+                        <!-- BEGIN no_news_translation -->
+                          <div class="newsNoTranslation">({'no_news_translation'|@translate})</div>
+                        <!-- END no_news_translation -->
+                        {$CONTENT}
+                      </td>
+                    </tr>
+                </table>
+              </td>
+            </tr>
+            <tr>
+              <td class="translationMenu" colspan="2">
+                <a href="{$U_MODIFY}" title="{'modify_translation'|@translate}"><img src="{$pwg_root}{$themeconf.icon_dir}/register.png" alt="{'modify_translation'|@translate}" ></a>
+	              <a href="{$U_DELETE}" title="{'delete_translation'|@translate}" {$TAG_INPUT_ENABLED} ><img src="{$pwg_root}{$themeconf.icon_dir}/category_delete.png" alt="{'delete_translation'|@translate}" ></a>
+	            </td>
+	          </tr>
+          </table>
+          <!-- END news_translation -->
+      </td>    
+    </tr>
+  </table>
+</form>
+<!-- END news -->
+
+
+
+
+<!-- BEGIN title_edit_news -->
+<div class="titrePage">
+  <ul class="categoryActions">
+    <li><a href="{$U_HELP}" onclick="popuphelp(this.href); return false;" title="{'Help'|@translate}"><img src="{$themeconf.icon_dir}/help.png" class="button" alt="(?)"></a></li>
+    <li><a href="{$URL}" title="{'back'|@translate}" {$TAG_INPUT_ENABLED} ><img src="{$pwg_root}{$themeconf.icon_dir}/category_delete.png" alt="{'back'|@translate}" ></a></li>
+    <li><a href="{$U_NEWS}" title="{'back_news_hint'|@translate}"><img src="{$pwg_root}{$themeconf.icon_dir}/up.png" alt="{'back_news_hint'|@translate}"></a></li>
+  </ul>
+  <h2>{'modify_translation'|@translate}</h2>
+</div>
+<!-- END title_edit_news -->
+
+<!-- BEGIN new_news -->
+<div class="titrePage">
+  <ul class="categoryActions">
+    <a href="{$U_NEWS}" title="{'back_news_hint'|@translate}"><img src="{$pwg_root}{$themeconf.icon_dir}/up.png" alt="{'back_news_hint'|@translate}"></a>
+  </ul>
+  <h2>{'post_news'|@translate}</h2>
+</div>
+<!-- END new_news -->
+
+<!-- BEGIN news_translation -->
+<div class="titrePage">
+  <ul class="categoryActions">
+    <a href="{$U_NEWS}" title="{'back_news_hint'|@translate}"><img src="{$pwg_root}{$themeconf.icon_dir}/up.png" alt="{'back_news_hint'|@translate}"></a>
+  </ul>
+  <h2>{'post_translation'|@translate}</h2>
+</div>
+<!-- END news_translation -->
+
+<!-- BEGIN form -->
+<form action="{$F_ACTION}" method="POST" name="publie">
+  <fieldset>
+    <legend>{'Informations'|@translate}</legend>
+    <table>
+      <tr>
+	      <td><strong>{'title'|@translate}</strong></td>
+	      <td><input name="title" type="text" size="75" maxlength="150" value="{$TITLE}" ></td>
+      </tr>
+
+      <tr>
+        <td><strong>{'news_description'|@translate}</strong></td>
+	      <td><textarea cols="70" rows="10" name="content" >{$CONTENT}</textarea></td>
+      </tr>
+      <tr>
+        <td><strong>{'langue'|@translate}</strong></td>
+        <td>{$LANG_SELECT}</td>
+      </tr>
+    </table>
+  </fieldset>
+  <p style="text-align:center;">
+    <input type="hidden" name="author" value="{$AUTHOR}" {$TAG_INPUT_ENABLED} >
+    <input type="hidden" name="idn" value="{$new_id}" {$TAG_INPUT_ENABLED} >
+    <input type="hidden" name="idt" value="{$NEWS_TRANSLATION_ID}" {$TAG_INPUT_ENABLED} >
+    <input type="submit" name="{$SUBMIT_NAME}" value="{'submit'|@translate}" class="bouton" {$TAG_INPUT_ENABLED} >
+  </p>
+</form>
+<!-- END form -->
+
+<br>
Index: extensions/NBC_News/trunk/admin/template/news_admin_perm.tpl
===================================================================
--- extensions/NBC_News/trunk/admin/template/news_admin_perm.tpl	(revision 5179)
+++ extensions/NBC_News/trunk/admin/template/news_admin_perm.tpl	(revision 5179)
@@ -0,0 +1,41 @@
+<div class="titrePage">
+  <ul class="categoryActions">
+    <li><a href="{U_HELP}" onclick="popuphelp(this.href); return false;" title="{lang:Help}"><img src="{themeconf:icon_dir}/help.png" class="button" alt="(?)"></a></li>
+  </ul>
+  <h2>{TITLE}</h2>
+  {TABSHEET}
+</div>
+
+<!-- BEGIN groups_refused -->
+<fieldset>
+  <legend>{lang:News refused thanks to group associations}</legend>
+
+  <ul>
+    <!-- BEGIN news -->
+    <li>{groups_refused.news.NAME}</li>
+    <!-- END news -->
+  </ul>
+</fieldset>
+<!-- END groups_refused -->
+
+<!-- BEGIN groups_authorized -->
+<fieldset>
+  <legend>{lang:News authorized thanks to group associations}</legend>
+
+  <ul>
+    <!-- BEGIN news -->
+    <li>{groups_authorized.news.NAME}</li>
+    <!-- END news -->
+  </ul>
+</fieldset>
+<!-- END groups_authorized -->
+
+<fieldset>
+  <legend>{lang:Other private news}</legend>
+
+  <form method="post" action="{F_ACTION}" {TAG_INPUT_ENABLED} >
+    {NEWS_DOUBLE_SELECT}
+  </form>
+
+  <p>{lang:Only private news are listed}</p>
+</fieldset>
Index: extensions/NBC_News/trunk/admin/template/news_config.tpl
===================================================================
--- extensions/NBC_News/trunk/admin/template/news_config.tpl	(revision 5179)
+++ extensions/NBC_News/trunk/admin/template/news_config.tpl	(revision 5179)
@@ -0,0 +1,45 @@
+<div class="titrePage">
+  <ul class="categoryActions">
+    <li><a href="{U_HELP}" onclick="popuphelp(this.href); return false;" title="{lang:Help}"><img src="{themeconf:icon_dir}/help.png" class="button" alt="(?)"></a></li>
+  </ul>
+  <h2>{lang:config}</h2>
+  {TABSHEET}
+</div>
+
+<form name="nbc_news" method="post" action="{NBC_News_F_ACTION}" class="general">
+  <fieldset>
+	 <legend>{lang:nbc_news_config_section}</legend>
+	 
+    <label>{lang:nbc_news_config_description}</label>
+
+    <br>
+    <br>
+
+    <label>
+      {lang:nb_news_homepage}<br>
+      <input type="text" name="nb_homepage" value="{nb_homepage_CONTENT}" size="20" {TAG_INPUT_ENABLED} />
+    </label>
+		  
+    <br>
+    <br>
+
+    <label>
+      {lang:nb_news_page}<br>
+      <input type="text" name="nb_page" value="{nb_page_CONTENT}" size="20" {TAG_INPUT_ENABLED} />
+    </label>
+		  
+    <br>
+    <br>
+
+    <label>
+      {lang:nb_news_page_option}<br>
+      <input type="text" name="nb_page_option" value="{nb_page_option_CONTENT}" size="50" {TAG_INPUT_ENABLED} />
+    </label>
+		  
+  </fieldset>
+
+  <p style="text-align:center;">
+    <input type="submit" name="submit" value="{lang:submit}" class="bouton" {TAG_INPUT_ENABLED} />
+  </p>
+
+</form>
Index: extensions/NBC_News/trunk/admin/template/news_double_select.tpl
===================================================================
--- extensions/NBC_News/trunk/admin/template/news_double_select.tpl	(revision 5179)
+++ extensions/NBC_News/trunk/admin/template/news_double_select.tpl	(revision 5179)
@@ -0,0 +1,35 @@
+<table class="newsdoubleSelect">
+  <tr>
+    <td>
+      <h3>{lang:news_authorized}</h3>
+      <select class="newsList" name="news_true[]" multiple="multiple" size="20">
+        <!-- BEGIN news_option_true -->
+        <option {news_option_true.SELECTED} value="{news_option_true.VALUE}">{news_option_true.OPTION}</option>
+        <!-- END news_option_true -->
+      </select>
+      <p><input type="submit" value="&raquo;" name="falsify" style="font-size:15px;" {TAG_INPUT_ENABLED}/></p>
+    </td>
+
+    <td>
+      <h3>{lang:news_notused}</h3>
+      <select class="newsList" name="news_false[]" multiple="multiple" size="20">
+        <!-- BEGIN news_option_false -->
+        <option {news_option_false.SELECTED} value="{news_option_false.VALUE}">{news_option_false.OPTION}</option>
+        <!-- END news_option_false -->
+      </select>
+      <p><input type="submit" value="&laquo;" name="trueify" style="font-size:15px;" {TAG_INPUT_ENABLED}/>
+      <input type="submit" value="&raquo;" name="refusify" style="font-size:15px;" {TAG_INPUT_ENABLED}/></p>
+    </td>
+
+    <td>
+      <h3>{lang:news_refused}</h3>
+      <select class="newsList" name="news_refuse[]" multiple="multiple" size="20">
+        <!-- BEGIN news_option_refuse -->
+        <option {news_option_refuse.SELECTED} value="{news_option_refuse.VALUE}">{news_option_refuse.OPTION}</option>
+        <!-- END news_option_refuse -->
+      </select>
+      <p><input type="submit" value="&laquo;" name="falsify" style="font-size:15px;" {TAG_INPUT_ENABLED}/></p>
+    </td>
+
+  </tr>
+</table>
Index: extensions/NBC_News/trunk/admin/template/news_group_list.tpl
===================================================================
--- extensions/NBC_News/trunk/admin/template/news_group_list.tpl	(revision 5179)
+++ extensions/NBC_News/trunk/admin/template/news_group_list.tpl	(revision 5179)
@@ -0,0 +1,24 @@
+<div class="titrePage">
+  <ul class="categoryActions">
+    <li><a href="{U_HELP}" onclick="popuphelp(this.href); return false;" title="{lang:Help}"><img src="{themeconf:icon_dir}/help.png" class="button" alt="(?)"></a></li>
+  </ul>
+  <h2>{lang:title_groups}</h2>
+  {TABSHEET}
+</div>
+
+<table class="table2">
+  <tr class="throw">
+    <th>{lang:Group name}</th>
+    <th>{lang:Members}</th>
+    <th>{lang:Actions}</th>
+  </tr>
+  <!-- BEGIN group -->
+  <tr class="{group.CLASS}">
+    <td>{group.NAME}</td>
+    <td><a href="{group.U_MEMBERS}">{group.MEMBERS}</a></td>
+    <td style="text-align:center;">
+      <a href="{group.U_PERM}"><img src="{themeconf:icon_dir}/permissions.png" class="button" style="border:none" alt="permissions" title="{lang:permissions}" /></a>
+    </td>
+  </tr>
+  <!-- END group -->
+</table>
Index: extensions/NBC_News/trunk/admin/template/news_perm.tpl
===================================================================
--- extensions/NBC_News/trunk/admin/template/news_perm.tpl	(revision 5179)
+++ extensions/NBC_News/trunk/admin/template/news_perm.tpl	(revision 5179)
@@ -0,0 +1,98 @@
+<div class="titrePage">
+  <ul class="categoryActions">
+    <li><a href="{U_HELP}" onclick="popuphelp(this.href); return false;" title="{lang:Help}"><img src="{themeconf:icon_dir}/help.png" class="button" alt="(?)"></a></li>
+  </ul>
+  <h2>{lang:Manage_permissions_for_a_news}</h2>
+  {TABSHEET}
+</div>
+
+<h3>{NEWS_NAV}</h3>
+
+<form action="{F_ACTION}" method="post" id="categoryPermissions">
+
+  <h4>{lang:Groups}</h4>
+
+  <fieldset>
+    <legend>{lang:news_Permission granted}</legend>
+    <ul>
+      <!-- BEGIN group_granted -->
+      <li><label><input type="checkbox" name="deny_groups[]" value="{group_granted.ID}" /> {group_granted.NAME}</label></li>
+      <!-- END group_granted -->
+    </ul>
+    <input type="submit" name="deny_granted_groups_submit" value="{lang:news_Deny selected groups}" {TAG_INPUT_ENABLED}/>
+  </fieldset>
+
+  <fieldset>
+    <legend>{lang:news_Permission refused}</legend>
+    <ul>
+      <!-- BEGIN group_refused -->
+      <li><label><input type="checkbox" name="refuse_groups[]" value="{group_refused.ID}"> {group_refused.NAME}</label></li>
+      <!-- END group_refused -->
+    </ul>
+    <input type="submit" name="deny_refused_groups_submit" value="{lang:news_Deny selected groups}" {TAG_INPUT_ENABLED}/>
+  </fieldset>
+
+  <fieldset>
+    <legend>{lang:news_Permission denied}</legend>
+    <ul>
+      <!-- BEGIN group_denied -->
+      <li><label><input type="checkbox" name="grant_groups[]" value="{group_denied.ID}"> {group_denied.NAME}</label></li>
+      <!-- END group_denied -->
+    </ul>
+    <input type="submit" name="grant_groups_submit" value="{lang:news_Grant selected groups}" {TAG_INPUT_ENABLED}/>
+    <input type="submit" name="refuse_groups_submit" value="{lang:news_Refuse selected groups}" {TAG_INPUT_ENABLED}/>
+  </fieldset>
+
+  <h4>{lang:Users}</h4>
+  
+  <fieldset>
+    <legend>{lang:news_Permission granted}</legend>
+    <ul>
+      <!-- BEGIN user_granted -->
+      <li><label><input type="checkbox" name="deny_users[]" value="{user_granted.ID}" /> {user_granted.NAME}</label></li>
+      <!-- END user_granted -->
+    </ul>
+    <input type="submit" name="deny_granted_users_submit" value="{lang:news_Deny selected users}" {TAG_INPUT_ENABLED}/>
+  </fieldset>
+
+  <fieldset>
+    <legend>{lang:news_Permission granted thanks to a group}</legend>
+    <ul>
+      <!-- BEGIN user_granted_indirect -->
+      <li><label><input type="checkbox" name="grant_indirect_users[]" value="{user_granted_indirect.ID}"> {user_granted_indirect.NAME} ({user_granted_indirect.GROUP})</label></li>
+      <!-- END user_granted_indirect -->
+    </ul>
+    <input type="submit" name="refuse_indirect_users_submit" value="{lang:news_Refuse selected users}" {TAG_INPUT_ENABLED}/>
+  </fieldset>
+
+  <fieldset>
+    <legend>{lang:news_Permission refused}</legend>
+    <ul>
+      <!-- BEGIN user_refused -->
+      <li><label><input type="checkbox" name="refuse_users[]" value="{user_refused.ID}"> {user_refused.NAME}</label></li>
+      <!-- END user_refused -->
+    </ul>
+    <input type="submit" name="deny_refused_users_submit" value="{lang:news_Deny selected users}" {TAG_INPUT_ENABLED}/>
+  </fieldset>
+
+  <fieldset>
+    <legend>{lang:news_Permission refused thanks to a group}</legend>
+    <ul>
+      <!-- BEGIN user_refused_indirect -->
+      <li>{user_refused_indirect.NAME} ({user_refused_indirect.GROUP})</li>
+      <!-- END user_refused_indirect -->
+    </ul>
+  </fieldset>
+
+  <fieldset>
+    <legend>{lang:news_Permission denied}</legend>
+    <ul>
+      <!-- BEGIN user_denied -->
+      <li><label><input type="checkbox" name="grant_users[]" value="{user_denied.ID}"> {user_denied.NAME}</label></li>
+      <!-- END user_denied -->
+    </ul>
+    <input type="submit" name="grant_users_submit" value="{lang:news_Grant selected users}" {TAG_INPUT_ENABLED}/>
+    <input type="submit" name="refuse_users_submit" value="{lang:news_Refuse selected users}" {TAG_INPUT_ENABLED}/>
+  </fieldset>
+
+</form>
Index: extensions/NBC_News/trunk/admin/template/news_user_list.tpl
===================================================================
--- extensions/NBC_News/trunk/admin/template/news_user_list.tpl	(revision 5179)
+++ extensions/NBC_News/trunk/admin/template/news_user_list.tpl	(revision 5179)
@@ -0,0 +1,23 @@
+<div class="titrePage">
+  <ul class="categoryActions">
+    <li><a href="{U_HELP}" onclick="popuphelp(this.href); return false;" title="{lang:Help}"><img src="{themeconf:icon_dir}/help.png" class="button" alt="(?)"></a></li>
+  </ul>
+  <h2>{lang:title_users}</h2>
+  {TABSHEET}
+</div>
+
+
+<table class="table2">
+  <tr class="throw">
+    <th>{lang:user name}</th>
+    <th>{lang:Actions}</th>
+  </tr>
+  <!-- BEGIN user -->
+  <tr class="{user.CLASS}">
+    <td>{user.NAME}</td>
+    <td style="text-align:center;">
+      <a href="{user.U_PERM}"><img src="{themeconf:icon_dir}/permissions.png" class="button" style="border:none" alt="permissions" title="{lang:permissions}" /></a>
+    </td>
+  </tr>
+  <!-- END user -->
+</table>
Index: extensions/NBC_News/trunk/include/constants.php
===================================================================
--- extensions/NBC_News/trunk/include/constants.php	(revision 5179)
+++ extensions/NBC_News/trunk/include/constants.php	(revision 5179)
@@ -0,0 +1,12 @@
+<?php
+
+global $prefixeTable;
+
+define('NEWS_TABLE', $prefixeTable.'news');
+define('NEWS_GROUP_ACCESS_TABLE', $prefixeTable.'news_group_access');
+define('NEWS_GROUP_REFUSED_TABLE', $prefixeTable.'news_group_refused');
+define('NEWS_TRANSLATION_TABLE', $prefixeTable.'news_translation');
+define('NEWS_USER_ACCESS_TABLE', $prefixeTable.'news_user_access');
+define('NEWS_USER_REFUSED_TABLE', $prefixeTable.'news_user_refused');
+
+?>
Index: extensions/NBC_News/trunk/include/functions_news.inc.php
===================================================================
--- extensions/NBC_News/trunk/include/functions_news.inc.php	(revision 5179)
+++ extensions/NBC_News/trunk/include/functions_news.inc.php	(revision 5179)
@@ -0,0 +1,125 @@
+<?php
+
+//language select creation
+function news_language_select($available_lang,$default, $select_name = "language")
+{
+  $lang_select = '<select name="' . $select_name . '">';
+  foreach ($available_lang as $code => $displayname)
+  {
+    $selected = ( strtolower($default) == strtolower($code) ) ? ' selected="selected"' : '';
+    $lang_select .= '<option value="' . $code . '"' . $selected . '>' . ucwords($displayname) . '</option>';
+  }
+  
+  $lang_select .= '</select>';
+
+  return $lang_select;
+}
+
+function display_select_news_wrapper($query, $selecteds, $blockname)
+{
+  $result = pwg_query($query);
+  
+  $news = array();
+  
+  if (!empty($result))
+  {
+    while ($row = mysql_fetch_array($result))
+    {
+      array_push($news, $row);
+    }
+  }
+  display_select_news($news, $selecteds, $blockname);
+}
+
+function display_select_news($news, $selecteds, $blockname)
+{
+  global $template;
+
+  foreach ($news as $new)
+  {
+    $selected = '';
+    if (in_array($new['id'], $selecteds))
+    {
+      $selected = ' selected="selected"';
+    }
+
+    $option = '['.$new['new_id'].'] - '.$new['title'];
+
+    $template->assign_block_vars(
+      $blockname,
+      array('SELECTED'=>$selected,
+            'VALUE'=>$new['new_id'],
+            'OPTION'=>$option
+        ));
+  }
+}
+
+
+function calculate_news_permissions($user_id)
+{
+  global $user;
+
+  $private_array = array();
+  $authorized_array = array();
+  $refused_array = array();
+
+  $query = '
+    SELECT id
+    FROM '.NEWS_TABLE.'
+    WHERE status = \'private\'
+    ;';
+  $result = pwg_query($query);
+
+  while ($row = mysql_fetch_array($result))
+  {
+    array_push($private_array, $row['id']);
+  }
+
+  // retrieve news ids directly refused to the user
+  $query = '
+    SELECT new_id
+    FROM '.NEWS_USER_REFUSED_TABLE.'
+    WHERE user_id = '.$user_id.'
+    ;';
+  $refused_array = array_from_query($query, 'new_id');
+
+  // retrieve news ids directly authorized to the user
+  $query = '
+    SELECT new_id
+    FROM '.NEWS_USER_ACCESS_TABLE.'
+    WHERE user_id = '.$user_id.'
+    ;';
+  $authorized_array = array_from_query($query, 'new_id');
+
+  // retrieve news ids refuseded to the groups the user belongs to
+  $query = '
+    SELECT new_id
+    FROM '.NEWS_GROUP_REFUSED_TABLE.' AS ngr
+    INNER JOIN '.USER_GROUP_TABLE.' AS ug ON ug.group_id = ngr.group_id
+    WHERE ug.user_id = '.$user_id.'
+    ;';
+  $refused_array = array_unique(array_merge($refused_array, array_from_query($query, 'new_id')));
+
+  // retrieve news ids authorized to the groups the user belongs to
+  $query = '
+    SELECT new_id
+    FROM '.NEWS_GROUP_ACCESS_TABLE.' AS nga
+    INNER JOIN '.USER_GROUP_TABLE.' AS ug ON ug.group_id = nga.group_id
+    WHERE ug.user_id = '.$user_id.'
+    ;';
+  $authorized_array = array_unique(array_merge($authorized_array, array_from_query($query, 'new_id')));
+
+  // only unauthorized private + refused categories are forbidden
+  $forbidden_array = array_unique(array_merge($refused_array, array_diff($private_array, $authorized_array)));
+
+  if ( empty($forbidden_array) )
+  {// at least, the list contains 0 value. This news does not exists so
+   // where clauses such as "WHERE news_id NOT IN(0)" will always be
+   // true.
+    array_push($forbidden_array, 0);
+  }
+
+  return implode(',', $forbidden_array);
+}
+
+?>
Index: extensions/NBC_News/trunk/include/index.php
===================================================================
--- extensions/NBC_News/trunk/include/index.php	(revision 5179)
+++ extensions/NBC_News/trunk/include/index.php	(revision 5179)
@@ -0,0 +1,33 @@
+<?php
+// +-----------------------------------------------------------------------+
+// | PhpWebGallery - a PHP based picture gallery                           |
+// | Copyright (C) 2002-2003 Pierrick LE GALL - pierrick@phpwebgallery.net |
+// | Copyright (C) 2003-2007 PhpWebGallery Team - http://phpwebgallery.net |
+// +-----------------------------------------------------------------------+
+// | file          : $Id: index.php 1912 2007-03-16 06:30:07Z rub $
+// | last update   : $Date: 2007-03-16 07:30:07 +0100 (ven, 16 mar 2007) $
+// | last modifier : $Author: rub $
+// | revision      : $Revision: 1912 $
+// +-----------------------------------------------------------------------+
+// | This program 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                                          |
+// |                                                                       |
+// | This program 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 this program; if not, write to the Free Software           |
+// | Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, |
+// | USA.                                                                  |
+// +-----------------------------------------------------------------------+
+
+// Recursive call
+$url = '../';
+header( 'Request-URI: '.$url );
+header( 'Content-Location: '.$url );
+header( 'Location: '.$url );
+exit();
+?>
Index: extensions/NBC_News/trunk/index.php
===================================================================
--- extensions/NBC_News/trunk/index.php	(revision 5179)
+++ extensions/NBC_News/trunk/index.php	(revision 5179)
@@ -0,0 +1,33 @@
+<?php
+// +-----------------------------------------------------------------------+
+// | PhpWebGallery - a PHP based picture gallery                           |
+// | Copyright (C) 2002-2003 Pierrick LE GALL - pierrick@phpwebgallery.net |
+// | Copyright (C) 2003-2007 PhpWebGallery Team - http://phpwebgallery.net |
+// +-----------------------------------------------------------------------+
+// | file          : $Id: index.php 1912 2007-03-16 06:30:07Z rub $
+// | last update   : $Date: 2007-03-16 07:30:07 +0100 (ven, 16 mar 2007) $
+// | last modifier : $Author: rub $
+// | revision      : $Revision: 1912 $
+// +-----------------------------------------------------------------------+
+// | This program 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                                          |
+// |                                                                       |
+// | This program 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 this program; if not, write to the Free Software           |
+// | Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, |
+// | USA.                                                                  |
+// +-----------------------------------------------------------------------+
+
+// Recursive call
+$url = '../';
+header( 'Request-URI: '.$url );
+header( 'Content-Location: '.$url );
+header( 'Location: '.$url );
+exit();
+?>
Index: extensions/NBC_News/trunk/language/en_UK/index.php
===================================================================
--- extensions/NBC_News/trunk/language/en_UK/index.php	(revision 5179)
+++ extensions/NBC_News/trunk/language/en_UK/index.php	(revision 5179)
@@ -0,0 +1,33 @@
+<?php
+// +-----------------------------------------------------------------------+
+// | PhpWebGallery - a PHP based picture gallery                           |
+// | Copyright (C) 2002-2003 Pierrick LE GALL - pierrick@phpwebgallery.net |
+// | Copyright (C) 2003-2007 PhpWebGallery Team - http://phpwebgallery.net |
+// +-----------------------------------------------------------------------+
+// | file          : $Id: index.php 1912 2007-03-16 06:30:07Z rub $
+// | last update   : $Date: 2007-03-16 07:30:07 +0100 (ven, 16 mar 2007) $
+// | last modifier : $Author: rub $
+// | revision      : $Revision: 1912 $
+// +-----------------------------------------------------------------------+
+// | This program 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                                          |
+// |                                                                       |
+// | This program 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 this program; if not, write to the Free Software           |
+// | Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, |
+// | USA.                                                                  |
+// +-----------------------------------------------------------------------+
+
+// Recursive call
+$url = '../';
+header( 'Request-URI: '.$url );
+header( 'Content-Location: '.$url );
+header( 'Location: '.$url );
+exit();
+?>
Index: extensions/NBC_News/trunk/language/en_UK/plugin.lang.php
===================================================================
--- extensions/NBC_News/trunk/language/en_UK/plugin.lang.php	(revision 5179)
+++ extensions/NBC_News/trunk/language/en_UK/plugin.lang.php	(revision 5179)
@@ -0,0 +1,62 @@
+<?php
+$lang['title_admin_news'] = 'Management of news';
+$lang['delete_translation'] = 'Delete this translation';
+$lang['delete_news'] = 'Delete this news';
+$lang['post_translation'] = 'Post a translation';
+$lang['modify_translation'] = 'Modify a translation';
+$lang['post_news'] = 'Post a news';
+$lang['news_added'] = 'Your news has been registered';
+$lang['news_deleted'] = 'The news has been deleted';
+$lang['translation_added'] = 'Your translation has been registered';
+$lang['translation_deleted'] = 'The translation has been deleted';
+$lang['translation_altered'] = 'The translation has been altered';
+$lang['back'] = 'Back';
+$lang['back_news_hint'] = 'Back to the news';
+$lang['title'] = 'Title';
+$lang['langue'] = 'Language';
+$lang['news_description'] = 'Content';
+$lang['news_status'] = 'Status';
+$lang['status_public'] = 'Public ';
+$lang['status_private'] = 'Private';
+$lang['Manage_permissions_for_a_news'] = 'Manage permissions for a news';
+$lang['managenews'] = 'Manage';
+$lang['newsuserperm'] = 'User\'s rights';
+$lang['newsgroupperm'] = 'Group\'s rights';
+$lang['News authorized thanks to group associations'] = 'News authorized thanks to group associations';
+$lang['News refused thanks to group associations'] = 'News refused thanks to group associations';
+$lang['Other private news'] = 'Other private news';
+$lang['Only private news are listed'] = 'Only private news are listed';
+$lang['title_users'] = 'Users management';
+$lang['user name'] = 'User name';
+$lang['news_change_status_submit'] = 'Change access type';
+$lang['news_status_changed'] = 'The news has changed of access type : ';
+$lang['news_Permission denied'] = 'Not used';
+$lang['news_Permission granted thanks to a group'] = 'Permission granted thanks to a group';
+$lang['news_Permission granted'] = 'Permission granted';
+$lang['news_Permission refused thanks to a group'] = 'Permission refused thanks to a group';
+$lang['news_Permission refused'] = 'Permission refused';
+$lang['news_authorized'] = 'Granted';
+$lang['news_notused'] = 'Not used';
+$lang['news_refused'] = 'Refused';
+$lang['news_Deny selected groups'] = 'Deny selected groups';
+$lang['news_Deny selected users'] = 'Deny selected users';
+$lang['news_Refuse selected groups'] = 'Refuse selected groups';
+$lang['news_Refuse selected users'] = 'Refuse selected users';
+$lang['news_Grant selected groups'] = 'Grant selected groups';
+$lang['news_Grant selected users'] = 'Grant selected users';
+
+$lang['title_news'] = 'Last news';
+$lang['hint_news'] = 'See last news';
+$lang['no_news_translation'] = 'This news has not been translated in your language';
+$lang['news'] = 'News';
+$lang['news_per_page'] = 'news per page';
+$lang['read_more']='Read more';
+
+$lang['nb_news_homepage']='default number of news to display on homepage';
+$lang['nb_news_page']='default number of news to display on news page, please choose a value of \'nb_news_page_option\' array';
+$lang['nb_news_page_option']='options for X number of news to display on news page';
+
+$lang['nbc_news_config_section'] = 'Settings of NBC News';
+$lang['nbc_news_config_description'] = 'Set your News.';
+$lang['nbc_news_save_config']='Configuration saved.';
+?>
Index: extensions/NBC_News/trunk/language/es_ES/index.php
===================================================================
--- extensions/NBC_News/trunk/language/es_ES/index.php	(revision 5179)
+++ extensions/NBC_News/trunk/language/es_ES/index.php	(revision 5179)
@@ -0,0 +1,33 @@
+<?php
+// +-----------------------------------------------------------------------+
+// | PhpWebGallery - a PHP based picture gallery                           |
+// | Copyright (C) 2002-2003 Pierrick LE GALL - pierrick@phpwebgallery.net |
+// | Copyright (C) 2003-2007 PhpWebGallery Team - http://phpwebgallery.net |
+// +-----------------------------------------------------------------------+
+// | file          : $Id: index.php 1912 2007-03-16 06:30:07Z rub $
+// | last update   : $Date: 2007-03-16 07:30:07 +0100 (ven, 16 mar 2007) $
+// | last modifier : $Author: rub $
+// | revision      : $Revision: 1912 $
+// +-----------------------------------------------------------------------+
+// | This program 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                                          |
+// |                                                                       |
+// | This program 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 this program; if not, write to the Free Software           |
+// | Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, |
+// | USA.                                                                  |
+// +-----------------------------------------------------------------------+
+
+// Recursive call
+$url = '../';
+header( 'Request-URI: '.$url );
+header( 'Content-Location: '.$url );
+header( 'Location: '.$url );
+exit();
+?>
Index: extensions/NBC_News/trunk/language/es_ES/plugin.lang.php
===================================================================
--- extensions/NBC_News/trunk/language/es_ES/plugin.lang.php	(revision 5179)
+++ extensions/NBC_News/trunk/language/es_ES/plugin.lang.php	(revision 5179)
@@ -0,0 +1,62 @@
+<?php
+$lang['title_admin_news'] = 'Gestión de las noticias';
+$lang['delete_translation'] = 'Suprimir la traducción';
+$lang['delete_news'] = 'Suprimir esta noticia';
+$lang['post_translation'] = 'Enviar una traducción';
+$lang['modify_translation'] = 'Modificar la traducción';
+$lang['post_news'] = 'Enviar una noticia';
+$lang['news_added'] = 'Su noticia ha sido registrada';
+$lang['news_deleted'] = 'La noticia ha sido suprimida';
+$lang['translation_added'] = 'Su traducción ha sido registrada';
+$lang['translation_deleted'] = 'La traducción ha sido suprimida';
+$lang['translation_altered'] = 'La traducción ha sido modificada';
+$lang['back'] = 'Vuelta ello arriere';
+$lang['back_news_hint'] = 'Vuelta en la página del news';
+$lang['title'] = 'Título';
+$lang['langue'] = 'Idioma';
+$lang['news_description'] = 'Descripción';
+$lang['news_status'] = 'Tipo de acceso';
+$lang['status_public'] = 'Pública ';
+$lang['status_private'] = 'Intimidad';
+$lang['Manage_permissions_for_a_news'] = 'Administrar los permisos de News';
+$lang['managenews'] = 'Gestión';
+$lang['newsuserperm'] = 'Derechos Utilizador';
+$lang['newsgroupperm'] = 'Derechos Grupo';
+$lang['News authorized thanks to group associations'] = 'News accesibles por la pertenencia a los grupos';
+$lang['News refused thanks to group associations'] = 'News negados por la pertenencia a los grupos';
+$lang['Other private news'] = 'News privadas';
+$lang['Only private news are listed'] = 'Las únicas el news particular son puestos en una lista';
+$lang['title_users'] = 'Gestión de los utilizadores';
+$lang['user name'] = 'Nombre del utilizador';
+$lang['news_change_status_submit'] = 'Cambiar el tipo de acceso';
+$lang['news_status_changed'] = 'La noticia cambió de tipo de acceso : ';
+$lang['news_Permission denied'] = 'No inutilizado';
+$lang['news_Permission granted thanks to a group'] = 'Acceso autorizado por la pertenencia a los grupos';
+$lang['news_Permission granted'] = 'Acceso autorizado';
+$lang['news_Permission refused thanks to a group'] = 'Acceso negado por la pertenencia a los grupos';
+$lang['news_Permission refused'] = 'Acceso negado';
+$lang['news_authorized'] = 'Autorizados';
+$lang['news_notused'] = 'No utilizado';
+$lang['news_refused'] = 'Negados';
+$lang['news_Deny selected groups'] = 'Inutilizado los grupos seleccionados';
+$lang['news_Deny selected users'] = 'Inutilizado los utilizadores seleccionados';
+$lang['news_Refuse selected groups'] = 'Negar el acceso a los grupos seleccionados';
+$lang['news_Refuse selected users'] = 'Negarles el acceso a los utilizadores seleccionados';
+$lang['news_Grant selected groups'] = 'Dar el acceso a los grupos seleccionados';
+$lang['news_Grant selected users'] = 'Darles el acceso a los utilizadores seleccionados';
+
+$lang['title_news'] = 'Últimas noticias';
+$lang['hint_news'] = 'Ver las últimas noticias';
+$lang['no_news_translation'] = 'No hay traducción de esta noticia en su lengua';
+$lang['news'] = 'Noticias';
+$lang['news_per_page'] = 'Noticias por página';
+$lang['read_more']='Leer la continuación';
+
+$lang['nb_news_homepage']='Número por defecto de news que hay que fijar sobre la página inicial';
+$lang['nb_news_page']='Número por defecto de news que hay que fijar sobre la página NEWS, escoja un valor del conjunto \'nb_news_page_option\'';
+$lang['nb_news_page_option']='OOpciones para X enumera de news que hay que fijar sobre la página NEWS';
+
+$lang['nbc_news_config_section'] = 'Configuración de NBC News';
+$lang['nbc_news_config_description'] = 'Configure vuestros News.';
+$lang['nbc_news_save_config']='Configuración registrada.';
+?>
Index: extensions/NBC_News/trunk/language/fr_FR/index.php
===================================================================
--- extensions/NBC_News/trunk/language/fr_FR/index.php	(revision 5179)
+++ extensions/NBC_News/trunk/language/fr_FR/index.php	(revision 5179)
@@ -0,0 +1,33 @@
+<?php
+// +-----------------------------------------------------------------------+
+// | PhpWebGallery - a PHP based picture gallery                           |
+// | Copyright (C) 2002-2003 Pierrick LE GALL - pierrick@phpwebgallery.net |
+// | Copyright (C) 2003-2007 PhpWebGallery Team - http://phpwebgallery.net |
+// +-----------------------------------------------------------------------+
+// | file          : $Id: index.php 1912 2007-03-16 06:30:07Z rub $
+// | last update   : $Date: 2007-03-16 07:30:07 +0100 (ven, 16 mar 2007) $
+// | last modifier : $Author: rub $
+// | revision      : $Revision: 1912 $
+// +-----------------------------------------------------------------------+
+// | This program 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                                          |
+// |                                                                       |
+// | This program 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 this program; if not, write to the Free Software           |
+// | Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, |
+// | USA.                                                                  |
+// +-----------------------------------------------------------------------+
+
+// Recursive call
+$url = '../';
+header( 'Request-URI: '.$url );
+header( 'Content-Location: '.$url );
+header( 'Location: '.$url );
+exit();
+?>
Index: extensions/NBC_News/trunk/language/fr_FR/plugin.lang.php
===================================================================
--- extensions/NBC_News/trunk/language/fr_FR/plugin.lang.php	(revision 5179)
+++ extensions/NBC_News/trunk/language/fr_FR/plugin.lang.php	(revision 5179)
@@ -0,0 +1,62 @@
+<?php
+$lang['title_admin_news'] = 'Gestion des nouvelles';
+$lang['delete_translation'] = 'Supprimer la traduction';
+$lang['delete_news'] = 'Supprimer cette nouvelle';
+$lang['post_translation'] = 'Poster une traduction';
+$lang['modify_translation'] = 'Modifier la traduction';
+$lang['post_news'] = 'Poster une nouvelle';
+$lang['news_added'] = 'Votre nouvelle a été enregistrée';
+$lang['news_deleted'] = 'La nouvelle a été supprimée';
+$lang['translation_added'] = 'Votre traduction a été enregistrée';
+$lang['translation_deleted'] = 'La traduction a été supprimée';
+$lang['translation_altered'] = 'La traduction a été modifiée';
+$lang['back'] = 'Retour en arriere';
+$lang['back_news_hint'] = 'Retour à la page des news';
+$lang['title'] = 'Titre';
+$lang['langue'] = 'Langue';
+$lang['news_description'] = 'Description';
+$lang['news_status'] = 'Type d\'accès';
+$lang['status_public'] = 'Publique ';
+$lang['status_private'] = 'Privé';
+$lang['Manage_permissions_for_a_news'] = 'Gérer les permissions de la News';
+$lang['managenews'] = 'Gestion';
+$lang['newsuserperm'] = 'Droits Utilisateur';
+$lang['newsgroupperm'] = 'Droits Groupe';
+$lang['News authorized thanks to group associations'] = 'News accessibles par l\'appartenance aux groupes';
+$lang['News refused thanks to group associations'] = 'News refusés par l\'appartenance aux groupes';
+$lang['Other private news'] = 'News privées';
+$lang['Only private news are listed'] = 'Seules les news privées sont listées';
+$lang['title_users'] = 'Gestion des utilisateurs';
+$lang['user name'] = 'Nom de l\'utilisateur';
+$lang['news_change_status_submit'] = 'Changer le type d\'accès';
+$lang['news_status_changed'] = 'La nouvelle a changée de type d\'accès : ';
+$lang['news_Permission denied'] = 'Non inutilisé';
+$lang['news_Permission granted thanks to a group'] = 'Accès autorisé par l\'appartenance aux groupes';
+$lang['news_Permission granted'] = 'Accès autorisé';
+$lang['news_Permission refused thanks to a group'] = 'Accès refusé par l\'appartenance aux groupes';
+$lang['news_Permission refused'] = 'Accès refusé';
+$lang['news_authorized'] = 'Autorisés';
+$lang['news_notused'] = 'Non utilisé';
+$lang['news_refused'] = 'Refusés';
+$lang['news_Deny selected groups'] = 'Ne pas utiliser les groupes sélectionnés';
+$lang['news_Deny selected users'] = 'Ne pas utiliser les utilisateurs sélectionnés';
+$lang['news_Refuse selected groups'] = 'Refuser l\'accès aux groupes sélectionnés';
+$lang['news_Refuse selected users'] = 'Refuser l\'accès aux utilisateurs sélectionnés';
+$lang['news_Grant selected groups'] = 'Donner l\'accès aux groupes sélectionnés';
+$lang['news_Grant selected users'] = 'Donner l\'accès aux utilisateurs sélectionnés';
+
+$lang['title_news'] = 'Dernières nouvelles';
+$lang['hint_news'] = 'Voir les dernières nouvelles';
+$lang['no_news_translation'] = 'Il n\'y a pas de traduction de cette nouvelle dans votre langue';
+$lang['news'] = 'Nouvelles';
+$lang['news_per_page'] = 'nouvelles par page';
+$lang['read_more']='Lire la suite';
+
+$lang['nb_news_homepage']='Nombre par défaut de news à afficher sur la page d\'accueil';
+$lang['nb_news_page']='Nombre par défaut de news à afficher sur la page NEWS, choisissez une valeur de l\'ensemble \'nb_news_page_option\'';
+$lang['nb_news_page_option']='Options pour X nombre de news à afficher sur la page NEWS';
+
+$lang['nbc_news_config_section'] = 'Configuration de NBC News';
+$lang['nbc_news_config_description'] = 'Configurez vos News.';
+$lang['nbc_news_save_config']='Configuration enregistrée.';
+?>
Index: extensions/NBC_News/trunk/language/index.php
===================================================================
--- extensions/NBC_News/trunk/language/index.php	(revision 5179)
+++ extensions/NBC_News/trunk/language/index.php	(revision 5179)
@@ -0,0 +1,33 @@
+<?php
+// +-----------------------------------------------------------------------+
+// | PhpWebGallery - a PHP based picture gallery                           |
+// | Copyright (C) 2002-2003 Pierrick LE GALL - pierrick@phpwebgallery.net |
+// | Copyright (C) 2003-2007 PhpWebGallery Team - http://phpwebgallery.net |
+// +-----------------------------------------------------------------------+
+// | file          : $Id: index.php 1912 2007-03-16 06:30:07Z rub $
+// | last update   : $Date: 2007-03-16 07:30:07 +0100 (ven, 16 mar 2007) $
+// | last modifier : $Author: rub $
+// | revision      : $Revision: 1912 $
+// +-----------------------------------------------------------------------+
+// | This program 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                                          |
+// |                                                                       |
+// | This program 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 this program; if not, write to the Free Software           |
+// | Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, |
+// | USA.                                                                  |
+// +-----------------------------------------------------------------------+
+
+// Recursive call
+$url = '../';
+header( 'Request-URI: '.$url );
+header( 'Content-Location: '.$url );
+header( 'Location: '.$url );
+exit();
+?>
Index: extensions/NBC_News/trunk/main.inc.php
===================================================================
--- extensions/NBC_News/trunk/main.inc.php	(revision 5179)
+++ extensions/NBC_News/trunk/main.inc.php	(revision 5179)
@@ -0,0 +1,140 @@
+<?php
+/*
+Plugin Name: NBC News
+Version: 2.0a
+Description: Permet de gerer l'afficher des news sur la 1ere page
+Plugin URI: http://phpwebgallery.net/ext/extension_view.php?eid=202
+Author: Nicco, Eric
+Author URI: http://gallery-nicco.no-ip.org/ - http://www.infernoweb.net
+*/
+
+
+/*
+
+ ***** TODO List *****
+
+Liste des choses a faire :
+
+-- gestion de la suppression d un groupe
+
+-- gestion d'une partie résumé un peu comme extended Presentation
+*/
+
+
+
+if (!defined('PHPWG_ROOT_PATH')) die('Hacking attempt!');
+define('NBC_NEWS_PATH' , PHPWG_PLUGINS_PATH.basename(dirname(__FILE__)).'/');
+
+include_once(NBC_NEWS_PATH.'include/constants.php');
+include_once(NBC_NEWS_PATH.'include/functions_news.inc.php');
+
+
+
+global $conf, $user, $im_priority;
+
+
+
+if (isset($conf['IndexManager']))
+{
+	include_once( PHPWG_PLUGINS_PATH . 'IndexManager/index_manager.php' );
+	check_indexmanager('NewsOnIndex');
+}
+
+
+
+add_event_handler('get_admin_plugin_menu_links', 'nbc_News_admin_menu');
+
+function nbc_News_admin_menu($menu)
+{
+  array_push($menu,
+    array(
+      'NAME' => 'News',
+      'URL'  => get_admin_plugin_menu_link(NBC_NEWS_PATH.'admin/news_admin.php')
+    )
+  );
+  
+  return $menu;
+}
+
+
+
+
+/* suppression de user */
+add_event_handler('delete_user', 'nbc_News_Deluser');
+
+function nbc_News_Deluser($user_id)
+{
+  $tables = array(
+    NEWS_USER_ACCESS_TABLE,
+    NEWS_USER_REFUSED_TABLE,
+  );
+
+  foreach ($tables as $table)
+  {
+    $query = '
+      DELETE FROM '.$table.'
+      WHERE user_id = '.$user_id.'
+    ;';
+    pwg_query($query);
+  }
+
+}
+
+
+
+if ( script_basename() == 'admin' and isset($_GET['page']) and $_GET['page'] == 'group_list' and isset($_GET['delete']) and is_numeric($_GET['delete']) )
+{
+  add_event_handler('loc_begin_page_tail', 'nbc_News_Delgroup');
+}
+
+function nbc_News_Delgroup()
+{
+  if ( !is_adviser() )
+  {
+    $tables = array(
+      NEWS_GROUP_ACCESS_TABLE,
+      NEWS_GROUP_REFUSED_TABLE,
+    );
+  
+    foreach ($tables as $table)
+    {
+      $query = '
+        DELETE FROM '.$table.'
+        WHERE group_id = '. $_GET['delete'].'
+      ;';
+      pwg_query($query);
+    }
+  }
+}
+
+
+
+add_event_handler('loc_end_index' , 'nbc_NewsOnIndex', isset($im_priority) ? $im_priority['NewsOnIndex'] : 40);
+
+function nbc_NewsOnIndex()
+{
+  global $page, $prefixeTable, $template;
+
+  if (isset($page['body_id']) and $page['section'] == 'categories' and (!isset($page['category'])))
+  {
+    include_once(NBC_NEWS_PATH.'NewsOnIndex.php');
+  }
+}
+
+
+
+add_event_handler('loc_end_page_header', 'nbc_NewsAddCSS' );
+
+function nbc_NewsAddCSS()
+{
+  global $template, $user;
+  
+  $template -> assign(
+    'head_element', array (
+    'CONTENT' => '<link rel="stylesheet" type="text/css" href="'.NBC_NEWS_PATH.'template/news.css">
+                  <link rel="stylesheet" type="text/css" href="'.NBC_NEWS_PATH.'template/'.$user['template'].'/theme/'.$user['theme'].'/news.css">',
+    )
+  );
+}
+
+?>
Index: extensions/NBC_News/trunk/maintain.inc.php
===================================================================
--- extensions/NBC_News/trunk/maintain.inc.php	(revision 5179)
+++ extensions/NBC_News/trunk/maintain.inc.php	(revision 5179)
@@ -0,0 +1,185 @@
+<?php
+
+if(!defined("NBC_NEWS_PATH"))
+  define('NBC_NEWS_PATH' , PHPWG_PLUGINS_PATH.basename(dirname(__FILE__)).'/');
+
+include_once(NBC_NEWS_PATH.'include/constants.php');
+
+
+function plugin_install()
+{
+  $q = '
+    INSERT INTO '.CONFIG_TABLE.' (param,value,comment)
+    VALUES ("nbc_News","3;10;5,10,25,50;","Parametres nbc_News");
+  ';
+
+  pwg_query($q);
+
+  $q = '
+    CREATE TABLE '.NEWS_TABLE.' (
+      id smallint(5) unsigned NOT NULL auto_increment,
+      date datetime NOT NULL default \'0000-00-00 00:00:00\',
+      author varchar(255) default NULL,
+      status enum(\'public\',\'private\') NOT NULL default \'public\',
+      PRIMARY KEY (id)
+    ) ENGINE=MyISAM;
+  ';
+  pwg_query($q);
+
+  $q = '
+    insert into phpwebgallery_news values (1, \'2008-01-01 12:00:00\', \'Nicco\', \'public\');
+  ';
+  pwg_query($q);
+
+  $q = '
+    CREATE TABLE '.NEWS_GROUP_ACCESS_TABLE.' (
+      group_id smallint(5) unsigned NOT NULL default \'0\',
+      new_id smallint(5) unsigned NOT NULL default \'0\',
+      PRIMARY KEY (group_id, new_id)
+    ) ENGINE=MyISAM;
+  ';
+  pwg_query($q);
+  
+  $q = '
+    CREATE TABLE '.NEWS_GROUP_REFUSED_TABLE.' (
+      group_id smallint(5) unsigned NOT NULL default \'0\',
+      new_id smallint(5) unsigned NOT NULL default \'0\',
+      PRIMARY KEY (group_id, new_id)
+    ) ENGINE=MyISAM;
+  ';
+  pwg_query($q);
+
+
+
+  $q = '
+    CREATE TABLE '.NEWS_TRANSLATION_TABLE.' (
+      id smallint(6) unsigned NOT NULL auto_increment,
+      new_id smallint(5) unsigned NOT NULL default \'0\',
+      language varchar(50) NOT NULL default \'fr_FR.iso-8859-1\',
+      title varchar(150) default NULL,
+      content longtext ,
+      PRIMARY KEY (id)
+    ) ENGINE=MyISAM;
+  ';
+  pwg_query($q);
+  
+  $q = '
+    insert  into '.NEWS_TRANSLATION_TABLE.' values 
+      (1, 1, \'fr_FR.iso-8859-1\', \'Systeme de News PWG installe\', \'Felicitation ! Le systeme de News pour PWG a ete installe !\'),
+      (2, 1, \'en_UK.iso-8859-1\', \'PWG News system installed\', \'Congratulation ! The news system for PWG has been installed !\');
+  ';
+  pwg_query($q);
+
+  $q = '
+    CREATE TABLE '.NEWS_USER_ACCESS_TABLE.' (
+      user_id smallint(5) NOT NULL,
+      new_id smallint(5) NOT NULL
+    ) ENGINE=MyISAM;
+  ';
+  pwg_query($q);
+  
+  $q = '
+    CREATE TABLE '.NEWS_USER_REFUSED_TABLE.' (
+      user_id smallint(5) NOT NULL,
+      new_id smallint(5) NOT NULL
+    ) ENGINE=MyISAM;
+  ';
+  pwg_query($q);
+
+}
+
+function plugin_deactivate()
+{
+  @unlink( PHPWG_ROOT_PATH.'news.php' );
+}
+
+function plugin_uninstall()
+{
+  global $conf;
+
+  if (isset($conf['nbc_News']))
+  {
+    $q = '
+      DELETE FROM '.CONFIG_TABLE.'
+      WHERE param="nbc_News" LIMIT 1;
+    ';
+
+    pwg_query($q);
+  }
+
+  $q = 'DROP TABLE '.NEWS_TABLE.'_SAV';
+  pwg_query($q);
+  
+  $q = 'DROP TABLE '.NEWS_GROUP_ACCESS_TABLE.'_SAV';
+  pwg_query($q);
+  
+  $q = 'DROP TABLE '.NEWS_GROUP_REFUSED_TABLE.'_SAV';
+  pwg_query($q);
+
+  $q = 'DROP TABLE '.NEWS_TRANSLATION_TABLE.'_SAV';
+  pwg_query($q);
+  
+  $q = 'DROP TABLE '.NEWS_USER_ACCESS_TABLE.'_SAV';
+  pwg_query($q);
+  
+  $q = 'DROP TABLE '.NEWS_USER_REFUSED_TABLE.'_SAV';
+  pwg_query($q);
+
+
+
+  $q = 'CREATE TABLE '.NEWS_TABLE.'_SAV AS SELECT * FROM '.NEWS_TABLE.'';
+  pwg_query($q);
+  
+  $q = 'CREATE TABLE '.NEWS_GROUP_ACCESS_TABLE.'_SAV AS SELECT * FROM '.NEWS_GROUP_ACCESS_TABLE.'';
+  pwg_query($q);
+  
+  $q = 'CREATE TABLE '.NEWS_GROUP_REFUSED_TABLE.'_SAV AS SELECT * FROM '.NEWS_GROUP_REFUSED_TABLE.'';
+  pwg_query($q);
+
+  $q = 'CREATE TABLE '.NEWS_TRANSLATION_TABLE.'_SAV AS SELECT * FROM '.NEWS_TRANSLATION_TABLE.'';
+  pwg_query($q);
+  
+  $q = 'CREATE TABLE '.NEWS_USER_ACCESS_TABLE.'_SAV AS SELECT * FROM '.NEWS_USER_ACCESS_TABLE.'';
+  pwg_query($q);
+  
+  $q = 'CREATE TABLE '.NEWS_USER_REFUSED_TABLE.'_SAV AS SELECT * FROM '.NEWS_USER_REFUSED_TABLE.'';
+  pwg_query($q);
+
+
+
+  $q = 'DROP TABLE '.NEWS_TABLE.'';
+  pwg_query($q);
+  
+  $q = 'DROP TABLE '.NEWS_GROUP_ACCESS_TABLE.'';
+  pwg_query($q);
+  
+  $q = 'DROP TABLE '.NEWS_GROUP_REFUSED_TABLE.'';
+  pwg_query($q);
+
+  $q = 'DROP TABLE '.NEWS_TRANSLATION_TABLE.'';
+  pwg_query($q);
+  
+  $q = 'DROP TABLE '.NEWS_USER_ACCESS_TABLE.'';
+  pwg_query($q);
+  
+  $q = 'DROP TABLE '.NEWS_USER_REFUSED_TABLE.'';
+  pwg_query($q);
+  
+  @unlink( dirname(__FILE__).'/_nbcnews_config.dat' );
+}
+
+function plugin_activate()
+{
+  $dir_name = basename( dirname(__FILE__) );
+  $c = <<<EOD
+<?php
+define('PHPWG_ROOT_PATH','./');
+include_once( PHPWG_ROOT_PATH. 'plugins/$dir_name/news.php');
+?>
+EOD;
+  $fp = fopen( PHPWG_ROOT_PATH.'news.php', 'w' );
+  fwrite( $fp, $c);
+  fclose( $fp );
+}
+
+?>
Index: extensions/NBC_News/trunk/news.php
===================================================================
--- extensions/NBC_News/trunk/news.php	(revision 5179)
+++ extensions/NBC_News/trunk/news.php	(revision 5179)
@@ -0,0 +1,195 @@
+<?php
+
+global $user, $template, $lang, $conf;
+
+if (!defined('PHPWG_ROOT_PATH')) define('PHPWG_ROOT_PATH','../../');
+
+include_once( PHPWG_ROOT_PATH.'include/common.inc.php' );
+
+check_status(ACCESS_GUEST);
+
+include_once('./include/constants.php');
+include_once('./include/functions_news.inc.php');
+include(get_language_filepath('plugin.lang.php', './'));
+
+
+
+$conf_nbc_News = explode(";" , $conf['nbc_News']);
+$conf['nb_news_homepage'] = $conf_nbc_News[0];
+$conf['nb_news_page'] = $conf_nbc_News[1];
+$conf['nb_news_page_option'] = explode("," ,$conf_nbc_News[2]);
+
+
+
+// detection of the start news to display
+if ( !isset( $_GET['start'] ) or !is_numeric( $_GET['start'] ) or ( is_numeric( $_GET['start'] ) and $_GET['start'] < 0 ) )
+{
+  $page['start'] = 0;
+}
+else
+{
+  $page['start'] = $_GET['start'];
+}
+
+// detection of the number of news to display per page
+if ( !isset( $_GET['nb_news_page'] ) or !is_numeric( $_GET['nb_news_page'] ) or ( is_numeric( $_GET['nb_news_page'] ) and $_GET['nb_news_page'] < 0 ) )
+{
+  $page['nb_news_page'] = $conf['nb_news_page'];
+}
+else
+{
+  $page['nb_news_page'] = $_GET['nb_news_page'];
+}
+
+
+
+// +-----------------------------------------------------------------------+
+// |                               options                                 |
+// +-----------------------------------------------------------------------+
+
+$title= $lang['title_news'];
+$template_title = $lang['title_news'];
+$page['body_id'] = 'theNewsPage';
+
+$template->set_filenames(array('news' => NBC_NEWS_PATH.'template/news.tpl'));
+
+$template->assign_vars(
+  array(
+    'U_NEWS_HOME' => PHPWG_ROOT_PATH,
+    'U_NEWS_HELP' => PHPWG_ROOT_PATH.'popuphelp.php?page=news',
+    'NEWS_CSS' => '<link rel="stylesheet" type="text/css" href="'.NBC_NEWS_PATH.'template/newspage.css">',
+  )
+);
+  
+
+
+// +-----------------------------------------------------------------------+
+// |               news per pages & nav bar display                        |
+// +-----------------------------------------------------------------------+
+
+$user['forbidden_news'] = calculate_news_permissions($user['id']);
+
+$query = '
+  SELECT COUNT(DISTINCT(id)) as nb_news
+  FROM '.NEWS_TABLE.'
+  WHERE id NOT IN ('.$user['forbidden_news'].')
+  ;';
+	
+$result = pwg_query($query);
+
+$row = mysql_fetch_array($result);
+$page['nb_news']=$row['nb_news'];
+
+//display number of news per page link
+$template->assign_block_vars('news_per_page', array());
+
+foreach ($conf['nb_news_page_option'] as $option)
+{
+  $template->assign_block_vars(
+    'news_per_page.nb_option',
+    array(
+      'OPTION' => $option,
+      'T_STYLE' => ($option == $page['nb_news_page'])?'text-decoration:underline;':'',
+      'U_OPTION' => add_url_params(NBC_NEWS_PATH.'news.php', array('nb_news_page' => $option)),
+    )
+  );
+}
+  
+//display nav bar
+$page['navigation_bar'] = create_navigation_bar( add_url_params(NBC_NEWS_PATH.'news.php', array('nb_news_page' => $page['nb_news_page'])), $page['nb_news'],$page['start'],$page['nb_news_page'], false);
+  
+$template->assign_block_vars('navigation', array('NAV_BAR' => $page['navigation_bar'])
+);
+
+  
+// +-----------------------------------------------------------------------+
+// |                          last news display                            |
+// +-----------------------------------------------------------------------+
+  
+//get every languages
+$available_lang=get_languages();
+ 
+// affiche les news publics + les news du groupe de l'utilisateur + les news de l'utilisateur
+$user['forbidden_news'] = calculate_news_permissions($user['id']);
+
+$query = '
+  SELECT id AS new_id, date, author
+  FROM '.NEWS_TABLE.'
+  WHERE id NOT IN ('.$user['forbidden_news'].')
+  ORDER BY date DESC
+  LIMIT '.$page['start'].','.$page['nb_news_page'].'
+  ;';
+    
+$result = pwg_query($query);
+
+while ($row = mysql_fetch_array($result))
+{
+  $new_id = $row['new_id'];
+  
+  $template->assign_block_vars(
+    'news',
+    array(
+      'NEWS_AUTHOR'=>$row['author'],
+      'NEWS_DATE'=>format_date($row['date'],'mysql_datetime',true),
+    )
+  );
+  
+  //get the news translation
+  $query = '
+    SELECT id AS news_translation_id, language, title, content
+    FROM '.NEWS_TRANSLATION_TABLE.'
+    WHERE new_id = \''.$new_id.'\'
+    ';
+    
+  $no_news_translation = false;
+    
+  $subresult = pwg_query($query.'AND language = \''.$user['language'].'\';');
+  $subrow = mysql_fetch_array($subresult);
+        
+  //there is a no translation for the user language
+  if (empty($subrow))
+  {
+    $no_news_translation=true;
+      
+		$research = pwg_query('SELECT language FROM '.USER_INFOS_TABLE.' WHERE user_id = '.$conf['guest_id'].';');
+		$defaultlanguage = mysql_fetch_array($research);
+
+		//get the default translation	
+		$subresult = pwg_query($query.'AND language = \''.$defaultlanguage['language'].'\';');
+		$subrow = mysql_fetch_array($subresult);
+			
+    //there is no translation for the default language
+    if (empty($subrow))
+    {
+      //get the first translation			
+      $subresult = pwg_query($query.'LIMIT 1;');
+      $subrow = mysql_fetch_array($subresult);
+    }		
+  }
+      
+  $message = $subrow['content'];
+      
+  $template->assign_block_vars(
+    'news.news_translation',
+    array(
+      'TITLE'=>$subrow['title'],
+      'CONTENT'=>$message,
+    )
+  );	
+         
+  //there is no tranlstation for this news
+  if ($no_news_translation)
+  {
+    $template->assign_block_vars('news.news_translation.no_news_translation', array());
+  }
+}
+
+// +-----------------------------------------------------------------------+
+// |                           html code display                           |
+// +-----------------------------------------------------------------------+
+
+include(PHPWG_ROOT_PATH.'include/page_header.php');
+//$template->assign_block_vars('title', array());
+$template->parse('news');
+include(PHPWG_ROOT_PATH.'include/page_tail.php');
+?>
Index: extensions/NBC_News/trunk/template/NewsOnIndex.tpl
===================================================================
--- extensions/NBC_News/trunk/template/NewsOnIndex.tpl	(revision 5179)
+++ extensions/NBC_News/trunk/template/NewsOnIndex.tpl	(revision 5179)
@@ -0,0 +1,34 @@
+<div id="NewsOnIndex" align="center">
+  <!-- BEGIN news -->
+  <h2><a href="{news.U_NEWS}" title="{lang:hint_news}">{lang:title_news}</a></h2>
+	<!-- BEGIN a_news -->
+  <table class="tableNews1">
+    <tr class="row1">
+      <td class="tablecompact">
+        <table class="tableNews2">
+          <tr class="newsThrow">
+            <td class="newsTitle">
+              {news.a_news.TITLE}
+            </td>
+            <td class="newsInfo">
+              <span class="newsAuthor">{news.a_news.NEWS_AUTHOR}</span> - <span class="newsDate">{news.a_news.NEWS_DATE}</span>
+            </td>
+          </tr>
+          <tr>
+            <td class="newsContent" colspan="2">
+              <!-- BEGIN no_news_translation -->
+                <div class="newsNoTranslation">({lang:no_news_translation})</div>
+              <!-- END no_news_translation -->
+              {news.a_news.CONTENT}
+      				<!-- BEGIN read_more -->
+  		        <a class="newsReadMoreLink" href="{news.a_news.read_more.URL}" title="{lang:read_more}">({lang:read_more})</a>
+  		        <!-- END read_more -->
+            </td>
+          </tr>
+        </table>
+      </td>
+    </tr>
+	</table>
+  <!-- END a_news -->
+  <!-- END news -->
+</div>
Index: extensions/NBC_News/trunk/template/icon/index.php
===================================================================
--- extensions/NBC_News/trunk/template/icon/index.php	(revision 5179)
+++ extensions/NBC_News/trunk/template/icon/index.php	(revision 5179)
@@ -0,0 +1,33 @@
+<?php
+// +-----------------------------------------------------------------------+
+// | PhpWebGallery - a PHP based picture gallery                           |
+// | Copyright (C) 2002-2003 Pierrick LE GALL - pierrick@phpwebgallery.net |
+// | Copyright (C) 2003-2007 PhpWebGallery Team - http://phpwebgallery.net |
+// +-----------------------------------------------------------------------+
+// | file          : $Id: index.php 1912 2007-03-16 06:30:07Z rub $
+// | last update   : $Date: 2007-03-16 07:30:07 +0100 (ven, 16 mar 2007) $
+// | last modifier : $Author: rub $
+// | revision      : $Revision: 1912 $
+// +-----------------------------------------------------------------------+
+// | This program 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                                          |
+// |                                                                       |
+// | This program 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 this program; if not, write to the Free Software           |
+// | Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, |
+// | USA.                                                                  |
+// +-----------------------------------------------------------------------+
+
+// Recursive call
+$url = '../';
+header( 'Request-URI: '.$url );
+header( 'Content-Location: '.$url );
+header( 'Location: '.$url );
+exit();
+?>
Index: extensions/NBC_News/trunk/template/index.php
===================================================================
--- extensions/NBC_News/trunk/template/index.php	(revision 5179)
+++ extensions/NBC_News/trunk/template/index.php	(revision 5179)
@@ -0,0 +1,33 @@
+<?php
+// +-----------------------------------------------------------------------+
+// | PhpWebGallery - a PHP based picture gallery                           |
+// | Copyright (C) 2002-2003 Pierrick LE GALL - pierrick@phpwebgallery.net |
+// | Copyright (C) 2003-2007 PhpWebGallery Team - http://phpwebgallery.net |
+// +-----------------------------------------------------------------------+
+// | file          : $Id: index.php 1912 2007-03-16 06:30:07Z rub $
+// | last update   : $Date: 2007-03-16 07:30:07 +0100 (ven, 16 mar 2007) $
+// | last modifier : $Author: rub $
+// | revision      : $Revision: 1912 $
+// +-----------------------------------------------------------------------+
+// | This program 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                                          |
+// |                                                                       |
+// | This program 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 this program; if not, write to the Free Software           |
+// | Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, |
+// | USA.                                                                  |
+// +-----------------------------------------------------------------------+
+
+// Recursive call
+$url = '../';
+header( 'Request-URI: '.$url );
+header( 'Content-Location: '.$url );
+header( 'Location: '.$url );
+exit();
+?>
Index: extensions/NBC_News/trunk/template/news.css
===================================================================
--- extensions/NBC_News/trunk/template/news.css	(revision 5179)
+++ extensions/NBC_News/trunk/template/news.css	(revision 5179)
@@ -0,0 +1,214 @@
+/* $Id: content.css 1451 2006-07-09 08:37:41Z chrisaga $ */
+
+TABLE.newsdoubleSelect {
+  text-align: center;
+  margin: 0 auto;
+  width: 100%;
+}
+
+TABLE.newsdoubleSelect TD {
+  padding: 0 5px;
+  width: 33.3333%;
+}
+
+TABLE.newsdoubleSelect SELECT.newsList {
+  width: 100%;
+}
+
+SELECT.newsList {
+  width: 100%;
+}
+
+.tableNews1 {
+  width:98%;
+  padding:0pt;
+
+  margin: 5px 0px 0px 0px;
+}
+
+.tableNews2 {
+  width:100%;
+}
+
+
+.tableNews3 {
+  width:96%;
+  padding:0pt;
+
+  margin: 7px 0px 7px 0px;
+}
+
+.newsThrow
+{  
+  height:20px;
+  border-collapse:collapse;
+}
+
+.newsTitle
+{
+  font-weight:bold;
+  text-align:left;
+  padding-left:5px;
+  border-collapse:collapse;
+}
+
+.newsInfo
+{
+  text-align:right;
+  border-collapse:collapse;
+}
+
+.newsAuthor
+{
+  font-size:12px;
+  text-align:right;
+  font-weight:bold;
+}
+
+.newsDate
+{
+  font-size:10px;
+  text-align:right;
+  padding: 5px;
+}
+
+.newsLanguage
+{
+  font-weight:bold;
+}
+
+.newsContent
+{
+  text-align:left;
+  padding: 10px;
+}
+
+.newsNoTranslation
+{
+  font-style:italic;
+}
+
+.newsMenu
+{
+  text-align:center;
+}
+
+.translationMenu
+{
+  padding-right:5px;
+  padding-bottom:5px;
+  text-align:right;
+}
+
+.newsReadMoreLink
+{
+  font-weight:bold;
+}
+
+/* Quote & Code blocks */
+.code {
+  border-left-width: 1px; border-top-width: 1px; border-right-width: 1px; border-bottom-width: 1px
+}
+
+.quote {
+  border-left-width: 1px; border-top-width: 1px; border-right-width: 1px; border-bottom-width: 1px
+}
+
+/* The content of the posts (body of text) */
+.postbody { font-size : 12px;}
+
+/* General text */
+.genmed { font-size : 11px; }
+
+
+
+
+
+
+
+
+
+
+
+
+/* ************************************* */
+/* Partie CSS par defaut pour les themes */
+/* ************************************* */
+.tableNews1 {
+  border:1px solid black;
+}
+
+.tableNews3 {
+  border:1px solid black;
+}
+
+.newsTitle
+{
+  color:#FFFFFF;
+  border-top: 1px solid #d3d3d3;
+  border-bottom: 1px solid #d3d3d3;
+}
+
+.newsInfo
+{
+  border-top: 1px solid #d3d3d3;
+  border-bottom: 1px solid #d3d3d3; 
+}
+
+.newsAuthor
+{
+  color:#FFF48E;
+}
+
+.newsLanguage
+{
+  color:#fff48e;
+}
+
+.newsContent
+{
+  background-color:#3F3F3F;
+}
+
+.newsNoTranslation
+{
+  color:red;
+}
+
+.newsMenu
+{
+  color:#EEEEEE;
+}
+
+.translationMenu
+{
+  color:#696969;
+}
+
+.newsMenu a, .translationMenu a
+{
+  color:#696969;
+}
+
+/* Quote & Code blocks */
+.code {
+  font-family: Courier, 'Courier New', sans-serif; font-size: 11px; color: #006600;
+  background-color: #FAFAFA; border: #797979; border-style: solid;
+}
+
+.quote {
+  font-family: Verdana, Arial, Helvetica, sans-serif; font-size: 11px; color: #444444; line-height: 125%;
+  background-color: #d3d3d3; border: #797979; border-style: solid;
+}
+
+/* The content of the posts (body of text) */
+a.postlink:link { text-decoration: none; color : #FFFFFF }
+a.postlink:visited { text-decoration: none; color : #fff48e; }
+a.postlink:hover { text-decoration: underline; color : #fff48e}
+
+/* General text */
+.genmed { color : #E0E0E0; }
+a.genmed { color: #006699; text-decoration: none; }
+a.genmed:hover { color: #DD6900; text-decoration: underline; }
+
+
Index: extensions/NBC_News/trunk/template/news.tpl
===================================================================
--- extensions/NBC_News/trunk/template/news.tpl	(revision 5179)
+++ extensions/NBC_News/trunk/template/news.tpl	(revision 5179)
@@ -0,0 +1,58 @@
+{NEWS_CSS}
+
+<div id="content" align="center">
+
+  <div class="titrePage">
+    <ul class="categoryActions">
+      <li><a href="{U_NEWS_HELP}" onclick="popuphelp(this.href); return false;" title="{lang:Help}" rel="nofollow"><img src="{pwg_root}{themeconf:icon_dir}/help.png" class="button" alt="(?)"></a></li>
+      <li><a href="{U_NEWS_HOME}" title="{lang:return to homepage}" rel="home"><img src="{pwg_root}{themeconf:icon_dir}/home.png" class="button" alt="{lang:home}"/></a></li>
+    </ul>
+    <h2>{lang:title_news}</h2>
+  </div>
+
+  <div>
+    <!-- BEGIN news_per_page -->
+      [
+      <!-- BEGIN nb_option -->
+        <a href="{news_per_page.nb_option.U_OPTION}" style="{news_per_page.nb_option.T_STYLE}">{news_per_page.nb_option.OPTION}</a>{T_SEPARATION}
+      <!-- END nb__option -->
+      {lang:news_per_page}
+      ]
+    <!-- END news_per_page -->
+    <!-- BEGIN navigation -->
+      <br>
+      {navigation.NAV_BAR}
+      <br>
+    <!-- END navigation -->
+  </div>
+
+  <!-- BEGIN news -->
+    <table class="tableNews3" >
+      <tr class="row1">
+        <td class="tablecompact">
+          <table class="tableNews2">
+            <!-- BEGIN news_translation -->
+              <tr class="newsThrow">
+                <td class="newsTitle">
+                  {news.news_translation.TITLE}
+                </td>
+                <td class="newsInfo">
+                  <span class="newsAuthor">{news.NEWS_AUTHOR}</span> - <span class="newsDate">{news.NEWS_DATE}</span>
+	              </td>
+	            </tr>
+	            <tr>
+                <td class="newsContent" colspan="2">
+                  <!-- BEGIN no_news_translation -->
+                    <div class="newsNoTranslation">({lang:no_news_translation})</div>
+                  <!-- END no_news_translation -->
+                  {news.news_translation.CONTENT}
+                </td>
+              </tr>
+            <!-- END news_translation -->
+          </table>
+        </td>
+      </tr>
+    </table>
+  <!-- END news -->
+  <br>
+</div>
Index: extensions/NBC_News/trunk/template/newspage.css
===================================================================
--- extensions/NBC_News/trunk/template/newspage.css	(revision 5179)
+++ extensions/NBC_News/trunk/template/newspage.css	(revision 5179)
@@ -0,0 +1,5 @@
+/* $Id: content.css 1451 2006-07-09 08:37:41Z chrisaga $ */
+
+#content {
+  margin-left: 1em;   /* si on place le block news ailleurs dans un autre div */ 
+}
Index: extensions/NBC_News/trunk/template/yoga/index.php
===================================================================
--- extensions/NBC_News/trunk/template/yoga/index.php	(revision 5179)
+++ extensions/NBC_News/trunk/template/yoga/index.php	(revision 5179)
@@ -0,0 +1,33 @@
+<?php
+// +-----------------------------------------------------------------------+
+// | PhpWebGallery - a PHP based picture gallery                           |
+// | Copyright (C) 2002-2003 Pierrick LE GALL - pierrick@phpwebgallery.net |
+// | Copyright (C) 2003-2007 PhpWebGallery Team - http://phpwebgallery.net |
+// +-----------------------------------------------------------------------+
+// | file          : $Id: index.php 1912 2007-03-16 06:30:07Z rub $
+// | last update   : $Date: 2007-03-16 07:30:07 +0100 (ven, 16 mar 2007) $
+// | last modifier : $Author: rub $
+// | revision      : $Revision: 1912 $
+// +-----------------------------------------------------------------------+
+// | This program 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                                          |
+// |                                                                       |
+// | This program 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 this program; if not, write to the Free Software           |
+// | Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, |
+// | USA.                                                                  |
+// +-----------------------------------------------------------------------+
+
+// Recursive call
+$url = '../';
+header( 'Request-URI: '.$url );
+header( 'Content-Location: '.$url );
+header( 'Location: '.$url );
+exit();
+?>
Index: extensions/NBC_News/trunk/template/yoga/theme/clear/index.php
===================================================================
--- extensions/NBC_News/trunk/template/yoga/theme/clear/index.php	(revision 5179)
+++ extensions/NBC_News/trunk/template/yoga/theme/clear/index.php	(revision 5179)
@@ -0,0 +1,33 @@
+<?php
+// +-----------------------------------------------------------------------+
+// | PhpWebGallery - a PHP based picture gallery                           |
+// | Copyright (C) 2002-2003 Pierrick LE GALL - pierrick@phpwebgallery.net |
+// | Copyright (C) 2003-2007 PhpWebGallery Team - http://phpwebgallery.net |
+// +-----------------------------------------------------------------------+
+// | file          : $Id: index.php 1912 2007-03-16 06:30:07Z rub $
+// | last update   : $Date: 2007-03-16 07:30:07 +0100 (ven, 16 mar 2007) $
+// | last modifier : $Author: rub $
+// | revision      : $Revision: 1912 $
+// +-----------------------------------------------------------------------+
+// | This program 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                                          |
+// |                                                                       |
+// | This program 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 this program; if not, write to the Free Software           |
+// | Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, |
+// | USA.                                                                  |
+// +-----------------------------------------------------------------------+
+
+// Recursive call
+$url = '../';
+header( 'Request-URI: '.$url );
+header( 'Content-Location: '.$url );
+header( 'Location: '.$url );
+exit();
+?>
Index: extensions/NBC_News/trunk/template/yoga/theme/clear/news.css
===================================================================
--- extensions/NBC_News/trunk/template/yoga/theme/clear/news.css	(revision 5179)
+++ extensions/NBC_News/trunk/template/yoga/theme/clear/news.css	(revision 5179)
@@ -0,0 +1,77 @@
+.tableNews1 {
+  border:1px solid black;
+}
+
+.tableNews3 {
+  border:1px solid black;
+}
+
+.newsTitle
+{
+	color:#006A8F;
+	border-top: 1px solid #d3d3d3;
+	border-bottom: 1px solid #d3d3d3;
+}
+
+.newsInfo
+{
+	border-top: 1px solid #d3d3d3;
+	border-bottom: 1px solid #d3d3d3; 
+}
+
+.newsAuthor
+{
+  color:#696969;
+}
+
+.newsLanguage
+{
+	color:#696969;
+}
+
+.newsContent
+{
+  background-color:#EEEEEE;
+}
+
+.newsNoTranslation
+{
+	color:red;
+}
+
+.newsMenu
+{
+  color:#EEEEEE;
+}
+
+.translationMenu
+{
+  color:#696969;
+}
+
+.newsMenu a, .translationMenu a
+{
+	color:#696969;
+}
+
+/* Quote & Code blocks */
+.code {
+	font-family: Courier, 'Courier New', sans-serif; font-size: 11px; color: #006600;
+	background-color: #FAFAFA; border: #797979; border-style: solid;
+}
+
+.quote {
+	font-family: Verdana, Arial, Helvetica, sans-serif; font-size: 11px; color: #444444; line-height: 125%;
+	background-color: #d3d3d3; border: #797979; border-style: solid;
+}
+
+/* The content of the posts (body of text) */
+a.postlink:link	{ text-decoration: none; color : #006699 }
+a.postlink:visited { text-decoration: none; color : #5493B4; }
+a.postlink:hover { text-decoration: underline; color : #DD6900}
+
+/* General text */
+.genmed { color : #E0E0E0; }
+a.genmed { color: #006699; text-decoration: none; }
+a.genmed:hover { color: #DD6900; text-decoration: underline; }
+
Index: extensions/NBC_News/trunk/template/yoga/theme/dark/index.php
===================================================================
--- extensions/NBC_News/trunk/template/yoga/theme/dark/index.php	(revision 5179)
+++ extensions/NBC_News/trunk/template/yoga/theme/dark/index.php	(revision 5179)
@@ -0,0 +1,33 @@
+<?php
+// +-----------------------------------------------------------------------+
+// | PhpWebGallery - a PHP based picture gallery                           |
+// | Copyright (C) 2002-2003 Pierrick LE GALL - pierrick@phpwebgallery.net |
+// | Copyright (C) 2003-2007 PhpWebGallery Team - http://phpwebgallery.net |
+// +-----------------------------------------------------------------------+
+// | file          : $Id: index.php 1912 2007-03-16 06:30:07Z rub $
+// | last update   : $Date: 2007-03-16 07:30:07 +0100 (ven, 16 mar 2007) $
+// | last modifier : $Author: rub $
+// | revision      : $Revision: 1912 $
+// +-----------------------------------------------------------------------+
+// | This program 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                                          |
+// |                                                                       |
+// | This program 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 this program; if not, write to the Free Software           |
+// | Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, |
+// | USA.                                                                  |
+// +-----------------------------------------------------------------------+
+
+// Recursive call
+$url = '../';
+header( 'Request-URI: '.$url );
+header( 'Content-Location: '.$url );
+header( 'Location: '.$url );
+exit();
+?>
Index: extensions/NBC_News/trunk/template/yoga/theme/dark/news.css
===================================================================
--- extensions/NBC_News/trunk/template/yoga/theme/dark/news.css	(revision 5179)
+++ extensions/NBC_News/trunk/template/yoga/theme/dark/news.css	(revision 5179)
@@ -0,0 +1,77 @@
+.tableNews1 {
+  border:1px solid black;
+}
+
+.tableNews3 {
+  border:1px solid black;
+}
+
+.newsTitle
+{
+  color:#FFFFFF;
+  border-top: 1px solid #d3d3d3;
+  border-bottom: 1px solid #d3d3d3;
+}
+
+.newsInfo
+{
+  border-top: 1px solid #d3d3d3;
+  border-bottom: 1px solid #d3d3d3; 
+}
+
+.newsAuthor
+{
+  color:#FFF48E;
+}
+
+.newsLanguage
+{
+  color:#fff48e;
+}
+
+.newsContent
+{
+  background-color:#3F3F3F;
+}
+
+.newsNoTranslation
+{
+  color:red;
+}
+
+.newsMenu
+{
+  color:#EEEEEE;
+}
+
+.translationMenu
+{
+  color:#696969;
+}
+
+.newsMenu a, .translationMenu a
+{
+  color:#696969;
+}
+
+/* Quote & Code blocks */
+.code {
+  font-family: Courier, 'Courier New', sans-serif; font-size: 11px; color: #006600;
+  background-color: #FAFAFA; border: #797979; border-style: solid;
+}
+
+.quote {
+  font-family: Verdana, Arial, Helvetica, sans-serif; font-size: 11px; color: #444444; line-height: 125%;
+  background-color: #d3d3d3; border: #797979; border-style: solid;
+}
+
+/* The content of the posts (body of text) */
+a.postlink:link { text-decoration: none; color : #FFFFFF }
+a.postlink:visited { text-decoration: none; color : #fff48e; }
+a.postlink:hover { text-decoration: underline; color : #fff48e}
+
+/* General text */
+.genmed { color : #E0E0E0; }
+a.genmed { color: #006699; text-decoration: none; }
+a.genmed:hover { color: #DD6900; text-decoration: underline; }
+
Index: extensions/NBC_News/trunk/template/yoga/theme/index.php
===================================================================
--- extensions/NBC_News/trunk/template/yoga/theme/index.php	(revision 5179)
+++ extensions/NBC_News/trunk/template/yoga/theme/index.php	(revision 5179)
@@ -0,0 +1,33 @@
+<?php
+// +-----------------------------------------------------------------------+
+// | PhpWebGallery - a PHP based picture gallery                           |
+// | Copyright (C) 2002-2003 Pierrick LE GALL - pierrick@phpwebgallery.net |
+// | Copyright (C) 2003-2007 PhpWebGallery Team - http://phpwebgallery.net |
+// +-----------------------------------------------------------------------+
+// | file          : $Id: index.php 1912 2007-03-16 06:30:07Z rub $
+// | last update   : $Date: 2007-03-16 07:30:07 +0100 (ven, 16 mar 2007) $
+// | last modifier : $Author: rub $
+// | revision      : $Revision: 1912 $
+// +-----------------------------------------------------------------------+
+// | This program 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                                          |
+// |                                                                       |
+// | This program 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 this program; if not, write to the Free Software           |
+// | Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, |
+// | USA.                                                                  |
+// +-----------------------------------------------------------------------+
+
+// Recursive call
+$url = '../';
+header( 'Request-URI: '.$url );
+header( 'Content-Location: '.$url );
+header( 'Location: '.$url );
+exit();
+?>
