diff --git a/archive.php b/archive.php index 7019ee4..c60bac1 100644 --- a/archive.php +++ b/archive.php @@ -61,14 +61,17 @@ if ( $count > 0 ) { $title_string = __( 'Archive is unable to be found.', 'comicpress' ); } } else $title_string = __( 'No Archive Found.', 'comicpress' ); -if ( have_posts() ) { ?> +if ( have_posts() ) { + ?>

- query_vars['chapters'] ) || ( $wp_query->query_vars['post_type'] == 'comic' ) ) { ?> + query_vars['chapters'] ) || ( $wp_query->query_vars['post_type'] == 'comic' ) ) { + ?>
@@ -80,17 +83,17 @@ if ( have_posts() ) { ?>
- +
query_vars['chapters'] ) || isset( $wp_query->query_vars['characters'] ) || isset( $wp_query->query_vars['locations'] ) || ( $wp_query->query_vars['post_type'] == 'comic' ) ) && ( comicpress_themeinfo( 'display_archive_as_links' ) && ! comicpress_is_bbpress() ) ) { - ?> - @@ -101,12 +104,14 @@ if ( have_posts() ) { ?>
+ $thumbnail = ( ! $thumbnail ) ? __( 'No Thumbnail or Featured Image Found.', 'comicpress' ) : $thumbnail; + ?>
- - +
>
@@ -124,12 +129,15 @@ if ( have_posts() ) { ?> - +
- post_type !== 'post' ) ? $post->post_type : get_post_format(); get_template_part( 'content', $post_format ); @@ -137,9 +145,10 @@ if ( have_posts() ) { ?> } ?>
- - - +

@@ -147,12 +156,13 @@ if ( have_posts() ) { ?>
- - - + diff --git a/functions/avatars.php b/functions/avatars.php index b67e810..f7f2a94 100644 --- a/functions/avatars.php +++ b/functions/avatars.php @@ -1,29 +1,29 @@ 0) { - $default = basename($results[(int)$checknum]); + $checknum = hexdec( substr( md5( $id_or_email ), 0, 5 ) ) % $count; + if ( $count > 0 ) { + $default = basename( $results[ (int) $checknum] ); } else { return false; } - return $blogurl.'/images/avatars/'.$current_avatar_directory.'/'.$default; + return $blogurl . '/images/avatars/' . $current_avatar_directory . '/' . $default; } } - return get_option('avatar_default'); + return get_option( 'avatar_default' ); } } diff --git a/functions/classes.php b/functions/classes.php index 83f3845..d43eb7e 100644 --- a/functions/classes.php +++ b/functions/classes.php @@ -5,38 +5,39 @@ * Author URI: http://frumph.net/ * Version: 1.0.8 * + * @package Comicpress */ -add_filter('body_class','comicpress_body_class'); +add_filter( 'body_class', 'comicpress_body_class' ); -function comicpress_body_class($classes = array()) { +function comicpress_body_class( $classes = array() ) { global $is_lynx, $is_gecko, $is_IE, $is_opera, $is_NS4, $is_safari, $is_chrome, $is_iphone, $post, $wp_query, $comicpress_is_signup; - if (is_user_logged_in()) { + if ( is_user_logged_in() ) { $current_user = wp_get_current_user(); - $user_login = $current_user->user_login; - if (!empty($user_login)) $classes[] = 'user-'.strtolower($user_login); + $user_login = $current_user->user_login; + if ( ! empty( $user_login ) ) $classes[] = 'user-' . strtolower( $user_login ); } else { $classes[] = 'user-guest'; } - if (comicpress_is_signup()) $classes[] = 'signup'; + if ( comicpress_is_signup() ) $classes[] = 'signup'; - if($is_lynx) $classes[] = 'lynx'; - elseif($is_gecko) $classes[] = 'gecko'; - elseif($is_opera) $classes[] = 'opera'; - elseif($is_NS4) $classes[] = 'ns4'; - elseif($is_safari) $classes[] = 'safari'; - elseif($is_chrome) $classes[] = 'chrome'; - elseif($is_IE) $classes[] = 'ie'; - else $classes[] = 'unknown'; - if($is_iphone) $classes[] = 'iphone'; - if (wp_is_mobile()) $classes[] = 'is-mobile'; + if ( $is_lynx ) $classes[] = 'lynx'; + elseif ( $is_gecko ) $classes[] = 'gecko'; + elseif ( $is_opera ) $classes[] = 'opera'; + elseif ( $is_NS4 ) $classes[] = 'ns4'; + elseif ( $is_safari ) $classes[] = 'safari'; + elseif ( $is_chrome ) $classes[] = 'chrome'; + elseif ( $is_IE ) $classes[] = 'ie'; + else $classes[] = 'unknown'; + if ( $is_iphone ) $classes[] = 'iphone'; + if ( wp_is_mobile() ) $classes[] = 'is-mobile'; -// Hijacked from the hybrid theme, http://themehybrid.com/ - if (is_single()) { - foreach ( (array)get_the_category( $wp_query->post->ID ) as $cat ) : + // Hijacked from the hybrid theme, http://themehybrid.com/ . + if ( is_single() ) { + foreach ( (array) get_the_category( $wp_query->post->ID ) as $cat ) : $classes[] = 'single-category-' . sanitize_html_class( $cat->slug, $cat->term_id ); endforeach; $classes[] = 'single-author-' . get_the_author_meta( 'user_nicename', $wp_query->post->post_author ); @@ -51,21 +52,21 @@ function comicpress_body_class($classes = array()) { $classes[] = 'sticky-post'; } -// NOT hijacked from anything, doi! people should do this. - $timestamp = current_time('timestamp'); - $rightnow = (int)date('Gi',$timestamp); - $ampm = date('a', $timestamp); + // NOT hijacked from anything, doi! people should do this. + $timestamp = current_time( 'timestamp' ); + $rightnow = (int) date( 'Gi',$timestamp ); + $ampm = date( 'a', $timestamp ); $classes[] = $ampm; -// $classes[] = 'time-'.$rightnow; - if ($rightnow > 559 && (int)$rightnow < 1800) $classes[] = 'day'; - if ($rightnow < 600 || (int)$rightnow > 1759) $classes[] = 'night'; + // $classes[] = 'time-'.$rightnow; + if ( $rightnow > 559 && (int) $rightnow < 1800 ) $classes[] = 'day'; + if ( $rightnow < 600 || (int )$rightnow > 1759 ) $classes[] = 'night'; - if ($rightnow > 2329 || $rightnow < 30) $classes[] = 'midnight'; - if ($rightnow > 459 && $rightnow < 1130) $classes[] = 'morning'; - if ($rightnow > 1129 && $rightnow < 1230) $classes[] = 'noon'; - if ($rightnow > 1759 && $rightnow < 2330) $classes[] = 'evening'; + if ( $rightnow > 2329 || $rightnow < 30 ) $classes[] = 'midnight'; + if ( $rightnow > 459 && $rightnow < 1130 ) $classes[] = 'morning'; + if ( $rightnow > 1129 && $rightnow < 1230 ) $classes[] = 'noon'; + if ( $rightnow > 1759 && $rightnow < 2330 ) $classes[] = 'evening'; - $classes[] = strtolower(date('D', $timestamp)); + $classes[] = strtolower( date( 'D', $timestamp ) ); if ( is_attachment() ) { $classes[] = 'attachment attachment-' . $wp_query->post->ID; @@ -75,23 +76,26 @@ function comicpress_body_class($classes = array()) { endforeach; } - if (comicpress_sidebars_disabled()) $classes[] = 'wide'; + if ( comicpress_sidebars_disabled() ) $classes[] = 'wide'; - $layout = get_theme_mod('comicpress-customize-select-layout', '3c'); - if (empty($layout)) $layout = '3c'; - $classes[] = 'layout-'.$layout; + $layout = get_theme_mod( 'comicpress-customize-select-layout', '3c' ); + if ( empty( $layout ) ) $layout = '3c'; + $classes[] = 'layout-' . $layout; return $classes; } -add_filter('post_class','comicpress_post_class'); +add_filter( 'post_class', 'comicpress_post_class' ); -function comicpress_post_class($classes = '') { +function comicpress_post_class( $classes = '' ) { global $post; static $post_alt; $args = array( - 'entry_tax' => array( 'category', 'post_tag' ) + 'entry_tax' => array( + 'category', + 'post_tag', + ) ); /* Microformats. */ @@ -102,22 +106,21 @@ function comicpress_post_class($classes = '') { if ( $post_alt % 2 ) $classes[] = 'odd'; - else - $classes[] = 'even'; + else $classes[] = 'even'; /* Sticky class (only on home/blog page). */ if( is_sticky() && is_home() ) $classes[] = 'sticky'; /* Author class. */ - if ( !is_attachment() ) + if ( ! is_attachment() ) $classes[] = 'post-author-' . sanitize_html_class( get_the_author_meta( 'user_nicename' ), get_the_author_meta( 'ID' ) ); /* User-created classes. */ - if ( !empty( $class ) ) : - if ( !is_array( $class ) ) + if ( ! empty( $class ) ) : + if ( ! is_array( $class ) ) $class = preg_split( '#\s+#', $class ); - $classes = array_merge( $classes, $class ); + $classes = array_merge( $classes, $class ); endif; /* Password-protected posts. */ @@ -127,22 +130,20 @@ function comicpress_post_class($classes = '') { return $classes; } -add_filter('comment_class','comicpress_comment_class'); +add_filter( 'comment_class', 'comicpress_comment_class' ); -function comicpress_comment_class($classes = '') { +function comicpress_comment_class( $classes = '' ) { global $current_user; - /* - * http://microid.org - */ + + /* http://microid.org */ $email = get_comment_author_email(); $url = get_comment_author_url(); - if(!empty($email) && !empty($url)) { - $microid = 'microid-mailto+http:sha1:' . sha1(sha1('mailto:'.$email).sha1($url)); + if ( ! empty( $email ) && ! empty( $url ) ) { + $microid = 'microid-mailto+http:sha1:' . sha1( sha1( 'mailto:' . $email) . sha1( $url ) ); $classes[] = $microid; } - if ($current_user->user_email == $email) $classes[] = 'ucomment'; + if ( $current_user->user_email == $email ) $classes[] = 'ucomment'; return $classes; } - -?> \ No newline at end of file +?> diff --git a/functions/comment-functions.php b/functions/comment-functions.php index d09c540..c811ac6 100644 --- a/functions/comment-functions.php +++ b/functions/comment-functions.php @@ -1,19 +1,19 @@ '; - if($url == true && $url != 'http://') - echo ''; + if ( $url == true && $url != 'http://' ) + echo ''; $id_or_email = get_comment_author_email(); - if (empty($id_or_email)) $id_or_email = get_comment_author(); + if ( empty( $id_or_email ) ) $id_or_email = get_comment_author(); - $current_avatar_directory = comicpress_themeinfo('avatar_directory'); - if (!empty($current_avatar_directory) && ($current_avatar_directory !== 'none')) { - $avatar_str = get_avatar($id_or_email, 64, comicpress_random_default_avatar($id_or_email), esc_html(get_comment_author())); - } else - $avatar_str = get_avatar($id_or_email, 64); + $current_avatar_directory = comicpress_themeinfo( 'avatar_directory' ); + if ( ! empty( $current_avatar_directory ) && ( $current_avatar_directory !== 'none' ) ) { + $avatar_str = get_avatar( $id_or_email, 64, comicpress_random_default_avatar( $id_or_email ), esc_html( get_comment_author() ) ); + } else $avatar_str = get_avatar( $id_or_email, 64 ); $return_str = str_replace('photo', 'photo instant nocorner itxtalt', $avatar_str); $return_str = str_replace('alt=', 'title="'.esc_html(get_comment_author()).'" alt=', $return_str); echo $return_str; - if($url == true && $url != 'http://') + if( $url == true && $url != 'http://' ) echo ''; echo ''; } @@ -45,13 +44,13 @@ function comicpress_avatar() { } /** -* Properly displays comment author name/link -* bbPress and other external systems sometimes don't set a display name for registrations -* WP has problems if no display name is set -* WP gives registered users URL of 'http://' if none is set -* -* @since 0.2.2 -*/ + * Properly displays comment author name/link + * bbPress and other external systems sometimes don't set a display name for registrations + * WP has problems if no display name is set + * WP gives registered users URL of 'http://' if none is set + * + * @since 0.2.2 + */ function comicpress_comment_author() { global $comment; @@ -61,7 +60,7 @@ function comicpress_comment_author() { /* * Registered members w/o URL defaults to 'http://' */ - if($url == 'http://') + if ( $url == 'http://' ) $url = false; /* @@ -69,25 +68,24 @@ function comicpress_comment_author() { * Bug with bbPress 0.9 series and WP 2.5 (no later testing) * 'Anonymous' should be localized according to WP, not the theme */ - if(is_object($comment) && ($comment->user_id > 0) && !$author) : - $user = get_userdata($comment->user_id); - if($user->display_name) - $author = $user->display_name; - elseif($user->user_nickname) - $author = $user->nickname; - elseif($user->user_nicename) - $author = $user->user_nicename; - else - $author = $user->user_login; + if ( is_object( $comment ) && ( $comment->user_id > 0 ) && ! $author ) : + $user = get_userdata( $comment->user_id ); + if ( $user->display_name ) + $author = $user->display_name; + elseif ( $user->user_nickname ) + $author = $user->nickname; + elseif ( $user->user_nicename ) + $author = $user->user_nicename; + else $author = $user->user_login; endif; /* * Display link and cite if URL is set * Also properly cites trackbacks/pingbacks */ - if($url) : + if( $url ) : $output = ''; - $output .= '' . $author . ''; + $output .= '' . $author . ''; $output .= ''; else : $output = ''; @@ -99,18 +97,18 @@ function comicpress_comment_author() { } /** -* Displays individual comments -* Uses the callback parameter for wp_list_comments -* Overwrites the default display of comments -* -* @since 0.2.3 -* -* @param $comment The comment variable -* @param $args Array of arguments passed from wp_list_comments -* @param $depth What level the particular comment is -*/ -function comicpress_comments_callback($comment, $args, $depth) { - $GLOBALS['comment'] = $comment; + * Displays individual comments + * Uses the callback parameter for wp_list_comments + * Overwrites the default display of comments + * + * @since 0.2.3 + * + * @param $comment The comment variable + * @param $args Array of arguments passed from wp_list_comments + * @param $depth What level the particular comment is + */ +function comicpress_comments_callback( $comment, $args, $depth ) { + $GLOBALS['comment'] = $comment; $GLOBALS['comment_depth'] = $depth; ?>
  • > @@ -125,61 +123,79 @@ function comicpress_comments_callback($comment, $args, $depth) { - +
    - + -
    -'; } -function list_pings($comment, $args, $depth) { - $GLOBALS['comment'] = $comment; ?> +function list_pings( $comment, $args, $depth ) { + $GLOBALS['comment'] = $comment; + ?>
  • -\r\n"; + $output = "

    \r\n"; $output .= comicpress_copyright_info(); $output .= "| "; $output .= __( 'Powered by', 'comicpress' ) . " WordPress " . __( 'with', 'comicpress' ) . " ComicPress\r\n"; $output .= comicpress_hosted_on(); $output .= ""; - $output .= "| "; - $output .= __( 'Subscribe:', 'comicpress' ) . "" . __( 'RSS', 'comicpress' ) . "\r\n"; + $output .= "| "; + $output .= __( 'Subscribe:', 'comicpress' ) . "" . __( 'RSS', 'comicpress' ) . "\r\n"; $output .= "\r\n"; - if (!comicpress_themeinfo('disable_scroll_to_top')) { + if ( ! comicpress_themeinfo( 'disable_scroll_to_top' ) ) { $output .= ""; - $output .= "| "; - $output .= "" . __( 'Back to Top ↑', 'comicpress' ) . ""; - $output .="\r\n"; + $output .= "| "; + $output .= "" . __( 'Back to Top ↑', 'comicpress' ) . ""; + $output .= "\r\n"; } $output .= "

    \r\n"; - echo apply_filters('comicpress_copyright_text', $output); + echo apply_filters( 'comicpress_copyright_text', $output ); } } -if (!function_exists('comicpress_hosted_on')) { +if ( ! function_exists( 'comicpress_hosted_on' ) ) { function comicpress_hosted_on() { - if (is_multisite()) { + if ( is_multisite() ) { $current_site = get_current_site(); - if (!isset($current_site->site_name)) { + if ( ! isset( $current_site->site_name ) ) { $site_name = ucfirst( $current_site->domain ); } else { $site_name = $current_site->site_name; } $output = "| "; - $output .= __( 'Hosted on', 'comicpress' ) . ' '. $site_name. ' '; - return apply_filters('comicpress_hosted_on', $output); + $output .= __( 'Hosted on', 'comicpress' ) . ' '. $site_name . ' '; + return apply_filters( 'comicpress_hosted_on', $output ); } } } -if (!function_exists('comicpress_copyright_info')) { +if ( ! function_exists( 'comicpress_copyright_info' ) ) { function comicpress_copyright_info() { - $copyright_name = comicpress_themeinfo('copyright_name'); - if (empty($copyright_name)) $copyright_name = get_bloginfo('name'); - $copyright_url = comicpress_themeinfo('copyright_url'); - if (empty($copyright_url)) $copyright_url = home_url(); - $copyright = __( '©', 'comicpress' ). comicpress_copyright_dates() . ' ' . apply_filters('comicpress_copyright_info_name', '' . $copyright_name . '') . ' '; - return apply_filters('comicpress_copyright_info', $copyright); + $copyright_name = comicpress_themeinfo( 'copyright_name' ); + if ( empty( $copyright_name ) ) $copyright_name = get_bloginfo( 'name' ); + $copyright_url = comicpress_themeinfo( 'copyright_url' ); + if ( empty( $copyright_url ) ) $copyright_url = home_url(); + $copyright = __( '©', 'comicpress' ) . comicpress_copyright_dates() . ' ' . apply_filters( 'comicpress_copyright_info_name', '' . $copyright_name . '' ) . ' '; + return apply_filters( 'comicpress_copyright_info', $copyright ); } } -if (!function_exists('comicpress_copyright_dates')) { +if ( ! function_exists( 'comicpress_copyright_dates' ) ) { function comicpress_copyright_dates() { global $wpdb; $copyright_dates = $wpdb->get_results(" @@ -62,15 +62,14 @@ if (!function_exists('comicpress_copyright_dates')) { post_status = 'publish' "); $output = ''; - if ($copyright_dates) { + if ( $copyright_dates ) { $copyright = $copyright_dates[0]->firstdate; - if($copyright_dates[0]->firstdate != $copyright_dates[0]->lastdate) { + if ( $copyright_dates[0]->firstdate != $copyright_dates[0]->lastdate ) { $copyright .= '-' . $copyright_dates[0]->lastdate; } $output = $copyright; } - return apply_filters('comicpress_copyright_dates', $output); + return apply_filters( 'comicpress_copyright_dates', $output ); } } - -?> \ No newline at end of file +?> diff --git a/functions/displaypost.php b/functions/displaypost.php index 5f785a5..f41f547 100644 --- a/functions/displaypost.php +++ b/functions/displaypost.php @@ -1,33 +1,33 @@ 1, - 'post_type' => 'post', - 'orderby' => 'post_date', - 'order' => 'DESC', - 'post_status' => 'publish', - 'category__in' => array($catnum) - ); + 'numberposts' => 1, + 'post_type' => 'post', + 'orderby' => 'post_date', + 'order' => 'DESC', + 'post_status' => 'publish', + 'category__in' => array($catnum), + ); $qposts = get_posts( $args ); } else { $args = array( - 'numberposts' => 1, - 'post_type' => 'post', - 'orderby' => 'post_date', - 'order' => 'DESC', - 'post_status' => 'publish' - ); + 'numberposts' => 1, + 'post_type' => 'post', + 'orderby' => 'post_date', + 'order' => 'DESC', + 'post_status' => 'publish', + ); $qposts = get_posts( $args ); } - if (is_array($qposts)) { - $qposts = reset($qposts); + if ( is_array( $qposts ) ) { + $qposts = reset( $qposts ); wp_redirect( get_permalink( $qposts->ID ) ); } else { wp_redirect( home_url() ); @@ -36,241 +36,270 @@ function comicpress_latest_blog_post_jump() { exit; } -if (!function_exists('comicpress_display_post_title')) { +if ( ! function_exists( 'comicpress_display_post_title' ) ) { function comicpress_display_post_title() { global $post, $wp_query; $get_post_title = ''; - if (($post->post_type == 'page') && is_front_page()) return; // don't display the title on static home pages - if ((comicpress_themeinfo('disable_page_titles') && is_page()) || (comicpress_themeinfo('disable_post_titles') && !is_page()) || (is_page('chat') || is_page('forum'))) return; - if (is_page()) { + if ( ( $post->post_type == 'page' ) && is_front_page() ) return; // Don't display the title on static home pages. + if ( ( comicpress_themeinfo( 'disable_page_titles' ) && is_page() ) || ( comicpress_themeinfo( 'disable_post_titles' ) && ! is_page() ) || (is_page( 'chat' ) || is_page( 'forum' ) ) ) return; + if ( is_page() ) { $post_title = "

    "; } else { $post_title = "

    "; } - if ((is_page_template('blog.php') || is_home() || is_front_page() || is_archive() || is_search()) && ($post->post_type != 'page')) $post_title .= ""; + if ( ( is_page_template( 'blog.php' ) || is_home() || is_front_page() || is_archive() || is_search() ) && ( $post->post_type != 'page') ) $post_title .= ""; $get_post_title .= get_the_title(); - if (!$get_post_title) $get_post_title = '( No Title )'; + if ( ! $get_post_title ) $get_post_title = '( No Title )'; $post_title .= $get_post_title; - if ((is_page_template('blog.php') || is_home() || is_front_page() || is_archive() || is_search()) && ($post->post_type != 'page')) $post_title .= ""; + if ( ( is_page_template('blog.php') || is_home() || is_front_page() || is_archive() || is_search() ) && ( $post->post_type != 'page') ) $post_title .= ""; $post_title .= "

    \r\n"; - echo apply_filters('comicpress_display_post_title',$post_title); + echo apply_filters( 'comicpress_display_post_title ', $post_title ); } } -if (!function_exists('comicpress_display_post_thumbnail')) { - function comicpress_display_post_thumbnail($size = 'thumbnail') { +if ( ! function_exists('comicpress_display_post_thumbnail' ) ) { + function comicpress_display_post_thumbnail( $size = 'thumbnail' ) { global $post, $wp_query; - if ($post->post_type == 'post') { - $post_thumbnail = ''; - $link = get_post_meta( $post->ID, 'link', true ); - if (empty($link)) $link = get_permalink(); + if ( $post->post_type == 'post' ) { + $post_thumbnail = ''; + $link = get_post_meta( $post->ID, 'link', true ); + if ( empty( $link ) ) $link = get_permalink(); if ( has_post_thumbnail() ) { - if (is_home()) { - $post_thumbnail = '
    '.get_the_post_thumbnail($post->ID, $size).'
    '."\r\n"; + if ( is_home() ) { + $post_thumbnail = '
    ' . get_the_post_thumbnail( $post->ID, $size ) . '
    '."\r\n"; } else - $post_thumbnail = '
    '.get_the_post_thumbnail($post->ID, $size).'
    '."\r\n"; + $post_thumbnail = '
    ' . get_the_post_thumbnail( $post->ID, $size ) . '
    '."\r\n"; } else { $url_image = get_post_meta($post->ID, 'featured-image', true); - if (!empty($url_image)) $post_thumbnail = '
    '.get_the_title().'
    '."\r\n"; + if ( ! empty( $url_image ) ) $post_thumbnail = '
    ' . get_the_title() . '
    ' . "\r\n"; } - echo apply_filters('comicpress_display_post_thumbnail', $post_thumbnail); + echo apply_filters( 'comicpress_display_post_thumbnail', $post_thumbnail ); } } } -if (!function_exists('comicpress_display_author_gravatar')) { +if ( ! function_exists( 'comicpress_display_author_gravatar' ) ) { function comicpress_display_author_gravatar() { global $post, $wp_query, $is_IE; - if (is_page()) return; - if (comicpress_themeinfo('enable_post_author_gravatar')) { - $author_get_gravatar = get_avatar(get_the_author_meta('email'), 82, comicpress_random_default_avatar(get_the_author_meta('email'),get_the_author_meta('display_name'))); - if (!$is_IE) $author_get_gravatar = str_replace('photo', 'photo instant nocorner itxtalt', $author_get_gravatar); - $author_gravatar = "
    ".$author_get_gravatar."
    \r\n"; - echo apply_filters('comicpress_display_author_gravatar', $author_gravatar); + if ( is_page() ) return; + if ( comicpress_themeinfo( 'enable_post_author_gravatar' ) ) { + $author_get_gravatar = get_avatar(get_the_author_meta( 'email '), 82, comicpress_random_default_avatar( get_the_author_meta(' email' ), get_the_author_meta( 'display_name' ) ) ); + if ( ! $is_IE ) $author_get_gravatar = str_replace( 'photo', 'photo instant nocorner itxtalt', $author_get_gravatar ); + $author_gravatar = "
    " . $author_get_gravatar . "
    \r\n"; + echo apply_filters( 'comicpress_display_author_gravatar', $author_gravatar ); } } } -if (!function_exists('comicpress_display_post_calendar')) { +if ( ! function_exists('comicpress_display_post_calendar' ) ) { function comicpress_display_post_calendar() { global $post, $wp_query; - if (is_page()) return; - if (comicpress_themeinfo('enable_post_calendar')) { - $post_calendar = "
    ".get_the_time('M')."".get_the_time('d')."
    \r\n"; - echo apply_filters('comicpress_display_post_calendar', $post_calendar); + if ( is_page() ) return; + if ( comicpress_themeinfo( 'enable_post_calendar') ) { + $post_calendar = "
    " . get_the_time(' M' ) . "" . get_the_time( 'd' ) . "
    \r\n"; + echo apply_filters( 'comicpress_display_post_calendar', $post_calendar ); } } } -if (!function_exists('comicpress_display_post_author')) { +if ( !function_exists( 'comicpress_display_post_author' ) ) { function comicpress_display_post_author() { global $post, $authordata; - if (!comicpress_themeinfo('disable_author_info_in_posts')) { - $post_author = ''.__( 'by', 'comicpress' ).' '."\r\n"; - echo apply_filters('comicpress_display_post_author',$post_author); + if ( ! comicpress_themeinfo( 'disable_author_info_in_posts') ) { + $post_author = ''.__( 'by', 'comicpress' ).' ' . "\r\n"; + echo apply_filters( 'comicpress_display_post_author', $post_author ); } } } -if (!function_exists('comicpress_display_post_date')) { +if ( ! function_exists( 'comicpress_display_post_date' ) ) { function comicpress_display_post_date() { global $post; - if (!comicpress_themeinfo('disable_date_info_in_posts')) { - $post_date = "".__( 'on ', 'comicpress' )."".get_the_date(get_option('date_format'))."\r\n"; - echo apply_filters('comicpress_display_post_date',$post_date); + if ( ! comicpress_themeinfo( 'disable_date_info_in_posts' ) ) { + $post_date = "".__( 'on ', 'comicpress' ) . "" . get_the_date( get_option( 'date_format' ) ) . "\r\n"; + echo apply_filters( 'comicpress_display_post_date', $post_date ); } } } -if (!function_exists('comicpress_display_post_time')) { +if ( ! function_exists( 'comicpress_display_post_time' ) ) { function comicpress_display_post_time() { global $post; - if (!comicpress_themeinfo('disable_date_info_in_posts') && !comicpress_themeinfo('disable_posted_at_time_in_posts')) { - $post_time = "".__( 'at ', 'comicpress' )."".get_the_time(get_option('time_format'))."\r\n"; - echo apply_filters('comicpress_display_post_time',$post_time); + if ( ! comicpress_themeinfo( 'disable_date_info_in_posts') && ! comicpress_themeinfo( 'disable_posted_at_time_in_posts' ) ) { + $post_time = "" . __( 'at ', 'comicpress' ) . "" . get_the_time( get_option( 'time_format' ) ) . "\r\n"; + echo apply_filters( 'comicpress_display_post_time', $post_time ); } } } -if (!function_exists('comicpress_display_modified_date_time')) { +if ( ! function_exists( 'comicpress_display_modified_date_time' ) ) { function comicpress_display_modified_date_time() { global $post; - if (!comicpress_themeinfo('disable_date_info_in_posts') && comicpress_themeinfo('enable_last_modified_in_posts')) { - $u_time = get_the_time('U'); - $u_modified_time = get_the_modified_time('U'); - if ($u_modified_time != $u_time) { - $post_date_time = ' '.__( '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 ( ! comicpress_themeinfo( 'disable_date_info_in_posts' ) && comicpress_themeinfo( 'enable_last_modified_in_posts' ) ) { + $u_time = get_the_time( 'U' ); + $u_modified_time = get_the_modified_time( 'U' ); + if ( $u_modified_time != $u_time ) { + $post_date_time = ' ' . __( '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(); + ?>
    > -
    +
    + +
    - +
    - '
    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 ) ) { + ?>
    <?php echo $mood; ?>
    - +
    <?php echo $mood; ?>
    - + $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 ) ) { + ?>
    - +
    - -
    - /> + +
    + />
    - +
    -
    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 @@ > - + - - + + > - +
    - - +
    >
    @@ -14,29 +17,29 @@ ‹
    -
    - +
    +
    - +
    - - 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 ) { + ?> +
    +
    - +
    diff --git a/options/comments.php b/options/comments.php index 4db56a4..7cdb113 100644 --- a/options/comments.php +++ b/options/comments.php @@ -1,6 +1,6 @@
    - +
    @@ -20,7 +20,7 @@ - /> + /> @@ -33,7 +33,7 @@ - /> + /> @@ -46,7 +46,7 @@ - /> + /> @@ -54,17 +54,17 @@ @@ -75,15 +75,16 @@ /> + /> @@ -33,7 +33,7 @@ - /> + /> @@ -60,21 +60,23 @@ + if ( is_array( $variable_dump ) ) { + while ( list( $key, $value ) = each( $variable_dump ) ) { + ?> - + - + - // --> -
    \ No newline at end of file +
    diff --git a/options/general.php b/options/general.php index de12f3d..548ecb8 100644 --- a/options/general.php +++ b/options/general.php @@ -1,6 +1,6 @@
    - +
    @@ -33,7 +33,7 @@ - /> + /> @@ -46,7 +46,7 @@ - /> + /> @@ -55,7 +55,7 @@
    - + @@ -72,7 +72,7 @@
    - /> + /> @@ -85,7 +85,7 @@ - /> + /> @@ -96,7 +96,7 @@ - +
    @@ -108,7 +108,7 @@ - +
    @@ -118,7 +118,7 @@

    - + @@ -135,7 +135,7 @@
    - /> + /> @@ -144,7 +144,7 @@

    - +
    @@ -158,4 +158,4 @@
    -
    \ No newline at end of file +
    diff --git a/options/menubar.php b/options/menubar.php index 00f8b02..1ba6eeb 100644 --- a/options/menubar.php +++ b/options/menubar.php @@ -1,6 +1,6 @@
    - +
    @@ -20,7 +20,7 @@ - /> + /> @@ -33,7 +33,7 @@ - /> + /> @@ -46,7 +46,7 @@ - /> + /> @@ -59,7 +59,7 @@ - /> + /> @@ -72,7 +72,7 @@ - /> + /> @@ -98,7 +98,7 @@ - /> + /> @@ -129,7 +129,7 @@ @@ -137,13 +137,13 @@ - - - + + + + ?> @@ -153,7 +153,7 @@ @@ -165,7 +165,7 @@ @@ -177,7 +177,7 @@ @@ -189,7 +189,7 @@ @@ -201,7 +201,7 @@ @@ -213,7 +213,7 @@ @@ -238,4 +238,4 @@
    -
    \ No newline at end of file +
    diff --git a/options/postspages.php b/options/postspages.php index 41a50f6..b7699d5 100644 --- a/options/postspages.php +++ b/options/postspages.php @@ -1,6 +1,6 @@
    - +
    @@ -20,7 +20,7 @@ - /> + /> @@ -33,7 +33,7 @@ - /> + /> @@ -46,7 +46,7 @@ - /> + /> - /> + /> @@ -78,7 +78,7 @@ - /> + /> @@ -91,7 +91,7 @@ - /> + /> @@ -104,7 +104,7 @@ - /> + /> @@ -117,7 +117,7 @@ - /> + /> @@ -130,7 +130,7 @@ - /> + /> @@ -143,7 +143,7 @@ - /> + /> @@ -151,16 +151,16 @@ @@ -168,16 +168,18 @@ @@ -223,7 +225,7 @@ @@ -240,7 +242,7 @@ @@ -272,4 +274,4 @@
    -
    \ No newline at end of file +
    diff --git a/options/splash.php b/options/splash.php index 5e52978..6bf9ecf 100644 --- a/options/splash.php +++ b/options/splash.php @@ -1,5 +1,5 @@
    - +
    @@ -87,4 +87,4 @@
    -
    \ No newline at end of file +
    diff --git a/page.php b/page.php index 1b2a964..4e53444 100644 --- a/page.php +++ b/page.php @@ -1,11 +1,12 @@ @@ -52,7 +43,9 @@ if ( have_posts() ) : - +
    @@ -64,8 +57,8 @@ if ( have_posts() ) : $post_format = ( $post->post_type !== 'post' ) ? $post->post_type : get_post_format(); get_template_part( 'content', $post_format ); endwhile; - } - ?> + } + ?>
    + diff --git a/sidebar-right.php b/sidebar-right.php index f38e125..bebc643 100644 --- a/sidebar-right.php +++ b/sidebar-right.php @@ -1,18 +1,34 @@ + + \ No newline at end of file + + diff --git a/sidebar-shop.php b/sidebar-shop.php index 8e4677b..43bf3c4 100644 --- a/sidebar-shop.php +++ b/sidebar-shop.php @@ -1,8 +1,8 @@ \ No newline at end of file + + diff --git a/sidebar.php b/sidebar.php index 94b83d0..8ab4e72 100644 --- a/sidebar.php +++ b/sidebar.php @@ -1,8 +1,8 @@ diff --git a/single.php b/single.php index 3e7ead0..8d5ca49 100644 --- a/single.php +++ b/single.php @@ -1,26 +1,29 @@ +} else { + ?>
    >
    -

    +

    + +

    @@ -28,4 +31,4 @@ if (have_posts()) { query_vars['characters'])) ? esc_html($wp_query->query_vars['characters']) : ''; +$character = ( isset( $wp_query->query_vars['characters'] ) ) ? esc_html( $wp_query->query_vars['characters'] ) : ''; -if (!empty($character)) { +if ( ! empty( $character) ) { $args = array( - 'post_type' => 'page', - 'meta_key' => 'location-overwrite', - 'meta_value' => $character + 'post_type' => 'page', + 'meta_key' => 'location-overwrite', + 'meta_value' => $character ); - $insertPage = new WP_Query(); $insertPage->query($args); + $insertPage = new WP_Query(); + $insertPage->query( $args ); - if ($insertPage->have_posts()) { - while ($insertPage->have_posts()) : $insertPage->the_post(); - get_template_part('content', 'page'); + if ( $insertPage->have_posts() ) { + while ( $insertPage->have_posts() ) : + $insertPage->the_post(); + get_template_part( 'content', 'page' ); endwhile; - $args = array( - 'nopaging' => true, - 'numberposts' => -1, - 'posts_per_page' => -1, - 'post_type' => 'comic', - 'orderby' => 'post_date', - 'order' => 'ASC', - 'post_status' => 'publish', - 'characters' => $character, - ); + $args = array( + 'nopaging' => true, + 'numberposts' => -1, + 'posts_per_page' => -1, + 'post_type' => 'comic', + 'orderby' => 'post_date', + 'order' => 'ASC', + 'post_status' => 'publish', + 'characters' => $character, + ); $qposts = get_posts( $args ); - if (!empty($qposts)) { - $output = '
    '; - $first_seen_object = reset($qposts); - $first_seen_title = $first_seen_object->post_title; - $first_seen_id = $first_seen_object->ID; - $last_seen_object = end($qposts); - $last_seen_title = $last_seen_object->post_title; - $last_seen_id = $last_seen_object->ID; - if ($first_seen_id == $last_seen_id) { - $output .= ''.__( 'Only Appearance:', 'comicpress' ).' '.$first_seen_title.'
    '; + if ( ! empty( $qposts ) ) { + $output = '
    '; + $first_seen_object = reset( $qposts ); + $first_seen_title = $first_seen_object->post_title; + $first_seen_id = $first_seen_object->ID; + $last_seen_object = end( $qposts ); + $last_seen_title = $last_seen_object->post_title; + $last_seen_id = $last_seen_object->ID; + if ( $first_seen_id == $last_seen_id ) { + $output .= '' . __( 'Only Appearance:', 'comicpress' ) . ' ' . $first_seen_title . '
    '; } else { - $output .= ''.__( 'Recent Appearance:', 'comicpress' ).' '.$last_seen_title.'
    '; - $output .= ''.__( 'First Appearance:', 'comicpress' ).' '.$first_seen_title.'
    '; + $output .= '' . __( 'Recent Appearance:', 'comicpress' ) . ' ' . $last_seen_title . '
    '; + $output .= '' . __( 'First Appearance:', 'comicpress' ) . ' ' . $first_seen_title . '
    '; } $output .= '
    '; - echo apply_filters('comicpress-character-stats', $output); + echo apply_filters( 'comicpress-character-stats', $output ); } } wp_reset_query(); } -// this shows what the 'archive' would show, if you don't want the archive underneith the custom page, remove this -get_template_part('archive'); +// this shows what the 'archive' would show, if you don't want the archive underneith the custom page, remove this. +get_template_part( 'archive' ); get_footer(); diff --git a/taxonomy-locations.php b/taxonomy-locations.php index 04fb13e..697a5d0 100644 --- a/taxonomy-locations.php +++ b/taxonomy-locations.php @@ -1,47 +1,49 @@ query_vars['locations'])) ? esc_html($wp_query->query_vars['locations']) : ''; +$location = ( isset( $wp_query->query_vars['locations'] ) ) ? esc_html( $wp_query->query_vars['locations'] ) : ''; -if (!empty($location)) { +if ( ! empty( $location ) ) { $args = array( - 'post_type' => 'page', - 'meta_key' => 'location-overwrite', - 'meta_value' => $location + 'post_type' => 'page', + 'meta_key' => 'location-overwrite', + 'meta_value' => $location ); - $insertPage = new WP_Query(); $insertPage->query($args); + $insertPage = new WP_Query(); + $insertPage->query( $args ); - if ($insertPage->have_posts()) { - while ($insertPage->have_posts()) : $insertPage->the_post(); - get_template_part('content', 'page'); + if ( $insertPage->have_posts() ) { + while ( $insertPage->have_posts() ) : + $insertPage->the_post(); + get_template_part( 'content', 'page' ); endwhile; } wp_reset_query(); - $args = array( - 'nopaging' => true, - 'numberposts' => -1, - 'posts_per_page' => -1, - 'post_type' => 'comic', - 'orderby' => 'post_date', - 'order' => 'ASC', - 'post_status' => 'publish', - 'locations' => $location, - ); + $args = array( + 'nopaging' => true, + 'numberposts' => -1, + 'posts_per_page' => -1, + 'post_type' => 'comic', + 'orderby' => 'post_date', + 'order' => 'ASC', + 'post_status' => 'publish', + 'locations' => $location, + ); $qposts = get_posts( $args ); - if (!empty($qposts)) { - $output = '
    '; - $first_seen_object = reset($qposts); - $first_seen_title = $first_seen_object->post_title; - $first_seen_id = $first_seen_object->ID; - $last_seen_object = end($qposts); - $last_seen_title = $last_seen_object->post_title; - $last_seen_id = $last_seen_object->ID; - if ($first_seen_id == $last_seen_id) { - $output .= ''.__( 'Only Scene:', 'comicpress' ).' '.$first_seen_title.'
    '; + if ( ! empty( $qposts ) ) { + $output = '
    '; + $first_seen_object = reset( $qposts ); + $first_seen_title = $first_seen_object->post_title; + $first_seen_id = $first_seen_object->ID; + $last_seen_object = end ($qposts ); + $last_seen_title = $last_seen_object->post_title; + $last_seen_id = $last_seen_object->ID; + if ( $first_seen_id == $last_seen_id ) { + $output .= '' . __( 'Only Scene:', 'comicpress' ) . ' ' . $first_seen_title . '
    '; } else { - $output .= ''.__( 'Recent Scene:', 'comicpress' ).' '.$last_seen_title.'
    '; - $output .= ''.__( 'First Scene:', 'comicpress' ).' '.$first_seen_title.'
    '; + $output .= '' . __( 'Recent Scene:', 'comicpress' ) . ' ' . $last_seen_title . '
    '; + $output .= '' . __( 'First Scene:', 'comicpress' ) . ' ' . $first_seen_title . '
    '; } $output .= '
    '; echo $output; @@ -50,7 +52,7 @@ if (!empty($location)) { wp_reset_query(); } -// this shows what the 'archive' would show, if you don't want the archive underneith the custom page, remove this -get_template_part('archive'); +// this shows what the 'archive' would show, if you don't want the archive underneith the custom page, remove this. +get_template_part( 'archive' ); get_footer();