Changeset 9200


Ignore:
Timestamp:
Feb 13, 2011, 11:12:58 AM (13 years ago)
Author:
mistic100
Message:

ContestResults :

  • Code revision
  • Add Letton (lv_LV) language, thanks to Aivars Baldone
  • Delete display options
  • Fix languages bugs
  • Improve public appearence
Location:
extensions/ContestResults
Files:
1 added
34 edited

Legend:

Unmodified
Added
Removed
  • extensions/ContestResults/admin/admin.php

    r6768 r9200  
    88// +-----------------------------------------------------------------------+
    99include_once(PHPWG_ROOT_PATH.'admin/include/tabsheet.class.php');
    10 if(!isset($_GET['tab']))
    11     $page['tab'] = 'manage';
    12 else
    13     $page['tab'] = $_GET['tab'];
     10$page['tab'] = (isset($_GET['tab'])) ? $_GET['tab'] : $page['tab'] = 'manage';
    1411       
    1512$tabsheet = new tabsheet();
    16 $tabsheet->add('manage', l10n('CR_manage_tab'), CR_ADMIN . '&tab=manage'); // Gestion des concours
    17 $tabsheet->add('new', l10n('CR_new_tab'), CR_ADMIN . '&tab=new'); // Ajouter un nouveau concours
    18 if(isset($_GET['contest_id'])) // Editer le concours | Résultats du concours
    19         $tabsheet->add($_GET['tab'], l10n('CR_'.$_GET['tab'].'_tab'), CR_ADMIN . '&tab=' . $_GET['tab'] . '&contest_id=' . $_GET['contest_id']);
    20 $tabsheet->add('config', l10n('Configuration'), CR_ADMIN . '&tab=config'); // Configuration
     13$tabsheet->add('manage', l10n('CR_manage_tab'), CR_ADMIN . '&tab=manage');  // Gestion des concours
     14$tabsheet->add('new', l10n('CR_new_tab'), CR_ADMIN . '&tab=new');                   // Ajouter un nouveau concours
     15if (isset($_GET['contest_id'])) {                                                                                               // Editer le concours | Résultats du concours
     16        $tabsheet->add($page['tab'], l10n('CR_'.$page['tab'].'_tab'), CR_ADMIN . '&tab=' . $page['tab'] . '&contest_id=' . $_GET['contest_id']);
     17}
     18$tabsheet->add('config', l10n('Configuration'), CR_ADMIN . '&tab=config');  // Configuration
    2119$tabsheet->select($page['tab']);
    2220$tabsheet->assign();
     
    2725$template->assign('CR_VERSION', CR_NAME . ' ' . CR_VERSION);
    2826$template->assign('CR_PATH', CR_PATH);
    29 if($page['tab'] == 'edit') $page['tab'] = 'new'; // L'édition se fait sur la page de création
     27if ($page['tab'] == 'edit') { $page['tab'] = 'new'; } // L'édition se fait sur la page de création
    3028include(CR_PATH.'admin/'.$page['tab'].'.php');
    3129?>
  • extensions/ContestResults/admin/config.php

    r6782 r9200  
    33
    44// +-----------------------------------------------------------------------+
    5 //              Modification de la configuration
     5//                              Modification de la configuration
    66// +-----------------------------------------------------------------------+
    7 if(isset($_POST['config_submit'])){
     7if (isset($_POST['config_submit'])) {
    88        $user_config = array(
    99                'menubar_mode' => array(
    1010                        'link' => (isset($_POST['menubar_mode_link'])) ? 1 : 0,
    11                         'block' => (isset($_POST['menubar_mode_block'])) ? 1 : 0
     11                        'block' => (isset($_POST['menubar_mode_block'])) ? 1 : 0,
    1212                ),
    1313                'menubar_link' => array(
    1414                        'menu' => (isset($_POST['menubar_link_menu'])) ? 1 : 0,
    15                         'specials' => (isset($_POST['menubar_link_specials'])) ? 1 : 0
     15                        'specials' => (isset($_POST['menubar_link_specials'])) ? 1 : 0,
    1616                ),
    1717                'menubar_block' => array(
    18                         'number' => $_POST['menubar_block_number']
    19                 )
     18                        'number' => $_POST['menubar_block_number'],
     19                ),
    2020        );
    2121       
    22         $query = "UPDATE " . CONFIG_TABLE . " SET `value` = '" . serialize($user_config) . "' WHERE `param` = 'ContestResults';";
    23         pwg_query($query);
     22        pwg_query("UPDATE " . CONFIG_TABLE . " SET `value` = '" . serialize($user_config) . "' WHERE `param` = 'ContestResults';");
    2423        redirect(CR_ADMIN . '&tab=config');
    2524}       
    2625
    2726// +-----------------------------------------------------------------------+
    28 //              Définition des variables template
     27//                              Définition des variables template
    2928// +-----------------------------------------------------------------------+
    3029$conf['ContestResults'] = unserialize($conf['ContestResults']);
  • extensions/ContestResults/admin/get_tn.php

    r6782 r9200  
    44include_once(PHPWG_ROOT_PATH.'include/common.inc.php');
    55
    6 $query = "SELECT id, name, file, path, tn_ext
     6$image = pwg_query("SELECT id, name, file, path, tn_ext
    77        FROM " . IMAGES_TABLE . "
    8         WHERE id = " . pwg_db_real_escape_string($_GET['image_id']) . ";";
    9 $image = pwg_query($query);
     8        WHERE id = " . pwg_db_real_escape_string($_GET['image_id']) . ";");
    109
    11 if(!pwg_db_num_rows($image)){
     10if (!pwg_db_num_rows($image)) {
    1211        $themeconf = $template->get_template_vars('themeconf');
    1312        $data['TN_SRC'] = $themeconf['admin_icon_dir'] . '/errors.png';
    1413        $data['IMAGE_NAME'] = 'N/A';
    15 }else{
     14       
     15} else {
    1616        $image = pwg_db_fetch_assoc($image);
    1717        $data['TN_SRC'] = get_thumbnail_url($image);
     
    2020
    2121echo "<img src='" . str_replace('../../.', '', $data['TN_SRC']) . "'/><br>" . $data['IMAGE_NAME'];
    22 
    2322?>
  • extensions/ContestResults/admin/index.php

    r6768 r9200  
    11<?php
    22// +-----------------------------------------------------------------------+
    3 // | PhpWebGallery - a PHP based picture gallery                           |
    4 // | Copyright (C) 2002-2003 Pierrick LE GALL - pierrick@phpwebgallery.net |
    5 // | Copyright (C) 2003-2007 PhpWebGallery Team - http://phpwebgallery.net |
     3// | Piwigo - a PHP based picture gallery                                  |
    64// +-----------------------------------------------------------------------+
    7 // | file          : $Id: index.php 1912 2007-03-16 06:30:07Z rub $
    8 // | last update   : $Date: 2007-03-16 07:30:07 +0100 (ven, 16 mar 2007) $
    9 // | last modifier : $Author: rub $
    10 // | revision      : $Revision: 1912 $
     5// | Copyright(C) 2008-2010 Piwigo Team                  http://piwigo.org |
     6// | Copyright(C) 2003-2008 PhpWebGallery Team    http://phpwebgallery.net |
     7// | Copyright(C) 2002-2003 Pierrick LE GALL   http://le-gall.net/pierrick |
    118// +-----------------------------------------------------------------------+
    129// | This program is free software; you can redistribute it and/or modify  |
  • extensions/ContestResults/admin/manage.php

    r6768 r9200  
    33
    44// +-----------------------------------------------------------------------+
    5 //                      Suppression d'un concours
     5//                              Suppression d'un concours
    66// +-----------------------------------------------------------------------+
    7 if(isset($_GET['delete'])){
    8         pwg_query('DELETE FROM ' . CR_TABLE_1 . ' WHERE id = ' . $_GET['delete'] . ';');
    9         pwg_query('DELETE FROM ' . CR_TABLE_2 . ' WHERE contest_id = ' . $_GET['delete'] . ';');
     7if (isset($_GET['delete_contest'])) {
     8        pwg_query('DELETE FROM ' . CR_TABLE_1 . ' WHERE id = ' . $_GET['delete_contest'] . ';');
     9        pwg_query('DELETE FROM ' . CR_TABLE_2 . ' WHERE contest_id = ' . $_GET['delete_contest'] . ';');
    1010        redirect(CR_ADMIN);
    1111}
    1212
    1313// +-----------------------------------------------------------------------+
    14 //                      Affichage des concours
     14//                              Affichage des concours
    1515// +-----------------------------------------------------------------------+
    16 foreach(array('pending','finished') AS $status){
    17         $query = "SELECT id, name, visible, date_begin, date_end, logo
     16foreach (array('pending','finished') AS $status) {
     17        $result = pwg_query("SELECT id, name, visible, date_begin, date_end, logo
    1818                FROM " . CR_TABLE_1 . "
    1919                WHERE status = '" . $status . "'
    20                 ORDER BY date_begin DESC;";
    21         $result = pwg_query($query);
     20                ORDER BY date_begin DESC;");
    2221
    23         while($contest = pwg_db_fetch_assoc($result)){
     22        while ($contest = pwg_db_fetch_assoc($result)) {
    2423                $template->append('contests_'.$status, array(
    2524                        'NAME' => trigger_event('render_CR_content', $contest['name']),
     
    2827                        'DATE_END' => format_date($contest['date_end']),
    2928                        'LOGO' => $contest['logo'],
    30                         'U_RESULTS' => CR_ADMIN . '&tab=results&contest_id=' . $contest['id'],
    31                         'U_EDIT' => CR_ADMIN . '&tab=edit&contest_id=' . $contest['id'],
    32                         'U_DELETE' => CR_ADMIN . '&delete=' . $contest['id'],
     29                        'U_RESULTS' => CR_ADMIN . '&amp;tab=results&amp;contest_id=' . $contest['id'],
     30                        'U_EDIT' => CR_ADMIN . '&amp;tab=edit&amp;contest_id=' . $contest['id'],
     31                        'U_DELETE' => CR_ADMIN . '&amp;delete_contest=' . $contest['id'],
    3332                        'URL' => CR_PUBLIC . $contest['id'] . '-' . str2url(trigger_event('render_CR_content', $contest['name'])),
    3433                ));
  • extensions/ContestResults/admin/new.php

    r6782 r9200  
    66
    77// +-----------------------------------------------------------------------+
    8 //              Ajout ou modification d'un concours
     8//                              Ajout ou modification d'un concours
    99// +-----------------------------------------------------------------------+
    10 if(isset($_POST['new_submit'])){
    11         // Pour les quatre zones de texte crée un tableau définissant le mode d'affichage
    12         foreach($textareas AS $key){
    13                 $_POST[$key.'_display']['pending'] = (isset($_POST[$key.'_pending'])) ? true : false;
    14                 $_POST[$key.'_display']['finished'] = (isset($_POST[$key.'_finished'])) ? true : false;
    15                 $_POST[$key.'_display'] = serialize($_POST[$key.'_display']);
    16         }
    17 
     10if (isset($_POST['new_submit'])) {
    1811        // Modification d'un concours
    19         if(isset($_POST['contest_id'])){
    20                 $query = "UPDATE " . CR_TABLE_1 . " SET
     12        if (isset($_GET['contest_id'])) {
     13                pwg_query("UPDATE " . CR_TABLE_1 . " SET
    2114                        `name` = '" . $_POST['name'] ."',
    2215                        `status` = '" . $_POST['status'] ."',
     
    2821                        `summary` = '" . $_POST['summary'] ."',
    2922                        `presentation` = '" . $_POST['presentation'] ."',
    30                         `presentation_display` = '" . $_POST['presentation_display'] ."',
    3123                        `rules` = '" . $_POST['rules'] ."',
    32                         `rules_display` = '" . $_POST['rules_display'] ."',
    3324                        `prices` = '" . $_POST['prices'] ."',
    34                         `prices_display` = '" . $_POST['prices_display'] ."',
    35                         `final` = '" . $_POST['final'] ."',
    36                         `final_display` = '" . $_POST['final_display'] ."'
    37                 WHERE `id` = " . $_POST['contest_id'] .";";
     25                        `final` = '" . $_POST['final'] ."'
     26                WHERE `id` = " . $_GET['contest_id'] .";");
    3827               
    39                 pwg_query($query);
    40                 redirect(CR_ADMIN);
     28                // redirige vers la page du concours si on en viens
     29                if (isset($_GET['redirect']) AND $_GET['redirect'] == 'page') {
     30                        redirect(CR_PUBLIC . $_GET['contest_id'] . '-' . str2url(trigger_event('render_CR_content', $_POST['name'])));
     31                } else {
     32                        redirect(CR_ADMIN);
     33                }
    4134               
    4235        // Ajout d'un concours
    43         }else{
    44                 $query = "INSERT INTO " . CR_TABLE_1 . "
     36        } else {
     37                pwg_query("INSERT INTO " . CR_TABLE_1 . "
    4538                        (
    4639                                name,
     
    5346                                summary,
    5447                                presentation,
    55                                 presentation_display,
    5648                                rules,
    57                                 rules_display,
    5849                                prices,
    59                                 prices_display,
    60                                 final,
    61                                 final_display
     50                                final
    6251                        )
    6352                        VALUES(
     
    7160                                '" . $_POST['summary'] ."',
    7261                                '" . $_POST['presentation'] ."',
    73                                 '" . $_POST['presentation_display'] ."',
    7462                                '" . $_POST['rules'] ."',
    75                                 '" . $_POST['rules_display'] ."',
    7663                                '" . $_POST['prices'] ."',
    77                                 '" . $_POST['prices_display'] ."',
    78                                 '" . $_POST['final'] ."',
    79                                 '" . $_POST['final_display'] ."'
    80                         );";
    81                
    82                 pwg_query($query);
     64                                '" . $_POST['final'] ."'
     65                        );");
    8366                redirect(CR_ADMIN);
    8467        }
     
    8770
    8871// +-----------------------------------------------------------------------+
    89 //              Définition des variables template
     72//                              Définition des variables template
    9073// +-----------------------------------------------------------------------+
    9174// Edition d'un concours
    92 if(isset($_GET['contest_id'])){
     75if (isset($_GET['contest_id'])) {
    9376        $query = "SELECT * FROM " . CR_TABLE_1 . " WHERE id = " . $_GET['contest_id'] . ";";
    9477        $contest = pwg_db_fetch_assoc(pwg_query($query));
     
    10689        ));
    10790       
    108         foreach($textareas AS $key){
    109                 $contest[$key.'_display'] = unserialize($contest[$key.'_display']);
    110                 if($contest[$key.'_display']['pending']) $template->assign(strtoupper($key).'_PENDING', true);
    111                 if($contest[$key.'_display']['finished']) $template->assign(strtoupper($key).'_FINISHED', true);
     91        foreach ($textareas AS $key) {
    11292                $template->assign(strtoupper($key), $contest[$key]);
    11393        }
    11494
    11595// Ajout d'un concours
    116 }else{
     96} else {
    11797        $template->assign(array(
    11898                'NAME' => null,
     
    126106        ));
    127107       
    128         foreach($textareas AS $key){
    129                 $template->assign(array(
    130                         strtoupper($key).'_PENDING' => true,
    131                         strtoupper($key).'_FINISHED' => true,
    132                         strtoupper($key) => null,
    133                 ));
     108        foreach ($textareas AS $key) {
     109                $template->assign(strtoupper($key), null);
    134110        }
    135111}
  • extensions/ContestResults/admin/results.php

    r6782 r9200  
    33
    44// +-----------------------------------------------------------------------+
    5 //                      Modification des résultats
     5//                              Modification des résultats
    66// +-----------------------------------------------------------------------+
    7 if(isset($_POST['results_modify'])){
    8         $query = "DELETE FROM " . CR_TABLE_2 . " WHERE `contest_id` = " . $_POST['contest_id'] .";";
    9         pwg_query($query);
     7if (isset($_POST['results_modify'])) {
     8        pwg_query("DELETE FROM " . CR_TABLE_2 . " WHERE `contest_id` = " . $_GET['contest_id'] .";");
    109       
    11         foreach($_POST['results'] AS $i => $data){
    12                 $query = "INSERT INTO " . CR_TABLE_2 . "(image_id, contest_id, rank, comment, author)
     10        foreach ($_POST['results'] AS $i => $data) {
     11                pwg_query("INSERT INTO " . CR_TABLE_2 . "
     12                        (
     13                                image_id,
     14                                contest_id,
     15                                rank,
     16                                comment,
     17                                author
     18                        )
    1319                        VALUES(
    1420                                '" . $data['image_id'] ."',
    15                                 '" . $_POST['contest_id'] ."',
     21                                '" . $_GET['contest_id'] ."',
    1622                                '" . $data['rank'] ."',
    1723                                '" . $data['comment'] ."',
    1824                                '" . $data['author'] . "'
    19                         );";
    20                 pwg_query($query);
     25                        );");
    2126        }
    2227       
    23         redirect(CR_ADMIN . '&tab=results&contest_id=' . $_POST['contest_id']);
     28        redirect(CR_ADMIN . '&amp;tab=results&amp;contest_id=' . $_GET['contest_id']);
    2429}
    2530
    2631// +-----------------------------------------------------------------------+
    27 //                      Affichage des résultats
     32//                              Affichage des résultats
    2833// +-----------------------------------------------------------------------+
     34// Nom du concours
    2935$query = "SELECT name FROM " . CR_TABLE_1 . " WHERE id = " . $_GET['contest_id'] . ";";
    3036$contest = pwg_db_fetch_assoc(pwg_query($query));
     37
    3138$template->assign(array(
    3239        'NAME' => trigger_event('render_CR_content', $contest['name']),
     
    3441));
    3542
    36 $query = "SELECT * FROM " . CR_TABLE_2 . " WHERE contest_id = " . $_GET['contest_id'] . " ORDER BY rank;";
    37 $results = pwg_query($query);
     43// Résultats
     44$results = pwg_query("SELECT * FROM " . CR_TABLE_2 . " WHERE contest_id = " . $_GET['contest_id'] . " ORDER BY rank;");
    3845
    39 while($result = pwg_db_fetch_assoc($results)){
     46while ($result = pwg_db_fetch_assoc($results)) {
    4047        $data = array(
    4148                'RANK' => $result['rank'],
     
    4350                'AUTHOR' => $result['author'],
    4451                'COMMENT' => $result['comment'],
    45                 'U_DELETE' => CR_ADMIN . '&tab=results&contest_id=' . $_GET['contest_id'] . '&delete_result=' . $result['image_id'],
    4652        );
    4753       
    4854        // Infos de l'image
    49         $query = "SELECT id, name, file, path, tn_ext
     55        $image = pwg_query("SELECT id, name, file, path, tn_ext
    5056                FROM " . IMAGES_TABLE . "
    51                 WHERE id = " . $result['image_id'] . ";";
    52         $image = pwg_query($query);
     57                WHERE id = " . $result['image_id'] . ";");
    5358       
    54         if(!pwg_db_num_rows($image)){
     59        if (!pwg_db_num_rows($image)) {
    5560                $themeconf = $template->get_template_vars('themeconf');
    5661                $data['TN_SRC'] = $themeconf['admin_icon_dir'] . '/errors.png';
    5762                $data['IMAGE_NAME'] = 'N/A';
    5863                $page['errors'][] = l10n_dec('CR_id_unknown %d', 'CR_id_unknown %d', $result['image_id']);
    59         }else{
     64               
     65        } else {
    6066                $image = pwg_db_fetch_assoc($image);
    6167                $data['TN_SRC'] = get_thumbnail_url($image);
  • extensions/ContestResults/admin/template/config.tpl

    r6782 r9200  
    33{html_head}
    44        <link rel="stylesheet" type="text/css" href="{$CR_PATH}admin/template/style.css">
    5         <style>
     5        <style type="text/css">
    66                tr td:first-child {ldelim}
    77                        max-width:300px;
     
    5555                        <tr>
    5656                                <td><span class="title">{'CR_menubar_block_number'|@translate}</span></td>
    57                                 <td>
    58                                         <input type="text" size="2" maxlength="2" name="menubar_block_number" value="{$BLOCK_NUMBER}"/>
    59                                 </td>
     57                                <td><input type="text" size="2" maxlength="2" name="menubar_block_number" value="{$BLOCK_NUMBER}"/></td>
    6058                        </tr>
    6159                </table>
  • extensions/ContestResults/admin/template/index.php

    r6768 r9200  
    11<?php
    22// +-----------------------------------------------------------------------+
    3 // | PhpWebGallery - a PHP based picture gallery                           |
    4 // | Copyright (C) 2002-2003 Pierrick LE GALL - pierrick@phpwebgallery.net |
    5 // | Copyright (C) 2003-2007 PhpWebGallery Team - http://phpwebgallery.net |
     3// | Piwigo - a PHP based picture gallery                                  |
    64// +-----------------------------------------------------------------------+
    7 // | file          : $Id: index.php 1912 2007-03-16 06:30:07Z rub $
    8 // | last update   : $Date: 2007-03-16 07:30:07 +0100 (ven, 16 mar 2007) $
    9 // | last modifier : $Author: rub $
    10 // | revision      : $Revision: 1912 $
     5// | Copyright(C) 2008-2010 Piwigo Team                  http://piwigo.org |
     6// | Copyright(C) 2003-2008 PhpWebGallery Team    http://phpwebgallery.net |
     7// | Copyright(C) 2002-2003 Pierrick LE GALL   http://le-gall.net/pierrick |
    118// +-----------------------------------------------------------------------+
    129// | This program is free software; you can redistribute it and/or modify  |
  • extensions/ContestResults/admin/template/new.tpl

    r6782 r9200  
    3030
    3131<div class="titrePage">
    32         <h2>{if isset($NAME)}{'CR_edit_tab'|@translate|cat:' : '|cat:$NAME}{else}{'CR_new_tab'|@translate}{/if}</h2>
     32        <h2>
     33        {if isset($NAME)}
     34                {'CR_edit_tab'|@translate|cat:' : '|cat:$NAME}
     35        {else}
     36                {'CR_new_tab'|@translate}
     37        {/if}
     38        </h2>
    3339</div>
    3440
     
    3642        <fieldset>
    3743                <legend>{'Configuration'|@translate}</legend>
     44               
    3845                <table>
    3946                        <tr>
    40                                 <td><span class="title cluetip" title="{'CR_title'|@translate}|{'CR_help_title'|@translate}{'CR_help_lang'|@translate}">{'CR_title'|@translate}</span></td>
     47                                <td><span class="title cluetip" title="{'CR_title'|@translate}|{'CR_help_title'|@translate}">{'CR_title'|@translate}</span></td>
    4148                                <td colspan="3"><input type="text" size="65" maxlength="255" name="name" value="{$NAME}"/></td>
    4249                        </tr>
     
    4552                       
    4653                        <tr>
    47                                 <td><span class="title cluetip" title="{'CR_status'|@translate}|{'CR_help_status'|@translate}">
    48                                         {'CR_status'|@translate}
    49                                 </span></td>
     54                                <td><span class="title cluetip" title="{'CR_status'|@translate}|{'CR_help_status'|@translate}">{'CR_status'|@translate}</span></td>
    5055                                <td>
    5156                                        <label><input type="radio" name="status" value="pending" {if $STATUS == 'pending'}checked="checked"{/if}> {'CR_pending'|@translate}</label>
    5257                                        <label><input type="radio" name="status" value="finished" {if $STATUS == 'finished'}checked="checked"{/if}> {'CR_finished'|@translate}</label>
    5358                                </td>
    54                                 <td><span class="title cluetip" title="{'CR_visible'|@translate}|{'CR_help_visible'|@translate}">
    55                                         {'CR_visible'|@translate}
    56                                 </span></td>
     59                                <td><span class="title cluetip" title="{'CR_visible'|@translate}|{'CR_help_visible'|@translate}">{'CR_visible'|@translate}</span></td>
    5760                                <td>
    5861                                        <label><input type="radio" name="visible" value="1" {if $VISIBLE == 1}checked="checked"{/if}> {'Yes'|@translate}</label>
     
    7174                        <tr>
    7275                                <td><span class="title">{'CR_logo'|@translate}</span></td>
    73                                 <td colspan="3"><input type="text" size="65" maxlength="255" value="{$LOGO}" name="logo"/></td>
     76                                <td colspan="3"><input type="text" style="width:100%;" maxlength="255" value="{$LOGO}" name="logo"/></td>
    7477                        </tr>
    7578                        <tr>
    7679                                <td><span class="title">{'CR_banner'|@translate}</span></td>
    77                                 <td colspan="3"><input type="text" size="65" maxlength="255" value="{$BANNER}" name="banner"/></td>
     80                                <td colspan="3"><input type="text" style="width:100%;" maxlength="255" value="{$BANNER}" name="banner"/></td>
    7881                        </tr>
    7982                       
     
    8184                       
    8285                        <tr>
    83                                 <td><span class="title cluetip" title="{'CR_summary'|@translate}|{'CR_help_summary'|@translate}{'CR_help_lang'|@translate}">
    84                                         {'CR_summary'|@translate}
    85                                 </span></td>
    86                                 <td colspan="3"><textarea name="summary" id ="textarea" rows="4" cols="50">{$SUMMARY}</textarea></td>
     86                                <td><span class="title cluetip" title="{'CR_summary'|@translate}|{'CR_help_summary'|@translate}">{'CR_summary'|@translate}</span></td>
     87                                <td colspan="3"><textarea name="summary" id ="textarea" rows="4" style="width:100%;">{$SUMMARY}</textarea></td>
    8788                        </tr>
    8889                </table>
    8990        </fieldset>
    9091       
    91         <div class="textareas"><span class="title cluetip" title="{'CR_textareas'|@translate}|{'CR_help_textareas'|@translate}{'CR_help_lang'|@translate}">
    92                 {'CR_textareas'|@translate}
    93         </span></div>
    94 
    9592        <fieldset>
    96                 <legend>{'CR_presentation'|@translate}</legend>
    97                 <div align="center">
    98                         <textarea name="presentation" id ="textarea" rows="4" cols="50" style="width:70%;">{$PRESENTATION}</textarea>
    99                         <br/>
    100                         {'CR_visibility'|@translate} :
    101                         <label><input type="checkbox" name="presentation_pending" value="true" {if isset($PRESENTATION_PENDING)}checked="checked"{/if}> {'CR_pending'|@translate}</label>
    102                         <label><input type="checkbox" name="presentation_finished" value="true" {if isset($PRESENTATION_FINISHED)}checked="checked"{/if}> {'CR_finished'|@translate}</label>
    103                 </div>
     93                <legend><span class="title cluetip" title="{'CR_textareas'|@translate}|{'CR_help_textareas'|@translate}">{'CR_textareas'|@translate}</span></legend>
     94               
     95                <table>                 
     96                        <tr>
     97                                <td><span class="title">{'CR_presentation'|@translate}</span></td>
     98                                <td style="width:75%;"><textarea name="presentation" id ="textarea" rows="4" style="width:100%;">{$PRESENTATION}</textarea></td>
     99                        </tr>
     100                       
     101                        <tr><td colspan="2"><br/></td></tr>
     102                       
     103                        <tr>
     104                                <td><span class="title">{'CR_rules'|@translate}</span></td>
     105                                <td><textarea name="rules" id ="textarea" rows="4" style="width:100%;">{$RULES}</textarea></td>
     106                        </tr>
     107                       
     108                        <tr><td colspan="2"><br/></td></tr>
     109                       
     110                        <tr>
     111                                <td><span class="title">{'CR_prices'|@translate}</span></td>
     112                                <td><textarea name="prices" id ="textarea" rows="4" style="width:100%;">{$PRICES}</textarea></td>
     113                        </tr>
     114                       
     115                        <tr><td colspan="2"><br/></td></tr>
     116                       
     117                        <tr>
     118                                <td><span class="title">{'CR_final'|@translate}</span></td>
     119                                <td><textarea name="final" id ="textarea" rows="4" style="width:100%;">{$FINAL}</textarea></td>
     120                        </tr>
     121                </table>
    104122        </fieldset>
    105123
    106         <fieldset>
    107                 <legend>{'CR_rules'|@translate}</legend>
    108                 <div align="center">
    109                         <textarea name="rules" id ="textarea" rows="4" cols="50" style="width:70%;">{$RULES}</textarea>
    110                         <br/>
    111                         {'CR_visibility'|@translate} :
    112                         <label><input type="checkbox" name="rules_pending" value="true" {if isset($RULES_PENDING)}checked="checked"{/if}> {'CR_pending'|@translate}</label>
    113                         <label><input type="checkbox" name="rules_finished" value="true" {if isset($RULES_FINISHED)}checked="checked"{/if}> {'CR_finished'|@translate}</label>
    114                 </div>
    115         </fieldset>
    116 
    117         <fieldset>
    118                 <legend>{'CR_prices'|@translate}</legend>
    119                 <div align="center">
    120                         <textarea name="prices" id ="textarea" rows="4" cols="50" style="width:70%;">{$PRICES}</textarea>
    121                         <br/>
    122                         {'CR_visibility'|@translate} :
    123                         <label><input type="checkbox" name="prices_pending" value="true" {if isset($PRICES_PENDING)}checked="checked"{/if}> {'CR_pending'|@translate}</label>
    124                         <label><input type="checkbox" name="prices_finished" value="true" {if isset($PRICES_FINISHED)}checked="checked"{/if}> {'CR_finished'|@translate}</label>
    125                 </div>
    126         </fieldset>
    127 
    128         <fieldset>
    129                 <legend>{'CR_final'|@translate}</legend>
    130                 <div align="center">
    131                         <textarea name="final" id ="textarea" rows="4" cols="50" style="width:70%;">{$FINAL}</textarea>
    132                         <br/>
    133                         {'CR_visibility'|@translate} :
    134                         <label><input type="checkbox" name="final_pending" value="true" {if isset($FINAL_PENDING)}checked="checked"{/if}> {'CR_pending'|@translate}</label>
    135                         <label><input type="checkbox" name="final_finished" value="true" {if isset($FINAL_FINISHED)}checked="checked"{/if}> {'CR_finished'|@translate}</label>
    136                 </div>
    137         </fieldset>
    138 
    139         {if isset($ID)}<input type="hidden" name="contest_id" value="{$ID}"/>{/if}
    140124        <p><input class="submit" type="submit" value="{'Submit'|@translate}" name="new_submit"/></p>
    141125</form>
  • extensions/ContestResults/admin/template/results.tpl

    r6782 r9200  
    5555                }
    5656               
    57                 // SUPPRIME UN CHAMP DE RESULTAT (champs non enregistrés uniquement)
     57                // SUPPRIME UN CHAMP DE RESULTAT
    5858                function DeleteResultField(k){ldelim}
    5959                        var result = document.getElementById('result_'+k);
     
    107107
    108108<div class="titrePage">
    109         <h2>
    110                 {'CR_results_tab'|@translate|cat:' : '|cat:$NAME}
    111                 <span class="cluetip" title="{'CR_results_tab'|@translate}|{'CR_help_results'|@translate}{'CR_help_lang'|@translate}"></span>
    112         </h2>
     109        <h2><span class="cluetip" title="{'CR_results_tab'|@translate}|{'CR_help_results'|@translate}">{'CR_results_tab'|@translate|cat:' : '|cat:$NAME} </span></h2>
    113110</div>
    114111
     
    126123                                                </li>
    127124                                        </ul>
     125                                       
    128126                                        <p>
    129127                                                <img src="{$themeconf.admin_icon_dir}/cat_move.png" class="button drag_button" style="display:none;" title="{'Drag to re-order'|@translate}">
    130128                                                {'CR_image_no'|@translate} <input type="text" size="6" name="results[{$i}][image_id]" value="{$result.IMAGE_ID}" onkeyup="UpdatePreview({$i}, this);"/>
     129                                               
    131130                                                <span id="preview-{$i}">
    132131                                                        <span class="vtip" title="<img src='{$result.TN_SRC}'/><br>{$result.IMAGE_NAME}">
     
    134133                                                        </span>
    135134                                                </span>
     135                                               
    136136                                                {'CR_author'|@translate} : <input type="text" name="results[{$i}][author]" value="{$result.AUTHOR}"/>
    137137                                                <textarea class="result_comment" name="results[{$i}][comment]">{$result.COMMENT}</textarea>
     
    147147       
    148148        <p>
    149                 <input type="hidden" name="contest_id" value="{$CONTEST_ID}"/>
    150149                <input class="submit" type="submit" value="{'Submit'|@translate}" name="results_modify"/>
    151150                <span id="AddLink"><input class="submit" type="submit" onclick="CreateResultField({$i}{if !isset($results)}, true{/if});return false;" value="{'CR_addfield'|@translate}"/></a>
  • extensions/ContestResults/changelog.txt

    r7974 r9200  
    1 ContestResults Changelog :
     11.2
     2- Code revision
     3- Add Letton (lv_LV) language, thanks to Aivars Baldone
     4- Delete display options
     5- Fix languages bugs
     6- Improve public appearence
     7
    281.1
    39- Add menu block/links + configuration
  • extensions/ContestResults/include/cr_comment_picture.php

    r6782 r9200  
    22if (!defined('PHPWG_ROOT_PATH')) die('Hacking attempt!');
    33
    4 // +-----------------------------------------------------------------------+
    54// Requète simple pour savoir si l'image a participé à des concours
    6 // +-----------------------------------------------------------------------+
    7 $query = "SELECT image_id FROM " . CR_TABLE_2 . " WHERE image_id = " . $page['image_id'] . ";";
    8 $results = pwg_query($query);
     5$participation = pwg_query("SELECT image_id FROM " . CR_TABLE_2 . " WHERE image_id = " . $page['image_id'] . ";");
    96
    10 if(pwg_db_num_rows($results)){
    11         $query = "SELECT
     7if(pwg_db_num_rows($participation)){
     8        $results = pwg_query("SELECT
    129                        i.rank,
    1310                        i.comment,
     
    1815                ON i.contest_id = c.id
    1916                WHERE i.image_id = " . $page['image_id'] . "
    20                 ORDER BY c.date_begin DESC;";
    21         $results = pwg_query($query);
     17                ORDER BY c.date_begin DESC;");
    2218       
    2319        // Gère plusieurs participations
    2420        $comment = null;
    25         while($result = pwg_db_fetch_assoc($results)){
     21        while( $result = pwg_db_fetch_assoc($results)) {
    2622                // Rang amélioré
    27                 if($result['rank'] <= 3) $result['rank'] = l10n('CR_order_'.$result['rank']);
    28                 else $result['rank'] .= l10n('CR_order_sup');
     23                $result['rank'] = ($result['rank'] <= 3) ? l10n('CR_order_'.$result['rank']) : $result['rank'] . l10n('CR_order_sup');
    2924               
    3025                // Lien vers le concours
     
    3328               
    3429                // Ajoute le commentaire après la description
    35                 $comment .= '<div style="border:1px solid #404040;padding:10px;margin:10px 25%">
    36                         <b><a href="' . $result['contest_link'] .'">' . $result['contest_name'] . '</a></b>
    37                         :: <u>' . $result['rank'] . '</u>
     30                $comment .= '<div class="CR_comment">
     31                        <b><a href="' . $result['contest_link'] .'">' . $result['contest_name'] . '</a></b> :: <u>' . $result['rank'] . ' ' . l10n('CR_place') . '</u>
    3832                        <p>' . trigger_event('render_CR_content', $result['comment']) . '</p>
    3933                </div>';
     
    4236                $template->append('related_categories', '<a href="' . CR_PUBLIC . '">' . l10n('Contests') . '</a>' . $conf['level_separator'] . '<a href="' . $result['contest_link'] . '">' . $result['contest_name'] . '</a>');
    4337        }
     38       
     39        // style utilisé pour les blocs des concours
     40        $css = '<style type="text/css">
     41                .CR_comment {
     42                        border:1px solid #404040;
     43                        padding:10px;
     44                        margin:10px 20%;
     45                }
     46        </style>';
    4447
    4548        $template->assign('COMMENT_IMG', $template->get_template_vars('COMMENT_IMG') . $comment);
     49        $template->assign('PLUGIN_PICTURE_BEFORE', $template->get_template_vars('PLUGIN_PICTURE_BEFORE') . $css);
    4650}
    47 
    4851?>
  • extensions/ContestResults/include/cr_main.php

    r6768 r9200  
    33
    44// +-----------------------------------------------------------------------+
    5 //                      Liste des concours
     5//                              Liste des concours
    66// +-----------------------------------------------------------------------+
    7 $query = "SELECT id, name, visible, date_begin, date_end, status, logo, summary FROM " . CR_TABLE_1 . " ORDER BY date_begin DESC;";
    8 $contests = pwg_query($query);
     7$contests = pwg_query("SELECT
     8                id,
     9                name,
     10                visible,
     11                date_begin,
     12                date_end,
     13                status,
     14                logo,
     15                summary
     16        FROM " . CR_TABLE_1 . "
     17        ORDER BY date_begin DESC;");
    918
    10 while($contest = pwg_db_fetch_assoc($contests)){
    11         if($contest['visible'] OR is_admin()){
     19while ($contest = pwg_db_fetch_assoc($contests)) {
     20        if ($contest['visible'] OR is_admin()) {
    1221                // infos sur le concours
    1322                $item =  array(
     
    1928                        'DATE_BEGIN' => format_date($contest['date_begin']),
    2029                        'LOGO' => $contest['logo'],
    21                         'SUMMARY' => trigger_event('render_CR_content', $contest['summary']),
     30                        'SUMMARY' => CR_cut_string(trigger_event('render_CR_content', $contest['summary']), 350),
    2231                        'URL' => CR_PUBLIC . $contest['id'] . '-' . str2url(trigger_event('render_CR_content', $contest['name'])),
    2332                );
    2433               
    2534                // podium si terminé
    26                 if($contest['status'] == 'finished'){
    27                         $query = "SELECT
     35                if ($contest['status'] == 'finished') {
     36                        $results = pwg_query("SELECT
    2837                                        i.id,
    2938                                        i.name,
     
    3847                                WHERE c.contest_id = " . $contest['id'] . "
    3948                                ORDER BY c.rank ASC
    40                                 LIMIT 3 OFFSET 0;";
    41                         $results = pwg_query($query);
     49                                LIMIT 3 OFFSET 0;");
    4250                       
    43                         while($result = pwg_db_fetch_assoc($results)){
     51                        while ($result = pwg_db_fetch_assoc($results)) {
    4452                                $item['RESULTS'][$result['rank']] = array(
    4553                                        'RANK' => $result['rank'],
     
    5058                }
    5159
    52                 $template->append('contests_'.$contest['status'], $item);
     60                $template->append('contests', $item);
    5361        }
    5462}
  • extensions/ContestResults/include/cr_menubar.php

    r6768 r9200  
    33
    44// +-----------------------------------------------------------------------+
    5 //                              Trigger
     5//                              Triggers
    66// +-----------------------------------------------------------------------+
    7 global $conf;
    87$config = unserialize($conf['ContestResults']);
    9 if($config['menubar_mode']['block'])
     8if ($config['menubar_mode']['block']) {
    109        add_event_handler('blockmanager_register_blocks', 'CR_register_menubar_blocks');
     10}
    1111add_event_handler('blockmanager_apply', 'CR_menubar_apply');
    1212
     
    1414//                              Ajouter un block
    1515// +-----------------------------------------------------------------------+
    16 function CR_register_menubar_blocks($menu_ref_arr){
     16function CR_register_menubar_blocks($menu_ref_arr) {
    1717        $menu = &$menu_ref_arr[0];
    18         if($menu->get_id() != 'menubar') return;
     18        if ($menu->get_id() != 'menubar') { return; }
    1919        $menu->register_block(new RegisteredBlock('mbContestResults', l10n('Contests'), 'ContestResults'));
    2020}
    2121
    2222// +-----------------------------------------------------------------------+
    23 //                      Remplis les block
     23//                              Remplis les block
    2424// +-----------------------------------------------------------------------+
    25 function CR_menubar_apply($menu_ref_arr){
     25function CR_menubar_apply($menu_ref_arr) {
    2626        global $template, $conf;
    2727        $config = unserialize($conf['ContestResults']);
    2828        $menu = &$menu_ref_arr[0];
    2929       
    30         // Block Contest
    31         if(($block = $menu->get_block('mbContestResults')) != null){
     30        // Block Contest - un nouveau bloc dans le menu
     31        if (($block = $menu->get_block('mbContestResults')) != null) {
    3232                $data = array();
     33               
     34                // on récupère les concours
     35                $contests = pwg_query("SELECT
     36                                id,
     37                                name,
     38                                visible,
     39                                status,
     40                                date_begin,
     41                                date_end
     42                        FROM " . CR_TABLE_1 . "
     43                        ORDER BY date_begin DESC;");
    3344
    34                 $query = "SELECT id, name, visible, status, date_begin, date_end
    35                         FROM " . CR_TABLE_1 . "
    36                         ORDER BY date_begin DESC
    37                         LIMIT " . $config['menubar_block']['number'] . " OFFSET 0;";
    38                 $result = pwg_query($query);
    39 
    40                 while($contest = pwg_db_fetch_assoc($result)){
    41                         if($contest['visible'] OR is_admin()){
     45                $m = 0; // copteur pour limiter le nombre de concours affichés
     46                while($contest = pwg_db_fetch_assoc($contests)){
     47                        if (($contest['visible'] OR is_admin()) AND $m < $config['menubar_block']['number']) {
    4248                                array_push($data, array(
    4349                                        'URL' => CR_PUBLIC . $contest['id'] . '-' . str2url(trigger_event('render_CR_content', $contest['name'])),
    4450                                        'LABEL' => trigger_event('render_CR_content', $contest['name']),
    4551                                        'DATE' => format_date($contest['date_begin']) . ' - ' . format_date($contest['date_end']),
    46                                         'STATUS' => $contest['status']
     52                                        'STATUS' => $contest['status'],
     53                                        'VISIBLE' => $contest['visible']
    4754                                ));
    4855                        }
     56                        $m++;
    4957                }
    5058
    51                 if(!empty($data)){
     59                // Finalement on rempli le bloc avec les concours
     60                if (!empty($data)) {
    5261                        $template->set_template_dir(CR_PATH . 'template/');
    5362                        $block->set_title('<a href="' . CR_PUBLIC . '">' . l10n('Contests') . '</a>');
     
    5766        }
    5867       
    59         // Block Menu
    60         if($config['menubar_mode']['link'] AND $config['menubar_link']['menu'] AND ($block = $menu->get_block('mbMenu')) != null){
     68        // Block Menu - ajout d'un lien dans le bloc Menu
     69        if ($config['menubar_mode']['link'] AND $config['menubar_link']['menu'] AND ($block = $menu->get_block('mbMenu')) != null) {
    6170                array_push($block->data, array(
    6271                        'URL' => CR_PUBLIC,
     
    6675        }
    6776       
    68         // Block Specials
     77        // Block Specials - ajout d'un lien dans le bloc Specials
    6978        if($config['menubar_mode']['link'] AND $config['menubar_link']['specials'] AND ($block = $menu->get_block('mbSpecials')) != null){
    7079                array_push($block->data, array(
  • extensions/ContestResults/include/cr_page.php

    r6782 r9200  
    33
    44// +-----------------------------------------------------------------------+
    5 //                      Page d'un concours
     5//                              Page d'un concours
    66// +-----------------------------------------------------------------------+
    7 if(is_admin()){
    8         $template->assign('U_EDIT', CR_ADMIN . '&tab=edit&contest_id=' . $page['contest']);
    9         $template->assign('U_RESULTS', CR_ADMIN . '&tab=results&contest_id=' . $page['contest']);
     7if (is_admin()) {
     8        $template->assign('U_EDIT', CR_ADMIN . '&amp;tab=edit&amp;contest_id=' . $page['contest'] . '&amp;redirect=page');
     9        $template->assign('U_RESULTS', CR_ADMIN . '&amp;tab=results&amp;contest_id=' . $page['contest']);
    1010}
    1111
    1212// Infos du concours
    13 $query = "SELECT * FROM " . CR_TABLE_1 . " WHERE id=" . $page['contest'] . ";";
    14 $results = pwg_query($query);
    15 $contest = pwg_db_fetch_assoc($results);
     13$contest = pwg_query("SELECT * FROM " . CR_TABLE_1 . " WHERE id=" . $page['contest'] . ";");
    1614
    17 if(pwg_db_num_rows($results) AND ($contest['visible'] OR is_admin())){
     15if (pwg_db_num_rows($contest)) {
     16        $contest = pwg_db_fetch_assoc($contest);
     17       
     18        // Concours non-publique
     19        if (!$contest['visible']) {
     20                check_status(ACCESS_ADMINISTRATOR);
     21        }
     22       
    1823        // Paramètres généraux
    1924        $template->assign(array(
     
    2934        ));
    3035       
    31         // Quatre zones texte
    32         foreach(array('presentation','rules','prices','final') AS $key){
    33                 $contest[$key.'_display'] = unserialize($contest[$key.'_display']);
    34                 if($contest[$key.'_display']['pending']) $template->assign(strtoupper($key).'_PENDING', true);
    35                 if($contest[$key.'_display']['finished']) $template->assign(strtoupper($key).'_FINISHED', true);
     36        // Les quatre zones texte
     37        foreach (array('presentation','rules','prices','final') AS $key) {
    3638                $template->assign(strtoupper($key), trigger_event('render_CR_content', $contest[$key]));
    3739        }
    3840       
    3941        // Affichage des résultats
    40         if($contest['status'] == 'finished'){
     42        if ($contest['status'] == 'finished') {
    4143                // Infos des résultats
    42                 $query = "SELECT * FROM " . CR_TABLE_2 . " WHERE contest_id=" . $contest['id'] . " ORDER BY rank ASC;";
    43                 $results = pwg_query($query);
     44                $results = pwg_query("SELECT * FROM " . CR_TABLE_2 . " WHERE contest_id=" . $contest['id'] . " ORDER BY rank ASC;");
    4445               
    45                 while($result = pwg_db_fetch_assoc($results)){
     46                while ($result = pwg_db_fetch_assoc($results)) {
    4647                        // Infos de l'image
    4748                        $query = "SELECT
     
    5960
    6061                        // retrieving category informations
    61                         $query = "SELECT id, name, permalink, uppercats
     62                        $query = "SELECT
     63                                        id,
     64                                        name,
     65                                        permalink,
     66                                        uppercats
    6267                                FROM " . CATEGORIES_TABLE."
    6368                                WHERE id = " . $image['category_id'] . ";";
     
    7277                       
    7378                        // Template
    74                         if(in_array($result['rank'], array(1,2,3))){
     79                        if (in_array($result['rank'], array(1,2,3))) {
    7580                                $data = array(
    7681                                        'RANK' => $result ['rank'],
     
    8085                                        'IMAGE_NAME' => (empty($image['name'])) ? get_name_from_file($image['file']) : $image['name'],
    8186                                        'COMMENT' => CR_cut_string(trigger_event('render_CR_content', $result['comment']), 450),
    82                                         );
     87                                );
    8388                        }else{
    8489                                $data = array(
     
    96101        $template->set_filenames(array('index'=> dirname(__FILE__).'/../template/cr_page.tpl'));
    97102       
    98 }else{
     103} else {
    99104        page_not_found(l10n('CR_notavailable'));
    100105}
  • extensions/ContestResults/include/functions.php

    r6782 r9200  
    33
    44// Racourcis un texte et ajoute une ellipse
    5 function CR_cut_string($string, $limit){
     5function CR_cut_string($string, $limit) {
    66        include_once(CR_PATH . 'include/cutstring.class.php');
    7         if(strlen(str_replace("\r\n", "\n", strip_tags($string))) > $limit){
     7        if (strlen(str_replace("\r\n", "\n", strip_tags($string))) > $limit) {
    88                $output = new HtmlCutString($string, $limit);
    99                return ($output->cut()).'...';
    10         }else{
     10        } else {
    1111                return $string;
    1212        }
     
    1414
    1515// Recupère le nom d'un coucours à partir de l'id
    16 function get_contest_name($id){
    17         $query = pwg_query("SELECT name FROM " . CR_TABLE_1 . " WHERE id = " . $id . ";");
    18         if(pwg_db_num_rows($query)){
    19                 $result = pwg_db_fetch_assoc($query);
    20                 return $result['name'];
    21         }else{
     16function get_contest_name($id) {
     17        $contest = pwg_query("SELECT name FROM " . CR_TABLE_1 . " WHERE id = " . $id . ";");
     18        if (pwg_db_num_rows($contest)) {
     19                $contest = pwg_db_fetch_assoc($contest);
     20                return $contest['name'];
     21        } else {
    2222                return null;
    2323        }
  • extensions/ContestResults/include/index.php

    r6768 r9200  
    11<?php
    22// +-----------------------------------------------------------------------+
    3 // | PhpWebGallery - a PHP based picture gallery                           |
    4 // | Copyright (C) 2002-2003 Pierrick LE GALL - pierrick@phpwebgallery.net |
    5 // | Copyright (C) 2003-2007 PhpWebGallery Team - http://phpwebgallery.net |
     3// | Piwigo - a PHP based picture gallery                                  |
    64// +-----------------------------------------------------------------------+
    7 // | file          : $Id: index.php 1912 2007-03-16 06:30:07Z rub $
    8 // | last update   : $Date: 2007-03-16 07:30:07 +0100 (ven, 16 mar 2007) $
    9 // | last modifier : $Author: rub $
    10 // | revision      : $Revision: 1912 $
     5// | Copyright(C) 2008-2010 Piwigo Team                  http://piwigo.org |
     6// | Copyright(C) 2003-2008 PhpWebGallery Team    http://phpwebgallery.net |
     7// | Copyright(C) 2002-2003 Pierrick LE GALL   http://le-gall.net/pierrick |
    118// +-----------------------------------------------------------------------+
    129// | This program is free software; you can redistribute it and/or modify  |
  • extensions/ContestResults/index.php

    r6768 r9200  
    11<?php
    22// +-----------------------------------------------------------------------+
    3 // | PhpWebGallery - a PHP based picture gallery                           |
    4 // | Copyright (C) 2002-2003 Pierrick LE GALL - pierrick@phpwebgallery.net |
    5 // | Copyright (C) 2003-2007 PhpWebGallery Team - http://phpwebgallery.net |
     3// | Piwigo - a PHP based picture gallery                                  |
    64// +-----------------------------------------------------------------------+
    7 // | file          : $Id: index.php 1912 2007-03-16 06:30:07Z rub $
    8 // | last update   : $Date: 2007-03-16 07:30:07 +0100 (ven, 16 mar 2007) $
    9 // | last modifier : $Author: rub $
    10 // | revision      : $Revision: 1912 $
     5// | Copyright(C) 2008-2010 Piwigo Team                  http://piwigo.org |
     6// | Copyright(C) 2003-2008 PhpWebGallery Team    http://phpwebgallery.net |
     7// | Copyright(C) 2002-2003 Pierrick LE GALL   http://le-gall.net/pierrick |
    118// +-----------------------------------------------------------------------+
    129// | This program is free software; you can redistribute it and/or modify  |
  • extensions/ContestResults/language/en_UK/index.php

    r6768 r9200  
    11<?php
    22// +-----------------------------------------------------------------------+
    3 // | PhpWebGallery - a PHP based picture gallery                           |
    4 // | Copyright (C) 2002-2003 Pierrick LE GALL - pierrick@phpwebgallery.net |
    5 // | Copyright (C) 2003-2007 PhpWebGallery Team - http://phpwebgallery.net |
     3// | Piwigo - a PHP based picture gallery                                  |
    64// +-----------------------------------------------------------------------+
    7 // | file          : $Id: index.php 1912 2007-03-16 06:30:07Z rub $
    8 // | last update   : $Date: 2007-03-16 07:30:07 +0100 (ven, 16 mar 2007) $
    9 // | last modifier : $Author: rub $
    10 // | revision      : $Revision: 1912 $
     5// | Copyright(C) 2008-2010 Piwigo Team                  http://piwigo.org |
     6// | Copyright(C) 2003-2008 PhpWebGallery Team    http://phpwebgallery.net |
     7// | Copyright(C) 2002-2003 Pierrick LE GALL   http://le-gall.net/pierrick |
    118// +-----------------------------------------------------------------------+
    129// | This program is free software; you can redistribute it and/or modify  |
  • extensions/ContestResults/language/en_UK/plugin.lang.php

    r8650 r9200  
    2525$lang['CR_final'] = 'Ending';
    2626$lang['CR_summary'] = 'Summary';
    27 $lang['CR_visibility'] = 'Visible if the contest is';
    2827$lang['CR_textareas'] = 'Contest description';
    2928$lang['CR_new'] = 'New contest';
     
    3534$lang['CR_comment'] = 'Comment';
    3635$lang['CR_rank'] = 'Rank';
     36$lang['CR_place'] = 'place';
    3737$lang['CR_period'] = 'Period';
    38 $lang['CR_visible'] = 'Visible';
     38$lang['CR_visible'] = 'Public';
    3939$lang['CR_nopublic'] = 'This page is not available for the public !';
    4040$lang['CR_notavailable'] = 'This contest is not available';
     
    5252$lang['CR_menubar_block_number'] = 'Quantity of contests to display in the block';
    5353
    54 $lang['CR_help_lang'] = (CR_ED_state == 'active') ? "<b>You can use HTML and multilanguage descriptions.</b>" : "<b>You can use HTML.</b>";
    55         // <span style='font-size:0.8em;'><br/><br/>
    56         // 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].
    57         // <br/><br/>
    58         // 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.
    59         // <br/><br/>
    60         // 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.";
    61 
    62 $lang['CR_help_title'] = "";
     54$lang['CR_help_lang'] = (CR_ED_STATE == 'active') ? "<b>You can use HTML and multilanguage descriptions.</b>" : "<b>You can use HTML.</b>";
     55$lang['CR_help_title'] = "" . $lang['CR_help_lang'];
    6356$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/>
    6457        <b>Caution :</b> the contest doesn't switch automaticaly to the status 'finished' when the end date is reached !";
    65 $lang['CR_help_visible'] = "If the contest is 'unvisible' only <b>administrators</b> can see it.";
    66 $lang['CR_help_summary'] = "The summary is only displayed in the general contest page.
    67         <br/>";
    68 $lang['CR_help_textareas'] = "- These four areas allow you to describe the contest.
    69         - For each area you can choose the displaying according to the contest status.";
     58$lang['CR_help_visible'] = "If the contest is not public only <b>administrators</b> can see it.";
     59$lang['CR_help_summary'] = "The summary is only displayed in the general contest page.<br/>
     60        <br/>" . $lang['CR_help_lang'];
     61$lang['CR_help_textareas'] = "These four areas allow you to describe the contest.<br/>
     62        <br/>" . $lang['CR_help_lang'];
    7063$lang['CR_help_results'] = "- Descriptions are displayed on each pictures pages and on the contest page for the first three.<br/>
    7164        - Sort elements by drag-and-drop them.<br/>
    72         - Hover this icon <img src='".CR_PATH."admin/template/image/images.png'/> to view the picture that corresponds to the id.<br/>";
     65        - Hover this icon <img src='".CR_PATH."admin/template/image/images.png'/> to view the picture that corresponds to the id.<br/>
     66        <br/>" . $lang['CR_help_lang'];
    7367
    7468?>
  • extensions/ContestResults/language/fr_FR/index.php

    r6768 r9200  
    11<?php
    22// +-----------------------------------------------------------------------+
    3 // | PhpWebGallery - a PHP based picture gallery                           |
    4 // | Copyright (C) 2002-2003 Pierrick LE GALL - pierrick@phpwebgallery.net |
    5 // | Copyright (C) 2003-2007 PhpWebGallery Team - http://phpwebgallery.net |
     3// | Piwigo - a PHP based picture gallery                                  |
    64// +-----------------------------------------------------------------------+
    7 // | file          : $Id: index.php 1912 2007-03-16 06:30:07Z rub $
    8 // | last update   : $Date: 2007-03-16 07:30:07 +0100 (ven, 16 mar 2007) $
    9 // | last modifier : $Author: rub $
    10 // | revision      : $Revision: 1912 $
     5// | Copyright(C) 2008-2010 Piwigo Team                  http://piwigo.org |
     6// | Copyright(C) 2003-2008 PhpWebGallery Team    http://phpwebgallery.net |
     7// | Copyright(C) 2002-2003 Pierrick LE GALL   http://le-gall.net/pierrick |
    118// +-----------------------------------------------------------------------+
    129// | This program is free software; you can redistribute it and/or modify  |
  • extensions/ContestResults/language/fr_FR/plugin.lang.php

    r6795 r9200  
    2525$lang['CR_final'] = 'Conclusion';
    2626$lang['CR_summary'] = 'Résumé';
    27 $lang['CR_visibility'] = 'Visible si le concours est';
    2827$lang['CR_textareas'] = 'Description du concours';
    2928$lang['CR_new'] = 'Nouveau concours';
     
    3534$lang['CR_comment'] = 'Commentaire';
    3635$lang['CR_rank'] = 'Rang';
     36$lang['CR_place'] = 'place';
    3737$lang['CR_period'] = 'Période';
    38 $lang['CR_visible'] = 'Visible';
     38$lang['CR_visible'] = 'Publique';
    3939$lang['CR_nopublic'] = "Cette page n'est pas accessible au public !";
    4040$lang['CR_notavailable'] = "Ce concours n'est pas disponible";
    4141$lang['CR_id_unknown %d'] = "L'image n°%d n'existe pas";
    4242
    43 $lang['CR_order_1'] = '1<sup>er</sup>';
     43$lang['CR_order_1'] = '1<sup>ère</sup>';
    4444$lang['CR_order_2'] = '2<sup>ème</sup>';
    4545$lang['CR_order_3'] = '3<sup>ème</sup>';
     
    5252$lang['CR_menubar_block_number'] = 'Nombre de concours à afficher dans le bloc';
    5353
    54 $lang['CR_help_lang'] = (CR_ED_state == 'active') ? "<b>Vous pouvez utiliser du HTML et les descriptions multilingues.</b>" : "<b>Vous pouvez utiliser du HTML.</b>";
    55         // <span style='font-size:0.8em;'><br/><br/>
    56         // 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].
    57         // <br/><br/>
    58         // 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.
    59         // <br/><br/>
    60         // 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>";
    61 
    62 $lang['CR_help_title'] = "";
     54$lang['CR_help_lang'] = (CR_ED_STATE == 'active') ? "<b>Vous pouvez utiliser du HTML et les descriptions multilingues.</b>" : "<b>Vous pouvez utiliser du HTML.</b>";
     55$lang['CR_help_title'] = "" . $lang['CR_help_lang'];
    6356$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/>
    6457        <b>Attention :</b> le concours ne passe pas automatiquement en status terminé quand la date de fin est atteinte !";
    65 $lang['CR_help_visible'] = "Si le concours est 'invisible' seuls les <b>administrateurs</b> peuvent le voir.";
     58$lang['CR_help_visible'] = "Si le concours n'est pas publique seuls les <b>administrateurs</b> peuvent le voir.";
    6659$lang['CR_help_summary'] = "Le résumé n'est affiché que sur la page regroupant tous les concours.<br/>
    67         <br/>";
    68 $lang['CR_help_textareas'] = "- Ces quatres zones de texte vous permettent de décrire le concours.<br/>
    69         - Pour chaque zone vous pouvez choisir son affichage selon le status du concours.<br/>
    70         <br/>";
     60        <br/>" . $lang['CR_help_lang'];
     61$lang['CR_help_textareas'] = "Ces quatres zones de texte vous permettent de décrire le concours.<br/>
     62        <br/>" . $lang['CR_help_lang'];
    7163$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/>
    7264        - Triez les éléments par glisser-déposer.<br/>
    7365        - Survolez l'icône <img src='".CR_PATH."admin/template/image/images.png'/> pour voir l'image correspondante à l'identifiant entré.<br/>
    74         <br/>";
     66        <br/>" . $lang['CR_help_lang'];
    7567
    7668?>
  • extensions/ContestResults/language/index.php

    r6768 r9200  
    11<?php
    22// +-----------------------------------------------------------------------+
    3 // | PhpWebGallery - a PHP based picture gallery                           |
    4 // | Copyright (C) 2002-2003 Pierrick LE GALL - pierrick@phpwebgallery.net |
    5 // | Copyright (C) 2003-2007 PhpWebGallery Team - http://phpwebgallery.net |
     3// | Piwigo - a PHP based picture gallery                                  |
    64// +-----------------------------------------------------------------------+
    7 // | file          : $Id: index.php 1912 2007-03-16 06:30:07Z rub $
    8 // | last update   : $Date: 2007-03-16 07:30:07 +0100 (ven, 16 mar 2007) $
    9 // | last modifier : $Author: rub $
    10 // | revision      : $Revision: 1912 $
     5// | Copyright(C) 2008-2010 Piwigo Team                  http://piwigo.org |
     6// | Copyright(C) 2003-2008 PhpWebGallery Team    http://phpwebgallery.net |
     7// | Copyright(C) 2002-2003 Pierrick LE GALL   http://le-gall.net/pierrick |
    118// +-----------------------------------------------------------------------+
    129// | This program is free software; you can redistribute it and/or modify  |
  • extensions/ContestResults/language/lv_LV/description.txt

    r8650 r9200  
    1 Pievieno konkursu pārvaldības lapas
     1Pievieno konkursu parvaldibas lapas
  • extensions/ContestResults/language/lv_LV/index.php

    r8650 r9200  
    11<?php
    22// +-----------------------------------------------------------------------+
    3 // | PhpWebGallery - a PHP based picture gallery                           |
    4 // | Copyright (C) 2002-2003 Pierrick LE GALL - pierrick@phpwebgallery.net |
    5 // | Copyright (C) 2003-2007 PhpWebGallery Team - http://phpwebgallery.net |
     3// | Piwigo - a PHP based picture gallery                                  |
    64// +-----------------------------------------------------------------------+
    7 // | file          : $Id$
    8 // | last update   : $Date$
    9 // | last modifier : $Author$
    10 // | revision      : $Revision$
     5// | Copyright(C) 2008-2010 Piwigo Team                  http://piwigo.org |
     6// | Copyright(C) 2003-2008 PhpWebGallery Team    http://phpwebgallery.net |
     7// | Copyright(C) 2002-2003 Pierrick LE GALL   http://le-gall.net/pierrick |
    118// +-----------------------------------------------------------------------+
    129// | This program is free software; you can redistribute it and/or modify  |
  • extensions/ContestResults/language/lv_LV/plugin.lang.php

    r8650 r9200  
    2525$lang['CR_final'] = 'Beigšana';
    2626$lang['CR_summary'] = 'Kopā';
    27 $lang['CR_visibility'] = 'Redzams, ja konkurss ir';
    2827$lang['CR_textareas'] = 'Konkursa apraksts';
    2928$lang['CR_new'] = 'Jauns konkurss';
     
    3534$lang['CR_comment'] = 'Komentārs';
    3635$lang['CR_rank'] = 'Novērtējums';
     36$lang['CR_place'] = 'vietu';
    3737$lang['CR_period'] = 'Periods';
    3838$lang['CR_visible'] = 'Redzams';
     
    5252$lang['CR_menubar_block_number'] = 'Blokā attēlojamo konkursu skaits';
    5353
    54 $lang['CR_help_lang'] = (CR_ED_state == 'active') ? "Iespējasm lietot HTML un multivalodu aprakstus." : "Varat lietot HTML.";
    55         //<span style='font-size:0.8em;'><br/><br/>
    56         // Multilvalodu apraksts ir izvietots starp [lang=xx] un [/lang] iezīmēm (tagiem), kur xx ir valodas kods (piemēram en, es, fr). Ir arī 2 īpašas valodas : [lang=default] un [lang=all].
    57         //<br/><br/>
    58         // Īpašā valoda pēc noklusējuma (default) : ja nebūs pieejams apraksts lietotāja izvēlētajā valodā, tad tiks lietots apraksts pēc noklusējuma noklusējuma valodā. Ja [lang=default] neeksistē, viss ārpus [lang] iezīmēm tiks uztverts kā apraksts pēc noklusējuma.
    59         //<br/><br/>
    60         // Īpašā valoda visi (all) : viss, kas atrodas starp iezīmēm [lang=all] tiks iekļauts aprakstā, veinalga kāda ir konekcijā esošā lietotāja definētā valoda. Tas galvenokārt ir noderīgi, ja aprakstā tiek iekļauts HTML/JavaScript kods.";
     54$lang['CR_help_lang'] = (CR_ED_STATE == 'active') ? "Iespējasm lietot HTML un multivalodu aprakstus." : "Varat lietot HTML.";
     55$lang['CR_help_title'] = "" . $lang['CR_help_lang'];
     56$lang['CR_help_status'] = "Kad konkurss ir <i>Pabeigts</i>, tā rezultāti tiek atainoti konkursa lapā un tiek aktivēts marķieris <span style='color:#a00;'>(Pabeigts)</span>.<br/>
     57        <b>Brīdinājums :</b> konkurss, sasniedzot tā beigu datumu, automātiski nepieņem statusu 'Pabeigts' !";
     58$lang['CR_help_visible'] = "Ja konkurss ir 'neredzams' (unvisible), to var redzāt tikai administrators.";
     59$lang['CR_help_summary'] = "Kopsavilkums tiek attēlots tikai konkursa galvenajā lapā.<br/>
     60        <br/>" . $lang['CR_help_lang'];
     61$lang['CR_help_textareas'] = "Šie četri apgabali dod jums iespēju aprakstīt konkursu.<br/>
     62        <br/>" . $lang['CR_help_lang'];
     63$lang['CR_help_results'] = "- Apraksti tiek rādīti uz katras attēla lapas un uz konkursa lapas - pirmajiem trim.<br/>
     64        - Kārtot elementus ar (velc un met) drag-and-drop metodi.<br/>
     65        - Uzej ar peli uz ikonas <img src='".CR_PATH."admin/template/image/images.png'/> lai redzētu attēlu, kas atbilst id.<br/>
     66        <br/>" . $lang['CR_help_lang'];
    6167
    62 $lang['CR_help_title'] = "";
    63 $lang['CR_help_status'] = "Kad konkurss ir Pabeigts, tā rezultāti tiek atainoti konkursa lapā un tiek aktivēts marķieris <span style='color:#a00;'>(Pabeigts)</span>.
    64         Brīdinājums : konkurss, sasniedzot tā beigu datumu, automātiski nepieņem statusu 'Pabeigts' !";
    65 $lang['CR_help_visible'] = "Ja konkurss ir 'neredzams' (unvisible), to var redzāt tikai administrators .";
    66 $lang['CR_help_summary'] = "Kopsavilkums tiek attēlots tikai konkursa galvenajā lapā.
    67         <br/>";
    68 $lang['CR_help_textareas'] = "- Šie četri apgabali dod jums iespēju aprakstīt konkursu.
    69         - Katram apgabalam, ņemot vērā konkursa statusu, iespējams izvēlēties tā attēlojumu.";
    70 $lang['CR_help_results'] = "- Apraksti tiek rādīti uz katras attēla lapas un uz konkursa lapas - pirmajiem trim.
    71         - Kārtot elementus ar (velc un met) drag-and-drop metodi.
    72         - Uzej ar peli uz ikonas, src='".CR_PATH."admin/template/image/images.png' _fcksavedurl='".CR_PATH."admin/template/image/images.png'/> lai redzētu attēlu, kas atbilst id.";
    7368?>
  • extensions/ContestResults/main.inc.php

    r6795 r9200  
    22/*
    33Plugin Name: ContestResults
    4 Version: 1.1
     4Version: 1.2
    55Description: Add contests management pages
    66Plugin URI: http://piwigo.org/ext/extension_view.php?eid=439
     
    1111if (!defined('PHPWG_ROOT_PATH')) die('Hacking attempt!');
    1212
    13 global $prefixeTable;
     13global $prefixeTable, $conf;
    1414
    1515// +-----------------------------------------------------------------------+
    16 //                      Variables globales CR
     16//                              Variables globales CR
    1717// +-----------------------------------------------------------------------+
    1818define('CR_DIR' , basename(dirname(__FILE__)));
     
    2121define('CR_TABLE_2' , $prefixeTable . 'contests_results');
    2222define('CR_NAME' , 'ContestResults');
    23 define('CR_VERSION', '1.1');
    24 define('CR_ADMIN', PHPWG_ROOT_PATH . 'admin.php?page=plugin&section=' . CR_DIR . '/admin/admin.php');
     23define('CR_VERSION', '1.2');
     24define('CR_ADMIN', PHPWG_ROOT_PATH . 'admin.php?page=plugin&amp;section=' . CR_DIR . '/admin/admin.php');
    2525define('CR_PUBLIC', make_index_url(array('section' => 'contests')) . '/');
    2626
    2727$ED = pwg_db_fetch_assoc(pwg_query("SELECT state FROM " . PLUGINS_TABLE . " WHERE id = 'ExtendedDescription';"));
    28 define('CR_ED_state', $ED['state']);
     28define('CR_ED_STATE', $ED['state']);
    2929
    3030
    3131// +-----------------------------------------------------------------------+
    32 //                              Trigger
     32//                                      Triggers
    3333// +-----------------------------------------------------------------------+
    3434add_event_handler('get_admin_plugin_menu_links', 'CR_admin_menu');      // Lien d'administration
     
    3636add_event_handler('loc_end_index', 'CR_index');                                         // Contenu du la page
    3737add_event_handler('loc_end_picture', 'CR_comment_picture', 10);         // Commentaire sur la page image
     38if(CR_ED_STATE == 'active') add_event_handler('render_CR_content', 'get_user_language_desc');   // Textes multilangues
    3839
    39 if(CR_ED_state == 'active') add_event_handler('render_CR_content', 'get_user_language_desc');   // Textes multilangues
    4040
    41 // Langues
    42 load_language('plugin.lang', CR_PATH);
    43 
     41// +-----------------------------------------------------------------------+
     42//                                      Fonctions
     43// +-----------------------------------------------------------------------+
    4444// Gestion du menu
    4545include(CR_PATH . 'include/cr_menubar.php');
    4646
    4747// Lien d'administration
    48 function CR_admin_menu($menu){
     48function CR_admin_menu($menu) {
    4949        array_push($menu, array(
    5050                'NAME' => CR_NAME,
     
    5555
    5656// Paramètre URL
    57 function CR_section_init(){
     57function CR_section_init() {
    5858    global $tokens, $page, $conf;
     59       
     60        load_language('plugin.lang', CR_PATH);
    5961        include(CR_PATH . 'include/functions.php');
    6062       
    61     if($tokens[0] == 'contests'){
     63    if ($tokens[0] == 'contests') { // on est dans la section concours
    6264                $page['section'] = 'contests';
    6365                $page['title'] = l10n('Contests');
    64                 if(isset($tokens[1]) AND $tokens[1]){
     66               
     67                if (isset($tokens[1]) AND $tokens[1]) { // on est sur la page d'un concours
    6568                        $page['contest'] = explode('-', $tokens[1]);
    6669                        $page['contest'] = $page['contest'][0];
     
    7073}
    7174
    72 // Contenu du la page
    73 function CR_index(){
     75// Contenu de la page
     76function CR_index() {
    7477    global $template, $page, $conf;
    75     if(isset($page['section']) and $page['section'] == 'contests'){
    76                 if(isset($page['contest']))
     78
     79    if (isset($page['section']) and $page['section'] == 'contests') {
     80                if (isset($page['contest'])) { // on est sur la page d'un concours
    7781                        include(CR_PATH . 'include/cr_page.php');
    78                 else
     82                } else { // on est dans la section concours
    7983                        include(CR_PATH . 'include/cr_main.php');
     84                }
    8085        }
    8186}
    8287
    8388// Ajoute le commentaire sur la page image
    84 function CR_comment_picture(){
     89function CR_comment_picture() {
    8590        global $page, $template, $conf;
    8691        include(CR_PATH . 'include/cr_comment_picture.php'); 
  • extensions/ContestResults/maintain.inc.php

    r6782 r9200  
    22if (!defined('PHPWG_ROOT_PATH')) die('Hacking attempt!');
    33
     4// Configuration par défaut
    45define('default_config' , serialize(array(
    56        'menubar_mode' => array(
     
    1617)));
    1718
    18 function plugin_install(){
     19// Installtion
     20function plugin_install() {
    1921        global $prefixeTable;
    2022
    21         $query = "CREATE TABLE `" . $prefixeTable . "contests` (
     23        pwg_query("CREATE TABLE `" . $prefixeTable . "contests` (
    2224                `id` INT NOT NULL AUTO_INCREMENT ,
    2325                `name` VARCHAR( 255 ) NOT NULL ,
     
    3032                `summary` TEXT NULL ,
    3133                `presentation` TEXT NULL ,
    32                 `presentation_display` VARCHAR( 255 ) NULL ,
    3334                `rules` TEXT NULL ,
    34                 `rules_display` VARCHAR( 255 ) NULL ,
    3535                `prices` TEXT NULL ,
    36                 `prices_display` VARCHAR( 255 ) NULL ,
    37                 `final` TEXT NULL ,
    38                 `final_display` VARCHAR( 255 ) NULL ,
     36                `final` TEXT NULL
    3937                PRIMARY KEY ( `id` )
    40         );";
    41         pwg_query($query);
     38        );");
    4239       
    43         $query = "CREATE TABLE `" . $prefixeTable . "contests_results` (
     40        pwg_query("CREATE TABLE `" . $prefixeTable . "contests_results` (
    4441                `image_id` INT NOT NULL ,
    4542                `contest_id` INT NOT NULL ,
     
    4845                `comment` TEXT NULL,
    4946                UNIQUE ( `image_id` , `contest_id` )
    50         );";
    51         pwg_query($query);
     47        );");
    5248       
    53         $query = "INSERT INTO " . CONFIG_TABLE . "(param,value,comment) VALUES('ContestResults', '" . default_config . "', 'Parametres du plugin ContestResults');";
    54         pwg_query($query);
     49        pwg_query("INSERT INTO " . CONFIG_TABLE . "(param,value,comment) VALUES('ContestResults', '" . default_config . "', 'Parametres du plugin ContestResults');");
    5550}
    5651
     52// Activation
    5753function plugin_activate(){
    58         global $conf;
     54        global $conf, $prefixeTable;
    5955
    60         // compatibilité avec les versions < 1.1
    61         if(!isset($conf['ContestResults'])){
    62                 $query = "INSERT INTO " . CONFIG_TABLE . "(param,value,comment) VALUES('ContestResults', '" . default_config . "', 'Parametres du plugin ContestResults');";
    63                 pwg_query($query);
     56        // compatibilité avec les versions < 1.1 (ajout d'une entrée de configuration)
     57        if (!isset($conf['ContestResults'])) {
     58                pwg_query("INSERT INTO " . CONFIG_TABLE . "(param,value,comment) VALUES('ContestResults', '" . default_config . "', 'Parametres du plugin ContestResults');");
     59        }
     60       
     61        // compatibilité avec les versions < 1.2 (suppression option d'affichage)
     62        $field = pwg_query("SHOW COLUMNS FROM `" . $prefixeTable . "contests` LIKE 'presentation_display'");
     63        if (pwg_db_num_rows($field)) {
     64                pwg_query("ALTER TABLE `" . $prefixeTable . "contests` DROP `presentation_display`");
     65                pwg_query("ALTER TABLE `" . $prefixeTable . "contests` DROP `rules_display`");
     66                pwg_query("ALTER TABLE `" . $prefixeTable . "contests` DROP `prices_display`");
     67                pwg_query("ALTER TABLE `" . $prefixeTable . "contests` DROP `final_display`");
    6468        }
    6569}
    6670
    67 function plugin_uninstall(){
     71// Désinstallation
     72function plugin_uninstall() {
    6873        global $prefixeTable;
    6974
    70         $query = "DROP TABLE `" . $prefixeTable . "contests`;";
    71         pwg_query($query);
    72        
    73         $query = "DROP TABLE `" . $prefixeTable . "contests_results`;";
    74         pwg_query($query);
    75        
    76         $query = "DELETE FROM " . CONFIG_TABLE . " WHERE `param` = 'ContestResults';";
    77         pwg_query($query);
     75        pwg_query("DROP TABLE `" . $prefixeTable . "contests`;");
     76        pwg_query("DROP TABLE `" . $prefixeTable . "contests_results`;");
     77        pwg_query("DELETE FROM " . CONFIG_TABLE . " WHERE `param` = 'ContestResults';");
    7878}
    7979?>
  • extensions/ContestResults/template/cr_main.tpl

    r6782 r9200  
    66
    77{if !empty($PLUGIN_INDEX_CONTENT_BEFORE)}{$PLUGIN_INDEX_CONTENT_BEFORE}{/if}
     8
    89<div id="content" class="content">
    910        <div class="titrePage">
     
    1314                <h2>{'Contests'|@translate}</h2>
    1415        </div> <!-- titrePage -->
    15         {if !isset($contests_pending) AND !isset($contests_finished)}
     16       
     17        {if !isset($contests)}
    1618                <div class="nopublic" style="margin-bottom:200px;">
    1719                        {'CR_no_contest'|@translate}
    1820                </div>
    19         {/if}
    20         {if isset($contests_pending)}
     21               
     22        {else}
    2123                <ul class="thumbnailCategories">
    22                         {foreach from=$contests_pending item=contest}
    23                                 <li>
    24                                         <div class="thumbnailCategory {if $contest.VISIBLE == 0}novisible{/if}">
    25                                                 <div class="illustration">
    26                                                         <a href="{$contest.URL}">
    27                                                                 {if !empty($contest.LOGO)}
    28                                                                         <img src="{$contest.LOGO}" alt="{$contest.NAME}" style="max-height:120px;max-width:120px;">
     24                                {foreach from=$contests item=contest}
     25                                        <li>
     26                                                <div class="thumbnailCategory {if $contest.VISIBLE == 0}novisible{/if}">
     27                                                        <div class="illustration">
     28                                                                <a href="{$contest.URL}">
     29                                                                {if $contest.STATUS == 'pending'}
     30                                                                        {if !empty($contest.LOGO)}
     31                                                                                <img src="{$contest.LOGO}" alt="{$contest.NAME}" style="max-height:120px;max-width:120px;">
     32                                                                        {/if}
     33                                                                {else}
     34                                                                        <img src="{$contest.RESULTS.1.TN_SRC}" alt="{$contest.NAME|@replace:'"':' '}">
    2935                                                                {/if}
    30                                                         </a>
    31                                                 </div>
    32                                                 <div class="description">
    33                                                         <h3>
    34                                                                 <a href="{$contest.URL}">{$contest.NAME}</a>
    35                                                         </h3>
    36                                                         <div class="text">
    37                                                                 <p class="Nb_images">{$contest.DATE_BEGIN} - {$contest.DATE_END}</p>
    38                                                                 {if !empty($contest.SUMMARY)}
    39                                                                         <p>{$contest.SUMMARY}</p>
    40                                                                 {/if}
     36                                                                </a>
    4137                                                        </div>
    42                                                 </div>
    43                                         </div>
    44                                 </li>
    45                         {/foreach}
    46                 </ul>
    47         {/if}
    48        
    49         {if isset($contests_finished)}
    50                 <ul class="thumbnailCategories">
    51                         {foreach from=$contests_finished item=contest}
    52                                 <li>
    53                                         <div class="thumbnailCategory {if $contest.VISIBLE == 0}novisible{/if}">
    54                                                 <div class="description">
    55                                                         <h3>
    56                                                                 <a href="{$contest.URL}">{$contest.NAME}</a>
    57                                                                 <span class="finished">({'CR_finished'|@translate})</span>
    58                                                         </h3>
    59                                                         <div class="text">
    60                                                                 <p class="Nb_images">{$contest.DATE_BEGIN} - {$contest.DATE_END}</p>
    61                                                                 <div class="results">
    62                                                                         <a href="{$contest.URL}">
     38                                                        <div class="description">
     39                                                                <h3>
     40                                                                        <a href="{$contest.URL}">{$contest.NAME}</a>
     41                                                                        {if $contest.STATUS == 'finished'}<span class="CR_finished">({'CR_finished'|@translate})</span>{/if}
     42                                                                </h3>
     43                                                                <div class="text">
     44                                                                        <p class="Nb_images">{$contest.DATE_BEGIN} - {$contest.DATE_END}</p>
     45                                                                        <p>
     46                                                                        {if $contest.STATUS == 'pending'}
     47                                                                                {if !empty($contest.SUMMARY)}
     48                                                                                        {$contest.SUMMARY}
     49                                                                                {/if}
     50                                                                        {else}
    6351                                                                                {foreach from=$contest.RESULTS item=result}
    64                                                                                         <img src="{$result.TN_SRC}" style="max-height:80px;max-width:120px;"/>
     52                                                                                        {'CR_order_'|cat:$result.RANK|@translate} {'CR_place'|@translate} - <u>{$result.AUTHOR}</u><br>
    6553                                                                                {/foreach}
    66                                                                         </a>
     54                                                                        {/if}
     55                                                                        </p>
    6756                                                                </div>
    6857                                                        </div>
    6958                                                </div>
    70                                         </div>
    71                                 </li>
    72                         {/foreach}
    73                 </ul>
     59                                        </li>
     60                                {/foreach}
     61                        </ul>
    7462        {/if}
    7563</div> <!-- content -->
  • extensions/ContestResults/template/cr_menubar.tpl

    r6768 r9200  
    11{html_head}
    22        <style type="text/css">
    3                 .finished {ldelim}
     3                .CR_finished {ldelim}
    44                        font-size:0.8em;
    55                        color:#a00;
     
    1515                                <a href="{$data.URL}" title="{$data.DATE}">
    1616                                        {$data.LABEL}
    17                                         {if $data.STATUS == 'finished'}<span class="finished">&times;</span>{/if}
     17                                        {if $data.STATUS == 'finished'}<span class="CR_finished">&times;</span>{/if}
    1818                                </a>
    1919                        </li>
  • extensions/ContestResults/template/cr_page.tpl

    r6782 r9200  
    66
    77{if !empty($PLUGIN_INDEX_CONTENT_BEFORE)}{$PLUGIN_INDEX_CONTENT_BEFORE}{/if}
    8 <div id="content_contest" class="content">
     8<div class="content">
    99        <div class="titrePage">
    1010                <ul class="categoryActions"> 
     
    1515                </ul>
    1616                <h2>
    17                         <a href="index.php?/contests">{'Contests'|@translate}</a>{$SEPARATOR}<a href="{$URL}">{$NAME}</a>
    18                         {if $STATUS=='finished'}<span class="finished">({'CR_finished'|@translate})</span>{/if}
     17                        <a href="index.php?/contests" name="top">{'Contests'|@translate}</a>{$SEPARATOR}<a href="{$URL}">{$NAME}</a>
     18                        {if $STATUS=='finished'}<span class="CR_finished">({'CR_finished'|@translate})</span>{/if}
    1919                </h2>
    2020        </div> <!-- titrePage -->
     
    2626        {/if}
    2727       
     28        <div class="CR_banner">
    2829        {if !empty($BANNER)}
    29                 <div class="CR_banner">
    30                         <a href="#results"><img src="{$BANNER}" alt="{$NAME}"/></a>
     30                <h1><a href="#results"><img src="{$BANNER}" alt="{$NAME}"/></a></h1>
     31        {else}
     32                <h1><a href="#results">{$NAME}</a></h1>
     33        {/if}
     34        </div>
     35       
     36        <div class="CR_text CR_period">
     37                {$DATE_BEGIN} - {$DATE_END}
     38        </div>
     39       
     40        {if !empty($PRESENTATION)}
     41                <div class="CR_text">
     42                        <h3>{'CR_presentation'|@translate} :</h3>
     43                        {$PRESENTATION}
    3144                </div>
    3245        {/if}
    3346       
    34         {if (($STATUS=='pending' AND $PRESENTATION_PENDING) OR ($STATUS=='finished' AND $PRESENTATION_FINISHED)) AND !empty($PRESENTATION)}
     47        {if !empty($RULES)}     
    3548                <div class="CR_text">
    36                         <h3>{'CR_presentation'|@translate} :</h3>
    37                         <p>{$PRESENTATION}</p>
     49                        <h3>{'CR_rules'|@translate} :</h3>
     50                        {$RULES}
    3851                </div>
    3952        {/if}
    4053       
    41         <div class="CR_text">
    42                 <h3>{'CR_period'|@translate} :</h3>
    43                 <p>{$DATE_BEGIN} - {$DATE_END}</p>
    44         </div>
     54        {if !empty($PRICES)}
     55                <div class="CR_text">
     56                        <h3>{'CR_prices'|@translate} :</h3>
     57                        {$PRICES}
     58                </div>
     59        {/if}
    4560       
    46         <div id="CR_rules_prices">
    47                 {if (($STATUS=='pending' AND $RULES_PENDING) OR ($STATUS=='finished' AND $RULES_FINISHED)) AND !empty($RULES)} 
    48                         <div id="CR_rules">
    49                                 <h3>{'CR_rules'|@translate} :</h3>
    50                                 <p>{$RULES}</p>
    51                         </div>
    52                 {/if}
    53                
    54                 {if (($STATUS=='pending' AND $PRICES_PENDING) OR ($STATUS=='finished' AND $PRICES_FINISHED)) AND !empty($PRICES)}
    55                         <div id="CR_prices">
    56                                 <h3>{'CR_prices'|@translate} :</h3>
    57                                 <p>{$PRICES}</p>
    58                         </div>
    59                 {/if}
    60         </div>
    61        
    62         {if (($STATUS=='pending' AND $FINAL_PENDING) OR ($STATUS=='finished' AND $FINAL_FINISHED)) AND !empty($FINAL)}
     61        {if !empty($FINAL)}
    6362                <div class="CR_text">
    6463                        <h3>{'CR_final'|@translate} :</h3>
    65                         <p>{$FINAL}</p>
     64                        {$FINAL}
    6665                </div>
    6766        {/if}
     
    6968
    7069{if !empty($RESULTS)}
    71         <div id="content_results" class="content">
     70        <div class="content">
    7271                <div class="titrePage">
    7372                        <ul class="categoryActions"> 
     
    8584                                        <div class="podium_{$result.RANK}">
    8685                                                <div class="illustration">
    87                                                         <div class="title">{'CR_order_'|cat:$result.RANK|@translate} - <u>{$result.AUTHOR}</u></div>
     86                                                        <div class="title">{'CR_order_'|cat:$result.RANK|@translate} {'CR_place'|@translate} - <u>{$result.AUTHOR}</u></div>
    8887                                                        <a href="{$result.IMAGE_URL}" title="{$result.IMAGE_NAME}">
    8988                                                                <img src="{$result.IMAGE_SRC}" alt="{$result.IMAGE_NAME}"/>
    9089                                                        </a>
    9190                                                </div>
    92                                                 <div class="comment">
    93                                                         <div>{$result.COMMENT}</div>
    94                                                 </div>
     91                                                <p>
     92                                                        {$result.COMMENT}
     93                                                </p>
    9594                                        </div>
    9695                                        {if $result.RANK == 3}</div>{/if}
     
    108107                                                                        <img class="thumbnail" src="{$result.TN_SRC}" alt="{$result.IMAGE_NAME}"/>
    109108                                                                </a>
    110                                                         </span>
     109                                                        </span>                                                 
    111110                                                        <span class="thumbLegend">
    112                                                                 <b>{$result.RANK}{'CR_order_sup'|@translate}</b> - {$result.AUTHOR}
     111                                                                <span class="thumbnail-name">
     112                                                                        {$result.AUTHOR}
     113                                                                </span>
     114                                                                <span class="nb-hits">
     115                                                                        <br>{$result.RANK}{'CR_order_sup'|@translate} {'CR_place'|@translate}
     116                                                                </span>
    113117                                                        </span>
    114118                                                </span>
     
    120124                {if !empty($LOGO)}
    121125                        <div class="CR_banner">
    122                                 <img src="{$LOGO}" alt="{$NAME}"/>
     126                                <h1><a href="#top"><img src="{$LOGO}" alt="{$NAME}"/></a></h1>
    123127                        </div>
    124128                {/if}
  • extensions/ContestResults/template/index.php

    r6768 r9200  
    11<?php
    22// +-----------------------------------------------------------------------+
    3 // | PhpWebGallery - a PHP based picture gallery                           |
    4 // | Copyright (C) 2002-2003 Pierrick LE GALL - pierrick@phpwebgallery.net |
    5 // | Copyright (C) 2003-2007 PhpWebGallery Team - http://phpwebgallery.net |
     3// | Piwigo - a PHP based picture gallery                                  |
    64// +-----------------------------------------------------------------------+
    7 // | file          : $Id: index.php 1912 2007-03-16 06:30:07Z rub $
    8 // | last update   : $Date: 2007-03-16 07:30:07 +0100 (ven, 16 mar 2007) $
    9 // | last modifier : $Author: rub $
    10 // | revision      : $Revision: 1912 $
     5// | Copyright(C) 2008-2010 Piwigo Team                  http://piwigo.org |
     6// | Copyright(C) 2003-2008 PhpWebGallery Team    http://phpwebgallery.net |
     7// | Copyright(C) 2002-2003 Pierrick LE GALL   http://le-gall.net/pierrick |
    118// +-----------------------------------------------------------------------+
    129// | This program is free software; you can redistribute it and/or modify  |
  • extensions/ContestResults/template/style.css

    r6782 r9200  
    1 .content {
    2         min-height:0;
    3 }
    4 
    5 .finished {
     1.CR_finished {
    62        font-weight:normal;
    73        font-size:0.8em;
     
    95        padding-left:10px;
    106        color:#a00;
    11 }
    12 
    13 .results {
    14         overflow:hidden;
    15         white-space:nowrap;
    167}
    178
     
    3122}
    3223
    33 #content_contest {
    34         padding-bottom:20px;
    35 }
    36 
    37 p {
    38         text-align:justify;
    39         margin:0 0 10px 20px;
    40         font-size:1.1em;
    41 }
    42 
    43 h3 {
    44         margin-bottom:0;
    45         font-size:1.3em;
    46 }
    47 
    48 ul {
    49         margin:0;
    50         font-size:1.1em;
    51 }
    52 
    5324.CR_banner {
    5425        width:100%;
    5526        text-align:center;
    5627}
     28        .CR_banner h1 {
     29                margin:20px;
     30                font-size:2.5em;
     31        }
    5732
    5833.CR_text {
    59         margin:0 5%;
     34        margin:0 20px 20px 20px;
     35        text-align:justify;
    6036}
    61 
    62 #CR_rules_prices {
     37        .CR_text h3 {
     38                margin:0 0 3px 0;
     39                font-size:1.3em;
     40                border-bottom:1px dotted #999;
     41                color:#ddd;
     42        }
     43       
     44.CR_period {
    6345        text-align:center;
    64         margin:0 5%;
     46        font-size:1.3em;
     47        font-weight:bold;
     48        font-style:italic;
     49        font-family:"Consolas";
     50        color:#ddd;
     51        border-top:1px dotted #999;
    6552}
    66         #CR_rules, #CR_prices {
    67                 display:inline-block;
    68                 width:49%;
    69                 text-align:left;
    70                 vertical-align:top;
    71         }
    72         #CR_rules_prices h3 {
    73                 margin-left:-1%;
    74         }
    7553
    7654#CR_podium {
    7755        text-align:center;
    78         margin:0 5% 30px 5%;
     56        margin:0 5px 30px 5px;
    7957}
    8058        #CR_podium .podium_1 {
     
    9270                }
    9371                #CR_podium .podium_1 .illustration {
    94                         margin:0 10% 10px 10%;
     72                        margin:0 5px 10px 5px;
    9573                }
    9674                        #CR_podium .podium_1 .illustration img {
     
    9876                                max-height:250px;
    9977                                max-width:100%;
    100                                 -moz-border-radius:10px;
    101                                 border-radius:10px;
     78                                border-radius:5px;
     79                                -moz-border-radius:5px;
     80                                -webkit-border-radius:5px;
     81                                -moz-box-shadow:0 0 5px #EFBF00;
     82                                -webkit-box-shadow:0 0 5px #EFBF00;
    10283                        }
    10384                                #CR_podium .podium_1 .illustration img:hover {
    10485                                        border-style:inset;
    10586                                }
    106                 #CR_podium .podium_1 .comment {
    107                         padding:0 5px;
    108                 }
    109                
    110                 #CR_podium .podium_1 .comment div {
    111                         margin:0 auto;
     87                #CR_podium .podium_1 p {
     88                        padding:0 10px 0 5px;
    11289                        text-align:justify;
     90                        font-size:0.9em;
    11391                }
    11492        #CR_podium .podium_23  {
     
    11795                text-align:left;
    11896                vertical-align:middle;
    119                 border-left:1px dotted #555;
     97                border-left:1px dotted #ddd;
    12098                max-height:400px;
    12199        }
     
    131109                                margin-bottom:5px;
    132110                        }
    133                                 #CR_podium .podium_2 .title {
     111                                #CR_podium .podium_3 .title {
    134112                                        color:#EF5400;
    135113                                }
    136                                 #CR_podium .podium_3 .title {
     114                                #CR_podium .podium_2 .title {
    137115                                        color:#9F9F9F;
    138116                                }
    139117                        #CR_podium .podium_2 .illustration, #CR_podium .podium_3 .illustration {
    140                                 display:inline-block;
    141                                 margin:0 2% 10px 2%;
    142                                 width:40%;
     118                                float:left;
     119                                margin:0 10px 10px 10px;
     120                                width:180px;
    143121                                text-align:center;
    144122                        }
     
    146124                                        border-width:3px;
    147125                                        border-style:outset;
    148                                         max-height:150px;
    149                                         max-width:100%;
    150                                         border-radius:6px;
    151                                         -moz-border-radius:6px;
     126                                        max-height:160px;
     127                                        max-width:170px;
     128                                        border-radius:5px;
     129                                        -moz-border-radius:5px;
     130                                        -webkit-border-radius:5px;
    152131                                }
     132                                        #CR_podium .podium_3 .illustration img {
     133                                                border-color:#EF5400;
     134                                                -moz-box-shadow:0 0 5px #EF5400;
     135                                                -webkit-box-shadow:0 0 5px #EF5400;
     136                                        }
    153137                                        #CR_podium .podium_2 .illustration img {
    154                                                 border-color:#EF5400;
    155                                         }
    156                                         #CR_podium .podium_3 .illustration img {
    157138                                                border-color:#9F9F9F;
     139                                                -moz-box-shadow:0 0 5px #9F9F9F;
     140                                                -webkit-box-shadow:0 0 5px #9F9F9F;
    158141                                        }
    159142                                        #CR_podium .podium_2 .illustration img:hover, #CR_podium .podium_3 .illustration img:hover {
     
    161144                                        }
    162145                       
    163                         #CR_podium .podium_2 .comment, #CR_podium .podium_3 .comment {
    164                                 display:inline-block;
    165                                 width:53%;
    166                                 height:50%;
    167                                 vertical-align:top;
    168                                 margin-top:20px;
     146                        #CR_podium .podium_2 p, #CR_podium .podium_3 p {
    169147                                text-align:justify;
    170148                                font-size:0.9em;
Note: See TracChangeset for help on using the changeset viewer.