Changeset 4173 for extensions/event_cats/include/ec_conf.inc.php
- Timestamp:
- Nov 2, 2009, 10:46:10 PM (15 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
extensions/event_cats/include/ec_conf.inc.php
r4171 r4173 33 33 _ the number of digits when creating a new code automatically 34 34 ($ec_conf[2] <=> read_ec_conf('auto_code_dg_nb')) ; 35 _ whether categories are displayed "cat / under_cat / ..." or36 "cat <CR LF> - under_cat <CR LF> - ..." ($ec_conf[3] <=>37 read_ec_conf(' cat_display')) ;35 _ ----------------------------------------------------------- 36 --------------------------------------- ( $ec_conf[3] <=> 37 read_ec_conf('') ) ; 38 38 _ whether the "how to" banner has already been displayed or not 39 39 ($ec_conf[4] <=> read_ec_conf('howto')) ; … … 47 47 *****************************************************************************/ 48 48 49 global $ec_conf ;49 global $ec_conf, $page; 50 50 51 51 // $ec_conf initalization / check … … 54 54 FROM `".CONFIG_TABLE."` 55 55 WHERE `param` = 'event_cats'; 56 "))) { 57 $ec_conf = explode(',' , $t[0]); 58 } 56 "))) $ec_conf = explode(',' , $t[0]); 59 57 else { 60 58 $ec_conf = explode(',' , '0,1,10,0,0,0,0'); 61 change_ec_conf('activated', 0); 59 if (!change_ec_conf('activated', 0)) 60 $page['errors'][] = 'Error updating $ec_conf'; 62 61 } 63 62 … … 74 73 */ 75 74 function change_ec_conf($c, $v) { 76 global $ec_conf ;75 global $ec_conf, $page; 77 76 switch ($c) { 78 77 case 'activated': … … 84 83 case 'auto_code_dg_nb': 85 84 $ec_conf[2] = $v; 86 break; 85 break; /* 87 86 case 'cat_display': 88 87 $ec_conf[3] = $v; 89 break; 88 break; */ 90 89 case 'howto': 91 90 $ec_conf[4] = $v; … … 97 96 $ec_conf[6] = $v; 98 97 break; 99 default: return false; 98 default: 99 $page['errors'][] = 'Bad change_ec_conf argument'; 100 return false; 100 101 } 101 return pwg_query("102 return (pwg_query(" 102 103 UPDATE `".CONFIG_TABLE."` 103 104 SET `value` = '".implode(',', $ec_conf)."' 104 105 WHERE `param` = 'event_cats'; 105 ") ;106 ") !== false); 106 107 } 107 108 … … 116 117 */ 117 118 function read_ec_conf($c) { 118 global $ec_conf ;119 global $ec_conf, $page; 119 120 switch ($c) { 120 121 case 'activated' : return $ec_conf[0]; 121 122 case 'dup_allow' : return $ec_conf[1]; 122 case 'auto_code_dg_nb' : return $ec_conf[2]; 123 case 'cat_display' : return $ec_conf[3]; 123 case 'auto_code_dg_nb' : return $ec_conf[2]; /* 124 case 'cat_display' : return $ec_conf[3]; */ 124 125 case 'howto' : return $ec_conf[4]; 125 126 case 'unknown_code' : return $ec_conf[5]; 126 127 case 'unknown_code_ap_id': return $ec_conf[6]; 127 default : return false; 128 default: 129 $page['errors'][] = 'Bad read_ec_conf argument'; 130 return false; 128 131 } 129 132 }
Note: See TracChangeset
for help on using the changeset viewer.