Index: extensions/nbc_ThemeChanger/README.txt
===================================================================
--- extensions/nbc_ThemeChanger/README.txt	(revision 3893)
+++ extensions/nbc_ThemeChanger/README.txt	(revision 3893)
@@ -0,0 +1,10 @@
+ThemeChanger vous permet de spécifier pour chaque catégorie un thème différent.
+Pour les catégories non spécifiées, le thème par défaut s'applique.
+
+
+ThemeChanger allow you to specify for each category a different theme. 
+For the unspecified categories, the theme by default is applied.
+
+
+ThemeChanger permette di precisare per ogni categoria un tema diverso. 
+Per le categorie non precisato, il tema da difetto è applicato.
Index: extensions/nbc_ThemeChanger/admin/index.php
===================================================================
--- extensions/nbc_ThemeChanger/admin/index.php	(revision 3893)
+++ extensions/nbc_ThemeChanger/admin/index.php	(revision 3893)
@@ -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_ThemeChanger/admin/nbc_ThemeChanger_admin.php
===================================================================
--- extensions/nbc_ThemeChanger/admin/nbc_ThemeChanger_admin.php	(revision 3893)
+++ extensions/nbc_ThemeChanger/admin/nbc_ThemeChanger_admin.php	(revision 3893)
@@ -0,0 +1,312 @@
+<?php
+//if (!defined(PHPWG_ROOT_PATH)) die('Hacking attempt!');
+
+global $user, $conf, $template;
+
+// Check Access and exit when user status is not ok
+check_status(ACCESS_ADMINISTRATOR);
+
+$me = get_plugin_data($plugin_id);
+
+load_language('plugin.lang', NBC_ThemeChanger_PATH);
+$page_ThemeChanger_admin = get_admin_plugin_menu_link(__FILE__);
+
+
+
+$cat=array();
+$categories = array();
+
+
+//chargement des catégories
+ $query = '
+    SELECT id, name, uppercats, global_rank
+    FROM '.CATEGORIES_TABLE.' ;
+  ';
+   $result = pwg_query($query);
+
+   while (($cat = mysql_fetch_array($result)) <> null)
+   {
+   array_push($categories , array("id" => $cat['id'],
+				"name" => $cat['name'],
+				"uppercats" =>$cat['uppercats'],
+				"longName" => get_cat_display_name_cache($cat['uppercats'], null, false),
+				"global_rank" => $cat['global_rank'],
+				));
+		}
+
+
+//chargement des thèmes
+$themes = array();
+foreach (get_pwg_themes() as $pwg_template)
+{
+	$selected = $pwg_template;
+	array_push($themes, $selected);
+}
+
+// Configuration du template
+$template->assign('params',
+array(
+    'U_HOME' => make_index_url(),
+	'F_ACTION' => add_url_params($page_ThemeChanger_admin, array()),
+    'U_ADD_ASSOC' => add_url_params($page_ThemeChanger_admin, array('action' => 'add_assoc')),
+    'U_HELP' => PHPWG_ROOT_PATH.'popuphelp.php?page=ThemeChanger_admin',
+	'Themes' => $themes,
+	'Categories' => $categories,
+));
+
+
+// Mise a jour de la base de donnee
+if (isset($_POST['submit']) and !is_adviser())
+  if ( (isset($_POST['categorychoise']) or isset($_POST['category_id'])) and isset($_POST['template']) )
+  {
+    $conf_nbc_ThemeChanger = isset($conf['nbc_ThemeChanger']) ? explode(";" , $conf['nbc_ThemeChanger']) : array();
+
+    $newconf_nbc_ThemeChanger = '';
+    $theme = explode("/" , $_POST['template']);
+    $add_ok = false;
+
+    $thecategory = isset($_POST['categorychoise']) ? $_POST['categorychoise'] : ( isset($_POST['category_id']) ? $_POST['category_id'] : '');
+
+    $_POST['categorychoise'] = '';
+    $_POST['category_id'] = '';
+    $_POST['template'] = '';
+    $_GET['action'] = '';
+
+    foreach ($conf_nbc_ThemeChanger as $Theme_Cat)
+    {
+      $element_ThemeChanger = explode("," , $Theme_Cat);
+
+      if ($newconf_nbc_ThemeChanger <> '')
+        $newconf_nbc_ThemeChanger .= ';';
+
+      if ($element_ThemeChanger[0] == $thecategory)
+      {
+        $newconf_nbc_ThemeChanger .= $thecategory.','.$theme[0].','.$theme[1];
+        $add_ok = true;
+      }
+      else if ($element_ThemeChanger[0] <> '')
+      {
+        $newconf_nbc_ThemeChanger .= $element_ThemeChanger[0].','.$element_ThemeChanger[1].','.$element_ThemeChanger[2];
+      }
+    }
+
+    if ($add_ok == false)
+    {
+      if ($newconf_nbc_ThemeChanger <> '')
+        $newconf_nbc_ThemeChanger .= ';';
+
+      $newconf_nbc_ThemeChanger .= $thecategory.','.$theme[0].','.$theme[1];
+    }
+
+    $conf['nbc_ThemeChanger'] = $newconf_nbc_ThemeChanger;
+
+    $query = '
+      UPDATE '.CONFIG_TABLE.'
+      SET value="'.$newconf_nbc_ThemeChanger.'"
+      WHERE param="nbc_ThemeChanger"
+      LIMIT 1';
+    pwg_query($query);
+
+    array_push($page['infos'], l10n('nbc_ThemeChanger_save_config'));
+}
+
+
+
+$conf_nbc_ThemeChanger = isset($conf['nbc_ThemeChanger']) ? explode(";" , $conf['nbc_ThemeChanger']) : array();
+
+$catsused = array();
+$assoc_ThemeChanger = array();
+
+foreach ($conf_nbc_ThemeChanger as $Theme_Cat)
+{
+  $element_ThemeChanger = explode("," , $Theme_Cat);
+
+  if ($element_ThemeChanger[0] <> '' and $element_ThemeChanger[1] <> '' and $element_ThemeChanger[2] <> '')
+  {
+    array_push($catsused, $element_ThemeChanger[0]);
+
+    $query = '
+      SELECT uppercats
+        FROM '.CATEGORIES_TABLE.'
+        WHERE id = \''.$element_ThemeChanger[0].'\'
+      ;';
+
+    $result = pwg_query($query);
+    $row = mysql_fetch_array($result);
+
+    $assoc_ThemeChanger[$element_ThemeChanger[0]] = array(
+      'CATEGORY_NAME' => get_cat_display_name_cache($row['uppercats'], null, false),
+      'TEMPLATE' => $element_ThemeChanger[1].'/'.$element_ThemeChanger[2],
+    );
+  }
+}
+
+
+
+
+//delete an association
+if ( isset($_GET['action']) and ($_GET['action']=='del_assoc') and isset($_GET['id_cat']) and is_numeric($_GET['id_cat']) and !is_adviser() )
+{
+  $conf_nbc_ThemeChanger = isset($conf['nbc_ThemeChanger']) ? explode(";" , $conf['nbc_ThemeChanger']) : array();
+
+  $newconf_nbc_ThemeChanger = '';
+
+  foreach ($conf_nbc_ThemeChanger as $Theme_Cat)
+  {
+    $element_ThemeChanger = explode("," , $Theme_Cat);
+
+    if ($element_ThemeChanger[0] <> $_GET['id_cat'] and $element_ThemeChanger[0] <> '')
+    {
+      if ($newconf_nbc_ThemeChanger <> '')
+        $newconf_nbc_ThemeChanger .= ';';
+
+      $newconf_nbc_ThemeChanger .= $element_ThemeChanger[0].','.$element_ThemeChanger[1].','.$element_ThemeChanger[2];
+    }
+  }
+
+  $conf['nbc_ThemeChanger'] = $newconf_nbc_ThemeChanger;
+
+  $query = '
+    UPDATE '.CONFIG_TABLE.'
+    SET value="'.$newconf_nbc_ThemeChanger.'"
+    WHERE param="nbc_ThemeChanger"
+    LIMIT 1';
+  pwg_query($query);
+
+  array_push($page['infos'], l10n('nbc_ThemeChanger_save_config'));
+}
+
+//modify an association
+else if ( isset($_GET['action']) and ($_GET['action']=='mod_assoc') and isset($_GET['id_cat']) and is_numeric($_GET['id_cat']) )
+{
+  $template->assign('formulaire',array(
+    'DESCRIPION' => $lang['modify_assoc'].' : '.$assoc_ThemeChanger[$_GET['id_cat']]['CATEGORY_NAME'],
+    'NAMETOMODIFY' => $assoc_ThemeChanger[$_GET['id_cat']]['CATEGORY_NAME'],
+    'IDTOMODIFY' => $_GET['id_cat'],
+  ));
+	
+  $template->assign('formulaire.categoryfield', array(
+    'NAME' => $assoc_ThemeChanger[$_GET['id_cat']]['CATEGORY_NAME'],
+    'ID' => $_GET['id_cat'],
+  ));
+
+  $blockname = 'formulaire.template_option';
+
+  foreach (get_pwg_themes() as $pwg_template)
+  {
+    if ($assoc_ThemeChanger[$_GET['id_cat']]['TEMPLATE'] == $pwg_template)
+    {
+      $selected = 'selected="selected"';
+    }
+    else
+    {
+      $selected = '';
+    }
+	
+	$template->assign(
+      $blockname,
+      array(
+        'VALUE'=> $pwg_template,
+        'CONTENT' => $pwg_template,
+        'SELECTED' => $selected
+        ));
+  }
+}
+
+//add an association
+else if ( isset($_GET['action']) and ($_GET['action']=='add_assoc') )
+{
+	//$template->assign_var('formulaire',array(
+	$template->assign(
+		'formulaire',
+		array('DESCRIPION' => $lang['add_assoc'],
+		)
+	);
+
+	$template->assign('formulaire.categorylist', array());
+	$blockname = 'formulaire.categorylist.parent_option';
+
+  $template->assign($blockname, array());
+
+
+  $query = '
+    SELECT id, name, uppercats, global_rank
+    FROM '.CATEGORIES_TABLE.'
+  ';
+  if (!empty($catsused))
+  {
+    $query .= '
+      WHERE id NOT IN ('.implode(',', $catsused).')
+    ';
+  }
+  $query .= ' ;';
+  display_select_cat_wrapper($query, array(), $blockname);
+
+  $blockname = 'formulaire.template_option';
+
+  foreach (get_pwg_themes() as $pwg_template)
+  {
+	$template->assign(
+      $blockname,
+      array(
+        'VALUE'=> $pwg_template,
+        'CONTENT' => $pwg_template,
+        'SELECTED' => '',
+      )
+    );
+  }
+}
+
+$conf_nbc_ThemeChanger = isset($conf['nbc_ThemeChanger']) ? explode(";" , $conf['nbc_ThemeChanger']) : array();
+
+$num = 0;
+$catsused = array();
+$assoc_ThemeChanger = array();
+$assoc = array();
+
+foreach ($conf_nbc_ThemeChanger as $Theme_Cat)
+{
+  $element_ThemeChanger = explode("," , $Theme_Cat);
+
+  if ($element_ThemeChanger[0] <> '' and $element_ThemeChanger[1] <> '' and $element_ThemeChanger[2] <> '')
+  {
+    array_push($catsused, $element_ThemeChanger[0]);
+
+    $query = '
+      SELECT uppercats
+        FROM '.CATEGORIES_TABLE.'
+        WHERE id = \''.$element_ThemeChanger[0].'\'
+      ;';
+
+    $result = pwg_query($query);
+    $row = mysql_fetch_array($result);
+
+     array_push($assoc , array(
+        'CLASS' => ($num++ % 2 == 1) ? 'row2' : 'row1',
+        'CATEGORY_NAME' => get_cat_display_name_cache($row['uppercats'], null, false),
+        'CATEGORY_ID'   => $element_ThemeChanger[0],
+        'TEMPLATE' => $element_ThemeChanger[1].'/'.$element_ThemeChanger[2],
+        'U_MODIFY'      => add_url_params($page_ThemeChanger_admin, array(
+          'action' => 'mod_assoc',
+          'id_cat' => $element_ThemeChanger[0],
+          )),
+        'U_DELETE'      => add_url_params($page_ThemeChanger_admin, array(
+          'action' => 'del_assoc',
+          'id_cat' => $element_ThemeChanger[0],
+          )),));
+
+    $assoc_ThemeChanger[$element_ThemeChanger[0]] = array(
+      'CATEGORY_NAME' => get_cat_display_name_cache($row['uppercats'], null, false),
+      'TEMPLATE' => $element_ThemeChanger[1].'/'.$element_ThemeChanger[2],
+    );
+  }
+}
+$template->assign(
+      'assoc',$assoc );
+
+
+//  template initialization
+$template->set_filenames(array('plugin_admin_content' => dirname(__FILE__).'/nbc_ThemeChanger_admin.tpl'));
+$template->assign_var_from_handle( 'ADMIN_CONTENT', 'plugin_admin_content');
+
+?>
Index: extensions/nbc_ThemeChanger/admin/nbc_ThemeChanger_admin.tpl
===================================================================
--- extensions/nbc_ThemeChanger/admin/nbc_ThemeChanger_admin.tpl	(revision 3893)
+++ extensions/nbc_ThemeChanger/admin/nbc_ThemeChanger_admin.tpl	(revision 3893)
@@ -0,0 +1,76 @@
+<div class="titrePage">
+	<h3>Theme Changer</h3>
+</div>
+
+<ul class="categoryActions">
+	<li><a href="{$params.U_HELP}" onclick="popuphelp(this.href); return false;" title="{'HELP'|@translate}"><img src="{$themeconf.icon_dir}/help.png" class="button" alt="(?)"></a></li>
+</ul>
+
+<br>
+[ <a href="{$params.U_ADD_ASSOC}">{'add_assoc'|@translate}</a> ]
+<br>
+
+<table class="table2">
+  <tr class="throw">
+    <th>{'categories'|@translate}</th>
+    <th>{'theme'|@translate}</th>
+    <th>{'action'|@translate}</th>
+  </tr>
+  <!-- BEGIN assoc -->
+  {foreach from=$assoc item=assoc key=i}  
+<tr class="{$assoc.CLASS}">
+
+    <td>{$assoc.CATEGORY_NAME}</td>
+    <td>{$assoc.TEMPLATE}</td>
+    <td style="text-align:center;">
+      <a href="{$assoc.U_MODIFY}"><img src="{$themeconf.icon_dir}/register.png" class="button" style="border:none" alt="{'modify_assoc'|@translate}" title="{'modify_assoc'|@translate}"></a>
+      <a href="{$assoc.U_DELETE}" onclick="return confirm('{'Are you sure?'|@translate}');" ><img src="{$themeconf.icon_dir}/category_delete.png" class="button" style="border:none" alt="{'delete_assoc'|@translate}" title="{'delete_assoc'|@translate}"></a>
+    </td>
+	
+  </tr>
+  {/foreach}
+  <!-- END assoc -->
+</table>
+
+<!-- BEGIN formulaire -->
+<form method="post" action="{$nbc_ThemeChanger_F_ACTION}" class="general">
+  <fieldset>
+    <legend>{$formulaire.DESCRIPION}</legend>
+    <table class="table2">
+      <tr class="throw">
+        <th>{'categories'|@translate}</th>
+        <th>{'theme'|@translate}</th>
+      </tr>
+      <tr>
+        <td>
+          <!-- BEGIN categorylist -->
+          <select class="categoryDropDown" name="categorychoise">
+            <!-- BEGIN parent_option -->
+			{foreach from=$params.Categories item=Categories key=i}
+				{if ($formulaire.IDTOMODIFY==$Categories.id)}
+					<option value="{$Categories.id}" selected ="selected">{$Categories.longName}</option>	
+				{else}
+					<option value="{$Categories.id}">{$Categories.longName}</option>	
+				{/if}
+			{/foreach}
+            <!-- END parent_option -->
+          </select>
+          <!-- END categorylist -->
+        </td>
+        <td>
+			<select name="template" id="template">
+			<!-- BEGIN template_option -->
+			{foreach from=$params.Themes item=Themes key=i}
+				<option value="{$Themes}" {$Themes}>{$Themes}</option>
+            {/foreach}
+			<!-- END template_option -->
+			</select>
+        </td>
+      </tr>
+    </table>
+  	
+    <div align="center"><input class="submit" type="submit" value="{'submit'|@translate}" name="submit" {$TAG_INPUT_ENABLED} /></div>
+
+  </fieldset>
+</form>
+<!-- END formulaire -->
Index: extensions/nbc_ThemeChanger/index.php
===================================================================
--- extensions/nbc_ThemeChanger/index.php	(revision 3893)
+++ extensions/nbc_ThemeChanger/index.php	(revision 3893)
@@ -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_ThemeChanger/language/en_UK/index.php
===================================================================
--- extensions/nbc_ThemeChanger/language/en_UK/index.php	(revision 3893)
+++ extensions/nbc_ThemeChanger/language/en_UK/index.php	(revision 3893)
@@ -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_ThemeChanger/language/en_UK/plugin.lang.php
===================================================================
--- extensions/nbc_ThemeChanger/language/en_UK/plugin.lang.php	(revision 3893)
+++ extensions/nbc_ThemeChanger/language/en_UK/plugin.lang.php	(revision 3893)
@@ -0,0 +1,10 @@
+<?php
+
+$lang['title_assoc'] = 'ThemeChanger';
+$lang['add_assoc'] = 'Add a new association';
+$lang['action'] = 'Action';
+$lang['modify_assoc'] = 'Modify the association';
+$lang['delete_assoc']='Delete the association';
+$lang['nbc_ThemeChanger_save_config']='Configuration saved.';
+
+?>
Index: extensions/nbc_ThemeChanger/language/fr_FR/index.php
===================================================================
--- extensions/nbc_ThemeChanger/language/fr_FR/index.php	(revision 3893)
+++ extensions/nbc_ThemeChanger/language/fr_FR/index.php	(revision 3893)
@@ -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_ThemeChanger/language/fr_FR/plugin.lang.php
===================================================================
--- extensions/nbc_ThemeChanger/language/fr_FR/plugin.lang.php	(revision 3893)
+++ extensions/nbc_ThemeChanger/language/fr_FR/plugin.lang.php	(revision 3893)
@@ -0,0 +1,10 @@
+<?php
+
+$lang['title_assoc'] = 'ThemeChanger';
+$lang['add_assoc'] = 'Ajoutez une nouvelle association';
+$lang['action'] = 'Action';
+$lang['modify_assoc'] = 'Modifier l\'association';
+$lang['delete_assoc']='Supprimer l\'association';
+$lang['nbc_ThemeChanger_save_config']='Configuration enregistrée.';
+
+?>
Index: extensions/nbc_ThemeChanger/language/index.php
===================================================================
--- extensions/nbc_ThemeChanger/language/index.php	(revision 3893)
+++ extensions/nbc_ThemeChanger/language/index.php	(revision 3893)
@@ -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_ThemeChanger/language/it_IT/index.php
===================================================================
--- extensions/nbc_ThemeChanger/language/it_IT/index.php	(revision 3893)
+++ extensions/nbc_ThemeChanger/language/it_IT/index.php	(revision 3893)
@@ -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_ThemeChanger/language/it_IT/plugin.lang.php
===================================================================
--- extensions/nbc_ThemeChanger/language/it_IT/plugin.lang.php	(revision 3893)
+++ extensions/nbc_ThemeChanger/language/it_IT/plugin.lang.php	(revision 3893)
@@ -0,0 +1,8 @@
+<?php
+$lang['title_assoc'] = 'ThemeChanger';
+$lang['add_assoc'] = 'Aggiungere una nuova associazione';
+$lang['action'] = 'Azione';
+$lang['modify_assoc'] = 'Modificare l\'associazione';
+$lang['delete_assoc']='Eliminare l\'associazione';
+$lang['nbc_ThemeChanger_save_config']='Configurazione salvata.';
+?>
Index: extensions/nbc_ThemeChanger/main.inc.php
===================================================================
--- extensions/nbc_ThemeChanger/main.inc.php	(revision 3893)
+++ extensions/nbc_ThemeChanger/main.inc.php	(revision 3893)
@@ -0,0 +1,73 @@
+<?php
+/*
+Plugin Name: NBC ThemeChanger
+Version: 2.0.1.b
+Description: Permet d imposer un theme à une categorie (merci a P@t).
+	ThemeChanger vous permet de spécifier pour chaque catégorie un thème différent.
+	Pour les catégories non spécifiées, le thème par défaut s'applique.
+	ThemeChanger allow you to specify for each category a different theme. 
+	For the unspecified categories, the theme by default is applied.
+	ThemeChanger permette di precisare per ogni categoria un tema diverso. 
+	Per le categorie non precisato, il tema da difetto è applicato.
+Plugin URI: http://phpwebgallery.net/ext/extension_view.php?eid=214
+Author: Nicco
+Author URI: http://gallery-nicco.no-ip.org
+Author Portage piwigo 2.0.X : Datajulien
+Author Portage piwigo 2.0.X URI : http://morgane.quoirez.com
+*/
+
+define('NBC_ThemeChanger_PATH' , PHPWG_PLUGINS_PATH.basename(dirname(__FILE__)).'/');
+
+
+//if (!defined(NBC_ThemeChanger_PATH)) die('Hacking attempt - ThemeChanger main.inc.php - NBC_ThemeChanger_PATH!');
+
+/* Set the administration panel of the plugin */
+
+
+class ThemeChanger
+// Sets the administration panel of the plugin
+{
+	function nbc_ThemeChanger_admin_menu($menu)
+	{
+	  array_push($menu,
+		array(
+		  'NAME' => 'ThemeChanger',
+		  'URL'  => get_admin_plugin_menu_link(NBC_ThemeChanger_PATH.'admin/nbc_ThemeChanger_admin.php')
+		)
+	  );
+	  return $menu;
+	}
+}
+
+$obj = new ThemeChanger();
+
+function change_category_theme()
+{
+  global $template, $page, $user, $conf;
+
+  $conf_nbc_ThemeChanger = isset($conf['nbc_ThemeChanger']) ? explode(";" , $conf['nbc_ThemeChanger']) : array();
+    
+  $category_theme = array();
+  
+  foreach ($conf_nbc_ThemeChanger as $Theme_Cat)
+  {
+    $element_ThemeChanger = explode("," , $Theme_Cat);
+    
+    if ($element_ThemeChanger[0] <> '' and $element_ThemeChanger[1] <> '' and $element_ThemeChanger[2] <> '')
+      $category_theme[$element_ThemeChanger[0]] = array( $element_ThemeChanger[1] , $element_ThemeChanger[2] );
+  }
+
+  if (isset($page['category']['id']) and isset($category_theme[$page['category']['id']]))
+  {
+    $user['template'] =  $category_theme[$page['category']['id']][0];
+    $user['theme'] = $category_theme[$page['category']['id']][1];
+
+    $template->Template(PHPWG_ROOT_PATH.'template/'.$user['template'], $user['theme']);
+  }
+}
+
+add_event_handler('get_admin_plugin_menu_links', array(&$obj, 'nbc_ThemeChanger_admin_menu') );
+add_event_handler('loc_end_section_init', 'change_category_theme');
+set_plugin_data($plugin['id'], $obj)
+
+?>
Index: extensions/nbc_ThemeChanger/maintain.inc.php
===================================================================
--- extensions/nbc_ThemeChanger/maintain.inc.php	(revision 3893)
+++ extensions/nbc_ThemeChanger/maintain.inc.php	(revision 3893)
@@ -0,0 +1,30 @@
+<?php
+
+if (!defined('PHPWG_ROOT_PATH')) die('Hacking attempt! - ThemeChanger maintain.inc.php - PHPWG_ROOT_PATH undefined');
+
+function plugin_install()
+{
+  $q = '
+    INSERT INTO '.CONFIG_TABLE.' (param,value,comment)
+    VALUES ("nbc_ThemeChanger","","Parametres nbc_ThemeChanger")
+  ;';
+    
+  pwg_query($q);
+}
+
+function plugin_uninstall()
+{
+  global $conf;
+
+  if (isset($conf['nbc_ThemeChanger']))
+  {
+    $q = '
+      DELETE FROM '.CONFIG_TABLE.'
+      WHERE param="nbc_ThemeChanger" LIMIT 1
+    ;';
+
+    pwg_query($q);
+  }
+}
+
+?>
