Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Added facebook meta option, fixed up the facebook like widget to have…

… 3 more options, changed the facebook like button in posts and pages to a button.

Fixed the custom-header so it doesnt divide by zero (hopefully)

Adjusted teh comicblogpost with another option and fixed the <div /h2 issue on single pages.

Signed-off-by: Philip M. Hofer (Frumph) <frumph_dragon@yahoo.com>
  • Loading branch information...
commit b2efb0ec9338d4560400f6e0e2c3af54dfb4744c 1 parent 4a2d6ca
Philip M. Hofer (Frumph) authored
View
37 addons/facebook.php
@@ -0,0 +1,37 @@
+<?php
+
+function comicpress_add_facebook_meta() {
+ global $post;
+ echo '<meta property="og:url" content="'.get_permalink().'" />'."\r\n";
+ echo '<meta property="og:site_name" content="'.get_bloginfo('name').'" />'."\r\n";
+ echo '<meta property="og:type" content="article" />'."\r\n";
+ if (is_single()) {
+ $comic_url = get_comic_url('mini', $post);
+ if (is_array($comic_url)) $comic_url = reset($comic_url);
+ echo '<meta property="og:title" content="'.get_the_title().'" />'."\r\n";
+ echo '<meta property="og:description" content="'.get_the_excerpt().'" />'."\r\n";
+ if (comicpress_in_comic_category()) {
+ echo '<meta property="og:image" content="'.$comic_url.'" />'."\r\n";
+ }
+ } elseif (is_home()) {
+ echo '<meta property="og:description" content="'.get_bloginfo('description').'" />'."\r\n";
+ }
+}
+
+add_action('wp_head', 'comicpress_add_facebook_meta');
+
+if (!function_exists('comicpress_display_facebook_like')) {
+ function comicpress_display_facebook_like($content) {
+ global $post, $wp_query;
+ if (!is_page()) {
+ if ((comicpress_in_comic_category() && comicpress_themeinfo('facebook_like_comic_post')) || (!comicpress_in_comic_category() && comicpress_themeinfo('facebook_like_blog_post'))) {
+ $content .= '<span class="facebook_like"><fb:like layout="box_count" show_faces="false" width="55" href="'.get_permalink().'"></fb:like></span>';
+ }
+ }
+ return $content;
+ }
+}
+
+add_action('the_content', 'comicpress_display_facebook_like');
+
+?>
View
12 changelog.txt
@@ -6,6 +6,14 @@ dual blog posts and checkmarked blog post stays with comic now works as properly
single blog posts and checkmarked blog posts stays with comic as well is now fixed (needs testing)
fixed thumbnail widget to *not* exclude the current page if its not set to random
adjusting the option pages input button to hit the right location properly
+added CDN URL ability for content delivery networks storing the comics
+fixed the missing nocache=1 in the comic-navigation widget
+comic blog post widget has a new option whether to disable the displaying of the widget if there's no content or not
+fixed the h2 in the comic blog post widget for single pages
+added a clear:both; to .comment-link css element
+modified the facebook like button widget to have 3 different options for display
+the facebook like button now uses a script load and the facebook fb:code
+added facebook meta information toggle, will be on if any facebook option is on
2.9.2.27
Stylized the control panel and dropdown archive boxes
@@ -13,7 +21,7 @@ fixed notice in control panel widget
sharethis_title, subscribe_title were missing from defaults being set in the comic-navigation.php, set em
accidently left in the #height - 100px; .. removed it so its now auto again
fixed a variable being passed in the latesthumbnail widget that was sending $true and not true ;/ its not a php var heh
-adding <div class="clear"></div> to the tipjar.php widget so it clears the internal floats properly
+adding div class="clear" /div to the tipjar.php widget so it clears the internal floats properly
fixed the themestyle.php to handle the vertical double right sidebar properly
removed .ie #comic button {} from the css, it was hardsetting it to white text
added the easel footer_text functionality and a new option in comicpress options to set the copyright name w/ modifiable information including URL to copyright holder (w/defaults)
@@ -46,7 +54,7 @@ adding comic-id-# ($post->id) as a wrap with #comic-wrap so that it can be targe
added check to see if on the comic_next for hovering over to see if its empty or not, if it is do a # instead of empty ""
Removed comicpress-debug.php, so no debug messages anymore
Removed copyright.php, it hasnt been in use in a long time
-changed the <div for the post title in the comic blog post widget to an h2 so that ttf replacer plugins can handle it
+changed the div for the post title in the comic blog post widget to an h2 so that ttf replacer plugins can handle it
fixed the /?randomcomic /?randompost to have &nocache=1 on the line so that wp-supercache doesn't cache it
implemented easel's menubar code which uses less CSS then the new comicpress's /cleaned up code/ no images for down arrow -> right arrow no, is text characters
fixed classic menubar's error with the comicpress_get_all_comic_categories_as_cat_string() when its supposed to be: comicpress_all_comic_categories_string()
View
3  comicpress-admin.php
@@ -197,7 +197,8 @@ function comicpress_admin_options() {
'enable_buystrip_post',
'disable_showing_members_category',
'facebook_like_blog_post',
- 'facebook_like_comic_post'
+ 'facebook_like_comic_post',
+ 'facebook_meta'
) as $key) {
if (!isset($_REQUEST[$key])) $_REQUEST[$key] = 0;
$comicpress_options[$key] = (bool)( $_REQUEST[$key] == 1 ? true : false );
View
17 functions.php
@@ -94,17 +94,15 @@ function comicpress_config() {
}
}
-if (comicpress_themeinfo('enable_members_only')) {
+// Addons
+if (comicpress_themeinfo('enable_members_only'))
@require_once(get_template_directory() . '/addons/membersonly.php');
-}
-
-if (comicpress_themeinfo('enable_related_comics')) {
+if (comicpress_themeinfo('enable_related_comics'))
@require_once(get_template_directory() . '/addons/relatedcomics.php');
-}
-
-if (comicpress_themeinfo('enable_related_posts')) {
+if (comicpress_themeinfo('enable_related_posts'))
@require_once(get_template_directory() . '/addons/relatedposts.php');
-}
+if (comicpress_themeinfo('facebook_meta') || comicpress_themeinfo('facebook_like_comic_post') || comicpress_themeinfo('facebook_like_comic_post'))
+ @require_once(get_template_directory() . '/addons/facebook.php');
// Dashboard Menu Comicpress Options and ComicPress CSS
if (is_admin()) {
@@ -183,6 +181,8 @@ function __comicpress_init() {
wp_enqueue_script('cookiejar', get_template_directory_uri() . '/js/cookiejar.js', array('prototype'));
wp_enqueue_script('bookmark', get_template_directory_uri() . '/js/bookmark.js', array('prototype', 'cookiejar'));
}
+ if (comicpress_themeinfo('facebook_like_blog_post') || comicpress_themeinfo('facebook_like_comic_post'))
+ wp_enqueue_script('facebook', 'http://connect.facebook.net/en_US/all.js#xfbml=1', array(), false, true);
}
do_action('comicpress_init');
@@ -474,6 +474,7 @@ function comicpress_load_options() {
'copyright_url' => '',
'facebook_like_blog_post' => false,
'facebook_like_comic_post' => false,
+ 'facebook_meta' => false,
'enable_comic_lightbox' => false,
'cdn_url' => ''
) as $field => $value) {
View
16 functions/custom-header.php
@@ -2,15 +2,19 @@
add_filter('comicpress_header_image_width', 'comicpress_change_header_width');
function comicpress_change_header_width($width) {
- if (comicpress_themeinfo('custom_image_header_width')) $width = comicpress_themeinfo('custom_image_header_width');
- return (int)$width;
+ $new_width = comicpress_themeinfo('custom_image_header_width');
+ if (!empty($new_width) && ((int)$new_width > 0))
+ $width = $new_width;
+ return $width;
}
add_filter('comicpress_header_image_height', 'comicpress_change_header_height');
function comicpress_change_header_height($height) {
- if (comicpress_themeinfo('custom_image_header_height')) $width = comicpress_themeinfo('custom_image_header_height');
- return (int)$height;
+ $new_height = comicpress_themeinfo('custom_image_header_height');
+ if (!empty($new_height) && ((int)$new_height > 0))
+ $height = $new_height;
+ return $height;
}
// Custom Image Header Defaults
@@ -18,8 +22,8 @@ function comicpress_change_header_height($height) {
define('HEADER_IMAGE', ''); // %s is theme dir
define('NO_HEADER_TEXT', true);
-define( 'HEADER_IMAGE_WIDTH', apply_filters( 'comicpress_header_image_width', 980) );
-define( 'HEADER_IMAGE_HEIGHT', apply_filters( 'comicpress_header_image_height', 100) );
+define( 'HEADER_IMAGE_WIDTH', apply_filters( 'comicpress_header_image_width', '980') );
+define( 'HEADER_IMAGE_HEIGHT', apply_filters( 'comicpress_header_image_height', '100') );
set_post_thumbnail_size( HEADER_IMAGE_WIDTH, HEADER_IMAGE_HEIGHT, true );
add_custom_image_header('comicpress_header_style', 'comicpress_admin_header_style');
View
15 functions/displaypost.php
@@ -141,20 +141,6 @@ function comicpress_display_related_posts($is_comic = false) {
}
}
-if (!function_exists('comicpress_display_facebook_like')) {
- function comicpress_display_facebook_like($is_comic = false, $bypass = false) {
- global $post, $wp_query;
- if (!is_page()) {
- if ($bypass || (($is_comic && comicpress_themeinfo('facebook_like_comic_post')) || (!$is_comic && comicpress_themeinfo('facebook_like_blog_post')))) {
- $the_perma = rawurlencode(get_permalink());
- $the_iframe = '<div class="facebook_like"><iframe src="http://www.facebook.com/plugins/like.php?href='.$the_perma.'&amp;layout=standard&amp;show_faces=true&amp;width=500&amp;action=like&amp;font=segoe+ui&amp;colorscheme=light&amp;height=80" scrolling="no" frameborder="0" style="border:none; overflow:hidden; width:500px; height:80px;" allowTransparency="true"></iframe></div>';
- echo apply_filters('comicpress_display_facebook_like', $the_iframe);
- }
- }
- echo apply_filters('comicpress_display_facebook_like', '');
- }
-}
-
if (!function_exists('comicpress_display_blog_navigation')) {
function comicpress_display_blog_navigation($is_comic = false) {
global $post, $wp_query;
@@ -251,7 +237,6 @@ function comicpress_display_post() {
<?php if (!is_page()) { ?>
<div class="post-extras">
<?php comicpress_display_post_tags(); ?>
- <?php comicpress_display_facebook_like($is_comic); ?>
<?php comicpress_display_comment_link(); ?>
<?php
if ($is_comic) {
View
13 options/addonoptions.php
@@ -199,7 +199,7 @@
<table class="widefat">
<thead>
<tr>
- <th colspan="3"><?php _e('Facebook Like','comicpress'); ?></th>
+ <th colspan="3"><?php _e('Facebook','comicpress'); ?></th>
</tr>
</thead>
<tr>
@@ -216,7 +216,7 @@
<?php _e('When enabled this option will allow the Facebook like button to appear at the bottom of regular blog posts.','comicpress'); ?>
</td>
</tr>
- <tr class="alternate">
+ <tr>
<th scope="row"><label for="facebook_like_comic_post"><?php _e('Enable the Facebook Like button in Comic Posts?','comicpress'); ?></label></th>
<td>
<input id="facebook_like_comic_post" name="facebook_like_comic_post" type="checkbox" value="1" <?php checked(true, comicpress_themeinfo('facebook_like_comic_post')); ?> />
@@ -225,6 +225,15 @@
<?php _e('Enabling this option will allow the Facebook like button to appear at the bottom of comic posts.','comicpress'); ?>
</td>
</tr>
+ <tr class="alternate">
+ <th scope="row"><label for="facebook_meta"><?php _e('Enable the Facebook Meta?','comicpress'); ?></label></th>
+ <td>
+ <input id="facebook_meta" name="facebook_meta" type="checkbox" value="1" <?php checked(true, comicpress_themeinfo('facebook_meta')); ?> />
+ </td>
+ <td>
+ <?php _e('When setting this option ComicPress will add meta information to the head area of each page so that facebook will recognize the content within.','comicpress'); ?>
+ </td>
+ </tr>
</table>
<table class="widefat">
View
11 style.css
@@ -648,6 +648,7 @@ h4, h4 a {
/* COMMENT LINK */
.comment-link {
+ clear: both;
font-weight: bold;
text-align: right;
}
@@ -1664,7 +1665,9 @@ textarea {
overflow: hidden;
}
-.post-extras .facebook_like {
- clear: both;
- padding-top: 10px;
-}
+.facebook_like {
+ float:right;
+ width: 55px;
+ height: 60px;
+ text-align: center;
+}
View
11 widgets/comicblogpost.php
@@ -27,7 +27,7 @@ function widget($args, $instance) {
$posts = &query_posts($comic_query);
if (have_posts()) {
while (have_posts()) : the_post();
- if (!empty($post->post_content)) {
+ if (!(empty($post->post_content) && $instance['hidecontent'])) {
echo $before_widget;
$temp_query = $wp_query->is_single;
$wp_query->is_single = true;
@@ -45,11 +45,11 @@ function widget($args, $instance) {
wp_reset_query();
} else {
setup_postdata($post);
- if (!empty($post->post_content) && comicpress_in_comic_category()) {
+ if (!(empty($post->post_content) && $instance['hidecontent']) && comicpress_in_comic_category()) {
echo $before_widget;
$title = empty($instance['title']) ? '' : apply_filters('widget_title', $instance['title']);
if (!empty($title)) { echo "<div class=\"comic-post-widget-header\">".$title."</div>\r\n"; }
- if ($instance['showtitle']) { echo "<div class=\"comic-post-widget-title\">".get_the_title()."</div>\r\n"; }
+ if ($instance['showtitle']) { echo "<h2 class=\"comic-post-widget-title\">".get_the_title()."</h2>\r\n"; }
if ($instance['showdate']) { echo "<div class=\"comic-post-widget-date\">".get_the_time('F jS, Y')."</div>\r\n"; }
the_content();
if ($instance['showcommentlink']) comicpress_display_comment_link();
@@ -66,22 +66,25 @@ function update($new_instance, $old_instance) {
$instance['showtitle'] = (bool)( $new_instance['showtitle'] == 1 ? true : false );
$instance['showdate'] = (bool)( $new_instance['showdate'] == 1 ? true : false );
$instance['showcommentlink'] = (bool)( $new_instance['showcommentlink'] == 1 ? true : false );
+ $instance['hidecontent'] = (bool)( $new_instance['hidecontent'] == 1 ? true : false );
return $instance;
}
function form($instance) {
- $instance = wp_parse_args( (array) $instance, array( 'title' => '', 'onlyhome' => false, 'showtitle' => false, 'showdate' => false, 'showcommentlink' => false ) );
+ $instance = wp_parse_args( (array) $instance, array( 'title' => '', 'onlyhome' => false, 'showtitle' => false, 'showdate' => false, 'showcommentlink' => false, 'hidecontent' => false ) );
$title = strip_tags($instance['title']);
$onlyhome = $instance['onlyhome'];
$showtitle = $instance['showtitle'];
$showdate = $instance['showdate'];
$showcommentlink = $instance['showcommentlink'];
+ $hidecontent = $instance['hidecontent'];
?>
<p><label for="<?php echo $this->get_field_id('title'); ?>">Heading:<br /><input class="widefat" id="<?php echo $this->get_field_id('title'); ?>" name="<?php echo $this->get_field_name('title'); ?>" type="text" value="<?php echo esc_attr($title); ?>" /></label></p>
<p><label for="<?php echo $this->get_field_id('onlyhome'); ?>"><input id="<?php echo $this->get_field_id('onlyhome'); ?>" name="<?php echo $this->get_field_name('onlyhome'); ?>" type="checkbox" value="1" <?php checked(true, $onlyhome); ?> /> Display only on the home page?</label></p>
<p><label for="<?php echo $this->get_field_id('showtitle'); ?>"><input id="<?php echo $this->get_field_id('showtitle'); ?>" name="<?php echo $this->get_field_name('showtitle'); ?>" type="checkbox" value="1" <?php checked(true, $showtitle); ?> /> Show the title of the post?</label></p>
<p><label for="<?php echo $this->get_field_id('showdate'); ?>"><input id="<?php echo $this->get_field_id('showdate'); ?>" name="<?php echo $this->get_field_name('showdate'); ?>" type="checkbox" value="1" <?php checked(true, $showdate); ?> /> Show the date of the post?</label></p>
<p><label for="<?php echo $this->get_field_id('showcommentlink'); ?>"><input id="<?php echo $this->get_field_id('showcommentlink'); ?>" name="<?php echo $this->get_field_name('showcommentlink'); ?>" type="checkbox" value="1" <?php checked(true, $showcommentlink); ?> /> Show the comment link to the post?</label></p>
+ <p><label for="<?php echo $this->get_field_id('hidecontent'); ?>"><input id="<?php echo $this->get_field_id('hidecontent'); ?>" name="<?php echo $this->get_field_name('hidecontent'); ?>" type="checkbox" value="1" <?php checked(true, $hidecontent); ?> /> Hide the display of the widget if there's no content?</label></p>
<?php
}
View
19 widgets/facebooklike.php
@@ -25,21 +25,36 @@ function widget($args, $instance) {
$title = empty($instance['title']) ? '' : apply_filters('widget_title', $instance['title']);
if ( !empty( $title ) ) { echo $before_title . $title . $after_title; };
// This only works in comic sidebar widgets, declare it to pass it as a comic.
- comicpress_display_facebook_like(true, true); // 2nd param is to bypass the check for $is_comic
+ switch ($instance['style']) {
+ case 1:
+ echo '<fb:like layout="box_count" show_faces="false" width="55" href="'.get_permalink().'"></fb:like>';
+ break;
+ case 2:
+ echo '<fb:like layout="button_count" show_faces="false" width="94" href="'.get_permalink().'"></fb:like>';
+ break;
+ case 3:
+ echo '<fb:like show_faces="false" width="260" href="'.get_permalink().'"></fb:like>';
+ break;
+ }
echo $after_widget;
}
function update($new_instance, $old_instance) {
$instance = $old_instance;
$instance['title'] = strip_tags($new_instance['title']);
+ $instance['style'] = (int)$new_instance['style'];
return $instance;
}
function form($instance) {
- $instance = wp_parse_args( (array) $instance, array( 'title' => '' ) );
+ $instance = wp_parse_args( (array) $instance, array( 'title' => '', 'style' => 1 ) );
$title = strip_tags($instance['title']);
+ $style = (int)$instance['style'];
?>
<p><label for="<?php echo $this->get_field_id('title'); ?>"><?php _e('Title:','comicpress'); ?> <input class="widefat" id="<?php echo $this->get_field_id('title'); ?>" name="<?php echo $this->get_field_name('title'); ?>" type="text" value="<?php echo esc_attr($title); ?>" /></label></p>
+ <p><label for="<?php echo $this->get_field_id('style'); ?>"><input id="<?php echo $this->get_field_id('style'); ?>" name="<?php echo $this->get_field_name('style'); ?>" type="radio" value="1" <?php checked(1, $style); ?> /> Box Count</label></p>
+ <p><label for="<?php echo $this->get_field_id('style'); ?>"><input id="<?php echo $this->get_field_id('style'); ?>" name="<?php echo $this->get_field_name('style'); ?>" type="radio" value="2" <?php checked(2, $style); ?> /> Button Count</label></p>
+ <p><label for="<?php echo $this->get_field_id('style'); ?>"><input id="<?php echo $this->get_field_id('style'); ?>" name="<?php echo $this->get_field_name('style'); ?>" type="radio" value="3" <?php checked(3, $style); ?> /> Standard</label></p>
<?php
}
}
Please sign in to comment.
Something went wrong with that request. Please try again.