mirror of
https://github.com/Frumph/comic-easel.git
synced 2026-07-01 09:24:58 -04:00
1.3.7 added new option for transcripts at bottom of posts, debug screen for var information
This commit is contained in:
+1
-1
@@ -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');
|
||||
|
||||
+2
-2
@@ -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 );
|
||||
|
||||
@@ -0,0 +1,61 @@
|
||||
<?php
|
||||
// Show Config Variables for right now
|
||||
// var_dump(ceo_pluginfo());
|
||||
|
||||
function ceo_check_directory($dirpath) {
|
||||
$output = '';
|
||||
if (is_dir(ceo_pluginfo($dirpath))) {
|
||||
$output = '<span style="color:green;">'.__('Directory Exists,','comiceasel').'</span>';
|
||||
if (is_writable(ceo_pluginfo($dirpath))) {
|
||||
$output .= ' <span style="color:green;">'.__('and is writable.','comiceasel').'</span>';
|
||||
} else {
|
||||
$output .= ' <span style="color:red;">'.__('and is not writable.','comiceasel').'</span>';
|
||||
}
|
||||
} else {
|
||||
$output = '<span style="color:red;">'.__('Directory does not exist,','comiceasel').'</span>';
|
||||
}
|
||||
return $output;
|
||||
}
|
||||
|
||||
?>
|
||||
<div class="wrap">
|
||||
<h2><?php _e('Comic Easel - Debug','comiceasel'); ?></h2>
|
||||
<table class="widefat">
|
||||
<thead>
|
||||
<tr>
|
||||
<th colspan="3"><?php _e('System Info','comiceasel'); ?></th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tr><td>error</td><td><?php echo ceo_pluginfo('error'); ?></td></tr>
|
||||
<tr><td>base_url</td><td><?php echo ceo_pluginfo('base_url'); ?></td></tr>
|
||||
<tr><td>base_path</td><td><?php echo ceo_pluginfo('base_path'); ?><br /><?php echo ceo_check_directory('base_path'); ?></td></tr>
|
||||
<tr><td>theme_url</td><td><?php echo ceo_pluginfo('theme_url'); ?></td></tr>
|
||||
<tr><td>theme_path</td><td><?php echo ceo_pluginfo('theme_path'); ?></td></tr>
|
||||
<tr><td>style_url</td><td><?php echo ceo_pluginfo('style_url'); ?></td></tr>
|
||||
<tr><td>style_path</td><td><?php echo ceo_pluginfo('style_path'); ?></td></tr>
|
||||
<tr><td>plugin_url</td><td><?php echo ceo_pluginfo('plugin_url'); ?></td></tr>
|
||||
<tr><td>plugin_path</td><td><?php echo ceo_pluginfo('plugin_path'); ?></td></tr>
|
||||
</table>
|
||||
</div>
|
||||
<br />
|
||||
<table class="widefat">
|
||||
<thead>
|
||||
<tr>
|
||||
<th colspan = "3">
|
||||
<?php _e('Variables', 'comiceasel'); ?>
|
||||
</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<?php
|
||||
$ceo_options = ceo_pluginfo();
|
||||
foreach ($ceo_options as $key => $val) {
|
||||
if (!isset($ceo_options[$key]) || !$val) { $val = 'Empty or False'; }
|
||||
if ($val == '1') $val = 'True';
|
||||
?>
|
||||
<tr>
|
||||
<td><?php echo $key; ?></td>
|
||||
<td><?php echo $val; ?></td>
|
||||
</tr>
|
||||
<?php }
|
||||
?>
|
||||
</table>
|
||||
+3
-4
@@ -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
|
||||
|
||||
+12
-1
@@ -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;
|
||||
}
|
||||
|
||||
|
||||
@@ -80,6 +80,15 @@
|
||||
<?php _e('Checkmarking this will make it so that the default stylesheets do not load, you would need to add those css elements yourself to your style.css','comiceasel'); ?>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th scope="row"><label for="enable_transcripts_in_comic_posts"><?php _e('Enable the transcripts to automatically show at the bottom of posts if they exist?','comiceasel'); ?></label></th>
|
||||
<td>
|
||||
<input id="enable_transcripts_in_comic_posts" name="enable_transcripts_in_comic_posts" type="checkbox" value="1" <?php checked(true, $ceo_options['enable_transcripts_in_comic_posts']); ?> />
|
||||
</td>
|
||||
<td>
|
||||
<?php _e('Enabling this will make transcripts show at the bottom of comic posts, if the comic has a transcript.','comiceasel'); ?>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
<br />
|
||||
<table class="widefat">
|
||||
|
||||
@@ -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)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user