Permalink
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...
Philip M. Hofer (Frumph)
Philip M. Hofer (Frumph) committed Jan 4, 2011
1 parent 8359f0c commit 7e0115354e57fb87b323d3349cf2d01f2c343a4e
View
@@ -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
@@ -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
@@ -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
@@ -1,125 +1,117 @@
<?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))
$theCatID = $theCatID->term_id;
}
$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>
<div class="comicarchiveframe" style="width: <?php echo $mini_comic_width; ?>px;">
<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
@@ -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
@@ -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
@@ -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));
}
+
?>
@@ -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;
Oops, something went wrong.

0 comments on commit 7e01153

Please sign in to comment.