Ignore:
Timestamp:
Mar 8, 2011, 1:19:06 PM (14 years ago)
Author:
mistic100
Message:

[extensions] ContestResults 1.3

  • Add error and success messages on admin page
  • Add Spain (es_ES) thanks to jpr928
  • Contest status is automatic and shows remaining days
  • More flexibility for description fields
  • Compatibility with Piwigo 2.2.0
File:
1 edited

Legend:

Unmodified
Added
Removed
  • extensions/ContestResults/main.inc.php

    r9333 r9572  
    22/*
    33Plugin Name: ContestResults
    4 Version: 1.2.a
     4Version: 1.3
    55Description: Add contests management pages
    66Plugin URI: http://piwigo.org/ext/extension_view.php?eid=439
     
    1616//                              Variables globales CR
    1717// +-----------------------------------------------------------------------+
     18define('CR_NAME' , 'Contest Results');
     19define('CR_VERSION', '1.3');
    1820define('CR_DIR' , basename(dirname(__FILE__)));
    1921define('CR_PATH' , PHPWG_PLUGINS_PATH . CR_DIR . '/');
    2022define('CR_TABLE_1' , $prefixeTable . 'contests');
    2123define('CR_TABLE_2' , $prefixeTable . 'contests_results');
    22 define('CR_NAME' , 'ContestResults');
    23 define('CR_VERSION', '1.2.a');
    2424define('CR_ADMIN', PHPWG_ROOT_PATH . 'admin.php?page=plugin&section=' . CR_DIR . '/admin/admin.php');
    2525define('CR_PUBLIC', make_index_url(array('section' => 'contests')) . '/');
     
    4242//                                      Fonctions
    4343// +-----------------------------------------------------------------------+
     44include(CR_PATH . 'include/functions.php');
    4445// Gestion du menu
    4546include(CR_PATH . 'include/cr_menubar.php');
     
    5960       
    6061        load_language('plugin.lang', CR_PATH);
    61         include(CR_PATH . 'include/functions.php');
    6262       
    6363    if ($tokens[0] == 'contests') { // on est dans la section concours
     
    6565                $page['title'] = l10n('Contests');
    6666               
    67                 if (isset($tokens[1]) AND $tokens[1]) { // on est sur la page d'un concours
    68                         $page['contest'] = explode('-', $tokens[1]);
    69                         $page['contest'] = $page['contest'][0];
    70                         $page['title'] .= $conf['level_separator'] . trigger_event('render_CR_content', get_contest_name($page['contest']));
     67                if (isset($tokens[1]) AND !empty($tokens[1])) { // on est sur la page d'un concours
     68                        $tokens[1] = explode('-', $tokens[1]);
     69                        if (preg_match('#^([0-9]*)$#', $tokens[1][0])) { // is_int ne marche pas parce que le chiffre est stocké en (string)
     70                                $page['contest'] = $tokens[1][0];
     71                                $page['title'] .= $conf['level_separator'] . trigger_event('render_CR_content', get_contest_name($page['contest']));
     72                        }
    7173                }
    7274        }
Note: See TracChangeset for help on using the changeset viewer.