From eac8f95f1afdea795e5f3a55ef3ba9d3fc8bcc2e Mon Sep 17 00:00:00 2001 From: "Philip M. Hofer (Frumph)" Date: Mon, 7 Sep 2009 06:37:15 -0700 Subject: [PATCH] renamed cp_theme_style to cp_theme_layout for better clarity Signed-off-by: Philip M. Hofer (Frumph) --- 404.php | 18 ++--- archive-comic-calendar.php | 18 ++--- archive-comic-storyline-thumbs.php | 18 ++--- archive-comic-storyline.php | 18 ++--- archive-comic-year.php | 18 ++--- archive-comic.php | 18 ++--- archive.php | 18 ++--- archives.php | 18 ++--- author.php | 18 ++--- blog.php | 18 ++--- buystrip.php | 18 ++--- comicpress-options-config.php | 4 +- comicpress-options.php | 5 +- footer.php | 4 +- functions.php | 11 +-- functions/avatars.php | 105 +++++++++++++++++++++++++ functions/displayblogpost.php | 14 +++- functions/displaycomicpost.php | 29 ++++--- header.php | 12 +-- image.php | 18 ++--- index.php | 24 +++--- links.php | 18 ++--- page.php | 18 ++--- search-transcript.php | 18 ++--- search.php | 18 ++--- sidebar-right.php | 2 +- single.php | 18 ++--- style.css | 3 +- themepack/silver/commentlink.php | 1 + themepack/silver/style.css | 6 +- themepack/twopointfive/commentlink.php | 1 + themepack/twopointfive/style.css | 8 ++ 32 files changed, 333 insertions(+), 202 deletions(-) create mode 100644 functions/avatars.php create mode 100644 themepack/silver/commentlink.php create mode 100644 themepack/twopointfive/commentlink.php diff --git a/404.php b/404.php index 17455b6..f30c0f8 100644 --- a/404.php +++ b/404.php @@ -1,27 +1,27 @@ - +
- + - +
- +
- +
- + - +
@@ -38,11 +38,11 @@
- +
diff --git a/archive-comic-calendar.php b/archive-comic-calendar.php index e16f1f1..3fcd774 100644 --- a/archive-comic-calendar.php +++ b/archive-comic-calendar.php @@ -5,18 +5,18 @@ Template Name: Comic Calendar Archive ?> - +
- + - +
- +
@@ -81,13 +81,13 @@ $month['11'] = array('month' => 'November', 'days' => '30'); $month['12'] = array('month' => 'December', 'days' => '31'); ?> - +
- + - +
@@ -167,11 +167,11 @@ foreach ( $years as $year ) {
- +
diff --git a/archive-comic-storyline-thumbs.php b/archive-comic-storyline-thumbs.php index a06d751..cf7af17 100644 --- a/archive-comic-storyline-thumbs.php +++ b/archive-comic-storyline-thumbs.php @@ -5,28 +5,28 @@ Template Name: Comic Storyline with Thumbs ?> - +
- + - +
- +
- +
- + - +
@@ -97,11 +97,11 @@ Template Name: Comic Storyline with Thumbs
- +
diff --git a/archive-comic-storyline.php b/archive-comic-storyline.php index ebb8ace..2e30c55 100644 --- a/archive-comic-storyline.php +++ b/archive-comic-storyline.php @@ -5,28 +5,28 @@ Template Name: Comic Storyline Archive ?> - +
- + - +
- +
- +
- + - +
@@ -99,11 +99,11 @@ Template Name: Comic Storyline Archive
- +
diff --git a/archive-comic-year.php b/archive-comic-year.php index a9b84a3..c9fa8b3 100644 --- a/archive-comic-year.php +++ b/archive-comic-year.php @@ -14,28 +14,28 @@ Template Name: Comic Year Archive ?> - +
- + - +
- +
- +
- + - +
@@ -72,11 +72,11 @@ Template Name: Comic Year Archive
- +
diff --git a/archive-comic.php b/archive-comic.php index 811faf0..d53e833 100644 --- a/archive-comic.php +++ b/archive-comic.php @@ -5,28 +5,28 @@ Template Name: Comic Archive ?> - +
- + - +
- +
- +
- + - +
@@ -60,11 +60,11 @@ Template Name: Comic Archive
- +
diff --git a/archive.php b/archive.php index 92dbf13..af34d4a 100644 --- a/archive.php +++ b/archive.php @@ -1,27 +1,27 @@ - +
- + - +
- +
- +
- + - +
@@ -146,11 +146,11 @@
- +
diff --git a/archives.php b/archives.php index a20e150..703e2d8 100644 --- a/archives.php +++ b/archives.php @@ -5,28 +5,28 @@ Template Name: Archives ?> - +
- + - +
- +
- +
- + - +
@@ -45,11 +45,11 @@ Template Name: Archives
- +
diff --git a/author.php b/author.php index ef6c733..5ab6da5 100644 --- a/author.php +++ b/author.php @@ -1,29 +1,29 @@ - +
- + - +
- +
- +
- + - +
@@ -85,11 +85,11 @@
- +
diff --git a/blog.php b/blog.php index 6f5fe59..385d55a 100644 --- a/blog.php +++ b/blog.php @@ -5,28 +5,28 @@ Template Name: Blog ?> - +
- + - +
- +
- +
- + - +
- +
diff --git a/buystrip.php b/buystrip.php index 8b18567..d217ca2 100644 --- a/buystrip.php +++ b/buystrip.php @@ -9,28 +9,28 @@ Templete Author Email: philip@frumph.net ?> - +
- + - +
- +
- +
- + - +
@@ -127,11 +127,11 @@ Templete Author Email: philip@frumph.net
- +
diff --git a/comicpress-options-config.php b/comicpress-options-config.php index b94d430..577a605 100644 --- a/comicpress-options-config.php +++ b/comicpress-options-config.php @@ -25,9 +25,9 @@ $options = array ( "type" => "comicpress-custom_css"), array( - "id" => "comicpress-cp_theme_style", + "id" => "comicpress-cp_theme_layout", "default" => "standard", - "type" => "comicpress-cp_theme_style"), + "type" => "comicpress-cp_theme_layout"), array( "id" => "comicpress-buy_print_email", diff --git a/comicpress-options.php b/comicpress-options.php index 2a6bd6b..57efbb4 100644 --- a/comicpress-options.php +++ b/comicpress-options.php @@ -95,7 +95,7 @@ function comicpress_admin() { + case "comicpress-cp_theme_layout": ?> Choose which theme layout you want to use.

This is the layout in which your theme will be presented.

@@ -139,7 +139,7 @@ function comicpress_admin() {
- +
+ - diff --git a/functions.php b/functions.php index 1bc0555..50b4f35 100644 --- a/functions.php +++ b/functions.php @@ -54,7 +54,7 @@ if (get_option('upload_path') !== false) { 'buy_print_us_ship' => 'buy_print_us_ship', 'buy_print_int_ship' => 'buy_print_int_ship', 'custom_css' => 'custom_css', - 'cp_theme_style' => 'cp_theme_style', + 'cp_theme_layout' => 'cp_theme_layout', 'transcript_in_posts' => 'transcript_in_posts', 'enable_widgetarea_use_sidebar_css' => 'enable_widgetarea_use_sidebar_css', 'enable_custom_image_header' => 'enable_custom_image_header', @@ -97,14 +97,15 @@ if (empty($themepack_directory)) $themepack_directory = 'silver'; if (empty($graphicnav_directory)) $graphicnav_directory = 'default'; if (empty($moods_directory)) $moods_directory = 'default'; if (empty($calendar_directory)) $calendar_directory = 'default'; +if (empty($cp_theme_layout)) $cp_theme_layout='standard'; -function is_cp_theme_style($choices) { -global $cp_theme_style; - if (empty($cp_theme_style)) $cp_theme_style='standard'; +function is_cp_theme_layout($choices) { +global $cp_theme_layout; + if (empty($cp_theme_layout)) $cp_theme_layout='standard'; $choices = explode(",", $choices); foreach ($choices as $choice) { - if ($choice == $cp_theme_style) { + if ($choice == $cp_theme_layout) { return true; } } diff --git a/functions/avatars.php b/functions/avatars.php new file mode 100644 index 0000000..03ec8e9 --- /dev/null +++ b/functions/avatars.php @@ -0,0 +1,105 @@ + tag for the user's avatar +*/ +function comicpress_get_avatar( $id_or_email, $size = '64', $alt = false) { + if ( ! get_option('show_avatars') ) + return false; + + if ( false === $alt) + $safe_alt = ''; + else + $safe_alt = attribute_escape( $alt ); + + if ( !is_numeric($size) ) + $size = '96'; + + $email = ''; + if ( is_numeric($id_or_email) ) { + $id = (int) $id_or_email; + $user = get_userdata($id); + if ( $user ) + $email = $user->user_email; + } elseif ( is_object($id_or_email) ) { + if ( isset($id_or_email->comment_type) && '' != $id_or_email->comment_type && 'comment' != $id_or_email->comment_type ) + return false; // No avatar for pingbacks or trackbacks + + if ( !empty($id_or_email->user_id) ) { + $id = (int) $id_or_email->user_id; + $user = get_userdata($id); + if ( $user) + $email = $user->user_email; + } elseif ( !empty($id_or_email->comment_author_email) ) { + $email = $id_or_email->comment_author_email; + } + } else { + $email = $id_or_email; + } + + if ( empty($default) ) { + $default = comicpress_random_default_avatar((string)$id_or_email); + if ( empty($default) || $default == 'none' ) { + $avatar_default = get_option('avatar_default'); + if ( empty($avatar_default) ) + $default = 'mystery'; + else + $default = $avatar_default; + } + } + + if ( 'mystery' == $default ) + $default = "http://www.gravatar.com/avatar/ad516503a11cd5ca435acc9bb6523536?s={$size}"; // ad516503a11cd5ca435acc9bb6523536 == md5('unknown@gravatar.com') + elseif ( 'blank' == $default ) + $default = includes_url('images/blank.gif'); + elseif ( !empty($email) && 'gravatar_default' == $default ) + $default = ''; + elseif ( 'gravatar_default' == $default ) + $default = "http://www.gravatar.com/avatar/s={$size}"; + elseif ( empty($email) ) + $default = "http://www.gravatar.com/avatar/?d=$default&s={$size}"; + elseif ( strpos($default, 'http://') === 0 ) + $default = add_query_arg( 's', $size, $default ); + + if ( !empty($email) ) { + $out = 'http://www.gravatar.com/avatar/'; + $out .= md5( strtolower( $email ) ); + $out .= '?s='.$size; + $out .= '&d=' . urlencode( $default ); + + $rating = get_option('avatar_rating'); + if ( !empty( $rating ) ) + $out .= "&r={$rating}"; + + $avatar = "{$safe_alt}"; + } else { + $avatar = "{$safe_alt}"; + } + + return apply_filters('comicpress_get_avatar', $avatar, $id_or_email, $size, $default, $alt); +} + +function comicpress_random_default_avatar($id_or_email = '') { + $current_avatar_directory = get_option('comicpress-avatar_directory'); + if (empty($current_avatar_directory)) $current_avatar_directory = 'default'; + + $count = count($results = glob(get_template_directory() . '/images/avatars/'.$current_avatar_directory.'/*')); + $default = ''; + + $checknum = hexdec(substr(md5($id_or_email),0,5)) % $count; + if ($count > 0) { + $default = basename($results[(int)$checknum]); + } else { + return false; + } + return get_bloginfo('stylesheet_directory').'/images/avatars/'.$current_avatar_directory.'/'.$default; +} + +?> \ No newline at end of file diff --git a/functions/displayblogpost.php b/functions/displayblogpost.php index 1f41ae4..5f29a3d 100644 --- a/functions/displayblogpost.php +++ b/functions/displayblogpost.php @@ -7,7 +7,7 @@ */ function display_blog_post() { - global $post, $wp_query, $authordata, $enable_related_posts, $enable_post_author_gravatar, $enable_post_calendar; ?> + global $post, $wp_query, $authordata, $enable_related_posts, $enable_post_author_gravatar, $enable_post_calendar, $themepack_directory; ?>
- - comment_status) { ?> - + comment_status) { + if ( ($themepack_directory != 'none' && !empty($themepack_directory) ) && file_exists(get_template_directory() . '/themepack/'.$themepack_directory.'/commentlink.php') ) { + include(get_template_directory() . '/themepack/' .$themepack_directory. '/commentlink.php'); + } else { ?> + +
diff --git a/functions/displaycomicpost.php b/functions/displaycomicpost.php index 800f586..b2fc357 100644 --- a/functions/displaycomicpost.php +++ b/functions/displaycomicpost.php @@ -7,7 +7,7 @@ */ function display_comic_post() { - global $post, $wp_query, $transcript_in_posts, $enable_related_comics, $enable_comic_post_author_gravatar, $enable_comic_post_calendar, $disable_categories_in_posts, $disable_tags_in_posts; + global $post, $wp_query, $transcript_in_posts, $enable_related_comics, $enable_comic_post_author_gravatar, $enable_comic_post_calendar, $disable_categories_in_posts, $disable_tags_in_posts, $themepack_directory;; $first_comic = get_first_comic_permalink(); $last_comic = get_last_comic_permalink(); ?> -
- -
- '); ?> +
+ +
+ '); ?> +
+ + comment_status) { + if ( ($themepack_directory != 'none' && !empty($themepack_directory) ) && file_exists(get_template_directory() . '/themepack/'.$themepack_directory.'/commentlink.php') ) { + include(get_template_directory() . '/themepack/' .$themepack_directory. '/commentlink.php'); + } else { ?> + + +
+
- - comment_status) { ?> - -
-
+
diff --git a/header.php b/header.php index beec598..ccdacc9 100644 --- a/header.php +++ b/header.php @@ -18,12 +18,12 @@ ?> - - - + + + @@ -43,8 +43,10 @@ +
+ + if (is_cp_theme_layout('standard,v')) { ?>
diff --git a/image.php b/image.php index 04b6ecb..58be5f1 100644 --- a/image.php +++ b/image.php @@ -1,27 +1,27 @@ - +
- + - +
- +
- +
- + - +
@@ -90,11 +90,11 @@
- +
diff --git a/index.php b/index.php index 4e694a5..b2fe210 100644 --- a/index.php +++ b/index.php @@ -1,17 +1,17 @@ - +
- + - +
- +
@@ -34,13 +34,13 @@ - +
- + - +
@@ -58,15 +58,15 @@ } else { ?> - +
- + - +
- +
diff --git a/links.php b/links.php index 719c4c2..989d81a 100644 --- a/links.php +++ b/links.php @@ -5,30 +5,30 @@ Template Name: Links ?> - +
- + - +
- +
- +
- + - +
- +
diff --git a/page.php b/page.php index 0c73ecc..ec18836 100644 --- a/page.php +++ b/page.php @@ -1,29 +1,29 @@ - +
- + - +
- +
- +
- + - +
@@ -49,11 +49,11 @@
- +
diff --git a/search-transcript.php b/search-transcript.php index d02a635..6c1720d 100644 --- a/search-transcript.php +++ b/search-transcript.php @@ -1,29 +1,29 @@ - +
- + - +
- +
- +
- + - +
@@ -130,11 +130,11 @@ $count = $tmp_search->post_count;
- +
diff --git a/search.php b/search.php index dfdd00e..2eec9ec 100644 --- a/search.php +++ b/search.php @@ -1,29 +1,29 @@ - +
- + - +
- +
- +
- + - +
@@ -129,11 +129,11 @@ $count = $tmp_search->post_count;
- +
diff --git a/sidebar-right.php b/sidebar-right.php index 9990803..b0d3a88 100644 --- a/sidebar-right.php +++ b/sidebar-right.php @@ -8,7 +8,7 @@ if ($disable_lrsidebars_frontpage == 'yes' && is_home()) { - +
  • diff --git a/single.php b/single.php index a927f48..2805233 100644 --- a/single.php +++ b/single.php @@ -1,17 +1,17 @@ - +
    - + - +
    - +
    @@ -28,13 +28,13 @@ - +
    - + - +
    @@ -77,11 +77,11 @@
    - +
    diff --git a/style.css b/style.css index 88fa514..4d84974 100644 --- a/style.css +++ b/style.css @@ -16,7 +16,7 @@ http://www.opensource.org/licenses/gpl-3.0.html body { margin: 0; font-family: 'Arial', sans-serif; - font-size: 13px; + font-size: 12px; font-style: normal; font-weight: normal; text-transform: none; @@ -603,7 +603,6 @@ a.navi-comments:hover span { line-height: 20px; font-family: 'Arial', sans-serif; font-weight: bold; - font-size: smaller; text-align: right; } diff --git a/themepack/silver/commentlink.php b/themepack/silver/commentlink.php new file mode 100644 index 0000000..fdcdd6a --- /dev/null +++ b/themepack/silver/commentlink.php @@ -0,0 +1 @@ +comment_status) { ?> diff --git a/themepack/silver/style.css b/themepack/silver/style.css index 3720c0d..0f2f174 100644 --- a/themepack/silver/style.css +++ b/themepack/silver/style.css @@ -240,12 +240,11 @@ body { } .comment-link a { - color: #800; - font-size: inherit; + color: #333; } .comment-link a:hover { - color: #b00; + color: #800; } .comment-balloon { @@ -274,7 +273,6 @@ body { } - /* WIDGETS */ .archive-dropdown-wrap { diff --git a/themepack/twopointfive/commentlink.php b/themepack/twopointfive/commentlink.php new file mode 100644 index 0000000..a2106be --- /dev/null +++ b/themepack/twopointfive/commentlink.php @@ -0,0 +1 @@ +comment_status) { ?> diff --git a/themepack/twopointfive/style.css b/themepack/twopointfive/style.css index 45e1158..35292a7 100644 --- a/themepack/twopointfive/style.css +++ b/themepack/twopointfive/style.css @@ -75,3 +75,11 @@ body { #footer a:hover { color: #fff; } + +/* COMMENT LINK */ + +.comment-link { + font-size: 9px; +} + +