Index: /extensions/ContestResults/admin/admin.php
===================================================================
--- /extensions/ContestResults/admin/admin.php	(revision 6768)
+++ /extensions/ContestResults/admin/admin.php	(revision 6768)
@@ -0,0 +1,31 @@
+<?php
+if(!defined('PHPWG_ROOT_PATH')) die('Hacking attempt!');
+
+load_language('plugin.lang', CR_PATH);
+
+// +-----------------------------------------------------------------------+
+//				Tabsheet
+// +-----------------------------------------------------------------------+
+include_once(PHPWG_ROOT_PATH.'admin/include/tabsheet.class.php');
+if(!isset($_GET['tab']))
+    $page['tab'] = 'manage';
+else
+    $page['tab'] = $_GET['tab'];
+	
+$tabsheet = new tabsheet();
+$tabsheet->add('manage', l10n('CR_manage_tab'), CR_ADMIN . '&tab=manage'); // Gestion des concours
+$tabsheet->add('new', l10n('CR_new_tab'), CR_ADMIN . '&tab=new'); // Ajouter un nouveau concours
+if(isset($_GET['contest_id'])) // Editer le concours | Résultats du concours
+	$tabsheet->add($_GET['tab'], l10n('CR_'.$_GET['tab'].'_tab'), CR_ADMIN . '&tab=' . $_GET['tab'] . '&contest_id=' . $_GET['contest_id']);
+$tabsheet->add('config', l10n('Configuration'), CR_ADMIN . '&tab=config'); // Configuration
+$tabsheet->select($page['tab']);
+$tabsheet->assign();
+
+// +-----------------------------------------------------------------------+
+//				Template
+// +-----------------------------------------------------------------------+
+$template->assign('CR_VERSION', CR_NAME . ' ' . CR_VERSION);
+$template->assign('CR_PATH', CR_PATH);
+if($page['tab'] == 'edit') $page['tab'] = 'new'; // L'édition se fait sur la page de création
+include(CR_PATH.'admin/'.$page['tab'].'.php');
+?>
Index: /extensions/ContestResults/admin/config.php
===================================================================
--- /extensions/ContestResults/admin/config.php	(revision 6768)
+++ /extensions/ContestResults/admin/config.php	(revision 6768)
@@ -0,0 +1,45 @@
+<?php
+if (!defined('PHPWG_ROOT_PATH')) die('Hacking attempt!');
+
+// +-----------------------------------------------------------------------+
+//		Modification de la configuration
+// +-----------------------------------------------------------------------+
+if(isset($_POST['config_submit'])){
+	$user_config = array(
+		'menubar_mode' => array(
+			'link' => ($_POST['menubar_mode_link']) ? 1 : 0,
+			'block' => ($_POST['menubar_mode_block']) ? 1 : 0
+		),
+		'menubar_link' => array(
+			'menu' => ($_POST['menubar_link_menu']) ? 1 : 0,
+			'specials' => ($_POST['menubar_link_specials']) ? 1 : 0
+		),
+		'menubar_block' => array(
+			'number' => $_POST['menubar_block_number']
+		)
+	);
+	
+	$query = "UPDATE " . CONFIG_TABLE . " SET `value` = '" . serialize($user_config) . "' WHERE `param` = 'ContestResults';";
+	pwg_query($query);
+	redirect(CR_ADMIN . '&tab=config');
+}	
+
+// +-----------------------------------------------------------------------+
+//		Définition des variables template
+// +-----------------------------------------------------------------------+
+$conf['ContestResults'] = unserialize($conf['ContestResults']);
+
+$template->assign(array(
+	'MODE_LINK' => ($conf['ContestResults']['menubar_mode']['link']) ? 'checked="checked"' : '',
+	'MODE_BLOCK' => ($conf['ContestResults']['menubar_mode']['block']) ? 'checked="checked"' : '',
+	'LINK_MENU' => ($conf['ContestResults']['menubar_link']['menu']) ? 'checked="checked"' : '',
+	'LINK_SPECIALS' => ($conf['ContestResults']['menubar_link']['specials']) ? 'checked="checked"' : '',
+	'BLOCK_NUMBER' => $conf['ContestResults']['menubar_block']['number'],
+));
+
+// +-----------------------------------------------------------------------+
+//				Template
+// +-----------------------------------------------------------------------+
+$template->set_filenames(array('plugin_admin_content' => dirname(__FILE__).'/template/config.tpl'));
+$template->assign_var_from_handle('ADMIN_CONTENT', 'plugin_admin_content');
+?>
Index: /extensions/ContestResults/admin/index.php
===================================================================
--- /extensions/ContestResults/admin/index.php	(revision 6768)
+++ /extensions/ContestResults/admin/index.php	(revision 6768)
@@ -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/ContestResults/admin/manage.php
===================================================================
--- /extensions/ContestResults/admin/manage.php	(revision 6768)
+++ /extensions/ContestResults/admin/manage.php	(revision 6768)
@@ -0,0 +1,43 @@
+<?php
+if(!defined('PHPWG_ROOT_PATH')) die('Hacking attempt!');
+
+// +-----------------------------------------------------------------------+
+//			Suppression d'un concours
+// +-----------------------------------------------------------------------+
+if(isset($_GET['delete'])){
+	pwg_query('DELETE FROM ' . CR_TABLE_1 . ' WHERE id = ' . $_GET['delete'] . ';');
+	pwg_query('DELETE FROM ' . CR_TABLE_2 . ' WHERE contest_id = ' . $_GET['delete'] . ';');
+	redirect(CR_ADMIN);
+}
+
+// +-----------------------------------------------------------------------+
+//			Affichage des concours
+// +-----------------------------------------------------------------------+
+foreach(array('pending','finished') AS $status){
+	$query = "SELECT id, name, visible, date_begin, date_end, logo
+		FROM " . CR_TABLE_1 . "
+		WHERE status = '" . $status . "'
+		ORDER BY date_begin DESC;";
+	$result = pwg_query($query);
+
+	while($contest = pwg_db_fetch_assoc($result)){
+		$template->append('contests_'.$status, array(
+			'NAME' => trigger_event('render_CR_content', $contest['name']),
+			'VISIBLE' => $contest['visible'],
+			'DATE_BEGIN' => format_date($contest['date_begin']),
+			'DATE_END' => format_date($contest['date_end']),
+			'LOGO' => $contest['logo'],
+			'U_RESULTS' => CR_ADMIN . '&tab=results&contest_id=' . $contest['id'],
+			'U_EDIT' => CR_ADMIN . '&tab=edit&contest_id=' . $contest['id'],
+			'U_DELETE' => CR_ADMIN . '&delete=' . $contest['id'],
+			'URL' => CR_PUBLIC . $contest['id'] . '-' . str2url(trigger_event('render_CR_content', $contest['name'])),
+		));
+	}
+}
+
+// +-----------------------------------------------------------------------+
+//				Template
+// +-----------------------------------------------------------------------+
+$template->set_filenames(array('plugin_admin_content' => dirname(__FILE__).'/template/manage.tpl'));
+$template->assign_var_from_handle('ADMIN_CONTENT', 'plugin_admin_content');
+?>
Index: /extensions/ContestResults/admin/new.php
===================================================================
--- /extensions/ContestResults/admin/new.php	(revision 6768)
+++ /extensions/ContestResults/admin/new.php	(revision 6768)
@@ -0,0 +1,142 @@
+<?php
+if (!defined('PHPWG_ROOT_PATH')) die('Hacking attempt!');
+
+// Les quatre zones de texte principales
+$textareas = array('presentation','rules','prices','final');
+
+// +-----------------------------------------------------------------------+
+//		Ajout ou modification d'un concours
+// +-----------------------------------------------------------------------+
+if(isset($_POST['new_submit'])){
+	// Pour les quatre zones de texte crée un tableau définissant le mode d'affichage
+	foreach($textareas AS $key){
+		if(isset($_POST[$key.'_pending'])) $_POST[$key.'_display']['pending'] = true; else $_POST[$key.'_display']['pending'] = false;
+		if(isset($_POST[$key.'_finished'])) $_POST[$key.'_display']['finished'] = true; else $_POST[$key.'_display']['finished'] = false;
+		$_POST[$key.'_display'] = serialize($_POST[$key.'_display']);
+	}
+
+	// Modification d'un concours
+	if(isset($_POST['contest_id'])){
+		$query = "UPDATE " . CR_TABLE_1 . " SET
+			`name` = '" . $_POST['name'] ."',
+			`status` = '" . $_POST['status'] ."',
+			`visible` = '" . $_POST['visible'] ."',
+			`date_begin` = '" . $_POST['date_begin'] ."',
+			`date_end` = '" . $_POST['date_end'] ."',
+			`logo` = '" . $_POST['logo'] ."',
+			`banner` = '" . $_POST['banner'] ."',
+			`summary` = '" . $_POST['summary'] ."',
+			`presentation` = '" . $_POST['presentation'] ."',
+			`presentation_display` = '" . $_POST['presentation_display'] ."',
+			`rules` = '" . $_POST['rules'] ."',
+			`rules_display` = '" . $_POST['rules_display'] ."',
+			`prices` = '" . $_POST['prices'] ."',
+			`prices_display` = '" . $_POST['prices_display'] ."',
+			`final` = '" . $_POST['final'] ."',
+			`final_display` = '" . $_POST['final_display'] ."'
+		WHERE `id` = " . $_POST['contest_id'] .";";
+		
+		pwg_query($query);
+		redirect(CR_ADMIN);
+		
+	// Ajout d'un concours
+	}else{
+		$query = "INSERT INTO " . CR_TABLE_1 . "
+			(
+				name,
+				date_begin,
+				date_end,
+				status,
+				visible,
+				logo,
+				banner,
+				summary,
+				presentation,
+				presentation_display,
+				rules,
+				rules_display,
+				prices,
+				prices_display,
+				final,
+				final_display
+			)
+			VALUES(
+				'" . $_POST['name'] ."',
+				'" . $_POST['date_begin'] ."',
+				'" . $_POST['date_end'] ."',
+				'" . $_POST['status'] ."',
+				'" . $_POST['visible'] ."',
+				'" . $_POST['logo'] ."',
+				'" . $_POST['banner'] ."',
+				'" . $_POST['summary'] ."',
+				'" . $_POST['presentation'] ."',
+				'" . $_POST['presentation_display'] ."',
+				'" . $_POST['rules'] ."',
+				'" . $_POST['rules_display'] ."',
+				'" . $_POST['prices'] ."',
+				'" . $_POST['prices_display'] ."',
+				'" . $_POST['final'] ."',
+				'" . $_POST['final_display'] ."'
+			);";
+		
+		pwg_query($query);
+		redirect(CR_ADMIN);
+	}
+}
+
+
+// +-----------------------------------------------------------------------+
+//		Définition des variables template
+// +-----------------------------------------------------------------------+
+// Edition d'un concours
+if(isset($_GET['contest_id'])){
+	$query = "SELECT * FROM " . CR_TABLE_1 . " WHERE id = " . $_GET['contest_id'] . ";";
+	$contest = pwg_db_fetch_assoc(pwg_query($query));
+		
+	$template->assign(array(
+		'ID' => $contest['id'],
+		'NAME' => $contest['name'],
+		'STATUS' => $contest['status'],
+		'VISIBLE' => $contest['visible'],
+		'DATE_BEGIN' => $contest['date_begin'],
+		'DATE_END' => $contest['date_end'],
+		'LOGO' => $contest['logo'],
+		'BANNER' => $contest['banner'],
+		'SUMMARY' => $contest['summary'],
+	));
+	
+	foreach($textareas AS $key){
+		$contest[$key.'_display'] = unserialize($contest[$key.'_display']);
+		if($contest[$key.'_display']['pending']) $template->assign(strtoupper($key).'_PENDING', true);
+		if($contest[$key.'_display']['finished']) $template->assign(strtoupper($key).'_FINISHED', true);
+		$template->assign(strtoupper($key), $contest[$key]);
+	}
+
+// Ajout d'un concours
+}else{
+	$template->assign(array(
+		'NAME' => null,
+		'STATUS' => 'pending',
+		'VISIBLE' => 1,
+		'DATE_BEGIN' => date('Y-m-d'),
+		'DATE_END' => date('Y-m-d', time()+2592000),
+		'LOGO' => null,
+		'BANNER' => null,
+		'SUMMARY' => null,
+	));
+	
+	foreach($textareas AS $key){
+		$template->assign(array(
+			strtoupper($key).'_PENDING' => true,
+			strtoupper($key).'_FINISHED' => true,
+			strtoupper($key) => null,
+		));
+	}
+}
+
+// +-----------------------------------------------------------------------+
+//				Template
+// +-----------------------------------------------------------------------+
+$template->set_filenames(array('plugin_admin_content' => dirname(__FILE__).'/template/new.tpl'));
+$template->assign_var_from_handle('ADMIN_CONTENT', 'plugin_admin_content');
+?>
Index: /extensions/ContestResults/admin/results.php
===================================================================
--- /extensions/ContestResults/admin/results.php	(revision 6768)
+++ /extensions/ContestResults/admin/results.php	(revision 6768)
@@ -0,0 +1,62 @@
+<?php
+if(!defined('PHPWG_ROOT_PATH')) die('Hacking attempt!');
+
+// +-----------------------------------------------------------------------+
+//			Modification des résultats
+// +-----------------------------------------------------------------------+
+if(isset($_POST['results_modify'])){
+	$query = "DELETE FROM " . CR_TABLE_2 . " WHERE `contest_id` = " . $_POST['contest_id'] .";";
+	pwg_query($query);
+	
+	foreach($_POST['results'] AS $i => $data){
+		$query = "INSERT INTO " . CR_TABLE_2 . "(image_id, contest_id, rank, comment, author)
+			VALUES(
+				'" . $data['image_id'] ."',
+				'" . $_POST['contest_id'] ."',
+				'" . $data['rank'] ."',
+				'" . $data['comment'] ."',
+				'" . $data['author'] . "'
+			);";
+		pwg_query($query);
+	}
+	
+	redirect(CR_ADMIN . '&tab=results&contest_id=' . $_POST['contest_id']);
+}
+
+// +-----------------------------------------------------------------------+
+//			Suppression d'un résultat
+// +-----------------------------------------------------------------------+
+if(isset($_GET['delete_result'])){
+	pwg_query('DELETE FROM ' . CR_TABLE_2 . ' WHERE contest_id = ' . $_GET['contest_id'] . ' AND image_id = ' . $_GET['delete_result'] . ';');
+	redirect(CR_ADMIN . '&tab=results&contest_id=' . $_GET['contest_id']);
+}
+
+// +-----------------------------------------------------------------------+
+// 			Affichage des résultats
+// +-----------------------------------------------------------------------+
+$query = "SELECT name FROM " . CR_TABLE_1 . " WHERE id = " . $_GET['contest_id'] . ";";
+$contest = pwg_db_fetch_assoc(pwg_query($query));
+$template->assign(array(
+	'NAME' => trigger_event('render_CR_content', $contest['name']),
+	'CONTEST_ID' => $_GET['contest_id']
+));
+
+$query = "SELECT * FROM " . CR_TABLE_2 . " WHERE contest_id = " . $_GET['contest_id'] . " ORDER BY rank;";
+$results = pwg_query($query);
+
+while($result = pwg_db_fetch_assoc($results)){
+	$template->append('results', array(
+		'RANK' => $result['rank'],
+		'ID' => $result['image_id'],
+		'AUTHOR' => $result['author'],
+		'COMMENT' => $result['comment'],
+		'U_DELETE' => CR_ADMIN . '&tab=results&contest_id=' . $_GET['contest_id'] . '&delete_result=' . $result['image_id'],
+	));
+}
+
+// +-----------------------------------------------------------------------+
+//				Template
+// +-----------------------------------------------------------------------+
+$template->set_filenames(array('plugin_admin_content' => dirname(__FILE__) . '/template/results.tpl'));
+$template->assign_var_from_handle('ADMIN_CONTENT', 'plugin_admin_content');
+?>
Index: /extensions/ContestResults/admin/template/config.tpl
===================================================================
--- /extensions/ContestResults/admin/template/config.tpl	(revision 6768)
+++ /extensions/ContestResults/admin/template/config.tpl	(revision 6768)
@@ -0,0 +1,68 @@
+{html_head}
+<link rel="stylesheet" type="text/css" href="{$CR_PATH}admin/template/style.css">
+<style>
+	td {ldelim} width:300px; }
+</style>
+{/html_head}
+
+{known_script id="jquery" src=$ROOT_URL|@cat:"themes/default/js/jquery.packed.js"}
+
+<script type="text/javascript">
+	function ToggleConfig(sel, section){ldelim}
+		var obj = $('#config_'+section);
+		if(sel.checked){ldelim}
+			obj.slideDown("slow");
+		}else{ldelim}
+			obj.slideUp("slow");
+		}
+	}
+</script>
+
+<h2 style="float:right;top:-24px;position:relative;font-style:italic;margin-bottom:-20px;font-size:12px;font-weight:normal;">{$CR_VERSION}</h2>
+
+<div class="titrePage">
+	<h2>{'Configuration'|@translate}</h2>
+</div>
+
+<form method="post" action="" class="properties">
+	<fieldset>
+		<legend>{'Menu'|@translate}</legend>
+		<table>	
+			<tr>
+				<td><span class="title">{'CR_menubar_mode'|@translate}</span></td>
+				<td>
+					<label><input type="checkbox" name="menubar_mode_link" value="true" onchange="ToggleConfig(this, 'link');" {$MODE_LINK}> {'CR_menubar_link'|@translate}</label>
+					<label><input type="checkbox" name="menubar_mode_block" value="true" onchange="ToggleConfig(this, 'block');" {$MODE_BLOCK}> {'CR_menubar_block'|@translate}</label>
+				</td>
+			</tr>
+		</table>
+			
+		<table id="config_link">
+			<tr><td colspan="2"><br/></td></tr>
+			<tr>
+				<td><span class="title">{'CR_menubar_link_display'|@translate}</span></td>
+				<td>
+					<label><input type="checkbox" name="menubar_link_menu" value="true" {$LINK_MENU}> {'Menu'|@translate}</label>
+					<label><input type="checkbox" name="menubar_link_specials" value="true" {$LINK_SPECIALS}> {'Specials'|@translate}</label>
+				</td>
+			</tr>
+		</table>
+
+		<table id="config_block">
+			<tr><td colspan="2"><br/></td></tr>
+			<tr>
+				<td><span class="title">{'CR_menubar_block_number'|@translate}</span></td>
+				<td>
+					<input type="text" size="2" maxlength="2" name="menubar_block_number" value="{$BLOCK_NUMBER}"/>
+				</td>
+			</tr>
+		</table>
+	</fieldset>
+
+	<p><input class="submit" type="submit" value="{'Submit'|@translate}" name="config_submit"/></p>
+</form>
+
+<script type="text/javascript">
+	ToggleConfig(document.forms[0].elements['menubar_mode_link'], 'link');
+	ToggleConfig(document.forms[0].elements['menubar_mode_block'], 'block');
+</script>
Index: /extensions/ContestResults/admin/template/index.php
===================================================================
--- /extensions/ContestResults/admin/template/index.php	(revision 6768)
+++ /extensions/ContestResults/admin/template/index.php	(revision 6768)
@@ -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/ContestResults/admin/template/manage.tpl
===================================================================
--- /extensions/ContestResults/admin/template/manage.tpl	(revision 6768)
+++ /extensions/ContestResults/admin/template/manage.tpl	(revision 6768)
@@ -0,0 +1,84 @@
+{html_head}
+<link rel="stylesheet" type="text/css" href="{$CR_PATH}admin/template/style.css">
+{/html_head}
+
+<h2 style="float:right;top:-24px;position:relative;font-style:italic;margin-bottom:-20px;font-size:12px;font-weight:normal;">{$CR_VERSION}</h2>
+
+<div class="titrePage">
+	<h2>{'CR_manage_tab'|@translate}</h2>
+</div>
+
+{if !isset($contests_pending) and !isset($contests_finished)}
+	{'CR_no_contest'|@translate}<br>
+	<a href="admin.php?page=plugin&section=ContestResults/admin/admin.php&tab=new">{'CR_new_tab'|@translate}</a>
+{/if}
+
+{if isset($contests_pending)}
+	<fieldset>
+		<legend>{'CR_pending_title'|@translate}</legend>
+		<form id="categoryOrdering">
+			<ul class="categoryUl">
+				{foreach from=$contests_pending item=contest name=pending_loop}
+					<li class="categoryLi {if $smarty.foreach.pending_loop.index is odd}virtual_cat{/if} {if $contest.VISIBLE == 0}hidden{/if}">
+						<ul class="categoryActions">
+							<li>
+								<a href="{$contest.U_EDIT}" title="{'CR_edit_tab'|@translate}">
+									<img src="{$themeconf.admin_icon_dir}/category_edit.png" class="button" alt="{'CR_edit_tab'|@translate}"/>
+								</a>
+							</li>
+							<li>
+								<a href="{$contest.U_RESULTS}" title="{'CR_results_tab'|@translate}">
+									<img src="{$themeconf.admin_icon_dir}/category_elements.png" class="button" alt="{'CR_results_tab'|@translate}"/>
+								</a>
+							</li>
+							<li>
+								<a href="{$contest.U_DELETE}" title="{'CR_delete'|@translate}" onclick="return confirm('{'Are you sure?'|@translate}');">
+									<img src="{$themeconf.admin_icon_dir}/category_delete.png" class="button" alt="{'CR_delete'|@translate}" />
+								</a>
+							</li>
+						</ul>
+						<p>
+							{if !empty($contest.LOGO)}<img src="{$contest.LOGO}" width="13px" class="button"/>{/if}
+							<strong><a href="{$contest.URL}" title="{'CR_go'|@translate}">{$contest.NAME}</a></strong> - {$contest.DATE_BEGIN} | {$contest.DATE_END}
+						</p>
+					</li>
+				{/foreach}
+			</ul>
+		</form>
+	</fieldset>
+{/if}
+
+{if isset($contests_finished)}
+	<fieldset>
+		<legend>{'CR_finished_title'|@translate}</legend>
+		<form id="categoryOrdering">
+			<ul class="categoryUl">
+				{foreach from=$contests_finished item=contest name=finished_loop}
+					<li class="categoryLi {if $smarty.foreach.finished_loop.index is odd}virtual_cat{/if} {if $contest.VISIBLE == 0}novisible{/if}">
+						<ul class="categoryActions">
+							<li>
+								<a href="{$contest.U_EDIT}" title="{'CR_edit_tab'|@translate}">
+									<img src="{$themeconf.admin_icon_dir}/category_edit.png" class="button" alt="{'CR_edit_tab'|@translate}"/>
+								</a>
+							</li>
+							<li>
+								<a href="{$contest.U_RESULTS}" title="{'CR_results_tab'|@translate}">
+									<img src="{$themeconf.admin_icon_dir}/category_elements.png" class="button" alt="{'CR_results_tab'|@translate}"/>
+								</a>
+							</li>
+							<li>
+								<a href="{$contest.U_DELETE}" title="{'CR_delete'|@translate}" onclick="return confirm('{'Are you sure?'|@translate}');">
+									<img src="{$themeconf.admin_icon_dir}/category_delete.png" class="button" alt="{'CR_delete'|@translate}" />
+								</a>
+							</li>
+						</ul>
+						<p>
+							{if !empty($contest.LOGO)}<img src="{$contest.LOGO}" width="13px" class="button"/>{/if}
+							<strong><a href="{$contest.URL}" title="{'CR_go'|@translate}">{$contest.NAME}</a></strong> - {$contest.DATE_BEGIN} | {$contest.DATE_END}
+						</p>
+					</li>
+				{/foreach}
+			</ul>
+		</form>
+	</fieldset>
+{/if}
Index: /extensions/ContestResults/admin/template/new.tpl
===================================================================
--- /extensions/ContestResults/admin/template/new.tpl	(revision 6768)
+++ /extensions/ContestResults/admin/template/new.tpl	(revision 6768)
@@ -0,0 +1,137 @@
+{html_head}
+	<link rel="stylesheet" type="text/css" href="{$CR_PATH}admin/template/style.css">
+{/html_head}
+
+{known_script id="jquery" src=$ROOT_URL|@cat:"themes/default/js/jquery.packed.js"}
+{known_script id="jquery.cluetip" src=$ROOT_URL|@cat:"themes/default/js/plugins/jquery.cluetip.packed.js"}
+
+{include file='include/autosize.inc.tpl'}
+{include file='include/datepicker.inc.tpl'}
+
+<script type="text/javascript">
+	$(function() {ldelim}
+		$("#DateBegin").datepicker({ldelim}dateFormat:"yy-mm-dd", firstDay:1});
+		$("#DateEnd").datepicker({ldelim}dateFormat:"yy-mm-dd", firstDay:1});
+	});
+
+	jQuery().ready(function(){ldelim}
+		jQuery('.cluetip').cluetip({ldelim}
+			width: 550,
+			splitTitle: '|'
+		});
+	});
+</script>
+
+<h2 style="float:right;top:-24px;position:relative;font-style:italic;margin-bottom:-20px;font-size:12px;font-weight:normal;">{$CR_VERSION}</h2>
+
+<div class="titrePage">
+	<h2>{if isset($NAME)}{'CR_edit_tab'|@translate|cat:' : '|cat:$NAME}{else}{'CR_new_tab'|@translate}{/if}</h2>
+</div>
+
+<form method="post" action="" class="properties">
+	<fieldset>
+		<legend>{'Configuration'|@translate}</legend>
+		<table>
+			<tr>
+				<td><span class="title cluetip" title="{'CR_title'|@translate}|{'CR_help_title'|@translate}{'CR_help_lang'|@translate}">{'CR_title'|@translate}</span></td>
+				<td colspan="3"><input type="text" size="65" maxlength="255" name="name" value="{$NAME}"/></td>
+			</tr>
+			
+			<tr><td colspan="4"><br/></td></tr>
+			
+			<tr>
+				<td><span class="title cluetip" title="{'CR_status'|@translate}|{'CR_help_status'|@translate}">
+					{'CR_status'|@translate}
+				</span></td>
+				<td>
+					<label><input type="radio" name="status" value="pending" {if $STATUS == 'pending'}checked="checked"{/if}> {'CR_pending'|@translate}</label>
+					<label><input type="radio" name="status" value="finished" {if $STATUS == 'finished'}checked="checked"{/if}> {'CR_finished'|@translate}</label>
+				</td>
+				<td><span class="title cluetip" title="{'CR_visible'|@translate}|{'CR_help_visible'|@translate}">
+					{'CR_visible'|@translate}
+				</span></td>
+				<td>
+					<label><input type="radio" name="visible" value="1" {if $VISIBLE == 1}checked="checked"{/if}> {'Yes'|@translate}</label>
+					<label><input type="radio" name="visible" value="0" {if $VISIBLE == 0}checked="checked"{/if}> {'No'|@translate}</label>
+				</td>
+			</tr>
+			<tr>
+				<td><span class="title">{'CR_dateB'|@translate}</span></td>
+				<td><input type="text" size="11" maxlength="10" value="{$DATE_BEGIN}" id="DateBegin" class="inputdate" name="date_begin"/></td>
+				<td><span class="title">{'CR_dateE'|@translate}</span></td>
+				<td><input type="text" size="11" maxlength="10" value="{$DATE_END}" id="DateEnd" class="inputdate" name="date_end"/></td>
+			</tr>
+
+			<tr><td colspan="4"><br/></td></tr>
+			
+			<tr>
+				<td><span class="title">{'CR_logo'|@translate}</span></td>
+				<td colspan="3"><input type="text" size="65" maxlength="255" value="{$LOGO}" name="logo"/></td>
+			</tr>
+			<tr>
+				<td><span class="title">{'CR_banner'|@translate}</span></td>
+				<td colspan="3"><input type="text" size="65" maxlength="255" value="{$BANNER}" name="banner"/></td>
+			</tr>
+			
+			<tr><td colspan="4"><br/></td></tr>
+			
+			<tr>
+				<td><span class="title cluetip" title="{'CR_summary'|@translate}|{'CR_help_summary'|@translate}{'CR_help_lang'|@translate}">
+					{'CR_summary'|@translate}
+				</span></td>
+				<td colspan="3"><textarea name="summary" id ="textarea" rows="4" cols="50">{$SUMMARY}</textarea></td>
+			</tr>
+		</table>
+	</fieldset>
+	
+	<div class="textareas"><span class="title cluetip" title="{'CR_textareas'|@translate}|{'CR_help_textareas'|@translate}{'CR_help_lang'|@translate}">
+		{'CR_textareas'|@translate}
+	</span></div>
+
+	<fieldset>
+		<legend>{'CR_presentation'|@translate}</legend>
+		<div align="center">
+			<textarea name="presentation" id ="textarea" rows="4" cols="50" style="width:70%;">{$PRESENTATION}</textarea>
+			<br/>
+			{'CR_visibility'|@translate} :
+			<label><input type="checkbox" name="presentation_pending" value="true" {if isset($PRESENTATION_PENDING)}checked="checked"{/if}> {'CR_pending'|@translate}</label>
+			<label><input type="checkbox" name="presentation_finished" value="true" {if isset($PRESENTATION_FINISHED)}checked="checked"{/if}> {'CR_finished'|@translate}</label>
+		</div>
+	</fieldset>
+
+	<fieldset>
+		<legend>{'CR_rules'|@translate}</legend>
+		<div align="center">
+			<textarea name="rules" id ="textarea" rows="4" cols="50" style="width:70%;">{$RULES}</textarea>
+			<br/>
+			{'CR_visibility'|@translate} :
+			<label><input type="checkbox" name="rules_pending" value="true" {if isset($RULES_PENDING)}checked="checked"{/if}> {'CR_pending'|@translate}</label>
+			<label><input type="checkbox" name="rules_finished" value="true" {if isset($RULES_FINISHED)}checked="checked"{/if}> {'CR_finished'|@translate}</label>
+		</div>
+	</fieldset>
+
+	<fieldset>
+		<legend>{'CR_prices'|@translate}</legend>
+		<div align="center">
+			<textarea name="prices" id ="textarea" rows="4" cols="50" style="width:70%;">{$PRICES}</textarea>
+			<br/>
+			{'CR_visibility'|@translate} :
+			<label><input type="checkbox" name="prices_pending" value="true" {if isset($PRICES_PENDING)}checked="checked"{/if}> {'CR_pending'|@translate}</label>
+			<label><input type="checkbox" name="prices_finished" value="true" {if isset($PRICES_FINISHED)}checked="checked"{/if}> {'CR_finished'|@translate}</label>
+		</div>
+	</fieldset>
+
+	<fieldset>
+		<legend>{'CR_final'|@translate}</legend>
+		<div align="center">
+			<textarea name="final" id ="textarea" rows="4" cols="50" style="width:70%;">{$FINAL}</textarea>
+			<br/>
+			{'CR_visibility'|@translate} :
+			<label><input type="checkbox" name="final_pending" value="true" {if isset($FINAL_PENDING)}checked="checked"{/if}> {'CR_pending'|@translate}</label>
+			<label><input type="checkbox" name="final_finished" value="true" {if isset($FINAL_FINISHED)}checked="checked"{/if}> {'CR_finished'|@translate}</label>
+		</div>
+	</fieldset>
+
+	{if isset($ID)}<input type="hidden" name="contest_id" value="{$ID}"/>{/if}
+	<p><input class="submit" type="submit" value="{'Submit'|@translate}" name="new_submit"/></p>
+</form>
Index: /extensions/ContestResults/admin/template/results.tpl
===================================================================
--- /extensions/ContestResults/admin/template/results.tpl	(revision 6768)
+++ /extensions/ContestResults/admin/template/results.tpl	(revision 6768)
@@ -0,0 +1,122 @@
+{include file='include/autosize.inc.tpl'}
+
+{known_script id="jquery" src=$ROOT_URL|@cat:"themes/default/js/jquery.packed.js"}
+{known_script id="jquery.ui" src=$ROOT_URL|@cat:"themes/default/js/ui/packed/ui.core.packed.js" }
+{known_script id="jquery.ui.sortable" src=$ROOT_URL|@cat:"themes/default/js/ui/packed/ui.sortable.packed.js" }
+{known_script id="jquery.cluetip" src=$ROOT_URL|@cat:"themes/default/js/plugins/jquery.cluetip.packed.js"}
+
+{html_head}
+<link rel="stylesheet" type="text/css" href="{$CR_PATH}admin/template/style.css">
+
+<script type="text/javascript">
+	function CreateResultField(j, new_contest){ldelim}
+		// Si il n'y a aucun résultats on efface le message
+		if(new_contest) document.getElementById('categoryUl').innerHTML = '';
+		
+		// Ajoute à la fin de la liste une nouvelle ligne de résultat vide
+		var new_result = document.createElement('li');
+		new_result.setAttribute('id', 'result_'+(j));
+		new_result.setAttribute('class', 'categoryLi virtual_cat');
+		
+		document.getElementById('categoryUl').appendChild(new_result);
+		
+		new_result.innerHTML = '<ul class="categoryActions"> '+
+			'<li> '+
+				'<a href="#" title="{'CR_delete_result'|@translate}" onclick="DeleteResultField('+j+');return false;"> '+
+					'<img src="{$themeconf.admin_icon_dir}/category_delete.png" class="button" alt="{'CR_delete_result'|@translate}" /> '+
+				'</a> '+
+			'</li> '+
+			'</ul> '+
+			'<p> '+
+				'<img src="{$themeconf.admin_icon_dir}/cat_move.png" class="button drag_button" style="display:none;" alt="{'Drag to re-order'|@translate}" title="{'Drag to re-order'|@translate}"> '+
+				'{'CR_image_no'|@translate} <input type="text" size="6" name="results['+j+'][image_id]" value=""/> '+
+				'{'CR_author'|@translate} : <input type="text" name="results['+j+'][author]" value=""/> '+
+				'<textarea class="result_comment" name="results['+j+'][comment]">{'CR_comment'|@translate}</textarea> '+
+			'</p> '+
+			'<p class="catPos">{'CR_rank'|@translate} : <input type="text" name="results['+j+'][rank]" value=""/></p>';
+		
+		// Remplace le lien de création
+		document.getElementById('AddLink').innerHTML = '<input class="submit" type="submit" onclick="CreateResultField('+(j+1)+');return false;" value="{'CR_addfield'|@translate}"/>';
+		
+		// Réinitiliase les fonctions jQuery
+		jQuery(".catPos").hide();
+		jQuery(".drag_button").show();
+		jQuery(".categoryLi").css("cursor","move");
+		jQuery('textarea').autogrow();
+		jQuery('textarea').css('overflow-y', 'hidden');
+	}
+
+	function DeleteResultField(k){ldelim}
+		var result = document.getElementById('result_'+k);
+		var parent = result.parentNode;
+		parent.removeChild(result);
+	}
+
+	jQuery().ready(function(){ldelim}
+		jQuery(".catPos").hide();
+		jQuery(".drag_button").show();
+		jQuery(".categoryLi").css("cursor","move");
+		jQuery(".categoryUl").sortable({ldelim}
+			axis: "y",
+			opacity: 0.8
+		});
+		jQuery("#categoryOrdering").submit(function(){ldelim}
+			ar = jQuery('.categoryUl').sortable('toArray');
+			for(i=0;i<ar.length;i++) {ldelim}
+				cat = ar[i].split('result_');
+				document.getElementsByName('results[' + cat[1] + '][rank]')[0].value = i+1;
+			}
+		});
+		jQuery('.cluetip').cluetip({ldelim}
+			width: 550,
+			splitTitle: '|'
+		});
+	});
+</script>
+{/html_head}
+
+<h2 style="float:right;top:-24px;position:relative;font-style:italic;margin-bottom:-20px;font-size:12px;font-weight:normal;">{$CR_VERSION}</h2>
+
+<div class="titrePage">
+	<h2>
+		{'CR_results_tab'|@translate|cat:' : '|cat:$NAME} 
+		<span class="cluetip" title="{'CR_results_tab'|@translate}|{'CR_help_results'|@translate}{'CR_help_lang'|@translate}">
+			<img src="{$ROOT_URL}{$themeconf.admin_icon_dir}/help.png"/>
+		</span>
+	</h2>
+</div>
+
+<form method="post" id="categoryOrdering" action="">
+	<ul class="categoryUl" id="categoryUl">
+		{counter start=0 assign=i}
+		{if isset($results)}
+			{foreach from=$results item=result name=result_loop}
+				<li class="categoryLi" id="result_{$i}">
+					<ul class="categoryActions">
+						<li>
+							<a href="{$result.U_DELETE}">
+								<img src="{$themeconf.admin_icon_dir}/category_delete.png" class="button" alt="{'CR_delete_result'|@translate}" />
+							</a>
+						</li>
+					</ul>
+					<p>
+						<img src="{$themeconf.admin_icon_dir}/cat_move.png" class="button drag_button" style="display:none;" alt="{'Drag to re-order'|@translate}" title="{'Drag to re-order'|@translate}">
+						{'CR_image_no'|@translate} <input type="text" size="6" name="results[{$i}][image_id]" value="{$result.ID}"/>
+						{'CR_author'|@translate} : <input type="text" name="results[{$i}][author]" value="{$result.AUTHOR}"/>
+						<textarea class="result_comment" name="results[{$i}][comment]">{$result.COMMENT}</textarea>
+					</p>
+					<p class="catPos">{'CR_rank'|@translate} : <input type="text" name="results[{$i}][rank]" value="{$result.RANK}"/></p>
+				</li>
+				{counter}
+			{/foreach}
+		{else}
+			{'CR_no_result'|@translate}
+		{/if}
+	</ul>
+	
+	<p>
+		<span id="AddLink"><input class="submit" type="submit" onclick="CreateResultField({$i}{if !isset($results)}, true{/if});return false;" value="{'CR_addfield'|@translate}"/></span>
+		<input type="hidden" name="contest_id" value="{$CONTEST_ID}"/>
+		<input class="submit" type="submit" value="{'Submit'|@translate}" name="results_modify"/>
+	</p>
+</form>
Index: /extensions/ContestResults/admin/template/style.css
===================================================================
--- /extensions/ContestResults/admin/template/style.css	(revision 6768)
+++ /extensions/ContestResults/admin/template/style.css	(revision 6768)
@@ -0,0 +1,45 @@
+.titrePage {
+	clear:right;
+}
+.titrePage h2 {
+	text-align:center;
+}
+
+.result_comment {
+	width:95%;
+	min-height:40px;
+	margin-left:5%;
+}
+
+LI.categoryLi.novisible {
+	opacity:0.5;
+}
+
+table {
+	width:600px;
+}
+td {
+	width:150px;
+	white-space: nowrap;
+}
+.title {
+	display:block;
+	font-weight:bold;
+	text-align:right;
+	margin-right:10px;
+}
+.title.cluetip:after {
+	margin-left:5px;
+	content:url('image/help.png');
+	vertical-align:top;
+}
+div.textareas span.title.cluetip{
+	text-align:center;
+	margin:20px 0 -10px 0;
+	font-size:1.2em;
+}
+input.inputdate {
+	background-image:url('image/calendar.png');
+	background-repeat:no-repeat;
+	background-position:center right;
+}
Index: /extensions/ContestResults/changelog.txt
===================================================================
--- /extensions/ContestResults/changelog.txt	(revision 6768)
+++ /extensions/ContestResults/changelog.txt	(revision 6768)
@@ -0,0 +1,10 @@
+1.1
+- Add menu block/links + configuration
+- Code revision
+
+1.0.a
+- Disable logos on the global page for finished contests
+- main.inc.php fixed
+
+1.0
+- First version
Index: /extensions/ContestResults/include/cr_comment_picture.php
===================================================================
--- /extensions/ContestResults/include/cr_comment_picture.php	(revision 6768)
+++ /extensions/ContestResults/include/cr_comment_picture.php	(revision 6768)
@@ -0,0 +1,48 @@
+<?php
+if (!defined('PHPWG_ROOT_PATH')) die('Hacking attempt!');
+
+// +-----------------------------------------------------------------------+
+// Requète simple pour savoir si l'image a participé à des concours 
+// +-----------------------------------------------------------------------+
+$query = "SELECT image_id FROM " . CR_TABLE_2 . " WHERE image_id = " . $page['image_id'] . ";";
+$results = pwg_query($query);
+
+if(pwg_db_num_rows($results)){
+	$query = "SELECT 
+			i.rank,
+			i.comment,
+			c.name AS contest_name,
+			c.id AS contest_id
+		FROM " . CR_TABLE_2 . " AS i
+		INNER JOIN " . CR_TABLE_1 . " AS c
+		ON i.contest_id = c.id
+		WHERE i.image_id = " . $page['image_id'] . "
+		ORDER BY c.date_begin DESC;";
+	$results = pwg_query($query);
+	
+	// Gère plusieurs participations
+	$comment = null;
+	while($result = pwg_db_fetch_assoc($results)){
+		// rang amélioré
+		if($result['rank'] <= 3) $result['rank'] = l10n('CR_order_'.$result['rank']);
+		else $result['rank'] .= l10n('CR_order_sup');
+		
+		// Lien vers le concours
+		$result['contest_name'] = trigger_event('render_CR_content', $result['contest_name']);
+		$result['contest_link'] = CR_PUBLIC . $result['contest_id'] . '-' . str2url($result['contest_name']);
+		
+		// Ajoute le commentaire après la description
+		$comment .= '<div style="border:1px solid #404040;padding:10px;margin:10px 25%">
+			<b><a href="' . $result['contest_link'] .'">' . $result['contest_name'] . '</a></b> 
+			:: <u>' . $result['rank'] . '</u>
+			<p>' . trigger_event('render_CR_content', $result['comment']) . '</p>
+		</div>';
+		
+		// Ajoute un lien vers le concours dans les albums
+		$template->append('related_categories', '<a href="' . CR_PUBLIC . '">' . l10n('Contests') . '</a>' . $conf['level_separator'] . '<a href="' . $result['contest_link'] . '">' . $result['contest_name'] . '</a>');
+	}
+
+	$template->assign('COMMENT_IMG', $template->get_template_vars('COMMENT_IMG') . $comment);
+}
+
+?>
Index: /extensions/ContestResults/include/cr_main.php
===================================================================
--- /extensions/ContestResults/include/cr_main.php	(revision 6768)
+++ /extensions/ContestResults/include/cr_main.php	(revision 6768)
@@ -0,0 +1,63 @@
+<?php 
+if (!defined('PHPWG_ROOT_PATH')) die('Hacking attempt!');
+
+// +-----------------------------------------------------------------------+
+//			Liste des concours
+// +-----------------------------------------------------------------------+
+$query = "SELECT id, name, visible, date_begin, date_end, status, logo, summary FROM " . CR_TABLE_1 . " ORDER BY date_begin DESC;";
+$contests = pwg_query($query);
+
+while($contest = pwg_db_fetch_assoc($contests)){
+	if($contest['visible'] OR is_admin()){
+		// infos sur le concours
+		$item =  array(
+			'ID' => $contest['id'],
+			'NAME' => trigger_event('render_CR_content', $contest['name']),
+			'VISIBLE' => $contest['visible'],
+			'STATUS' => $contest['status'],
+			'DATE_END' => format_date($contest['date_end']),
+			'DATE_BEGIN' => format_date($contest['date_begin']),
+			'LOGO' => $contest['logo'],
+			'SUMMARY' => trigger_event('render_CR_content', $contest['summary']),
+			'URL' => CR_PUBLIC . $contest['id'] . '-' . str2url(trigger_event('render_CR_content', $contest['name'])),
+		);
+		
+		// podium si terminé
+		if($contest['status'] == 'finished'){
+			$query = "SELECT
+					i.id,
+					i.name,
+					i.file,
+					i.path,
+					i.tn_ext,
+					c.rank,
+					c.author
+				FROM " . IMAGES_TABLE . " AS i
+				INNER JOIN " . CR_TABLE_2 . " AS c
+				ON c.image_id = i.id
+				WHERE c.contest_id = " . $contest['id'] . "
+				ORDER BY c.rank ASC
+				LIMIT 3 OFFSET 0;";
+			$results = pwg_query($query);
+			
+			while($result = pwg_db_fetch_assoc($results)){
+				$item['RESULTS'][$result['rank']] = array(
+					'RANK' => $result['rank'],
+					'AUTHOR' => $result['author'],
+					'TN_SRC' => get_thumbnail_url($result)
+				);
+			}
+		}
+
+		$template->append('contests_'.$contest['status'], $item);
+	}
+}
+
+$template->set_filenames(array('index'=> dirname(__FILE__).'/../template/cr_main.tpl'));
+
+// +-----------------------------------------------------------------------+
+//				Template
+// +-----------------------------------------------------------------------+
+$template->assign('CR_PATH', CR_PATH);
+$template->assign('SEPARATOR', $conf['level_separator']);
+?>
Index: /extensions/ContestResults/include/cr_menubar.php
===================================================================
--- /extensions/ContestResults/include/cr_menubar.php	(revision 6768)
+++ /extensions/ContestResults/include/cr_menubar.php	(revision 6768)
@@ -0,0 +1,77 @@
+<?php
+if (!defined('PHPWG_ROOT_PATH')) die('Hacking attempt!');
+
+// +-----------------------------------------------------------------------+
+//				Trigger
+// +-----------------------------------------------------------------------+
+global $conf;
+$config = unserialize($conf['ContestResults']);
+if($config['menubar_mode']['block'])
+	add_event_handler('blockmanager_register_blocks', 'CR_register_menubar_blocks');
+add_event_handler('blockmanager_apply', 'CR_menubar_apply');
+
+// +-----------------------------------------------------------------------+
+//				Ajouter un block
+// +-----------------------------------------------------------------------+
+function CR_register_menubar_blocks($menu_ref_arr){
+	$menu = &$menu_ref_arr[0];
+	if($menu->get_id() != 'menubar') return;
+	$menu->register_block(new RegisteredBlock('mbContestResults', l10n('Contests'), 'ContestResults'));
+}
+
+// +-----------------------------------------------------------------------+
+//			Remplis les block
+// +-----------------------------------------------------------------------+
+function CR_menubar_apply($menu_ref_arr){
+	global $template, $conf;
+	$config = unserialize($conf['ContestResults']);
+	$menu = &$menu_ref_arr[0];
+	
+	// Block Contest
+	if(($block = $menu->get_block('mbContestResults')) != null){
+		$data = array();
+
+		$query = "SELECT id, name, visible, status, date_begin, date_end 
+			FROM " . CR_TABLE_1 . " 
+			ORDER BY date_begin DESC 
+			LIMIT " . $config['menubar_block']['number'] . " OFFSET 0;";
+		$result = pwg_query($query);
+
+		while($contest = pwg_db_fetch_assoc($result)){
+			if($contest['visible'] OR is_admin()){
+				array_push($data, array(
+					'URL' => CR_PUBLIC . $contest['id'] . '-' . str2url(trigger_event('render_CR_content', $contest['name'])),
+					'LABEL' => trigger_event('render_CR_content', $contest['name']),
+					'DATE' => format_date($contest['date_begin']) . ' - ' . format_date($contest['date_end']),
+					'STATUS' => $contest['status']
+				));
+			}
+		}
+
+		if(!empty($data)){
+			$template->set_template_dir(CR_PATH . 'template/');
+			$block->set_title('<a href="' . CR_PUBLIC . '">' . l10n('Contests') . '</a>');
+			$block->template = 'cr_menubar.tpl';
+			$block->data = $data;
+		}
+	}
+	
+	// Block Menu
+	if($config['menubar_mode']['link'] AND $config['menubar_link']['menu'] AND ($block = $menu->get_block('mbMenu')) != null){
+		array_push($block->data, array(
+			'URL' => CR_PUBLIC,
+			'TITLE' => l10n('Contests'),
+			'NAME' => l10n('Contests')
+		));
+	}
+	
+	// Block Specials
+	if($config['menubar_mode']['link'] AND $config['menubar_link']['specials'] AND ($block = $menu->get_block('mbSpecials')) != null){
+		array_push($block->data, array(
+			'URL' => CR_PUBLIC,
+			'TITLE' => l10n('Contests'),
+			'NAME' => l10n('Contests')
+		));
+	}
+}
+?>
Index: /extensions/ContestResults/include/cr_page.php
===================================================================
--- /extensions/ContestResults/include/cr_page.php	(revision 6768)
+++ /extensions/ContestResults/include/cr_page.php	(revision 6768)
@@ -0,0 +1,111 @@
+<?php 
+if (!defined('PHPWG_ROOT_PATH')) die('Hacking attempt!');
+
+// +-----------------------------------------------------------------------+
+//			Page d'un concours
+// +-----------------------------------------------------------------------+
+if(is_admin()){
+	$template->assign('U_EDIT', CR_ADMIN . '&tab=edit&contest_id=' . $page['contest']);
+	$template->assign('U_RESULTS', CR_ADMIN . '&tab=results&contest_id=' . $page['contest']);
+}
+
+// Infos du concours
+$query = "SELECT * FROM " . CR_TABLE_1 . " WHERE id=" . $page['contest'] . ";";
+$contest = pwg_db_fetch_assoc(pwg_query($query));
+
+if($contest['visible'] OR is_admin()){
+	// Paramètres généraux
+	$template->assign(array(
+		'ID' => $contest['id'],
+		'NAME' => trigger_event('render_CR_content', $contest['name']),
+		'STATUS' => $contest['status'],
+		'VISIBLE' => $contest['visible'],
+		'DATE_BEGIN' => format_date($contest['date_begin']),
+		'DATE_END' => format_date($contest['date_end']),
+		'LOGO' => $contest['logo'],
+		'BANNER' => $contest['banner'],
+		'URL' => CR_PUBLIC . $contest['id'] . '-' . str2url(trigger_event('render_CR_content', $contest['name'])),
+	));
+	
+	// Quatre zones texte
+	foreach(array('presentation','rules','prices','final') AS $key){
+		$contest[$key.'_display'] = unserialize($contest[$key.'_display']);
+		if($contest[$key.'_display']['pending']) $template->assign(strtoupper($key).'_PENDING', true);
+		if($contest[$key.'_display']['finished']) $template->assign(strtoupper($key).'_FINISHED', true);
+		$template->assign(strtoupper($key), trigger_event('render_CR_content', $contest[$key]));
+	}
+	
+	// Affichage des résultats
+	if($contest['status'] == 'finished'){
+		// Infos des résultats
+		$query = "SELECT * FROM " . CR_TABLE_2 . " WHERE contest_id=" . $contest['id'] . " ORDER BY rank ASC;";
+		$results = pwg_query($query);
+		
+		while($result = pwg_db_fetch_assoc($results)){
+			// Infos de l'image
+			$query = "SELECT
+					i.id,
+					i.name,
+					i.file,
+					i.path,
+					i.tn_ext,
+					ic.category_id
+				FROM " . IMAGES_TABLE . " AS i
+				INNER JOIN " . IMAGE_CATEGORY_TABLE . " AS ic
+				ON ic.image_id = i.id
+				WHERE i.id = " . $result['image_id'] . ";";
+			$image = pwg_db_fetch_assoc(pwg_query($query));
+			
+			// Nom de l'image
+			if(empty($image['name']))
+				$image['name'] = get_name_from_file($image['file']);
+
+			// retrieving category informations
+			$query = "SELECT id, name, permalink, uppercats
+				FROM " . CATEGORIES_TABLE."
+				WHERE id = " . $image['category_id'] . ";";
+			$image['cat'] = pwg_db_fetch_assoc(pwg_query($query));
+	
+			// link to the full size picture
+			$image['url'] = make_picture_url(array(
+				'category' => $image['cat'],
+				'image_id' => $image['id'],
+				'image_file' => $image['file'],
+			));			
+			
+			// Template
+			if(in_array($result['rank'], array(1,2,3))){
+				$array = array(
+					'RANK' => $result ['rank'],
+					'AUTHOR' => $result['author'],
+					'IMAGE_SRC' => str_replace('thumbnail/'.$conf['prefix_thumbnail'], null, get_thumbnail_url($image)),
+					'IMAGE_URL' => $image['url'],
+					'IMAGE_NAME' => $image['name'],
+					'COMMENT' => CR_cut_string(trigger_event('render_CR_content', $result['comment']), 450),
+					);
+			}else{
+				$array = array(
+					'RANK' => $result ['rank'],
+					'AUTHOR' => $result['author'],
+					'TN_SRC' => get_thumbnail_url($image),
+					'IMAGE_URL' => $image['url'],
+					'IMAGE_NAME' => $image['name'],
+				);
+			}
+			$template->append('RESULTS', $array);
+		}
+	}
+	
+	$template->set_filenames(array('index'=> dirname(__FILE__).'/../template/cr_page.tpl'));
+	
+}else{
+	page_not_found(l10n('CR_notavailable'));
+}
+
+
+// +-----------------------------------------------------------------------+
+//				Template
+// +-----------------------------------------------------------------------+
+$template->assign('CR_PATH', CR_PATH);
+$template->assign('SEPARATOR', $conf['level_separator']);
+?>
Index: /extensions/ContestResults/include/functions.php
===================================================================
--- /extensions/ContestResults/include/functions.php	(revision 6768)
+++ /extensions/ContestResults/include/functions.php	(revision 6768)
@@ -0,0 +1,41 @@
+<?php
+if (!defined('PHPWG_ROOT_PATH')) die('Hacking attempt!');
+
+if(!function_exists('get_user_language_desc')){
+	function get_user_language_desc($desc){
+		global $user;
+		$user_lang = substr($user['language'], 0, 2);
+
+		if(!substr_count(strtolower($desc), '[lang=' . $user_lang . ']')){
+			$user_lang = 'default';
+		}
+
+		if(substr_count(strtolower($desc), '[lang=' . $user_lang . ']')){
+			// la balise avec la langue de l'utilisateur a été trouvée
+			$patterns[] = '#(^|\[/lang\])(.*?)(\[lang=(' . $user_lang . '|all)\]|$)#is';
+			$replacements[] = '';
+			$patterns[] = '#\[lang=(' . $user_lang . '|all)\](.*?)\[/lang\]#is';
+			$replacements[] = '\\1';
+
+		}else{
+			// la balise avec la langue de l'utilisateur n'a pas été trouvée
+			// On prend tout ce qui est hors balise
+			$patterns[] = '#\[lang=all\](.*?)\[/lang\]#is';
+			$replacements[] = '\\1';
+			$patterns[] = '#\[lang=.*\].*\[/lang\]#is';
+			$replacements[] = '';
+		}
+		return preg_replace($patterns, $replacements, $desc);
+	}
+}
+
+function CR_cut_string($string, $lg){
+	if(strlen($string) > $lg){
+		$string = substr($string, 0, $lg);
+		$last_space = strrpos($string,' ');
+		return substr($string, 0, $last_space).'...';
+	}else{
+		return $string;
+	}
+}
+?>
Index: /extensions/ContestResults/include/index.php
===================================================================
--- /extensions/ContestResults/include/index.php	(revision 6768)
+++ /extensions/ContestResults/include/index.php	(revision 6768)
@@ -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/ContestResults/index.php
===================================================================
--- /extensions/ContestResults/index.php	(revision 6768)
+++ /extensions/ContestResults/index.php	(revision 6768)
@@ -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/ContestResults/language/en_UK/index.php
===================================================================
--- /extensions/ContestResults/language/en_UK/index.php	(revision 6768)
+++ /extensions/ContestResults/language/en_UK/index.php	(revision 6768)
@@ -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/ContestResults/language/en_UK/plugin.lang.php
===================================================================
--- /extensions/ContestResults/language/en_UK/plugin.lang.php	(revision 6768)
+++ /extensions/ContestResults/language/en_UK/plugin.lang.php	(revision 6768)
@@ -0,0 +1,64 @@
+<?php
+
+$lang['Contests'] = 'Contests';
+$lang['CR_edit_tab'] = 'Edit contest';
+$lang['CR_delete'] = 'Delete contest';
+$lang['CR_delete_result'] = 'Delete element';
+$lang['CR_manage_tab'] = 'Contests management';
+$lang['CR_new_tab'] = 'Add a new contest';
+$lang['CR_results_tab'] = 'Contest results';
+$lang['CR_pending_title'] = 'Pending contests';
+$lang['CR_finished_title'] = 'Finished contest';
+$lang['CR_results'] = 'Results';
+$lang['CR_go'] = 'Go to the contest page';
+$lang['CR_title'] = 'Title';
+$lang['CR_status'] = 'Status';
+$lang['CR_dateB'] = 'Bagin date';
+$lang['CR_dateE'] = 'Edn date';
+$lang['CR_logo'] = 'Logo';
+$lang['CR_banner'] = 'Banner';
+$lang['CR_pending'] = 'Pending';
+$lang['CR_finished'] = 'Finished';
+$lang['CR_presentation'] = 'Presentation';
+$lang['CR_rules'] = 'Rules';
+$lang['CR_prices'] = 'Prices';
+$lang['CR_final'] = 'Ending';
+$lang['CR_summary'] = 'Summary';
+$lang['CR_visibility'] = 'Visible if the contest is';
+$lang['CR_textareas'] = 'Contest description';
+$lang['CR_new'] = 'New contest';
+$lang['CR_addfield'] = 'Add an element';
+$lang['CR_no_result'] = 'No element registered';
+$lang['CR_no_contest'] = 'No contest registered';
+$lang['CR_image_no'] = 'Image n°';
+$lang['CR_author'] = 'Author';
+$lang['CR_comment'] = 'Comment';
+$lang['CR_rank'] = 'Rank';
+$lang['CR_period'] = 'Period';
+$lang['CR_visible'] = 'Visible';
+$lang['CR_nopublic'] = 'This page is not available for the public !';
+$lang['CR_notavailable'] = 'This contest is not available';
+
+$lang['CR_order_1'] = '1<sup>st</sup>';
+$lang['CR_order_2'] = '2<sup>nd</sup>';
+$lang['CR_order_3'] = '3<sup>rd</sup>';
+$lang['CR_order_sup'] = '<sup>th</sup>';
+
+$lang['CR_help_lang'] = "<b>You can use HTML and multilanguage descriptions :</b>
+	<span style='font-size:0.8em;'><br/><br/>
+	Multilanguage descriptions are placed between [lang=xx] and [/lang] tags, where xx is the language code (for example en, es, fr). There is also 2 special languages : [lang=default] and [lang=all].
+	<br/><br/>
+	Special language <i>default</i> : the default description will be used if the description is not available in the connected user selected language. If [lang=default] does not exists, anything outside the [lang] tags will be considered as the default description.
+	<br/><br/>
+	Special language <i>all</i> : anything inside [lang=all] will be included in the description, anywhat the connected user defined language is. This is mainly useful to include HTML/JavaScript code inside a description.";
+	
+$lang['CR_help_title'] = "";
+$lang['CR_help_status'] = "When the contest is <i>Finished</i> the results are displayed on the contest page and the marker <span style='color:#a00;'>(Finished)</span> is activated.
+	<br/><b>Caution :</b> the contest doesn't switch automaticaly to the status 'finished' when the end date is reached !";
+$lang['CR_help_visible'] = "If the contest is 'unvisible' only <b>administrators</b> can see it.";
+$lang['CR_help_summary'] = "The summary is only displayed in the general contest page.<br/><br/>";
+$lang['CR_help_textareas'] = "These four areas allow you to describe the contest.
+	<br/>For each area you can choose the displaying according to the contest status.<br/><br/>";
+$lang['CR_help_results'] = "Descriptions are displayed on each pictures pages and on the contest page for the first three.
+	<br/>Sort elements by drag-and-drop them.<br/><br/>";
+?>
Index: /extensions/ContestResults/language/fr_FR/index.php
===================================================================
--- /extensions/ContestResults/language/fr_FR/index.php	(revision 6768)
+++ /extensions/ContestResults/language/fr_FR/index.php	(revision 6768)
@@ -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/ContestResults/language/fr_FR/plugin.lang.php
===================================================================
--- /extensions/ContestResults/language/fr_FR/plugin.lang.php	(revision 6768)
+++ /extensions/ContestResults/language/fr_FR/plugin.lang.php	(revision 6768)
@@ -0,0 +1,70 @@
+<?php
+
+$lang['Contests'] = 'Concours';
+$lang['CR_edit_tab'] = 'Editer le concours';
+$lang['CR_delete'] = 'Supprimer le concours';
+$lang['CR_delete_result'] = 'Supprimer élément';
+$lang['CR_manage_tab'] = 'Gestion des concours';
+$lang['CR_new_tab'] = 'Ajouter un nouveau concours';
+$lang['CR_results_tab'] = 'Résultats du concours';
+$lang['CR_pending_title'] = 'Concours en cours';
+$lang['CR_finished_title'] = 'Concours terminés';
+$lang['CR_results'] = 'Résultats';
+$lang['CR_go'] = 'Aller sur la page du concours';
+$lang['CR_title'] = 'Titre';
+$lang['CR_status'] = 'Statut';
+$lang['CR_dateB'] = 'Date de début';
+$lang['CR_dateE'] = 'Date de fin';
+$lang['CR_logo'] = 'Logo';
+$lang['CR_banner'] = 'Bannière';
+$lang['CR_pending'] = 'En cours';
+$lang['CR_finished'] = 'Terminé';
+$lang['CR_presentation'] = 'Présentation';
+$lang['CR_rules'] = 'Contraintes';
+$lang['CR_prices'] = 'Prix';
+$lang['CR_final'] = 'Conclusion';
+$lang['CR_summary'] = 'Résumé';
+$lang['CR_visibility'] = 'Visible si le concours est';
+$lang['CR_textareas'] = 'Description du concours';
+$lang['CR_new'] = 'Nouveau concours';
+$lang['CR_addfield'] = 'Ajouter un élément';
+$lang['CR_no_result'] = 'Aucun élément enregistré';
+$lang['CR_no_contest'] = 'Aucun concours enregistré';
+$lang['CR_image_no'] = 'Image n°';
+$lang['CR_author'] = 'Auteur';
+$lang['CR_comment'] = 'Commentaire';
+$lang['CR_rank'] = 'Rang';
+$lang['CR_period'] = 'Période';
+$lang['CR_visible'] = 'Visible';
+$lang['CR_nopublic'] = "Cette page n'est pas accessible au public !";
+$lang['CR_notavailable'] = "Ce concours n'est pas disponible";
+
+$lang['CR_order_1'] = '1<sup>er</sup>';
+$lang['CR_order_2'] = '2<sup>ème</sup>';
+$lang['CR_order_3'] = '3<sup>ème</sup>';
+$lang['CR_order_sup'] = '<sup>ème</sup>';
+
+$lang['CR_menubar_mode'] = 'Intégrer ContestResults au menu';
+$lang['CR_menubar_link'] = 'Lien dans un bloc menu existant';
+$lang['CR_menubar_link_display'] = 'Afficher le lien dans les blocs';
+$lang['CR_menubar_block'] = 'Nouveau bloc menu';
+$lang['CR_menubar_block_number'] = 'Nombre de concours à afficher dans le bloc';
+
+$lang['CR_help_lang'] = "<b>Vous pouvez utiliser du HTML et les descriptions multilingues :</b>
+	<span style='font-size:0.8em;'><br/><br/>
+	Les descriptions multilingues se font entre les balises [lang=xx] et [/lang], ou xx est le code de la langue (par exemple fr, en, es, it, etc....) Il existe également 2 balises spéciales: [lang=default] et [lang=all].
+	<br/><br/>
+	Balise <i>default</i> : la description par défaut sera utilisée si la description dans la langue de l'utilisateur n'est pas définie. Si [lang=default] n'existe pas, tout ce qui est situé en dehors des balises de langues sera considéré comme description par défaut.
+	<br/><br/>
+	Balise <i>all</i> : tout ce qui est situé entre les balises [lang=all] et [/lang] sera inclus dans la description, quelle que soit la langue de l'utilisateur. Ceci est particulièrement pratique pour inclure du code html ou javascript dans une description.</span>";
+	
+$lang['CR_help_title'] = "";
+$lang['CR_help_status'] = "Quand le concours est <i>Terminé</i> les résultats sont affichés sur la page du concours et l'indicateur <span style='color:#a00;'>(Terminé)</span> s'active.
+	<br/><b>Attention :</b> le concours ne passe pas automatiquement en status terminé quand la date de fin est atteinte !";
+$lang['CR_help_visible'] = "Si le concours est 'invisible' seuls les <b>administrateurs</b> peuvent le voir.";
+$lang['CR_help_summary'] = "Le résumé n'est affiché que sur la page regroupant tous les concours.<br/><br/>";
+$lang['CR_help_textareas'] = "Ces quatres zones de texte vous permettent de décrire le concours.
+	<br/>Pour chaque zone vous pouvez choisir son affichage selon le status du concours.<br/><br/>";
+$lang['CR_help_results'] = "Les descriptions seront affichées sur les pages de chaque images et sur la page du concours pour les trois premiers.
+	<br/>Triez les éléments par glisser-déposer.<br/><br/>";
+?>
Index: /extensions/ContestResults/language/index.php
===================================================================
--- /extensions/ContestResults/language/index.php	(revision 6768)
+++ /extensions/ContestResults/language/index.php	(revision 6768)
@@ -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/ContestResults/main.inc.php
===================================================================
--- /extensions/ContestResults/main.inc.php	(revision 6768)
+++ /extensions/ContestResults/main.inc.php	(revision 6768)
@@ -0,0 +1,90 @@
+<?php
+/*
+Plugin Name: ContestResults
+Version: 1.1
+Description: Add contests management pages
+Plugin URI: http://piwigo.org/ext/extension_view.php?eid=439
+Author: Mistic
+Author URI: http://www.strangeplanet.fr
+*/
+
+if (!defined('PHPWG_ROOT_PATH')) die('Hacking attempt!');
+
+global $prefixeTable;
+
+// +-----------------------------------------------------------------------+
+//			Variables globales CR
+// +-----------------------------------------------------------------------+
+define('CR_DIR' , basename(dirname(__FILE__)));
+define('CR_PATH' , PHPWG_PLUGINS_PATH . CR_DIR . '/');
+define('CR_TABLE_1' , $prefixeTable . 'contests');
+define('CR_TABLE_2' , $prefixeTable . 'contests_results');
+define('CR_NAME' , 'ContestResults');
+define('CR_VERSION', '1.1');
+define('CR_ADMIN', PHPWG_ROOT_PATH . 'admin.php?page=plugin&section=' . CR_DIR . '/admin/admin.php');
+define('CR_PUBLIC', make_index_url(array('section' => 'contests')) . '/');
+
+// Gestion du menu
+include(CR_PATH . 'include/cr_menubar.php');
+
+// Lien d'administration
+function CR_admin_menu($menu){
+	array_push($menu, array(
+		'NAME' => CR_NAME,
+		'URL' => CR_ADMIN
+	));
+	return $menu;
+}
+
+// Paramètre URL
+function CR_section_init(){
+    global $tokens, $page;
+	load_language('plugin.lang', CR_PATH);
+    if($tokens[0] == 'contests'){
+		$page['section'] = 'contests';
+		$page['title'] = l10n('Contests');
+		if(isset($tokens[1]) AND $tokens[1]){
+			$page['contest'] = explode('-', $tokens[1]);
+			$page['contest'] = $page['contest'][0];
+			$page['title'] .= trigger_event('render_CR_content', get_contest_name($page['contest']));
+		}
+	}
+}
+
+// Contenu du la page
+function CR_index(){
+    global $template, $page, $conf, $menu;
+    if(isset($page['section']) and $page['section'] == 'contests'){
+		include(CR_PATH . 'include/functions.php');
+		if(isset($page['contest']))
+			include(CR_PATH . 'include/cr_page.php');
+		else
+			include(CR_PATH . 'include/cr_main.php');
+	}
+}
+
+// Ajoute le commentaire sur la page image
+function CR_comment_picture(){
+	global $page, $template, $conf;
+	include(CR_PATH . 'include/functions.php');
+	include(CR_PATH . 'include/cr_comment_picture.php');  
+}
+
+function get_contest_name($contest){
+	global $conf;
+	$query = pwg_query("SELECT name FROM " . CR_TABLE_1 . " WHERE id = " . $contest . ";");
+	if(pwg_db_num_rows($query)){
+		$result = pwg_db_fetch_assoc($query);
+		return $conf['level_separator'] . $result['name'];
+	}else{
+		return null;
+	}
+}
+
+add_event_handler('get_admin_plugin_menu_links', 'CR_admin_menu'); // Lien d'administration
+add_event_handler('loc_end_section_init', 'CR_section_init'); // Paramètre URL
+add_event_handler('loc_end_index', 'CR_index'); // Contenu du la page
+add_event_handler('loc_end_picture', 'CR_comment_picture', 10); // Ajoute le commentaire sur la page image
+add_event_handler('render_CR_content', 'get_user_language_desc'); // Textes multilangues
+
+?>
Index: /extensions/ContestResults/maintain.inc.php
===================================================================
--- /extensions/ContestResults/maintain.inc.php	(revision 6768)
+++ /extensions/ContestResults/maintain.inc.php	(revision 6768)
@@ -0,0 +1,78 @@
+<?php
+if (!defined('PHPWG_ROOT_PATH')) die('Hacking attempt!');
+
+define('default_config' , array(
+	'menubar_mode' => array(
+		'link' => 0,
+		'block' => 1
+	),
+	'menubar_link' => array(
+		'menu' => 1,
+		'specials' => 0
+	),
+	'menubar_block' => array(
+		'number' => 5
+	)
+));
+
+function plugin_install(){
+	global $prefixeTable;
+
+	$query = "CREATE TABLE `" . $prefixeTable . "contests` (
+		`id` INT NOT NULL AUTO_INCREMENT ,
+		`name` VARCHAR( 255 ) NOT NULL ,
+		`date_begin` DATE NOT NULL ,
+		`date_end` DATE NOT NULL ,
+		`status` VARCHAR( 255 ) NOT NULL ,
+		`visible` TINYINT(1) NOT NULL ,
+		`logo` VARCHAR( 255 ) NULL ,
+		`banner` VARCHAR( 255 ) NULL ,
+		`summary` TEXT NULL ,
+		`presentation` TEXT NULL ,
+		`presentation_display` VARCHAR( 255 ) NULL ,
+		`rules` TEXT NULL ,
+		`rules_display` VARCHAR( 255 ) NULL ,
+		`prices` TEXT NULL ,
+		`prices_display` VARCHAR( 255 ) NULL ,
+		`final` TEXT NULL ,
+		`final_display` VARCHAR( 255 ) NULL ,
+		PRIMARY KEY ( `id` )
+	);";
+	pwg_query($query);
+	
+	$query = "CREATE TABLE `" . $prefixeTable . "contests_results` (
+		`image_id` INT NOT NULL ,
+		`contest_id` INT NOT NULL ,
+		`rank` INT NOT NULL ,
+		`author` VARCHAR( 255 ) NOT NULL ,
+		`comment` TEXT NULL,
+		UNIQUE ( `image_id` , `contest_id` )
+	);";
+	pwg_query($query);
+	
+	if(!isset($conf['ContestResults'])){
+		$query = "INSERT INTO " . CONFIG_TABLE . "(param,value,comment) VALUES('ContestResults', '" . serialize(default_config) . "', 'Parametres du plugin ContestResults');";
+		pwg_query($query);
+	}
+}
+
+function plugin_activate(){
+	if(!isset($conf['ContestResults'])){
+		$query = "INSERT INTO " . CONFIG_TABLE . "(param,value,comment) VALUES('ContestResults', '" . serialize(default_config) . "', 'Parametres du plugin ContestResults');";
+		pwg_query($query);
+	}
+}
+
+function plugin_uninstall(){
+	global $prefixeTable;
+
+	$query = "DROP TABLE `" . $prefixeTable . "contests`;";
+	pwg_query($query);
+	
+	$query = "DROP TABLE `" . $prefixeTable . "contests_results`;";
+	pwg_query($query);
+	
+	$query = "DELETE FROM " . CONFIG_TABLE . " WHERE `param` = 'ContestResults';";
+	pwg_query($query);
+}
+?>
Index: /extensions/ContestResults/template/cr_main.tpl
===================================================================
--- /extensions/ContestResults/template/cr_main.tpl	(revision 6768)
+++ /extensions/ContestResults/template/cr_main.tpl	(revision 6768)
@@ -0,0 +1,73 @@
+{html_head}
+<link rel="stylesheet" type="text/css" href="{$CR_PATH}template/style.css">
+{/html_head}
+
+{$MENUBAR}
+
+{if !empty($PLUGIN_INDEX_CONTENT_BEFORE)}{$PLUGIN_INDEX_CONTENT_BEFORE}{/if}
+<div id="content" class="content">
+	<div class="titrePage">
+		<ul class="categoryActions">
+			{if !empty($PLUGIN_INDEX_ACTIONS)}{$PLUGIN_INDEX_ACTIONS}{/if}
+		</ul>
+		<h2>{'Contests'|@translate}</h2>
+	</div> <!-- titrePage -->
+	
+	{if isset($contests_pending)}
+		<ul class="thumbnailCategories">
+			{foreach from=$contests_pending item=contest}
+				<li>
+					<div class="thumbnailCategory {if $contest.VISIBLE == 0}novisible{/if}">
+						<div class="illustration">
+							<a href="{$contest.URL}">
+								{if !empty($contest.LOGO)}
+									<img src="{$contest.LOGO}" alt="{$contest.NAME}" style="max-height:120px;max-width:120px;">
+								{/if}
+							</a>
+						</div>
+						<div class="description">
+							<h3>
+								<a href="{$contest.URL}">{$contest.NAME}</a>
+							</h3>
+							<div class="text">
+								<p class="Nb_images">{$contest.DATE_BEGIN} - {$contest.DATE_END}</p>
+								{if !empty($contest.SUMMARY)}
+									<p>{$contest.SUMMARY}</p>
+								{/if}
+							</div>
+						</div>
+					</div>
+				</li>
+			{/foreach}
+		</ul>
+	{/if}
+	
+	{if isset($contests_finished)}
+		<ul class="thumbnailCategories">
+			{foreach from=$contests_finished item=contest}
+				<li>
+					<div class="thumbnailCategory {if $contest.VISIBLE == 0}novisible{/if}">
+						<div class="description">
+							<h3>
+								<a href="{$contest.URL}">{$contest.NAME}</a>
+								<span class="finished">({'CR_finished'|@translate})</span>
+							</h3>
+							<div class="text">
+								<p class="Nb_images">{$contest.DATE_BEGIN} - {$contest.DATE_END}</p>
+								<div class="results">
+									<a href="{$contest.URL}">
+										{foreach from=$contest.RESULTS item=result}
+											<img src="{$result.TN_SRC}" style="max-height:80px;max-width:120px;"/>
+										{/foreach}
+									</a>
+								</div>
+							</div>
+						</div>
+					</div>
+				</li>
+			{/foreach}
+		</ul>
+	{/if}
+</div> <!-- content -->
+
+{if !empty($PLUGIN_INDEX_CONTENT_AFTER)}{$PLUGIN_INDEX_CONTENT_AFTER}{/if}
Index: /extensions/ContestResults/template/cr_menubar.tpl
===================================================================
--- /extensions/ContestResults/template/cr_menubar.tpl	(revision 6768)
+++ /extensions/ContestResults/template/cr_menubar.tpl	(revision 6768)
@@ -0,0 +1,22 @@
+{html_head}
+	<style type="text/css">
+		.finished {ldelim}
+			font-size:0.8em;
+			color:#a00;
+		}
+	</style>
+{/html_head}
+
+<dt>{$block->get_title()}</dt>
+	<dd>
+	<ul>
+		{foreach from=$block->data item=data}
+			<li>
+				<a href="{$data.URL}" title="{$data.DATE}">
+					{$data.LABEL}
+					{if $data.STATUS == 'finished'}<span class="finished">&times;</span>{/if}
+				</a>
+			</li>
+		{/foreach}
+	</ul>
+</dd>
Index: /extensions/ContestResults/template/cr_page.tpl
===================================================================
--- /extensions/ContestResults/template/cr_page.tpl	(revision 6768)
+++ /extensions/ContestResults/template/cr_page.tpl	(revision 6768)
@@ -0,0 +1,128 @@
+{html_head}
+<link rel="stylesheet" type="text/css" href="{$CR_PATH}template/style.css">
+{/html_head}
+
+{$MENUBAR}
+
+{if !empty($PLUGIN_INDEX_CONTENT_BEFORE)}{$PLUGIN_INDEX_CONTENT_BEFORE}{/if}
+<div id="content_contest" class="content">
+	<div class="titrePage">
+		<ul class="categoryActions">  
+			{if isset($U_EDIT) }
+				<li><a href="{$U_EDIT}" title="{'CR_edit_tab'|@translate}"><img src="{$ROOT_URL}{$themeconf.icon_dir}/category_edit.png" class="button" alt="{'CR_edit_tab'|@translate}"></a></li>
+			{/if}
+			{if !empty($PLUGIN_INDEX_ACTIONS)}{$PLUGIN_INDEX_ACTIONS}{/if}
+		</ul>
+		<h2>
+			<a href="index.php?/contests">{'Contests'|@translate}</a>{$SEPARATOR}<a href="{$URL}">{$NAME}</a>
+			{if $STATUS=='finished'}<span class="finished">({'CR_finished'|@translate})</span>{/if}
+		</h2>
+	</div> <!-- titrePage -->
+
+	{if  $VISIBLE == 0}
+		<div class="nopublic">
+			{'CR_nopublic'|@translate}
+		</div>
+	{/if}
+	
+	{if !empty($BANNER)}
+		<div class="CR_banner">
+			<a href="#results"><img src="{$BANNER}" alt="{$NAME}"/></a>
+		</div>
+	{/if}
+	
+	{if (($STATUS=='pending' AND $PRESENTATION_PENDING) OR ($STATUS=='finished' AND $PRESENTATION_FINISHED)) AND !empty($PRESENTATION)}
+		<div class="CR_text">
+			<h3>{'CR_presentation'|@translate} :</h3>
+			<p>{$PRESENTATION}</p>
+		</div>
+	{/if}
+	
+	<div class="CR_text">
+		<h3>{'CR_period'|@translate} :</h3>
+		<p>{$DATE_BEGIN} - {$DATE_END}</p>
+	</div>
+	
+	<div id="CR_rules_prices">
+		{if (($STATUS=='pending' AND $RULES_PENDING) OR ($STATUS=='finished' AND $RULES_FINISHED)) AND !empty($RULES)}	
+			<div id="CR_rules">
+				<h3>{'CR_rules'|@translate} :</h3>
+				<p>{$RULES}</p>
+			</div>
+		{/if}
+		
+		{if (($STATUS=='pending' AND $PRICES_PENDING) OR ($STATUS=='finished' AND $PRICES_FINISHED)) AND !empty($PRICES)}
+			<div id="CR_prices">
+				<h3>{'CR_prices'|@translate} :</h3>
+				<p>{$PRICES}</p>
+			</div>
+		{/if}
+	</div>
+	
+	{if (($STATUS=='pending' AND $FINAL_PENDING) OR ($STATUS=='finished' AND $FINAL_FINISHED)) AND !empty($FINAL)}
+		<div class="CR_text">
+			<h3>{'CR_final'|@translate} :</h3>
+			<p>{$FINAL}</p>
+		</div>
+	{/if}
+</div> <!-- content_contest -->
+
+{if !empty($RESULTS)}
+	<div id="content_results" class="content">
+		<div class="titrePage">
+			<ul class="categoryActions">  
+				{if isset($U_RESULTS) }
+					<li><a href="{$U_RESULTS}" title="{'CR_results'|@translate}"><img src="{$ROOT_URL}{$themeconf.icon_dir}/category_edit.png" class="button" alt="{'CR_results'|@translate}"></a></li>
+				{/if}
+			</ul>
+			<h2><a href="{$URL}">{$NAME}</a>{$SEPARATOR}<a href="#results" name="results">{'CR_results'|@translate}</a></h2>
+		</div>
+		
+		<div id="CR_podium">
+			{foreach from=$RESULTS item=result}
+				{if $result.RANK <= 3}
+					{if $result.RANK == 2}<div class="podium_23">{/if}
+					<div class="podium_{$result.RANK}">
+						<div class="illustration">
+							<div class="title">{'CR_order_'|cat:$result.RANK|@translate} - <u>{$result.AUTHOR}</u></div>
+							<a href="{$result.IMAGE_URL}" title="{$result.IMAGE_NAME}">
+								<img src="{$result.IMAGE_SRC}" alt="{$result.IMAGE_NAME}"/>
+							</a>
+						</div>
+						<div class="comment">
+							<div>{$result.COMMENT}</div>
+						</div>
+					</div>
+					{if $result.RANK == 3}</div>{/if}
+				{/if}
+			{/foreach}
+		</div>
+		
+		<ul class="thumbnails">
+			{foreach from=$RESULTS item=result}
+				{if $result.RANK > 3}
+					<li>
+						<span class="wrap1">
+							<span class="wrap2">
+								<a href="{$result.IMAGE_URL}" title="{$result.IMAGE_NAME}">
+									<img class="thumbnail" src="{$result.TN_SRC}" alt="{$result.IMAGE_NAME}"/>
+								</a>
+							</span>
+							<span class="thumbLegend">
+								<b>{$result.RANK}{'CR_order_sup'|@translate}</b> - {$result.AUTHOR}
+							</span>
+						</span>
+					</li>
+				{/if}
+			{/foreach}
+		</ul>
+		
+		{if !empty($LOGO)}
+			<div class="CR_banner">
+				<img src="{$LOGO}" alt="{$NAME}"/>
+			</div>
+		{/if}
+	</div> <!-- content_results -->
+{/if}
+
+{if !empty($PLUGIN_INDEX_CONTENT_AFTER)}{$PLUGIN_INDEX_CONTENT_AFTER}{/if}
Index: /extensions/ContestResults/template/index.php
===================================================================
--- /extensions/ContestResults/template/index.php	(revision 6768)
+++ /extensions/ContestResults/template/index.php	(revision 6768)
@@ -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/ContestResults/template/style.css
===================================================================
--- /extensions/ContestResults/template/style.css	(revision 6768)
+++ /extensions/ContestResults/template/style.css	(revision 6768)
@@ -0,0 +1,171 @@
+.content {
+	min-height:0;
+}
+
+.finished {
+	font-weight:normal;
+	font-size:0.8em;
+	letter-spacing:0.3em;
+	padding-left:10px;
+	color:#a00;
+}
+
+div.thumbnailCategory.novisible {
+	opacity:0.4;
+}
+
+.results {
+	overflow:hidden;
+	white-space:nowrap;
+}
+
+div.nopublic {
+	background:#aaa;
+	border:1px dotted #555;
+	font-weight:bold;
+	font-size:1.3em;
+	color:#222;
+	text-align:center;
+	padding:10px;
+	margin:0 20px 10px 20px;
+}
+
+#content_contest {
+	padding-bottom:20px;
+}
+
+p {
+	text-align:justify;
+	margin:0 0 10px 20px;
+	font-size:1.1em;
+}
+
+h3 {
+	margin-bottom:0;
+	font-size:1.3em;
+}
+
+ul {
+	margin:0;
+	font-size:1.1em;
+}
+
+.CR_banner {
+	width:100%;
+	text-align:center;
+}
+
+.CR_text {
+	margin:0 5%;
+}
+
+#CR_rules_prices {
+	text-align:center;
+	margin:0 5%;
+}
+	#CR_rules, #CR_prices {
+		display:inline-block;
+		width:49%;
+		text-align:left;
+		vertical-align:top;
+	}
+	#CR_rules_prices h3 {
+		margin-left:-1%;
+	}
+
+#CR_podium {
+	text-align:center;
+	margin:0 5% 30px 5%;
+}
+	#CR_podium .podium_1 {
+		display:inline-block;
+		width:49%;
+		vertical-align:middle;
+		text-align:center;
+		max-height:400px;
+	}
+		#CR_podium .podium_1 .title {
+			font-weight:bold;
+			font-size:1.3em;
+			color:#EFBF00;
+			margin-bottom:5px;
+		}
+		#CR_podium .podium_1 .illustration {
+			margin:0 10% 10px 10%;
+		}
+			#CR_podium .podium_1 .illustration img {
+				border:4px outset #EFBF00;
+				max-height:250px;
+				max-width:100%;
+				-moz-border-radius:10px;
+				border-radius:10px;
+			}
+				#CR_podium .podium_1 .illustration img:hover {
+					border-style:inset;
+				}
+		#CR_podium .podium_1 .comment {
+			padding:0 5px;
+		}
+		
+		#CR_podium .podium_1 .comment div {
+			margin:0 auto;
+			text-align:justify;
+		}
+	#CR_podium .podium_23  {
+		display:inline-block;
+		width:49%;
+		text-align:left;
+		vertical-align:middle;
+		border-left:1px dotted #555;
+		max-height:400px;
+	}
+		#CR_podium .podium_2, #CR_podium .podium_3 {
+			height:50%;
+			max-height:200px;
+			overflow:hidden;
+		}
+			#CR_podium .podium_2 .title, #CR_podium .podium_3 .title {
+				font-weight:bold;
+				font-size:1.1em;
+				text-align:center;
+				margin-bottom:5px;
+			}
+				#CR_podium .podium_2 .title {
+					color:#EF5400;
+				}
+				#CR_podium .podium_3 .title {
+					color:#9F9F9F;
+				}
+			#CR_podium .podium_2 .illustration, #CR_podium .podium_3 .illustration {
+				display:inline-block;
+				margin:0 2% 10px 2%;
+				width:40%;
+				text-align:center;
+			}
+				#CR_podium .podium_2 .illustration img, #CR_podium .podium_3 .illustration img {
+					border-width:3px;
+					border-style:outset;
+					max-height:150px;
+					max-width:100%;
+					border-radius:6px;
+					-moz-border-radius:6px;
+				}
+					#CR_podium .podium_2 .illustration img {
+						border-color:#EF5400;
+					}
+					#CR_podium .podium_3 .illustration img {
+						border-color:#9F9F9F;
+					}
+					#CR_podium .podium_2 .illustration img:hover, #CR_podium .podium_3 .illustration img:hover {
+						border-style:inset;
+					}
+			
+			#CR_podium .podium_2 .comment, #CR_podium .podium_3 .comment {
+				display:inline-block;
+				width:53%;
+				height:50%;
+				vertical-align:top;
+				margin-top:20px;
+				text-align:justify;
+				font-size:0.9em;
+			}
