Changeset 3985 for extensions/event_cats/include
- Timestamp:
- Oct 7, 2009, 9:31:04 AM (15 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
extensions/event_cats/include/evntcats_funcs.inc.php
r3971 r3985 183 183 foreach ($ec_lists['ec_table'] as &$ec_entry) { // & is needed here 184 184 if (isset($to_correct[$ec_entry['code']])) { 185 $ec_entry['action'] = $new_action; 185 $ec_entry['action'] = ($check_forced) ? 186 $ec_entry['action'].$new_action : $new_action; 186 187 } 187 188 } … … 195 196 196 197 // Multiple "forced" params for a single code check 197 ec_inpect('forced', ' ec_ok_forced_pb', true, true);198 ec_inpect('forced', '_f_pb', true, true); 198 199 199 200 // User id and associated page validities checks … … 202 203 // Check if associated user_id exists 203 204 if ( 204 $ec_entry['action'] == 'ec_ok'and205 is_in($ec_entry['action'], 'ec_ok') and 205 206 !array_key_exists($ec_entry['user_id'], $ec_lists['user_ids']) 206 207 ) { … … 211 212 $a = 0; 212 213 if (!empty($ec_entry['arg1']) and 213 (strpos($ec_entry['action'], 'ec_ok') !== false)) $a++; // Only arg2214 is_in($ec_entry['action'], 'ec_ok')) $a++; // Only arg2 214 215 // is significant if action is ec_nok[_xxx] . 215 216 if (!empty($ec_entry['arg2'])) $a+= 2; … … 220 221 if ( 221 222 $ec_ap_ok and ( 222 $ec_entry['action'] == 'ec_ok'or223 is_in($ec_entry['action'], 'ec_ok') or 223 224 $ec_entry['action'] == 'ec_nok' 224 225 ) and … … 231 232 case 1: // Category 232 233 case 3: // Image 233 if ( $ec_entry['action'] == 'ec_ok') {234 if (is_in($ec_entry['action'], 'ec_ok')) { 234 235 if (array_key_exists($ec_entry['arg1'], $ec_lists['categories'])) { 235 236 if ($a == 3) { // case 3: // Image … … 274 275 $res = pwg_query('SELECT id,title FROM '.ADD_PAGES_TABLE); 275 276 while ($r = mysql_fetch_assoc($res)) { 276 $c = ( strpos($r['title'], '/user_id=')) ? '/user_id=' : '/group_id=';277 $c = (is_in($r['title'], '/user_id=')) ? '/user_id=' : '/group_id='; 277 278 $a = explode($c ,$r['title']); 278 279 $ec_lists['add_pages'][$r['id']] = $a[0]; … … 297 298 // Construction of $ec_lists['ec_table'] array var 298 299 build_ec_table(); 300 } 301 302 /* 303 * is_in($haystack, $needle) 304 * returns true or false whether $needle is a string found in string $haystack 305 * 306 * @param 307 * $haystack : the string in which to search 308 * $needle : the string looked for 309 * @return 310 * true if $needle is found in $haystack ; false if not 311 */ 312 function is_in($haystack, $needle) { 313 return (strpos($haystack, $needle) !== false); 299 314 } 300 315
Note: See TracChangeset
for help on using the changeset viewer.