function wps_settings_categories() { global $wpdb, $wps_subdomains; $categories = array(); // Build Cat Subdomain array (link, name, slug, theme, tied) foreach ($wps_subdomains->cats as $catID => $cat) { $categories['subdomains'][$catID]['ID'] = $catID; $categories['subdomains'][$catID]['name'] = $cat->name; $categories['subdomains'][$catID]['slug'] = $cat->slug; $categories['subdomains'][$catID]['theme'] = $cat->theme; $categories['subdomains'][$catID]['filter_pages'] = $cat->filter_pages; } $cats_nosub = wps_getNonSubCats(); if (!empty($cats_nosub)) { $tmp_cats = get_categories('hide_empty=0&include=' . implode(',', $cats_nosub)); // Build Excluded Cat array (link, name, slug, theme, tied) foreach ($tmp_cats as $cat) { $categories['non_subdomains'][$cat->term_id]['ID'] = $cat->term_id; $categories['non_subdomains'][$cat->term_id]['name'] = $cat->name; $categories['non_subdomains'][$cat->term_id]['slug'] = $cat->slug; } } else { $categories['non_subdomains'] = array(); } // Determine if MakeAllSubdomain is set. $suball = get_option(WPS_OPT_SUBALL) != ""; ?> <div class="wrap"> <h2><?php _e('Categories', 'wpro'); ?> </h2> <p> <?php print wps_admin_notices(); ?> <?php if ($suball) { print '<b>Make All Subdomains</b> is turned <b>ON</b> so all main categories are turned into subdomains unless specifically excluded.'; } ?> </p> <p>A list of all main Categories currently configured to be Subdomains</p> <table class="widefat"> <thead> <tr> <th scope="col">Category</th> <th scope="col">Subdomain</th> <th scope="col">Custom Theme</th> <th scope="col">Filter Pages</th> </tr> </thead> <tbody> <?php print wps_category_rows($categories['subdomains'], 1); ?> </tbody> </table> <p>A list of all main Categories currently configured to <b>not</b> be Subdomains</p> <table class="widefat"> <thead> <tr> <th scope="col">Category</th> <th scope="col">Subdomain</th> </tr> </thead> <tbody> <?php print wps_category_rows($categories['non_subdomains'], 0); ?> </tbody> </table> </div> <?php }
function wps_settings_categories() { global $wpdb, $wps_subdomains; $categories = array(); // Build Cat Subdomain array (link, name, slug, theme, tied) foreach ($wps_subdomains->cats as $catID => $cat) { $categories['subdomains'][$catID]['ID'] = $catID; $categories['subdomains'][$catID]['name'] = $cat->name; $categories['subdomains'][$catID]['slug'] = $cat->slug; $categories['subdomains'][$catID]['theme'] = $cat->theme; $categories['subdomains'][$catID]['filter_pages'] = $cat->filter_pages; } $cats_nosub = wps_getNonSubCats(); if (!empty($cats_nosub)) { $tmp_cats = get_categories('hide_empty=0&include=' . implode(',', $cats_nosub)); // Build Excluded Cat array (link, name, slug, theme, tied) foreach ($tmp_cats as $cat) { $categories['non_subdomains'][$cat->term_id]['ID'] = $cat->term_id; $categories['non_subdomains'][$cat->term_id]['name'] = $cat->name; $categories['non_subdomains'][$cat->term_id]['slug'] = $cat->slug; } } else { $categories['non_subdomains'] = array(); } // Determine if MakeAllSubdomain is set. $suball = get_option(WPS_OPT_SUBALL) != ""; wps_admin_tabs('categories'); ?> <h3><?php _e('Active Subdomains', 'wps'); ?> </h3> <?php if ($suball) { ?> <p class="description"><b><?php _e('Make all Subdomains', 'wps'); ?> </b> <?php _e('is turned <b>ON</b> so all main categories are turned into subdomains unless specifically excluded.', 'wps'); ?> </p> <?php } ?> <p class="description"><b><?php _e('Note', 'wps'); ?> :</b> <?php _e('Only works for main categories', 'wps'); ?> </p> <table class="widefat"> <thead> <tr> <th scope="col"><?php _e('Category', 'wps'); ?> </th> <th scope="col"><?php _e('Subdomain', 'wps'); ?> </th> <th scope="col"><?php _e('Themes', 'wps'); ?> </th> <th scope="col"><?php _e('Pages Filter', 'wps'); ?> </th> </tr> </thead> <tbody> <?php print wps_category_rows($categories['subdomains'], 1); ?> </tbody> </table> <p> </p> <div class="trd-forth"> <h3><?php _e('Inactive Subdomains', 'wps'); ?> </h3> <?php if ($suball) { ?> <p class="description"><b><?php _e('Make all Subdomains', 'wps'); ?> </b> <?php _e('is turned <b>ON</b> so all main categories are turned into subdomains unless specifically excluded as below.', 'wps'); ?> </p> <?php } ?> <p class="description"><b><?php _e('Note', 'wps'); ?> :</b> <?php _e('Subdomains not working for child categories', 'wps'); ?> <table class="widefat"> <thead> <tr> <th scope="col"><?php _e('Category', 'wps'); ?> </th> <th scope="col"><?php _e('Subdomain', 'wps'); ?> </th> </tr> </thead> <tbody> <?php print wps_category_rows($categories['non_subdomains'], 0); ?> </tbody> </table> </div> <?php wps_admin_donate(); }