' . __( 'and modified on', 'comicpress' ) . ' ' . get_the_modified_date( get_option( 'date_format' ) ) . '. ';
+ if ( ! comicpress_themeinfo( 'disable_posted_at_time_in_posts' ) ) $post_date_time .= ' ' . __( 'at', 'comicpress' ).' ' . get_the_modified_time( get_option( 'time_format' ) ) . ' '."\r\n";
+ echo apply_filters( 'comicpress_display_modified_date_time', $post_date_time );
}
}
}
}
-if (!function_exists('comicpress_display_post_category')) {
+if ( ! function_exists( 'comicpress_display_post_category' ) ) {
function comicpress_display_post_category() {
global $post;
$post_category = '';
- if (!comicpress_is_bbpress() && !comicpress_themeinfo('disable_categories_in_posts') && !is_attachment() && ($post->post_type == 'post')) {
- $post_category = "". __( 'Posted In:', 'comicpress' ).' '.get_the_category_list(', ')."
\r\n";
+ if ( ! comicpress_is_bbpress() && ! comicpress_themeinfo( 'disable_categories_in_posts' ) && !is_attachment() && ( $post->post_type == 'post' ) ) {
+ $post_category = "" . __( 'Posted In:', 'comicpress' ) . ' ' . get_the_category_list( ', ' ) . "
\r\n";
}
- echo apply_filters('comicpress_display_post_category', $post_category);
+ echo apply_filters( 'comicpress_display_post_category', $post_category );
}
}
-if (!function_exists('comicpress_display_post_tags')) {
+if ( ! function_exists( 'comicpress_display_post_tags' ) ) {
function comicpress_display_post_tags() {
global $post;
- if (!comicpress_themeinfo('disable_tags_in_posts')) {
- $post_tags = "".get_the_tag_list(__( '└ Tags: ', 'comicpress' ), ', ', ' ')."
\r\n";
- echo apply_filters('comicpress_display_post_tags', $post_tags);
+ if ( ! comicpress_themeinfo( 'disable_tags_in_posts' ) ) {
+ $post_tags = "" . get_the_tag_list( __( '└ Tags: ', 'comicpress' ), ', ', ' ' ) . "
\r\n";
+ echo apply_filters( 'comicpress_display_post_tags', $post_tags );
}
}
}
-if (!function_exists('comicpress_display_comment_link')) {
+if ( ! function_exists( 'comicpress_display_comment_link' ) ) {
function comicpress_display_comment_link() {
global $post;
- if ($post->comment_status == 'open' && !is_singular()) { ?>
+ if ( $post->comment_status == 'open' && ! is_singular() ) {
+ ?>
is_single;
$wp_query -> is_single = true;
}
- if (is_single() && !is_page() && !is_archive() && !is_search() && ($post->post_type == 'post')) { ?>
+ if ( is_single() && ! is_page() && ! is_archive() && ! is_search() && ( $post->post_type == 'post' ) ) {
+ ?>
- %link',__( '‹ Prev', 'comicpress' ), false); ?>
- %link',__( 'Next ›', 'comicpress' ), false); ?>
+ %link',__( '‹ Prev', 'comicpress' ), false ); ?>
+ %link',__( 'Next ›', 'comicpress' ), false ); ?>
- is_single = $temp_single;
}
}
}
-if (!function_exists('comicpress_display_the_content')) {
+if ( ! function_exists( 'comicpress_display_the_content' ) ) {
function comicpress_display_the_content() {
global $post, $wp_query;
- if ((is_archive() || is_search()) && (comicpress_themeinfo('excerpt_or_content_in_archive') == 'excerpt') && !comicpress_is_bbpress()) {
- do_action('comicpress-display-the-content-before');
+ if ( ( is_archive() || is_search() ) && ( comicpress_themeinfo( 'excerpt_or_content_in_archive' ) == 'excerpt' ) && ! comicpress_is_bbpress() ) {
+ do_action( 'comicpress-display-the-content-before' );
the_excerpt();
- do_action('comicpress-display-the-content-after');
+ do_action( 'comicpress-display-the-content-after' );
} else {
- if (!is_single()) { global $more; $more = 0; }
- do_action('comicpress-display-the-content-before');
- the_content(__( '↓ Read the rest of this entry...', 'comicpress' ));
- do_action('comicpress-display-the-content-after');
+ if ( ! is_single() ) {
+ global $more; $more = 0;
+ }
+ do_action( 'comicpress-display-the-content-before' );
+ the_content( __( '↓ Read the rest of this entry...', 'comicpress' ) );
+ do_action( 'comicpress-display-the-content-after' );
}
}
}
-if (!function_exists('comicpress_display_post')) {
+if ( ! function_exists( 'comicpress_display_post' ) ) {
function comicpress_display_post() {
global $post, $wp_query;
- if (!comicpress_is_bbpress()) comicpress_display_blog_navigation(); ?>
+ if ( ! comicpress_is_bbpress() ) comicpress_display_blog_navigation();
+ ?>
>
-
+
+
+
Featured Post
+
Featured Post
+
post_type == 'post') { edit_post_link(__( 'Edit', 'comicpress' ), ' ', ' '); }
+ comicpress_display_post_date();
+ comicpress_display_post_time();
+ comicpress_display_modified_date_time();
+ if ( $post->post_type == 'post' ) {
+ edit_post_link( __( 'Edit', 'comicpress' ), ' ', ' ');
+ }
comicpress_display_post_category();
/* Integrate the WP-Plugin: WP-PostRatings */
- if (function_exists('the_ratings') && $post->post_type == 'post') { the_ratings(); }
- do_action('comicpress-post-info');
- do_action('comic-post-info');
- } ?>
+ if ( function_exists( 'the_ratings' ) && $post->post_type == 'post' ) { the_ratings();
+ }
+ do_action( 'comicpress-post-info' );
+ do_action( 'comic-post-info' );
+ }
+ ?>
- '
Pages: ', 'after' => '
', 'next_or_number' => 'number')); ?>
+ '
Pages: ',
+ 'after' => '
',
+ 'next_or_number' => 'number',
+ )
+ );
+ ?>
-
+
-
+
-
+
post_content, $matches);
- $found_id = (isset($matches[1])) ? $matches[1] : false;
- if ($found_id) echo ' '."\r\n";
+ preg_match( $pattern, $post->post_content, $matches );
+ $found_id = ( isset( $matches[1] ) ) ? $matches[1] : false;
+ if ( $found_id ) echo ' ' . "\r\n";
}
}
diff --git a/functions/moods.php b/functions/moods.php
index 27c69f0..6b6bc16 100644
--- a/functions/moods.php
+++ b/functions/moods.php
@@ -13,44 +13,51 @@
*
* Edit a post and it you will see the possible moods you can use, select one.
*
+ * @package ComicPress
+ *
*/
-add_action('save_post', 'comicpress_handle_edit_post_mood_save' ,5, 1);
-add_action('add_meta_boxes', 'comicpress_add_moods_into_posts');
+add_action( 'save_post', 'comicpress_handle_edit_post_mood_save', 5, 1 );
+add_action( 'add_meta_boxes', 'comicpress_add_moods_into_posts' );
function comicpress_add_moods_into_posts() {
global $post;
- if (!empty($post) && ($post->post_type == 'comic' || $post->post_type == 'post')) {
- add_meta_box('comicpress_showmood_edit_post', __( 'Moods', 'comicpress' ), 'comicpress_showmood_edit_post', 'post', 'normal', 'low');
+ if ( ! empty( $post ) && ( $post->post_type == 'comic' || $post->post_type == 'post' ) ) {
+ add_meta_box( 'comicpress_showmood_edit_post', __( 'Moods', 'comicpress' ), 'comicpress_showmood_edit_post', 'post', 'normal', 'low' );
}
}
function comicpress_show_mood_in_post() {
global $post;
- $moods_directory = comicpress_themeinfo('moods_directory');
- if (!empty($moods_directory) && $moods_directory != 'none') {
+ $moods_directory = comicpress_themeinfo( 'moods_directory' );
+ if ( !empty( $moods_directory ) && $moods_directory != 'none' ) {
$mood_file = get_post_meta( get_the_ID(), "mood", true );
- if (!empty($mood_file) && $mood_file != '') {
- $mood = explode(".", $mood_file);
- $mood = reset($mood);
- if ( !empty($mood_file) && file_exists(get_stylesheet_directory() . '/images/moods/'.$moods_directory.'/'.$mood_file) ) { ?>
+ if ( ! empty( $mood_file ) && $mood_file != '') {
+ $mood = explode( ".", $mood_file );
+ $mood = reset( $mood );
+ if ( ! empty( $mood_file ) && file_exists( get_stylesheet_directory() . '/images/moods/' . $moods_directory . '/' . $mood_file ) ) {
+ ?>
-
+
-
+ $moods_directory = comicpress_themeinfo( 'moods_directory' );
+ if ( ! empty( $moods_directory ) && $moods_directory != 'none' ) {
+ ?>
@@ -59,25 +66,26 @@ function comicpress_showmood_edit_post() {
$currentmood = get_post_meta( $post->ID, "mood", true );
- if (empty($currentmood) || $currentmood == '' || $currentmood == null) {
+ if ( empty( $currentmood ) || $currentmood == '' || $currentmood == null ) {
$mood = __( 'none', 'comicpress' );
} else {
- $mood = explode(".", $currentmood);
- $mood = reset($mood);
+ $mood = explode( ".", $currentmood );
+ $mood = reset( $mood );
}
$count = 0;
- $count = count($results = glob(get_stylesheet_directory() . '/images/moods/'.$moods_directory.'/*'));
- if (!$count) {
- $count = count($results = glob(get_template_directory() . '/images/moods/'.$moods_directory.'/*'));
+ $count = count( $results = glob( get_stylesheet_directory() . '/images/moods/' . $moods_directory . '/*') );
+ if ( ! $count ) {
+ $count = count( $results = glob(get_template_directory() . '/images/moods/' . $moods_directory . '/*') );
$moods_uri = get_template_directory_uri();
} else {
$moods_uri = get_stylesheet_directory_uri();
}
echo $count . ' ' . __( 'Moods are available.', 'comicpress' ) . '
'
- . __( 'Using Moods from directory:', 'comicpress' ) . ' '. $moods_directory . '
'
- . __( 'Current Mood:', 'comicpress' ) .' '. $mood . '
';
- if (!empty($results)) { ?>
+ . __( 'Using Moods from directory:', 'comicpress' ) . ' ' . $moods_directory . '
'
+ . __( 'Current Mood:', 'comicpress' ) . ' ' . $mood . '
';
+ if ( ! empty( $results ) ) {
+ ?>
none
@@ -85,33 +93,37 @@ function comicpress_showmood_edit_post() {
/>
-
+
-
-
-
-
-
-
-
/>
+
+
+
+
+
+
+
/>
-
+
-
ID, 'comicpress-update-page-options' );
- $disable_sidebars = get_post_meta($post->ID, 'disable-sidebars', true);
+ $disable_sidebars = get_post_meta( $post->ID, 'disable-sidebars', true );
?>
@@ -16,35 +16,35 @@ function comicpress_page_editor_options($post) {
-
\ No newline at end of file
+?>
diff --git a/functions/pagination.php b/functions/pagination.php
index 321f45a..4b1d6ce 100644
--- a/functions/pagination.php
+++ b/functions/pagination.php
@@ -2,14 +2,20 @@
function comicpress_pagination() {
global $post, $wp_query;
- if(function_exists('comicpress_wp_pagenavi')) {
- comicpress_wp_pagenavi('');
- } else { ?>
+ if ( function_exists( 'comicpress_wp_pagenavi' ) ) {
+ comicpress_wp_pagenavi( '' );
+ } else {
+ ?>
-
\ No newline at end of file
diff --git a/functions/syndication.php b/functions/syndication.php
index 0052b6c..1d403c4 100644
--- a/functions/syndication.php
+++ b/functions/syndication.php
@@ -3,24 +3,23 @@
* Syndication
* Author: Philip M. Hofer (Frumph)
*
+ * @package ComicPress
*/
// add_filter( 'pre_get_posts' , 'comicpress_include_custom_post_types_in_rss' );
function comicpress_include_custom_post_types_in_rss( $query ) {
- if ($query->is_feed && !isset($query->post_type) && empty($query->post_type)) {
- $args = array(
- 'public' => true,
- '_builtin' => false
- );
- $output = 'names';
- $operator = 'and';
+ if ( $query->is_feed && ! isset( $query->post_type ) && empty( $query->post_type ) ) {
+ $args = array(
+ 'public' => true,
+ '_builtin' => false,
+ );
+ $output = 'names';
+ $operator = 'and';
$post_types = get_post_types( $args , $output , $operator );
- // remove 'pages' from the RSS
- $post_types = array_merge( $post_types, array('post') ) ;
+ // Remove 'pages' from the RSS.
+ $post_types = array_merge( $post_types, array( 'post' ) ) ;
$query->set( 'post_type' , $post_types );
}
return $query;
}
-
-?>
\ No newline at end of file
diff --git a/header.php b/header.php
index 97d0d53..659a1b1 100644
--- a/header.php
+++ b/header.php
@@ -1,28 +1,28 @@
>
-
+
-
-
+
+
>
-
+
-
+
@@ -49,17 +52,26 @@
-
- comment_status) { comments_template('', true); } ?>
-
+ comment_status ) {
+ comments_template( '', true );
+ }
+ endwhile;
+ else :
+ ?>
-
-
-
\ No newline at end of file
+
diff --git a/layout-foot.php b/layout-foot.php
index ef1019f..53e6b9d 100644
--- a/layout-foot.php
+++ b/layout-foot.php
@@ -1,15 +1,15 @@
-
+
diff --git a/layout-head.php b/layout-head.php
index 0f6a55d..59936e0 100644
--- a/layout-head.php
+++ b/layout-head.php
@@ -1,31 +1,34 @@
-
-
-
+
-
+
+
-
+
-
-
-
diff --git a/options.php b/options.php
index 08a6e93..d8749c0 100644
--- a/options.php
+++ b/options.php
@@ -1,101 +1,107 @@
-
+function comicpress_admin_options() {
+ ?>
-
+
+ if ( isset( $_REQUEST['action'] ) && $_REQUEST['action'] == 'comicpress_reset' ) {
+ delete_option( 'cp-options' );
+ global $comicpress_themeinfo;
+ $comicpress_themeinfo = '';
+ ?>
-
+
-
'menubar_social_tumblr',
'menubar_social_deviantart',
'menubar_social_myspace',
- 'menubar_social_email'
- ) as $key) {
- if (isset($_REQUEST[$key]) && !empty($_REQUEST[$key])) {
- $comicpress_options[$key] = esc_url($_REQUEST[$key]);
- } else {
- // set to empty if it's not set
- $comicpress_options[$key] = '';
- }
+ 'menubar_social_email',
+ ) as $key ) {
+ if ( isset( $_REQUEST[$key] ) && !empty( $_REQUEST[$key] ) ) {
+ $comicpress_options[$key] = esc_url( $_REQUEST[$key] );
+ } else {
+ // Set to empty if it's not set.
+ $comicpress_options[$key] = '';
+ }
}
$tab = 'menubar';
- update_option('cp-options', $comicpress_options);
+ update_option( 'cp-options', $comicpress_options );
}
- if ($_REQUEST['action'] == 'comicpress_save_postspages') {
-
- foreach (array(
- 'enable_avatar_trick', // postspages
- 'disable_page_titles', // postspages
- 'disable_post_titles', // postspages
- 'enable_post_calendar', // postspages
- 'enable_post_author_gravatar', // postspages
- 'disable_categories_in_posts', // postspages
- 'disable_tags_in_posts', // postspages
- 'disable_author_info_in_posts', // postspages
- 'disable_date_info_in_posts', // postspages
- 'enable_last_modified_in_posts', // postspages
- 'disable_posted_at_time_in_posts', // postspages
- ) as $key) {
- if (!isset($_REQUEST[$key])) $_REQUEST[$key] = 0;
- $comicpress_options[$key] = (bool)( $_REQUEST[$key] == 1 ? true : false );
+ if ( $_REQUEST['action'] == 'comicpress_save_postspages' ) {
+ foreach ( array(
+ 'enable_avatar_trick', // Posts & Pages.
+ 'disable_page_titles', // Posts & Pages.
+ 'disable_post_titles', // Posts & Pages.
+ 'enable_post_calendar', // Posts & Pages.
+ 'enable_post_author_gravatar', // Posts & Pages.
+ 'disable_categories_in_posts', // Posts & Pages.
+ 'disable_tags_in_posts', // Posts & Pages.
+ 'disable_author_info_in_posts', // Posts & Pages.
+ 'disable_date_info_in_posts', // Posts & Pages.
+ 'enable_last_modified_in_posts', // Posts & Pages.
+ 'disable_posted_at_time_in_posts', // Posts & Pages.
+ ) as $key) {
+ if ( ! isset( $_REQUEST[$key] ) ) $_REQUEST[$key] = 0;
+ $comicpress_options[$key] = (bool) ( $_REQUEST[$key] == 1 ? true : false );
}
-
- foreach (array(
- 'moods_directory', // postspages
- 'content_width', // postspages
- 'content_width_disabled_sidebars' // postspages
- ) as $key) {
- if (isset($_REQUEST[$key]))
- $comicpress_options[$key] = wp_filter_nohtml_kses($_REQUEST[$key]);
+ foreach ( array(
+ 'moods_directory', // Posts & Pages.
+ 'content_width', // Posts & Pages.
+ 'content_width_disabled_sidebars', // Posts & Pages.
+ ) as $key ) {
+ if ( isset($_REQUEST[$key] ) )
+ $comicpress_options[$key] = wp_filter_nohtml_kses( $_REQUEST[$key] );
}
$tab = 'postspages';
- update_option('cp-options', $comicpress_options);
+ update_option( 'cp-options', $comicpress_options );
}
- if ($_REQUEST['action'] == 'comicpress_save_comments') {
-
- foreach (array(
- 'disable_comment_note', // comments
- 'disable_comment_javascript', // commments
- 'enable_comments_on_homepage', // comments
- ) as $key) {
- if (!isset($_REQUEST[$key])) $_REQUEST[$key] = 0;
- $comicpress_options[$key] = (bool)( $_REQUEST[$key] == 1 ? true : false );
+ if ( $_REQUEST['action'] == 'comicpress_save_comments' ) {
+ foreach ( array(
+ 'disable_comment_note', // Comments.
+ 'disable_comment_javascript', // Comments.
+ 'enable_comments_on_homepage', // Comments.
+ ) as $key ) {
+ if ( ! isset( $_REQUEST[$key] ) ) $_REQUEST[$key] = 0;
+ $comicpress_options[$key] = (bool) ( $_REQUEST[$key] == 1 ? true : false );
}
-
- foreach (array(
- 'avatar_directory' // comments
- ) as $key) {
- if (isset($_REQUEST[$key]))
- $comicpress_options[$key] = wp_filter_nohtml_kses($_REQUEST[$key]);
+ foreach ( array(
+ 'avatar_directory' // Comments.
+ ) as $key ) {
+ if ( isset( $_REQUEST[$key] ) )
+ $comicpress_options[$key] = wp_filter_nohtml_kses( $_REQUEST[$key] );
}
$tab = 'comments';
- update_option('cp-options', $comicpress_options);
+ update_option( 'cp-options', $comicpress_options );
}
- if ($_REQUEST['action'] == 'comicpress_save_archivesearch') {
-
- foreach (array(
- 'display_archive_as_links', // archivesearch
- 'enable_numbered_pagination' // postspages
- ) as $key) {
- if (!isset($_REQUEST[$key])) $_REQUEST[$key] = 0;
- $comicpress_options[$key] = (bool)( $_REQUEST[$key] == 1 ? true : false );
+ if ( $_REQUEST['action'] == 'comicpress_save_archivesearch' ) {
+ foreach ( array(
+ 'display_archive_as_links', // Archive & Search.
+ 'enable_numbered_pagination', // Posts & Pages.
+ ) as $key ) {
+ if ( ! isset( $_REQUEST[$key] ) ) $_REQUEST[$key] = 0;
+ $comicpress_options[$key] = (bool) ( $_REQUEST[$key] == 1 ? true : false );
}
- foreach (array(
- 'archive_display_order', // archivesearch
- 'excerpt_or_content_in_archive' // archivesearch
- ) as $key) {
- if (isset($_REQUEST[$key]))
- $comicpress_options[$key] = wp_filter_nohtml_kses($_REQUEST[$key]);
+ foreach ( array(
+ 'archive_display_order', // Archive & Search.
+ 'excerpt_or_content_in_archive', // Archive & Search.
+ ) as $key ) {
+ if ( isset( $_REQUEST[$key] ) )
+ $comicpress_options[$key] = wp_filter_nohtml_kses( $_REQUEST[$key] );
}
$tab = 'archivesearch';
- update_option('cp-options', $comicpress_options);
+ update_option( 'cp-options', $comicpress_options );
}
- if ($_REQUEST['action'] == 'comicpress_save_debug') {
- foreach (array(
+ if ( $_REQUEST['action'] == 'comicpress_save_debug' ) {
+ foreach ( array(
'enable_debug_footer_code',
- 'force_active_connection_close'
- ) as $key) {
+ 'force_active_connection_close',
+ ) as $key ) {
if (!isset($_REQUEST[$key])) $_REQUEST[$key] = 0;
- $comicpress_options[$key] = (bool)( $_REQUEST[$key] == 1 ? true : false );
+ $comicpress_options[$key] = (bool) ( $_REQUEST[$key] == 1 ? true : false );
}
$tab = 'debug';
- update_option('cp-options', $comicpress_options);
+ update_option( 'cp-options', $comicpress_options );
}
- if ($tab) { ?>
-
-
-
+
+
+
- __( 'Introduction', 'comicpress' ),
- 'general' => __( 'General', 'comicpress' ),
- 'menubar' => __( 'Menubar', 'comicpress' ),
- 'postspages' => __( 'Posts & Pages', 'comicpress' ),
- 'comments' => __( 'Comments', 'comicpress' ),
+ __( 'Introduction', 'comicpress' ),
+ 'general' => __( 'General', 'comicpress' ),
+ 'menubar' => __( 'Menubar', 'comicpress' ),
+ 'postspages' => __( 'Posts & Pages', 'comicpress' ),
+ 'comments' => __( 'Comments', 'comicpress' ),
'archivesearch' => __( 'Archive & Search', 'comicpress' ),
- 'debug' => __( 'Debug', 'comicpress' )
- );
-
- if (empty($tab)) { $tab = 'splash'; }
-
- foreach($tab_info as $tab_id => $label) { ?>
-
-
+ 'debug' => __( 'Debug', 'comicpress' ),
+ );
+ if ( empty( $tab ) ) { $tab = 'splash'; }
+ foreach ( $tab_info as $tab_id => $label ) {
+ ?>
+
+
-
+