diff --git a/ceo-admin.php b/ceo-admin.php index 971b09d..24df8f2 100644 --- a/ceo-admin.php +++ b/ceo-admin.php @@ -19,9 +19,9 @@ function ceo_add_menu_pages() { $import_title = __('Import', 'comiceasel'); // the ceo_pluginfo used here actually initiates it. -// $debug_hook = add_submenu_page($menu_location, $plugin_title . ' - ' . $debug_title, $debug_title, 'edit_theme_options', 'comiceasel-debug', 'ceo_debug'); $import_hook = add_submenu_page($menu_location, $plugin_title . ' - ' . $import_title, $import_title, 'edit_theme_options', 'comiceasel-import', 'ceo_import'); $config_hook = add_submenu_page($menu_location, $plugin_title . ' - ' . $config_title, $config_title, 'edit_theme_options', 'comiceasel-config', 'ceo_manager_config'); + $debug_hook = add_submenu_page($menu_location, $plugin_title . ' - ' . $debug_title, $debug_title, 'edit_theme_options', 'comiceasel-debug', 'ceo_debug'); add_action('admin_head-' . $config_hook, 'ceo_admin_page_head'); add_action('admin_print_scripts-' . $config_hook, 'ceo_admin_print_scripts'); add_action('admin_print_styles-' . $config_hook, 'ceo_admin_print_styles'); diff --git a/ceo-config.php b/ceo-config.php index 835be2a..02c11f0 100644 --- a/ceo-config.php +++ b/ceo-config.php @@ -18,7 +18,6 @@ if (isset($_REQUEST['action']) && $_REQUEST['action'] == 'comiceasel_reset') { } $ceo_options = get_option('comiceasel-config'); if ( isset($_POST['_wpnonce']) && wp_verify_nonce($_POST['_wpnonce'], 'update-options') ) { - if ($_REQUEST['action'] == 'ceo_save_general') { foreach (array( @@ -39,7 +38,8 @@ if ( isset($_POST['_wpnonce']) && wp_verify_nonce($_POST['_wpnonce'], 'update-op 'enable_comic_sidebar_locations', 'disable_related_comics', 'display_first_comic_on_home_page', - 'disable_style_sheet' + 'disable_style_sheet', + 'enable_transcripts_in_comic_posts' ) as $key) { if (!isset($_REQUEST[$key])) $_REQUEST[$key] = 0; $ceo_options[$key] = (bool)( $_REQUEST[$key] == 1 ? true : false ); diff --git a/ceo-debug.php b/ceo-debug.php new file mode 100644 index 0000000..ba46ea8 --- /dev/null +++ b/ceo-debug.php @@ -0,0 +1,61 @@ +'.__('Directory Exists,','comiceasel').''; + if (is_writable(ceo_pluginfo($dirpath))) { + $output .= ' '.__('and is writable.','comiceasel').''; + } else { + $output .= ' '.__('and is not writable.','comiceasel').''; + } + } else { + $output = ''.__('Directory does not exist,','comiceasel').''; + } + return $output; +} + +?> +
+

+ + + + + + + + + + + + + + + +
error
base_url
base_path
theme_url
theme_path
style_url
style_path
plugin_url
plugin_path
+
+
+ + + + + + + $val) { + if (!isset($ceo_options[$key]) || !$val) { $val = 'Empty or False'; } + if ($val == '1') $val = 'True'; +?> + + + + + +
+ +
\ No newline at end of file diff --git a/comiceasel.php b/comiceasel.php index a0a710a..3bd4e56 100644 --- a/comiceasel.php +++ b/comiceasel.php @@ -3,7 +3,7 @@ Plugin Name: Comic Easel Plugin URI: http://comiceasel.com Description: Comic Easel allows you to incorporate a WebComic using the WordPress Media Library functionality with Navigation into almost all WordPress themes. With just a few modifications of adding injection do_action locations into a theme, you can have the theme of your choice display and manage a webcomic. -Version: 1.3.6 +Version: 1.3.7 Author: Philip M. Hofer (Frumph) Author URI: http://frumph.net/ @@ -307,7 +307,8 @@ function ceo_load_options($reset = false) { 'disable_related_comics' => false, 'custom_post_type_slug_name' => 'comic', 'display_first_comic_on_home_page' => false, - 'disable_style_sheet' => false + 'disable_style_sheet' => false, + 'enable_transcripts_in_comic_posts' => false ) as $field => $value) { $ceo_config[$field] = $value; } @@ -332,8 +333,6 @@ function ceo_pluginfo($whichinfo = null) { $ceo_options['disable_style_sheet'] = false; update_option('comiceasel-config', $ceo_options); } - if (!isset($ceo_options['disable_style_sheet']) || empty($ceo_options['disable_style_sheet'])) $ceo_options['disable_style_sheet'] = false; - if (!isset($ceo_options['custom_post_type_slug_name']) || empty($ceo_options['custom_post_type_slug_name'])) $ceo_options['custom_post_type_slug_name'] == 'comic'; $ceo_coreinfo = wp_upload_dir(); $ceo_addinfo = array( // if wp_upload_dir reports an error, capture it diff --git a/functions/filters.php b/functions/filters.php index 79f2fd8..3b2a458 100644 --- a/functions/filters.php +++ b/functions/filters.php @@ -13,6 +13,7 @@ add_filter('request', 'ceo_post_type_tags_fix'); add_filter('body_class', 'ceo_body_class'); add_filter('get_terms_args', 'ceo_chapters_find_menu_orderby'); // add_filter('get_lastpostmodified', 'ceo_lastpostmodified'); +add_filter('the_content', 'ceo_insert_comic_transcript_into_posts'); function ceo_rss_request($qv) { if (isset($qv['feed']) && !isset($qv['post_type']) && !isset($qv['chapters'])) { @@ -85,7 +86,7 @@ function ceo_query_post_type($query) { function ceo_body_class($classes = '') { global $post, $wp_query; - + if (!empty($post) && $post->post_type == 'comic') { $terms = wp_get_object_terms( $post->ID, 'chapters'); foreach ($terms as $term) { @@ -119,3 +120,13 @@ function ceo_lastpostmodified() { wp_cache_set( "lastpostmodified:custom:server", $lastpostmodified, 'timeinfo', 3600 ); return $lastpostmodified; } + +function ceo_insert_comic_transcript_into_posts($content) { + global $post; + if (ceo_pluginfo('enable_transcripts_in_comic_posts') && $post->post_type == 'comic') { + $transcript = ceo_the_transcript('styled'); + return $content.$transcript; + } + return $content; +} + diff --git a/options/general.php b/options/general.php index f0bd146..c0ed99a 100644 --- a/options/general.php +++ b/options/general.php @@ -80,6 +80,15 @@ + + + + /> + + + + +
diff --git a/readme.txt b/readme.txt index f22f1c2..2292697 100644 --- a/readme.txt +++ b/readme.txt @@ -126,6 +126,10 @@ The comic navigation widget is only seen if you have the comic sidebar's enabled == Changelog == += 1.3.7 = +New debug screen for variables and system information. (for me to help people with mainly) +New option to enable transcripts to appear at the bottom of posts if the transcript exists instead of using the shortcode. Disable if you want to use the shortcode instead. + = 1.3.6 = Introducing Comic Easel - Import (comic -> import in the wp-admin)