Only in headspace2.orig/models: error_log diff -ru headspace2.orig/models/headspace.php headspace2/models/headspace.php --- headspace2.orig/models/headspace.php 2009-07-11 15:21:50.000000000 -0500 +++ headspace2/models/headspace.php 2009-08-19 15:10:17.000000000 -0500 @@ -88,10 +88,28 @@ } function get_types() { - return array( + + // Standard types + $types = array( 'global' => array (__ ('Global Settings', 'headspace'), __ ('applied to everything unless otherwise specified', 'headspace')), 'home' => array (__ ('Home Page', 'headspace'), __ ('applied to the home page (or blog page)', 'headspace')), 'front' => array (__ ('Front Page', 'headspace'), __('applied to front page (if you have set WordPress to use a static page)')), + 'taxonomy' => array (__ ('Taxonomy Archives', 'headspace'), __ ('applied when viewing a taxonomy archive', 'headspace'))); + + // get taxonomy types + $all_taxonomies = get_object_taxonomies('post'); + + foreach ($all_taxonomies as $taxonomy) { + + if ($taxonomy == 'post_tag' || $taxonomy == 'category') + continue; + + $tax_detail = get_taxonomy($taxonomy); + $types['taxonomy_'.$tax_detail->name] = array (__ ('Taxonomy Archives - '.$tax_detail->label, 'headspace'), __ ('applied when viewing a taxonomy archive for the '.$tax_detail->label.' taxonomy', 'headspace')); + + } + + $types = array_merge($types, array( 'archive' => array (__ ('Archives', 'headspace'), __ ('applied when viewing the archives', 'headspace')), 'category' => array (__ ('Categories', 'headspace'), __ ('applied to category pages without specific settings', 'headspace')), 'post' => array (__ ('Posts', 'headspace'), __ ('applied to posts without specific settings', 'headspace')), @@ -102,7 +120,10 @@ 'tags' => array (__ ('Tag Pages', 'headspace'), __ ('applied when viewing tag pages', 'headspace')), 'attachment' => array (__ ('Attachment Pages'), __ ('applied when viewing an attachment', 'headspace')), 'login' => array (__ ('Login Pages', 'headspace'), __ ('applied when viewing login, logout, or registration pages', 'headspace')), - ); + )); + + return $types; + } function extract_module_settings($data, $area) { @@ -166,9 +187,23 @@ $meta[] = get_option ('headspace_search'); else if (is_tag ()) $meta[] = get_option ('headspace_tags'); - else if (is_archive ()) - $meta[] = get_option ('headspace_archive'); - else if (strpos ($_SERVER['REQUEST_URI'], 'wp-login.php') !== false) + else if (is_archive ()) { + if (is_tax()) { + $taxonomy = get_query_var('taxonomy'); + $specific_taxonomy_settings = get_option ('headspace_taxonomy_'.$taxonomy); + $generic_taxonomy_settings = get_option ('headspace_taxonomy'); + + // Settings for a specific taxonomy override general ones + foreach($specific_taxonomy_settings as $key => $value) { + if (!empty($value)) + $generic_taxonomy_settings[$key] = $value; + } + + $meta[] = $generic_taxonomy_settings; + } else { + $meta[] = get_option ('headspace_archive'); + } + } else if (strpos ($_SERVER['REQUEST_URI'], 'wp-login.php') !== false) $meta[] = get_option ('headspace_login'); else if (is_feed ()) { // Remove title from RSS @@ -326,4 +361,4 @@ // Cause the singleton to fire HeadSpace2::get (); -?> \ No newline at end of file +?> Only in headspace2.orig/models: headspace.php.new diff -ru headspace2.orig/models/inline_tags.php headspace2/models/inline_tags.php --- headspace2.orig/models/inline_tags.php 2009-07-11 15:21:50.000000000 -0500 +++ headspace2/models/inline_tags.php 2009-08-19 14:07:19.000000000 -0500 @@ -160,6 +160,12 @@ if (strpos ($value, '%%tag_description%%') !== false) $value = str_replace ('%%tag_description%%', HS_InlineTags::get_tag_description ($post), $value); + if (strpos ($value, '%%term_description%%') !== false) + $value = str_replace ('%%term_description%%', HS_InlineTags::get_term_description (), $value); + + if (strpos ($value, '%%term_title%%') !== false) + $value = str_replace ('%%term_title%%', HS_InlineTags::get_term_title (), $value); + if (strpos ($value, '%%page%%') !== false) $value = str_replace ('%%page%%', HS_InlineTags::get_page ($post), $value); @@ -214,6 +220,52 @@ return ''; } + /** + * Return the current taxonomy term description + * + * @return string + **/ + + function get_term_description() { + + $taxonomy = get_query_var('taxonomy'); + $term = get_query_var('term'); + + if (function_exists ('get_term') && $taxonomy != '' && $term != '') { + + $term = get_term_by('slug', $term, $taxonomy); + + if ( is_wp_error($term) ) + return ''; + + return($term->description); + } + return ''; + } + + /** + * Return the current taxonomy term title * + * @return string + **/ + + function get_term_title() { + + $taxonomy = get_query_var('taxonomy'); + $term = get_query_var('term'); + + if (function_exists ('get_term') && $taxonomy != '' && $term != '') { + + $term = get_term_by('slug', $term, $taxonomy); + + if ( is_wp_error($term) ) + return ''; + + return($term->name); + } + return ''; + } + + /** * Return the current categories Only in headspace2.orig/models: inline_tags.php.old Only in headspace2.orig/models: inline_tags.php.orig Only in headspace2.orig/models: taxonomy_support_for_headspace.txt diff -ru headspace2.orig/view/admin/help.php headspace2/view/admin/help.php --- headspace2.orig/view/admin/help.php 2009-07-11 15:21:50.000000000 -0500 +++ headspace2/view/admin/help.php 2009-08-19 14:07:19.000000000 -0500 @@ -16,6 +16,8 @@ 'category' => __( 'Replaced with the post categories (comma separated)', 'headspace'), 'category_description' => __( 'Replaced with the category description', 'headspace'), 'tag_description' => __( 'Replaced with the tag description', 'headspace'), + 'term_description' => __( 'Replaced with the term description', 'headspace'), + 'term_title' => __( 'Replaced with the term name', 'headspace'), 'modified' => __( 'Replaced with the post/page modified time', 'headspace'), 'id' => __( 'Replaced with the post/page ID', 'headspace'), 'name' => __( 'Replaced with the post/page author\'s \'nicename\'', 'headspace'), Only in headspace2.orig/view/admin: help.php.old