- switch ($_CONFIG['removeip_anon_ip']) {
- case 'Y':
- define('__CFG_REMOVEIP_ANON_IP_Y', " checked=\"checked\"");
- define('__CFG_REMOVEIP_ANON_IP_N', "");
- break;
-
- case 'N':
- define('__CFG_REMOVEIP_ANON_IP_Y', "");
- define('__CFG_REMOVEIP_ANON_IP_N', " checked=\"checked\"");
- break;
- } // END - switch
-
- switch ($_CONFIG['removeip_anon_host']) {
- case 'Y':
- define('__CFG_REMOVEIP_ANON_HOST_Y', " checked=\"checked\"");
- define('__CFG_REMOVEIP_ANON_HOST_N', "");
- break;
-
- case 'N':
- define('__CFG_REMOVEIP_ANON_HOST_Y', "");
- define('__CFG_REMOVEIP_ANON_HOST_N', " checked=\"checked\"");
- break;
- } // END - switch
-
- switch ($_CONFIG['removeip_anon_ua']) {
- case 'Y':
- define('__CFG_REMOVEIP_ANON_UA_Y', " checked=\"checked\"");
- define('__CFG_REMOVEIP_ANON_UA_N', "");
- break;
-
- case 'N':
- define('__CFG_REMOVEIP_ANON_UA_Y', "");
- define('__CFG_REMOVEIP_ANON_UA_N', " checked=\"checked\"");
- break;
- } // END - switch
-
- switch ($_CONFIG['removeip_anon_ref']) {
- case 'Y':
- define('__CFG_REMOVEIP_ANON_REF_Y', " checked=\"checked\"");
- define('__CFG_REMOVEIP_ANON_REF_N', "");
- break;
-
- case 'N':
- define('__CFG_REMOVEIP_ANON_REF_Y', "");
- define('__CFG_REMOVEIP_ANON_REF_N', " checked=\"checked\"");
- break;
- } // END - switch
-
- switch ($_CONFIG['removeip_admin_show']) {
- case 'Y':
- define('__CFG_REMOVEIP_ADMIN_SHOW_Y', " checked=\"checked\"");
- define('__CFG_REMOVEIP_ADMIN_SHOW_N', "");
- break;
-
- case 'N':
- define('__CFG_REMOVEIP_ADMIN_SHOW_Y', "");
- define('__CFG_REMOVEIP_ADMIN_SHOW_N', " checked=\"checked\"");
- break;
- } // END - switch
-
- switch ($_CONFIG['removeip_guest_show']) {
- case 'Y':
- define('__CFG_REMOVEIP_GUEST_SHOW_Y', " checked=\"checked\"");
- define('__CFG_REMOVEIP_GUEST_SHOW_N', "");
- break;
-
- case 'N':
- define('__CFG_REMOVEIP_GUEST_SHOW_Y', "");
- define('__CFG_REMOVEIP_GUEST_SHOW_N', " checked=\"checked\"");
- break;
- } // END - switch
-
- switch ($_CONFIG['removeip_member_show']) {
- case 'Y':
- define('__CFG_REMOVEIP_MEMBER_SHOW_Y', " checked=\"checked\"");
- define('__CFG_REMOVEIP_MEMBER_SHOW_N', "");
- break;
-
- case 'N':
- define('__CFG_REMOVEIP_MEMBER_SHOW_Y', "");
- define('__CFG_REMOVEIP_MEMBER_SHOW_N', " checked=\"checked\"");
- break;
- } // END - switch
-
- switch ($_CONFIG['removeip_sponsor_show']) {
- case 'Y':
- define('__CFG_REMOVEIP_SPONSOR_SHOW_Y', " checked=\"checked\"");
- define('__CFG_REMOVEIP_SPONSOR_SHOW_N', "");
- break;
-
- case 'N':
- define('__CFG_REMOVEIP_SPONSOR_SHOW_Y', "");
- define('__CFG_REMOVEIP_SPONSOR_SHOW_N', " checked=\"checked\"");
- break;
- } // END - switch
-
- switch ($_CONFIG['anonymous_ip']) {
- case "127.0.0.1":
- define('__CFG_ANONYMOUS_IP_LOCAL' , " selected=\"selected\"");
- define('__CFG_ANONYMOUS_IP_ZERO' , "");
- define('__CFG_ANONYMOUS_IP_RANDOM', "");
- break;
-
- case "0.0.0.0":
- define('__CFG_ANONYMOUS_IP_LOCAL' , "");
- define('__CFG_ANONYMOUS_IP_ZERO' , " selected=\"selected\"");
- define('__CFG_ANONYMOUS_IP_RANDOM', "");
- break;
-
- case "RANDOM":
- define('__CFG_ANONYMOUS_IP_LOCAL' , "");
- define('__CFG_ANONYMOUS_IP_ZERO' , "");
- define('__CFG_ANONYMOUS_IP_RANDOM', " selected=\"selected\"");
- break;
- } // END - switch
+ foreach (array('removeip_anon_ip','removeip_anon_host','removeip_anon_ua','removeip_anon_ref','removeip_admin_show','removeip_guest_show','removeip_member_show','removeip_sponsor_show') as $entry) {
+ $content[$entry . '_y'] = '';
+ $content[$entry . '_n'] = '';
+ $content[$entry . '_' . strtolower(getConfig($entry))] = ' selected="selected"';
+ } // END - if
+
+ // Prepare more entries
+ foreach (array('anonymous_ip_local','anonymous_ip_zero','anonymous_ip_random') as $entry) {
+ $content[$entry] = '';
+ } // END - foreach
+
+ // Set default selections
+ foreach (array('anonymous_ip') as $entry) {
+ $content[$entry . '_' . strtolower(getConfig($entry))] = ' selected="selected"';
+ } // END - foreach