Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

fix facebook code, membersonly code rewrite of archive.php

rewrite of syndication.php

added new reference widget

Signed-off-by: Philip M. Hofer (Frumph) <frumph_dragon@yahoo.com>
  • Loading branch information...
commit 7e0115354e57fb87b323d3349cf2d01f2c343a4e 1 parent 8359f0c
Philip M. Hofer (Frumph) authored
View
4 404.php
@@ -1,9 +1,9 @@
<?php get_header(); ?>
-
+
<div class="post post-page post-404">
<div class="post-head"></div>
<div class="post-content">
- <h2 class="pagetitle"><?php _e('Page Not Found','comicpress'); ?></h2>
+ <h2 class="pagetitle"><?php _e('Page Not Found','comicpress'); ?></h2>
<p><a href="<?php echo home_url(); ?>"><?php _e('Click here to return to the home page','comicpress'); ?></a> <?php _e('or try a search:','comicpress'); ?></p>
<p><?php get_search_form(); ?></p>
</div>
View
2  addons/facebook.php
@@ -25,7 +25,7 @@ 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>';
+ $content .= '<span class="facebook-like"><fb:like layout="box_count" show_faces="false" width="255" href="'.get_permalink().'"></fb:like></span>';
}
}
return $content;
View
52 addons/membersonly.php
@@ -15,7 +15,9 @@
add_shortcode( 'member', 'shortcode_for_comicpress_members_only' );
add_action('show_user_profile', 'comicpress_profile_members_only');
add_action('edit_user_profile', 'comicpress_profile_members_only');
-add_action('profile_update', 'comicpress_profile_members_only_save');
+
+add_action( 'personal_options_update', 'comicpress_profile_members_only_save' );
+add_action( 'edit_user_profile_update', 'comicpress_profile_members_only_save' );
if (comicpress_themeinfo('members_post_category') && comicpress_themeinfo('disable_showing_members_category'))
add_filter('pre_get_posts','comicpress_members_filter');
@@ -58,18 +60,25 @@ function shortcode_for_comicpress_members_only( $atts, $content = null ) {
}
function comicpress_profile_members_only() {
- global $profileuser, $current_user, $errormsg;
+ global $profileuser, $errormsg;
$comicpress_is_member = get_user_meta($profileuser->ID,'comicpress-is-member', true);
if (empty($comicpress_is_member)) $comicpress_is_member = 0;
+ $current_site = get_current_site();
+ if (!isset($current_site->site_name)) {
+ $site_name = ucfirst( $current_site->domain );
+ } else {
+ $site_name = $current_site->site_name;
+ }
?>
- <h3><?php _e('Member of','comicpress'); ?> <?php bloginfo('name'); ?></h3>
+ <div style="border: solid 1px #aaa; background: #eee; padding: 0 10px 10px;">
+ <h3><?php _e('Member of','comicpress'); ?> <?php echo $site_name; ?></h3>
<table class="form-table">
<tr>
- <th><label for="Memberflag"><?php _e('Member?','comicpress'); ?></label></th>
- <td>
+ <th><label for="Memberflag"><?php _e('Member?','comicpress'); ?></label></th>
+ <td>
<?php
- if (current_user_can('manage_options')) { ?>
- <input id="comicpress-is-member" name="comicpress-is-member" type="checkbox" value="1" <?php checked(true, get_user_meta($profileuser->ID,'comicpress-is-member', true)); ?> />
+ if (current_user_can('edit_users') || is_super_admin()) { ?>
+ <input id="comicpress-is-member" name="comicpress-is-member" type="checkbox" value="1" <?php checked(true, $comicpress_is_member); ?> />
<?php } else {
if ($comicpress_is_member) {
echo 'Is Member';
@@ -78,16 +87,23 @@ function comicpress_profile_members_only() {
}
}
?>
- </td>
+ </td>
</tr>
</table>
+ </div>
+ <br />
+ <br />
<?php }
-function comicpress_profile_members_only_save() {
- $id = (int)$_POST['user_id'];
- $is_member = (int)$_POST['comicpress-is-member'];
- $comicpress_is_member = (bool)( $is_member == 1 ? 1 : 0 );
- update_user_meta($id, 'comicpress-is-member', $comicpress_is_member);
+function comicpress_profile_members_only_save($this_id) {
+ if (current_user_can('edit_users', $this_id)) {
+ if (isset($_POST['comicpress-is-member'])) {
+ $comicpress_is_member = (bool)($_POST['comicpress-is-member'] == 1 ? 1 : 0 );
+ } else {
+ $comicpress_is_member = 0;
+ }
+ update_user_meta($this_id, 'comicpress-is-member', $comicpress_is_member);
+ }
}
/**
@@ -105,14 +121,16 @@ function in_members_category() {
}
function comicpress_is_member() {
- global $user_ID;
- if (!empty($user_ID)) {
- $is_member = get_user_meta($user_ID,'comicpress-is-member', true);
+ if (is_super_admin()) return true;
+ $this_ID = get_current_user_id();
+ if (!empty($this_ID)) {
+ $is_member = get_user_meta($this_ID, 'comicpress-is-member', true);
+ if (empty($is_member)) $is_member = false;
if ($is_member || current_user_can('manage_options')) {
return true;
}
}
- return false;
+ return false;
}
function comicpress_members_comment_filter($content) {
View
148 archive.php
@@ -1,9 +1,8 @@
<?php
get_header();
-// Set them as empty for right now
+// set to empty
$order = $post_count = $theCatID = '';
-
if (is_category()) {
$theCatID = get_term_by( 'slug', $wp_query->query_vars['category_name'], 'category' );
if (!empty($theCatID))
@@ -11,67 +10,87 @@
}
$category_thumbnail_postcount = comicpress_themeinfo('category_thumbnail_postcount');
+$archive_display_order = comicpress_themeinfo('archive_display_order');
+if (empty($archive_display_order)) $archive_display_order = 'DESC';
+if (!empty($theCatID) && comicpress_in_comic_category($theCatID)) $is_comic = true;
-if (is_category() && (!empty($theCatID) && comicpress_in_comic_category($theCatID))) $is_comic = true;
+if ($is_comic && comicpress_themeinfo('display_archive_as_text_links')) $category_thumbnail_postcount = '-1';
-if ($is_comic && comicpress_themeinfo('display_comic_archive_as_text_links')) $category_thumbnail_postcount = '-1';
+$order = '&order='.$archive_display_order;
-$archive_display_order = comicpress_themeinfo('archive_display_order');
+if (comicpress_themeinfo('display_archive_as_links')) {
+ $post_count = '&showposts=-1&posts_per_page=-1';
+}
$order = '&order='.$archive_display_order;
if ($is_comic) $post_count = '&showposts='.$category_thumbnail_postcount.'&posts_per_page='.$category_thumbnail_postcount;
-// Get the total count no matter what type of archive
+Protect();
$tmp_search = new WP_Query($query_string.'&showposts=-1&posts_per_page=-1');
-$count = $tmp_search->post_count;
-if (!$count) $count = "no";
+if (isset($tmp_search->post_count)) {
+ $count = $tmp_search->post_count;
+} else {
+ $count = "No";
+}
+UnProtect();
$args = $query_string . $post_count . $order;
-
$posts = &query_posts($args);
-
+
if (have_posts()) :
+
+ $post = $posts[0]; // Hack. Set $post so that the_date() works
+ $post_title_type = $title_string = '';
+ if ($post->post_type !== 'post') $post_title_type = $post->post_type.'-'; // extra space at the end for visual
+ if (is_category()) { /* Category */
+ $title_string = __('Archive for &#8216;','comicpress').$post_title_type.single_cat_title('',false).__('&#8217;', 'comicpress');
+ } elseif(is_tag()) { /* Tag */
+ $title_string = __('Posts Tagged &#8216;','comicpress').$post_title_type.single_tag_title('',false).__('&#8217;', 'comicpress');
+ } elseif (is_day()) {
+ $title_string = __('Archive for &#8216;','comicpress').$post_title_type.get_the_time('F jS, Y').__('&#8217;', 'comicpress');
+ } elseif (is_month()) {
+ $title_string = __('Archive for &#8216;','comicpress').$post_title_type.get_the_time('F, Y').__('&#8217;', 'comicpress');
+ } elseif (is_year()) {
+ $title_string = __('Archive for &#8216;','comicpress').$post_title_type.get_the_time('Y').__('&#8217;', 'comicpress');
+ } elseif (is_author()) {
+ $title_string = __('Author Archive &#8216;','comicpress').$post_title_type.get_the_time('Y').__('&#8217;', 'comicpress');
+ } elseif (isset($_GET['paged']) && !empty($_GET['paged'])) {
+ $title_string = __('Archives','comicpress');
+ } elseif (taxonomy_exists($wp_query->query_vars['taxonomy'])) {
+ if (term_exists($wp_query->query_vars['term'])) {
+ $title_string = __('Archive for &#8216;','comicpress').$post_title_type.$wp_query->query_vars['term'].__('&#8217;', 'comicpress');
+ } else {
+ $title_string = __('Archive for &#8216;','comicpress').$post_title_type.$wp_query->query_vars['taxonomy'].__('&#8217;', 'comicpress');
+ }
+ } elseif ($post->post_type !== 'post') {
+ $title_string = __('Archive for &#8216;','comicpress').$post->post_type.__('&#8217;', 'comicpress');
+ } else {
+ $title_string = __('Archive is unable to be found.','comicpress');
+ }
?>
- <?php $post = $posts[0]; // Hack. Set $post so that the_date() works. ?>
- <?php /* Category Archive */ if (is_category()) { ?>
- <h2 class="pagetitle"><?php _e('Archive for &#8216;','comicpress'); ?><?php single_cat_title() ?>&#8217;</h2>
- <?php /* Tag Archive */ } elseif( is_tag() ) { ?>
- <h2 class="pagetitle"><?php _e('Posts Tagged &#8216;','comicpress'); ?><?php single_tag_title() ?>&#8217;</h2>
- <?php /* Daily Archive */ } elseif (is_day()) { ?>
- <h2 class="pagetitle"><?php _e('Archive for','comicpress'); ?> <?php the_time('F jS, Y') ?></h2>
- <?php /* Monthly Archive */ } elseif (is_month()) { ?>
- <h2 class="pagetitle"><?php _e('Archive for','comicpress'); ?> <?php the_time('F, Y') ?></h2>
- <?php /* Yearly Archive */ } elseif (is_year()) { ?>
- <h2 class="pagetitle"><?php _e('Archive for','comicpress'); ?> <?php the_time('Y') ?></h2>
- <?php /* Author Archive */ } elseif (is_author()) { ?>
- <h2 class="pagetitle"><?php _e('Author Archive','comicpress'); ?></h2>
- <?php /* Paged Archive */ } elseif (isset($_GET['paged']) && !empty($_GET['paged'])) { ?>
- <h2 class="pagetitle"><?php _e('Archives','comicpress'); ?></h2>
- <?php /* taxonomy */ } elseif (taxonomy_exists($wp_query->query_vars['taxonomy'])) {
- if (term_exists($wp_query->query_vars['term'])) { ?>
- <h2 class="pagetitle"><?php _e('Archive for','comicpress'); ?> <?php echo $wp_query->query_vars['taxonomy']; ?> - <?php echo $wp_query->query_vars['term']; ?></h2>
- <?php } else { ?>
- <h2 class="pagetitle"><?php _e('Archive for','comicpress'); ?> <?php echo $wp_query->query_vars['taxonomy']; ?></h2>
- <?php } ?>
- <?php /* Post Type */ } elseif ($post->post_type !== 'post') { ?>
- <h2 class="pagetitle"><?php echo $post->post_type; ?></h2>
- <?php } ?>
- <div class="searchresults"><?php printf(_n("%d item.", "%d items.", $count,'comicpress'),$count); ?></div>
+ <h2 class="page-title"><?php echo $title_string; ?></h2>
+ <div class="archiveresults"><?php printf(_n("%d result.", "%d results.", $count,'comicpress'),$count); ?></div>
<div class="clear"></div>
-
- <?php if (comicpress_themeinfo('archive_display_comic_thumbs_in_order') && !comicpress_themeinfo('display_comic_archive_as_text_links')) { ?>
- <?php if ($is_comic) { ?>
-
+ <?php
+ if (comicpress_themeinfo('display_archive_as_text_links') && !($is_comic && comicpress_themeinfo('archive_display_comic_thumbs_in_order'))) { ?>
+ <div <?php post_class(); ?>>
+ <div class="post-head"></div>
+ <div class="entry">
+ <table class="archive-table">
+ <?php while (have_posts()) : the_post(); ?>
+ <tr><td class="archive-date"><?php the_time('M d, Y') ?></td><td class="archive-title"><a href="<?php echo get_permalink($post->ID) ?>" rel="bookmark" title="<?php _e('Permanent Link:','comicpress'); ?> <?php the_title() ?>"><?php the_title() ?></a></td></tr>
+ <?php endwhile; ?>
+ </table>
+ </div>
+ <div class="post-foot"></div>
+ </div>
+ <?php } elseif (comicpress_themeinfo('archive_display_comic_thumbs_in_order') && ($is_comic)) { ?>
<div <?php post_class(); ?>>
<div class="post-head"></div>
<div class="post-content">
- <?php } ?>
-
- <?php while (have_posts()) : the_post();
-
- if ($is_comic) { ?>
+ <?php while (have_posts()) : the_post(); ?>
<div class="comicthumbwrap">
<?php global $mini_comic_width; ?>
<div class="comicthumbdate"><?php echo get_the_time('M jS, Y'); ?></div>
@@ -79,47 +98,20 @@
<a href="<?php the_permalink() ?>" title="<?php echo the_title(); ?>"><?php echo comicpress_display_comic_thumbnail('mini', $post, true); ?></a><br />
</div>
</div>
- <?php } else {
- comicpress_display_post();
- }
-
- endwhile;
-
- if ($is_comic) { ?>
+ <?php endwhile; ?>
<div class="clear"></div>
</div>
<div class="post-foot"></div>
</div>
-
- <?php }
- } else {
- if ($is_comic) { ?>
- <table class="month-table">
- <?php }
+ <?php } else {
while (have_posts()) : the_post();
- if ($is_comic) { ?>
- <tr><td class="archive-date"><?php the_time('M j') ?></td><td class="archive-title"><a href="<?php echo get_permalink($post->ID) ?>" rel="bookmark" title="<?php _e('Permanent Link:','comicpress'); ?> <?php the_title() ?>"><?php the_title() ?></a></td></tr>
- <?php } else {
- comicpress_display_post();
- }
+ comicpress_display_post();
endwhile;
- if ($is_comic) { ?>
- </table>
- <?php }
- }?>
+ }
+ ?>
<div class="clear"></div>
<?php comicpress_pagination(); ?>
- <?php else : ?>
- <div <?php post_class(); ?>>
- <div class="post-head"></div>
- <div class="post">
- <h3><?php _e('No entries found.','comicpress'); ?></h3>
- <p><?php _e('Try another search?','comicpress'); ?></p>
- <p><?php the_widget('WP_Widget_Search'); ?></p>
- </div>
- <div class="post-foot"></div>
- </div>
- <?php endif; ?>
+<?php endif; ?>
-<?php get_footer() ?>
+<?php get_footer(); ?>
View
8 changelog.txt
@@ -1,4 +1,10 @@
-2.9.2.28
+2.9.2.29
+revamped the syndication comic into the rss to allow for a filter that can be used to add info to the syndication
+added extra profile options for MSN, Twitter and Facebook fields - functions/profile-options.php
+total rewrite of archive.php - fixed bug with text-links for the archive.php
+added new widget "reference" documentation is inside the widget and will be on comicpress.net
+
+2.9.2.28
change the forum url to http://comicpress.net/forum/ bbpress wasnt working out, so switched to simple:press
added 2 new options on the comicpress-options post&pages tab, enable facebook like
added new widget, facebook like, that goes in any of the comic sidebars for better control where you might the like button to be
View
2  comicpress-admin.php
@@ -161,7 +161,7 @@ function comicpress_admin_options() {
'archive_display_comic_thumbs_in_order',
'template-comic-year-all-cats',
'archive_start_latest_year',
- 'display_comic_archive_as_text_links'
+ 'display_archive_as_text_links'
) as $key) {
if (!isset($_REQUEST[$key])) $_REQUEST[$key] = 0;
$comicpress_options[$key] = (bool)( $_REQUEST[$key] == 1 ? true : false );
View
5 functions.php
@@ -436,7 +436,7 @@ function comicpress_load_options() {
'excerpt_or_content_search' => 'excerpt',
'category_thumbnail_postcount' => '-1',
'archive_display_comic_thumbs_in_order' => false,
- 'display_comic_archive_as_text_links' => false,
+ 'display_archive_as_text_links' => false,
'members_post_category' => '',
@@ -497,7 +497,7 @@ function comicpress_themeinfo($whichinfo = null) {
$comicpress_coreinfo = wp_upload_dir();
$comicpress_addinfo = array(
'upload_path' => get_option('upload_path'),
- 'version' => '2.9.2.28',
+ 'version' => '2.9.2.29',
'siteurl' => trailingslashit(get_option('siteurl')),
'home' => trailingslashit(home_url()),
'comiccat' => $comiccat,
@@ -622,4 +622,5 @@ function comicpress_get_string_to_exclude_all_but_provided_categories($category)
return implode(" and ", array_diff($category_ids, $category));
}
+
?>
View
8 functions/displaycomic.php
@@ -366,8 +366,12 @@ function get_comic_path($folder = 'comic', $override_post = null, $filter = 'def
if (count($results = glob("${folder_to_use}/${filter_with_date}")) > 0) {
$newresults = array();
- foreach ($results as $result) {
- // Strip the base directory off.
+ if (is_array($results)) {
+ foreach ($results as $result) {
+ // Strip the base directory off.
+ $newresults[] = str_replace(comicpress_themeinfo('basedir'), '', $result);
+ }
+ } else {
$newresults[] = str_replace(comicpress_themeinfo('basedir'), '', $result);
}
return $newresults;
View
30 functions/profile-options.php
@@ -0,0 +1,30 @@
+<?php
+/**
+ * Profile Options
+ * by Philip M. Hofer (Frumph)
+ * http://frumph.net/
+ *
+ * Displays more profile options available to end users
+ *
+ *
+ */
+
+function easel_remove_unwanted_contactmethods( $contactmethods ) {
+ unset($contactmethods['aim']);
+ unset($contactmethods['jabber']);
+ unset($contactmethods['yim']);
+ return $contactmethods;
+}
+
+// add_filter('user_contactmethods','easel_remove_unwanted_contactmethods',10,1);
+
+
+function add_new_contactmethods($methods){
+ $methods['twitter'] = 'Twitter ID';
+ $methods['facebook'] = 'Facebook';
+ $methods['msn'] = 'MSN';
+ return $methods;
+}
+
+add_filter('user_contactmethods','add_new_contactmethods');
+
View
36 functions/syndication.php
@@ -37,11 +37,11 @@ function comicpress_export_wp() {
//Insert the comic image into the RSS feed
if (!function_exists('comicpress_comic_feed')) {
function comicpress_comic_feed() {
- global $post; ?>
- <p><a href="<?php the_permalink(); ?>"><?php echo comicpress_display_comic_thumbnail('rss',$post); ?></a></p>
- <?php if (comicpress_themeinfo('comic_rank_id')) { ?>
- <p><a href="http://comicrank.com/<?php echo comicpress_themeinfo('comic_rank_id'); ?>/in" target="_blank"><img src="http://view.comicrank.com/<?php echo comicpress_themeinfo('comic_rank_id'); ?>/1.png" alt="Comic Rank" title="Comic Rank - Webcomic toplist" style="border:none 0px;" /></a></p>
- <?php }
+ global $post;
+ $output = '<p>';
+ $output .= '<a href="'.get_permalink().'" title="'.comicpress_the_hovertext($post).'">'.comicpress_display_comic_thumbnail('rss',$post).'</a>';
+ $output .= '</p>';
+ return apply_filters('comicpress_comic_feed', $output);
}
}
@@ -49,11 +49,11 @@ function comicpress_comic_feed() {
if (!function_exists('comicpress_insert_comic_feed')) {
function comicpress_insert_comic_feed($content) {
global $wp_query, $post;
- if (is_feed() && comicpress_in_comic_category()) {
- return comicpress_comic_feed() . $content;
- } else {
- return $content;
+ $category = get_the_category($post->ID);
+ if (is_feed() && comicpress_in_comic_category($category[0]->cat_ID)) {
+ echo comicpress_comic_feed();
}
+ return apply_filters('comicpress_insert_comic_feed', $content);
}
}
@@ -61,5 +61,23 @@ function comicpress_insert_comic_feed($content) {
add_filter('the_excerpt','comicpress_insert_comic_feed');
// Using the_content and the_excerpt instead of the_content_rss cause it doesn't work properly otherwise
+/*
+add_filter('comicpress_comic_feed', 'comicpress_test_feed');
+
+function comicpress_test_feed($output) {
+ $output .= '<table width="500" style="border: none;" cellpadding="0" cellpadding="0">';
+ $output .= '<tr>';
+ $output .= '<td style="border: none;"><img src="http://www.zfcomics.com/graphics/footer/top.jpg" alt="" style="width: 500px; height:72px; border: none;" /></td>';
+ $output .= '</tr>';
+ $output .= '<tr>';
+ $output .= '<td><img src="http://www.zfcomics.com/graphics/footer/1.jpg" alt="" style="height:39px; width:25px; border: none;" /><a href="http://www.zfcomics.com"><img src="http://www.zfcomics.com/graphics/footer/read.jpg" alt="" height="39" width="113" padding="0" border="0" /></a><a href="http://www.zfcomics.com/store"><img src="http://www.zfcomics.com/graphics/footer/store.jpg" alt="" width="57" height="39" padding="0" border="0" /></a><a href="http://www.facebook.com/dgriff13"><img src="http://www.zfcomics.com/graphics/footer/fb.jpg" alt="" width="85" height="39" padding="0" border="0" /></a><a href="http://www.twitter.com/dgriff13"><img src="http://www.zfcomics.com/graphics/footer/twitter.jpg" alt="" width="67" height="39"padding="0" border="0" /></a><img src="http://www.zfcomics.com/graphics/footer/2.jpg" alt="" width="61" height="39" padding="0" border="0" /><a href="http://www.facebook.com/dgriff13"><img src="http://www.zfcomics.com/graphics/footer/FBicon.jpg" alt="" width="36" height="39" padding="0" border="0" /></a><a href="http://www.twitter.com/dgriff13"><img src="http://www.zfcomics.com/graphics/footer/twittericon.jpg" alt="" width="37" height="39" padding="0" border="0" /></a><img src="http://www.zfcomics.com/graphics/footer/3.jpg" alt="" style="width: 18px; height:39px; border: none;" /></td>';
+ $output .= '</tr>';
+ $output .= '<tr>';
+ $output .= '<td><img src="http://www.zfcomics.com/graphics/footer/4.jpg" alt="" width="280" height="156" padding="0" border="0" /><a href="http://www.zfcomics.com/store"><img src="http://www.zfcomics.com/graphics/footer/book.jpg" alt="" width="220" height="156" padding="0" border="0" /></a></td>';
+ $output .= '</tr>';
+ $output .= '</table>';
+ return $output;
+}
+*/
?>
View
BIN  images/ref/rascal.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View
4 options/archivesearchoptions.php
@@ -68,9 +68,9 @@
</td>
</tr>
<tr>
- <th scope="row"><label for="display_comic_archive_as_text_links"><?php _e('Archive Text Links instead of Images','comicpress'); ?></label></th>
+ <th scope="row"><label for="display_archive_as_text_links"><?php _e('Archive Text Links instead of Images','comicpress'); ?></label></th>
<td>
- <input id="display_comic_archive_as_text_links" name="display_comic_archive_as_text_links" type="checkbox" value="1" <?php checked(true, comicpress_themeinfo('display_comic_archive_as_text_links')); ?> />
+ <input id="display_archive_as_text_links" name="display_archive_as_text_links" type="checkbox" value="1" <?php checked(true, comicpress_themeinfo('display_archive_as_text_links')); ?> />
</td>
<td>
<?php _e('If this is set, it disables the above mini thumbs and just displays text links in the set order.','comicpress'); ?>
View
29 style.css
@@ -6,7 +6,7 @@ Description: Publish a comic with WordPress. Visit the ComicPress Website (<a hr
Author: Philip M. Hofer
Author URI: http://frumph.net
Tags: White, Two-Columns, Three-Columns, left-sidebar, right-sidebar, fixed-width, custom-header, theme-options, threaded-comments, sticky-post, translation-ready
-Version: 2.9.2.28
+Version: 2.9.2.29
License: GNU General Public License, v3 (or newer)
License URI: http://www.opensource.org/licenses/gpl-3.0.html
.
@@ -1041,7 +1041,7 @@ table#wp-calendar td {
height: 14px;
}
-.searchresults {
+.searchresults, .archiveresults {
padding: 0 0 30px 10px;
font-style: italic;
}
@@ -1665,9 +1665,24 @@ textarea {
overflow: hidden;
}
-.facebook_like {
- float:right;
- width: 55px;
- height: 60px;
- text-align: center;
+.facebook_like, .facebook-like {
+ display: inline-block;
+}
+
+.refimage {
+ height: 64px;
+ width: 64px;
+ display: inline-block;
+ float: left;
+ margin-right: 3px;
+}
+
+.reftext {
+ font-size: 11px;
}
+
+.refname {
+ text-transform: capitalize;
+ font-weight: 700;
+ font-size: 14px;
+}
View
2  widgets/classicmenubar.php
@@ -78,7 +78,7 @@ function comicpress_classic_menubar() {
$listpages .= $menulinks;
?>
<ul id="menu">
- <li class="page_item page-item-home<?php if (is_home()) { ?> current_page_item<?php } ?>"><a href="<?php echo home_url(); ?>">Home</a></li>
+ <li class="<?php if (is_home()) { ?>current_page_item <?php } ?>page_item page-item-home"><a href="<?php echo home_url(); ?>">Home</a></li>
<?php echo $listpages; ?>
<?php if ($comicpress_options['contact_in_menubar']) { ?>
<li class="page_item page-item-contact"><a href="mailto:<?php bloginfo('admin_email'); ?>">Contact</a></li>
View
118 widgets/reference.php
@@ -0,0 +1,118 @@
+<?php
+/*
+Widget Name: References
+Widget URI: http://comicpress.net/
+Description: If .png image found in images/ref/
+Author: Philip M. Hofer (Frumph)
+Version: 1.00
+
+Installation Instructions:
+
+This widget goes into your child-theme's wp-content/themes/comicpress-<childthemename>/widgets/ directory,
+copy this reference.php into there.
+
+This is the CSS I use, copy it into your style.css of your child-theme.
+
+.refimage {
+ height: 64px;
+ width: 64px;
+ display: inline-block;
+ float: left;
+ margin-right: 3px;
+}
+
+.reftext {
+ font-size: 11px;
+}
+
+.refname {
+ text-transform: capitalize;
+ font-weight: 700;
+ font-size: 14px;
+}
+
+When you add tags to your post, go to the wp-admin -> post -> post tags area, edit the tag and add a description,
+thats what is used to find the reference, if it's empty it wont be used as a reference
+
+In your child themes images directory, create a directory called "ref" and add an image for the reference into it, its
+based on the slug of your tag you created. So the tag "Rascal" with slug "rascal" will use rascal as the image name,
+and I decided to use .png, so it would be rascal.png which is used to find the image.
+
+*/
+class comicpress_reference_widget extends WP_Widget {
+
+ function comicpress_reference_widget($skip_widget_init = false) {
+ if (!$skip_widget_init) {
+ $widget_ops = array('classname' => __CLASS__, 'description' => __('Display a reference on tags (if image found in dir. based on tag name)','comicpress') );
+ $this->WP_Widget(__CLASS__, __('Reference','comicpress'), $widget_ops);
+ }
+ }
+/*
+function ceo_display_comic_locations() {
+ global $post;
+ if ($post->post_type == 'comic') {
+ $before = '<div class="comic-locations">Location: ';
+ $sep = ', ';
+ $after = '</div>';
+ $output = get_the_term_list( $post->ID, 'locations', $before, $sep, $after );
+ echo apply_filters('ceo_display_comic_locations', $output);
+ }
+}
+*/
+
+ function widget($args, $instance) {
+ global $post, $wp_query;
+ Protect();
+ extract($args, EXTR_SKIP);
+ echo $before_widget;
+ $title = empty($instance['title']) ? __('Reference','comicpress') : apply_filters('widget_title', $instance['title']);
+ if ( !empty( $title ) ) { echo $before_title . $title . $after_title; };
+ $tags_list = get_the_terms($post->ID, 'post_tag');
+ if (!empty($tags_list)) {
+ foreach ($tags_list as $tagname) {
+ if (!empty($tagname->description)) { ?>
+ <div class="refwrap">
+ <?php if (file_exists(get_stylesheet_directory().'/images/ref/'.$tagname->slug.'.png')) {
+ $image_file = trailingslashit(get_stylesheet_directory_uri()).'images/ref/'.$tagname->slug.'.png'; ?>
+ <div class="refimage refimage-<?php echo $tagname->slug; ?>">
+ <img src="<?php echo $image_file; ?>" alt="<?php echo $tagname->slug; ?>" />
+ </div>
+ <?php } ?>
+ <div class="reftext reftext-<?php echo $tagname->slug; ?>">
+ <div class="refname refname-<?php echo $tagname-slug; ?>"><?php echo $tagname->name; ?></div>
+ <?php if (!empty($tagname->description)) echo $tagname->description; ?>
+ <div class="clear"></div>
+ </div>
+ <div class="clear"></div>
+ </div>
+ <?php }
+ }
+ if (!empty($instance['info'])) { ?>
+ <div class="refinfo"><?php echo $instance['info']; ?></div>
+ <?php }
+ }
+ echo $after_widget;
+ UnProtect();
+ }
+
+ function update($new_instance, $old_instance) {
+ $instance = $old_instance;
+ $instance['title'] = strip_tags($new_instance['title']);
+ $instance['info'] = strip_tags($new_instance['info']);
+ return $instance;
+ }
+
+ function form($instance) {
+ $instance = wp_parse_args( (array) $instance, array( 'title' => '', 'info' => '' ) );
+ $title = strip_tags($instance['title']);
+ $info = strip_tags($instance['info']);
+ ?>
+ <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('info'); ?>"><?php _e('Bottom Information:','comicpress'); ?><br /><input class="widefat" id="<?php echo $this->get_field_id('info'); ?>" name="<?php echo $this->get_field_name('info'); ?>" type="text" value="<?php echo esc_attr($info); ?>" /></label></p>
+ <?php
+ }
+}
+
+register_widget('comicpress_reference_widget');
+
+?>
Please sign in to comment.
Something went wrong with that request. Please try again.