Ignore:
Timestamp:
Oct 23, 2009, 1:48:54 AM (15 years ago)
Author:
LucMorizur
Message:

[Event Cats] PNG, JS, TPL and CSS normally finished now. Remains "only" PHP and SQL...

Location:
extensions/event_cats/include
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • extensions/event_cats/include/ec_conf.inc.php

    r4027 r4092  
    3333 _ the number of digits when creating a new code automatically
    3434   ($ec_conf[2] <=> read_ec_conf('auto_code_dg_nb')) ;
     35 _ whether the "how to" banner has already been displayed or not
     36   ($ec_conf[3] <=> read_ec_conf('howto')) ;
    3537 _ what to do in case an unknown code is used with "autolog" parameter
    36    ($ec_conf[3] <=> read_ec_conf('unknown_code')) :
     38   ($ec_conf[4] <=> read_ec_conf('unknown_code')) :
    3739   0 : nothing ("goto" home page, index.php (not logged in of course)) ;
    3840   1 : redirected to "access denied" page ;
    3941   2 : redirected to an Additional Page precised below.
    4042 _ the id of the Additional Page which must be used in case of usage of an
    41    unknow code ($ec_conf[4] <=> read_ec_conf('unknown_code_ap_id')).
     43   unknow code ($ec_conf[5] <=> read_ec_conf('unknown_code_ap_id')).
    4244*****************************************************************************/
    4345
     
    5355}
    5456else {
    55   $ec_conf = explode(',' , '0,1,10,0,0');
     57  $ec_conf = explode(',' , '0,1,10,0,0,0');
    5658  change_ec_conf('activated', 0);
    5759}
     
    8082      $ec_conf[2] = $v;
    8183    break;
    82     case 'unknown_code':
     84    case 'howto':
    8385      $ec_conf[3] = $v;
    8486    break;
     87    case 'unknown_code':
     88      $ec_conf[4] = $v;
     89    break;
    8590    case 'unknown_code_ap_id':
    86       $ec_conf[4] = $v;
     91      $ec_conf[5] = $v;
    8792    break;
    8893    default: return false;
     
    110115    case 'dup_allow'         : return $ec_conf[1];
    111116    case 'auto_code_dg_nb'   : return $ec_conf[2];
    112     case 'unknown_code'      : return $ec_conf[3];
    113     case 'unknown_code_ap_id': return $ec_conf[4];
     117    case 'howto'             : return $ec_conf[3];
     118    case 'unknown_code'      : return $ec_conf[4];
     119    case 'unknown_code_ap_id': return $ec_conf[5];
    114120    default                  : return false;
    115121  }
  • extensions/event_cats/include/evntcats_funcs.inc.php

    r4058 r4092  
    121121   *   (no return value)
    122122   */
    123   function ec_inpect($checked_item, $new_action,
    124    $check_ec_nok = false, $check_forced = false) {
     123  function ec_inpect($checked_item, $new_action, $check_ec_nok = true) {
    125124    global $ec_lists;
    126125    $first = array();
    127126    $to_correct = array();
    128127   
    129     // $to_correct is needed because following code would not work anywhere :
     128    // $to_correct is needed cause following code would not work everywhere :
    130129    /*
    131130    foreach ($table as $value) {
     
    154153          if (
    155154           $first[$ec_current_code] != $ec_entry[$checked_item] or
    156            ($check_forced and $ec_entry[$checked_item] == 'true')
     155           ($new_action == '' and $ec_entry[$checked_item] == 'true')
    157156          ) {
    158157            $to_correct[$ec_current_code] = true; // value not used in fact
     
    166165    foreach ($ec_lists['ec_table'] as &$ec_entry) { // & is needed here
    167166      if (isset($to_correct[$ec_entry['code']])) {
    168         $ec_entry['action'] = ($check_forced) ?
    169          $ec_entry['action'].$new_action : $new_action;
     167        if ($new_action == '') {
     168          if (
     169            pwg_query('
     170              UPDATE `'.EVNTCATS_TABLE.'`
     171              SET `forced` = "false"
     172              WHERE `id` = '.$ec_entry['id']
     173            ) == null
     174          ) die('Could not fix a "_f_pb"');
     175          $ec_entry['forced'] = 'false';
     176        }
     177        else $ec_entry['action'] = $new_action;
    170178      }
    171179    }
     
    173181
    174182  // Multiple action params for a single code check
    175   ec_inpect('action', 'ec_nok_action_pb', true);
     183  ec_inpect('action', 'ec_nok_action_pb');
    176184 
    177185  // Multiple user_ids for a single code check
    178   ec_inpect('user_id', 'ec_nok_userid_pb');
     186  ec_inpect('user_id', 'ec_nok_userid_pb', false);
    179187 
    180188  // Multiple "forced" params for a single code check
    181   ec_inpect('forced', '_f_pb', true, true);
     189  ec_inpect('forced', '');
    182190 
    183191  // User id and associated page validities checks
     
    308316 */
    309317function ec_create_entry_OK() {
     318  global $page;
     319  $page['errors'][] = 'Y\'a p\'têt\' ben eu une erreur...';
    310320  return false;
    311321}
     
    322332 */
    323333function ec_duplicate_entry_OK() {
     334  global $page;
     335  $page['errors'][] = 'Y\'a sûrement eu une erreur...';
    324336  return false;
    325337}
     
    336348 */
    337349function ec_modify_entry_OK() {
     350  global $page;
     351  $page['errors'][] = 'Y\'a pas eu une erreur ?...';
    338352  return false;
    339353}
Note: See TracChangeset for help on using the changeset viewer.