2.8.1.2
Signed-off-by: Philip M. Hofer (Frumph) <frumph_dragon@yahoo.com>
This commit is contained in:
parent
caa0c1f19f
commit
826fa2d48c
13
404.php
13
404.php
|
@ -1,5 +1,9 @@
|
|||
<?php get_header(); ?>
|
||||
|
||||
<?php if (is_cp_theme_style('gn,v3c,v')) { ?>
|
||||
<div id="content-wrapper">
|
||||
<?php } ?>
|
||||
|
||||
<?php if (is_cp_theme_style('gn,v3c')) get_sidebar('left'); ?>
|
||||
|
||||
<?php if (is_cp_theme_style('v3c,v')) { ?>
|
||||
|
@ -7,9 +11,9 @@
|
|||
<div class="column">
|
||||
<?php } ?>
|
||||
|
||||
<?php if (is_cp_theme_style('gn')) { ?>
|
||||
<div id="pagewrap-right">
|
||||
<?php } ?>
|
||||
<?php if (is_cp_theme_style('gn')) { ?>
|
||||
<div id="pagewrap-right">
|
||||
<?php } ?>
|
||||
|
||||
<?php if (is_cp_theme_style('3c,standard')) { ?>
|
||||
<div id="content-wrapper">
|
||||
|
@ -30,9 +34,8 @@
|
|||
<br class="clear-margins" />
|
||||
</div>
|
||||
<div class="post-page-foot"></div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="clear"></div>
|
||||
</div>
|
||||
|
||||
<?php
|
||||
if (is_cp_theme_style('3c,v3c,gn,standard,v')) {
|
||||
|
|
|
@ -8,7 +8,7 @@
|
|||
<?php } ?>
|
||||
<?php get_sidebar('footer'); ?>
|
||||
<p>
|
||||
<?php global $wpmu_version; if (empty($wpmu_version)) { ?>©<?php echo cp_copyright_year(); ?> <?php echo the_author_meta('firstname',1); echo " "; echo the_author_meta('lastname',1); ?> | <?php } ?><?php bloginfo('name') ?> is powered by <a href="http://wordpress.org/">WordPress</a> with <a href="http://comicpress.org/">ComicPress</a>
|
||||
<?php echo cp_copyright_year(); ?> | Powered by <a href="http://wordpress.org/">WordPress</a> with <a href="http://comicpress.org/">ComicPress</a>
|
||||
| Subscribe: <a href="<?php bloginfo('rss2_url') ?>">RSS Feed</a> | <a href="#outside" onclick="scrollup(); return false;">Back to Top ↑</a><br />
|
||||
<!-- <?php echo get_num_queries() ?> queries. <?php timer_stop(1) ?> seconds. -->
|
||||
</p>
|
||||
|
|
104
functions.php
104
functions.php
|
@ -5,7 +5,7 @@ if (function_exists('id_get_comment_number')) {
|
|||
remove_filter('comments_number','id_get_comment_number');
|
||||
}
|
||||
|
||||
$comicpress_version = '2.8.1.1';
|
||||
$comicpress_version = '2.8.1.2';
|
||||
|
||||
// Remove the wptexturizer from changing the quotes and squotes.
|
||||
// remove_filter('the_title', 'wptexturize');
|
||||
|
@ -39,7 +39,6 @@ if (!empty($wpmu_version)) {
|
|||
require_once(get_template_directory() . '/comicpress-config.php');
|
||||
}
|
||||
|
||||
|
||||
if (get_option('upload_path') !== false) {
|
||||
$variables_to_extract = array();
|
||||
|
||||
|
@ -108,61 +107,29 @@ global $cp_theme_style;
|
|||
}
|
||||
|
||||
// WIDGETS WP 2.8 compatible ONLY, no backwards compatibility here.
|
||||
|
||||
require_once(get_template_directory() . '/widgets/control-panel.php');
|
||||
require_once(get_template_directory() . '/widgets/graphical-navigation.php');
|
||||
require_once(get_template_directory() . '/widgets/buythisprint.php');
|
||||
require_once(get_template_directory() . '/widgets/bookmark.php');
|
||||
require_once(get_template_directory() . '/widgets/transcription.php');
|
||||
require_once(get_template_directory() . '/widgets/latestthumb.php');
|
||||
require_once(get_template_directory() . '/widgets/latestcomics.php');
|
||||
require_once(get_template_directory() . '/widgets/scheduledposts.php');
|
||||
require_once(get_template_directory() . '/widgets/calendar.php');
|
||||
require_once(get_template_directory() . '/widgets/randomcomic.php');
|
||||
require_once(get_template_directory() . '/widgets/randompost.php');
|
||||
require_once(get_template_directory() . '/widgets/searchtranscript.php');
|
||||
require_once(get_template_directory() . '/widgets/latestcomicjump.php');
|
||||
require_once(get_template_directory() . '/widgets/permalink.php');
|
||||
require_once(get_template_directory() . '/widgets/comicdate.php');
|
||||
require_once(get_template_directory() . '/widgets/comictitle.php');
|
||||
require_once(get_template_directory() . '/widgets/comiccomments.php');
|
||||
require_once(get_template_directory() . '/widgets/menubar.php');
|
||||
require_once(get_template_directory() . '/widgets/archive-dropdown.php');
|
||||
require_once(get_template_directory() . '/widgets/comicblogpost.php');
|
||||
foreach (glob(dirname(__FILE__) . '/widgets/*.php') as $__file) { require_once($__file); }
|
||||
|
||||
// FUNCTIONS & Extra's
|
||||
foreach (glob(dirname(__FILE__) . '/functions/*.php') as $__file) { require_once($__file); }
|
||||
|
||||
require_once(get_template_directory() . '/functions/displaycomic.php');
|
||||
require_once(get_template_directory() . '/functions/displaycomicpost.php');
|
||||
require_once(get_template_directory() . '/functions/displayblogpost.php');
|
||||
require_once(get_template_directory() . '/functions/pagination.php');
|
||||
require_once(get_template_directory() . '/functions/adminnotes.php');
|
||||
require_once(get_template_directory() . '/functions/checkbrowser.php');
|
||||
require_once(get_template_directory() . '/functions/searchcustomfields.php');
|
||||
require_once(get_template_directory() . '/functions/multicomics.php');
|
||||
require_once(get_template_directory() . '/functions/rawformatting.php');
|
||||
require_once(get_template_directory() . '/functions/relatedposts.php');
|
||||
require_once(get_template_directory() . '/functions/relatedcomics.php');
|
||||
require_once(get_template_directory() . '/functions/membersonly.php');
|
||||
require_once(get_template_directory() . '/functions/syndication.php');
|
||||
require_once(get_template_directory() . '/functions/moods.php');
|
||||
// These are in the options directory because they have toggles in the options configuration and do not get loaded
|
||||
// unless they are needed.
|
||||
|
||||
if ($enable_numbered_pagination == 'yes') {
|
||||
require_once(get_template_directory() . '/functions/wp-pagenavi.php');
|
||||
require_once(get_template_directory() . '/options/wp-pagenavi.php');
|
||||
}
|
||||
|
||||
if ($disable_extended_comments == 'no') {
|
||||
require_once(get_template_directory() . '/functions/comment-functions.php');
|
||||
if ($disable_extended_comments != 'yes') {
|
||||
require_once(get_template_directory() . '/options/comment-functions.php');
|
||||
}
|
||||
|
||||
if ($enable_custom_image_header == 'yes') {
|
||||
require_once(get_template_directory() . '/options/custom-image-header.php');
|
||||
}
|
||||
|
||||
// Dashboard Menu Comicpress Options and ComicPress CSS
|
||||
|
||||
require_once(get_template_directory() . '/comicpress-options.php');
|
||||
|
||||
if ($enable_custom_image_header == 'yes') {
|
||||
require_once(get_template_directory() . '/functions/custom-image-header.php');
|
||||
}
|
||||
|
||||
// If any errors occur while searching for a comic file, the error messages will be pushed into here.
|
||||
$comic_pathfinding_errors = array();
|
||||
|
||||
|
@ -751,16 +718,45 @@ function comicpress_is_active_sidebar( $name ) {
|
|||
return false;
|
||||
}
|
||||
|
||||
function cp_copyright_year() {
|
||||
$latest_comic = get_terminal_post_in_category('',true);
|
||||
$archive_year = get_post_time('Y', false, $latest_comic, true);
|
||||
$current_year = date('Y');
|
||||
if ($archive_year == $current_year) {
|
||||
$return_year = $current_year;
|
||||
} else {
|
||||
$return_year = $archive_year . '-' . $current_year;
|
||||
function copyrightDate() {
|
||||
global $wpdb;
|
||||
$copyright_dates = $wpdb->get_results("
|
||||
SELECT
|
||||
YEAR(min(post_date_gmt)) AS firstdate,
|
||||
YEAR(max(post_date_gmt)) AS lastdate
|
||||
FROM
|
||||
$wpdb->posts
|
||||
");
|
||||
if($copyright_dates) {
|
||||
$copyright = "© " . $copyright_dates[0]->firstdate;
|
||||
if($copyright_dates[0]->firstdate != $copyright_dates[0]->lastdate) {
|
||||
$copyright .= '-' . $copyright_dates[0]->lastdate;
|
||||
}
|
||||
echo $copyright . " " . get_bloginfo('name');
|
||||
}
|
||||
return $return_year;
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
|
||||
function cp_copyright_year() {
|
||||
global $wpdb;
|
||||
$copyright_dates = $wpdb->get_results("
|
||||
SELECT
|
||||
YEAR(min(post_date_gmt)) AS firstdate,
|
||||
YEAR(max(post_date_gmt)) AS lastdate
|
||||
FROM
|
||||
$wpdb->posts
|
||||
");
|
||||
$output = '';
|
||||
if($copyright_dates) {
|
||||
$copyright = "© " . $copyright_dates[0]->firstdate;
|
||||
if($copyright_dates[0]->firstdate != $copyright_dates[0]->lastdate) {
|
||||
$copyright .= '-' . $copyright_dates[0]->lastdate;
|
||||
}
|
||||
$output = $copyright . " " . get_bloginfo('name');
|
||||
}
|
||||
return $output;
|
||||
}
|
||||
|
||||
?>
|
|
@ -9,7 +9,7 @@
|
|||
*/
|
||||
function display_comics_multi() {
|
||||
global $post;
|
||||
if (($result = get_comic_path($folder, $override_post, $filter, 1)) !== false) {
|
||||
if (($result = get_comic_path('comic', '', '', 1)) !== false) {
|
||||
foreach ($result as $pathto_comic) { ?>
|
||||
<div class="comicdisp">
|
||||
<img src="<?php echo get_option('home'). '/' .$pathto_comic; ?>" alt="<?php the_title(); ?>" title="<?php the_hovertext(); ?>" />
|
||||
|
@ -17,7 +17,7 @@ function display_comics_multi() {
|
|||
<?php }
|
||||
} else {
|
||||
if (($folder == 'archive' || $folder == 'rss')) {
|
||||
if (($result = get_comic_path('comic', $override_post, $filter, 1)) !== false) {
|
||||
if (($result = get_comic_path('comic', '', '', 1)) !== false) {
|
||||
foreach ($result as $pathto_comic) { ?>
|
||||
<div class="comicdisp">
|
||||
<img src="<?php echo get_option('home'). '/' .$pathto_comic; ?>" alt="<?php the_title(); ?>" title="<?php the_hovertext(); ?>" />
|
||||
|
|
|
@ -1,59 +0,0 @@
|
|||
<?php
|
||||
/**
|
||||
* Syndication - Feed Count Capturing & adding comic to feed.
|
||||
* Author: Philip M. Hofer (Frumph)
|
||||
*
|
||||
*/
|
||||
/*
|
||||
|
||||
function cp_add_to_feed_count_rss() {
|
||||
$feedcount = get_option('comicpress_feed_count_rss');
|
||||
if (!empty($feedcount)) {
|
||||
$feedcount = $feedcount + 1;
|
||||
update_option('comicpress_feed_count_rss', $feedcount);
|
||||
} else {
|
||||
add_option('comicpress_feed_count_rss', 1, ' ', 'yes');
|
||||
}
|
||||
}
|
||||
|
||||
add_action('do_feed_rss', 'cp_add_to_feed_count_rss',5);
|
||||
|
||||
|
||||
function cp_add_to_feed_count_rdf() {
|
||||
$feedcount = get_option('comicpress_feed_count_rdf');
|
||||
if (!empty($feedcount)) {
|
||||
$feedcount = $feedcount + 1;
|
||||
update_option('comicpress_feed_count_rdf', $feedcount);
|
||||
} else {
|
||||
add_option('comicpress_feed_count_rdf', 1, ' ', 'yes');
|
||||
}
|
||||
}
|
||||
|
||||
add_action('do_feed_rdf', 'cp_add_to_feed_count_rdf',5);
|
||||
|
||||
|
||||
function cp_add_to_feed_count_atom() {
|
||||
$feedcount = get_option('comicpress_feed_count_atom');
|
||||
if (!empty($feedcount)) {
|
||||
$feedcount = $feedcount + 1;
|
||||
update_option('comicpress_feed_count_atom', $feedcount);
|
||||
} else {
|
||||
add_option('comicpress_feed_count_atom', 1, ' ', 'yes');
|
||||
}
|
||||
}
|
||||
|
||||
add_action('do_feed_atom', 'cp_add_to_feed_count_atom',5);
|
||||
|
||||
function cp_add_to_feed_count_rss2() {
|
||||
$feedcount = get_option('comicpress_feed_count_rss2');
|
||||
if (!empty($feedcount)) {
|
||||
$feedcount = $feedcount + 1;
|
||||
update_option('comicpress_feed_count_rss2', $feedcount);
|
||||
} else {
|
||||
add_option('comicpress_feed_count_rss2', 1, ' ', 'yes');
|
||||
}
|
||||
}
|
||||
|
||||
add_action('do_feed_rss2', 'cp_add_to_feed_count_rss2',5);
|
||||
*/
|
||||
?>
|
|
@ -0,0 +1,20 @@
|
|||
// JavaScript Document
|
||||
|
||||
$j("pre").hover(function() {
|
||||
var codeInnerWidth = $j("code", this).width() + 10;
|
||||
if (codeInnerWidth > 550) {
|
||||
$j(this)
|
||||
.stop(true, false)
|
||||
.css({
|
||||
zIndex: "100",
|
||||
position: "relative"
|
||||
})
|
||||
.animate({
|
||||
width: codeInnerWidth + "px"
|
||||
});
|
||||
}
|
||||
}, function() {
|
||||
$j(this).stop(true, false).animate({
|
||||
width: 550
|
||||
});
|
||||
});
|
|
@ -0,0 +1,232 @@
|
|||
<?php
|
||||
|
||||
/**
|
||||
* Better display of avatars in comments
|
||||
* Should only be used in comment sections (may update in future)
|
||||
* Checks for false empty commenter URLs 'http://' w/registered users
|
||||
* Adds the class 'photo' to the image
|
||||
* Adds a call to 'images/trackback.jpg' for trackbacks
|
||||
* Adds a call to 'images/pingback.jpg' for pingbacks
|
||||
*
|
||||
* Filters should only return a string for an image URL for the avatar with class $avatar
|
||||
* They should not get the avatar as this is done after the filter
|
||||
*
|
||||
* @since 0.2
|
||||
* @filter
|
||||
*/
|
||||
function comicpress_avatar() {
|
||||
global $comment;
|
||||
|
||||
$url = get_comment_author_url();
|
||||
|
||||
$comment_type = get_comment_type();
|
||||
|
||||
if($comment_type == 'trackback') :
|
||||
$avatar = '/images/trackback.png';
|
||||
|
||||
elseif($comment_type == 'pingback') :
|
||||
$avatar = '/images/pingback.png';
|
||||
|
||||
elseif(get_settings('avatar_default')):
|
||||
$avatar = get_settings('avatar_default');
|
||||
|
||||
endif;
|
||||
|
||||
// $avatar = apply_filters('comicpress_avatar', $avatar);
|
||||
if($url == true && $url != 'http://')
|
||||
echo '<a href="' . $url . '" rel="external nofollow" title="' . wp_specialchars(get_comment_author(), 1) . '">';
|
||||
|
||||
if(function_exists('get_avatar') && $comment_type != 'pingback' && $comment_type != 'trackback' ) {
|
||||
echo str_replace("alt='", "alt='".wp_specialchars(get_comment_author(), 1)."' title='".wp_specialchars(get_comment_author(), 1), get_avatar(get_comment_author_email(), 64));
|
||||
} else {
|
||||
if ($comment_type == 'pingback' || $comment_type == 'trackback') {
|
||||
echo '<img src="'.get_bloginfo('stylesheet_directory').$avatar.'" class="photo trackping" />';
|
||||
} else {
|
||||
echo '<img src="'.get_bloginfo('stylesheet_directory').$avatar.'" class="avatar photo" />';
|
||||
}
|
||||
}
|
||||
|
||||
if($url == true && $url != 'http://')
|
||||
echo '</a>';
|
||||
}
|
||||
|
||||
/**
|
||||
* 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;
|
||||
|
||||
$author = get_comment_author();
|
||||
$url = get_comment_author_url();
|
||||
|
||||
/*
|
||||
* Registered members w/o URL defaults to 'http://'
|
||||
*/
|
||||
if($url == 'http://')
|
||||
$url = false;
|
||||
|
||||
/*
|
||||
* Registered through bbPress sometimes leaves no display name
|
||||
* Bug with bbPress 0.9 series and WP 2.5 (no later testing)
|
||||
* 'Anonymous' should be localized according to WP, not the theme
|
||||
*/
|
||||
if($comment->user_id > 0) :
|
||||
$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) :
|
||||
$output = '<cite title="' . $url . '">';
|
||||
$output .= '<a href="' . $url . '" title="' . wp_specialchars($author, 1) . '" class="external nofollow">' . $author . '</a>';
|
||||
$output .= '</cite>';
|
||||
else :
|
||||
$output = '<cite>';
|
||||
$output .= $author;
|
||||
$output .= '</cite>';
|
||||
endif;
|
||||
|
||||
echo $output;
|
||||
}
|
||||
|
||||
/**
|
||||
* 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;
|
||||
?>
|
||||
|
||||
<li id="comment-<?php comment_ID(); ?>" class="<?php comicpress_comment_class(); ?>">
|
||||
|
||||
<?php comicpress_avatar(); // Avatar filter ?>
|
||||
|
||||
<div class="comment-meta-data">
|
||||
|
||||
<div class="comment-author vcard">
|
||||
<?php comicpress_comment_author(); ?><br />
|
||||
</div>
|
||||
|
||||
<span class="comment-time" title="<?php comment_date(__('l, F jS, Y, g:i a','comicpress')); ?>">
|
||||
<?php printf(__('%1$s at %2$s','comicpress'), get_comment_date(), get_comment_time()); ?>
|
||||
</span>
|
||||
|
||||
<span class="separator">|</span> <a class="permalink" href="#comment-<?php echo str_replace('&', '&', get_comment_ID()); ?>" title="<?php _e('Permalink to comment','comicpress'); ?>"><?php _e('Permalink','comicpress'); ?></a>
|
||||
|
||||
<?php
|
||||
if((get_option('thread_comments')) && ($args['type'] == 'all' || get_comment_type() == 'comment')) :
|
||||
$max_depth = get_option('thread_comments_depth');
|
||||
echo comment_reply_link(array(
|
||||
'reply_text' => __('Reply','comicpress'),
|
||||
'login_text' => __('Log in to reply.','comicpress'),
|
||||
'depth' => $depth,
|
||||
'max_depth' => $max_depth,
|
||||
'before' => '<span class="separator">|</span> <span class="comment-reply-link">',
|
||||
'after' => '</span>'
|
||||
));
|
||||
endif;
|
||||
?>
|
||||
<?php edit_comment_link('<span class="edit">'.__('Edit','comicpress').'</span>',' <span class="separator">|</span> ',''); ?>
|
||||
|
||||
<?php if($comment->comment_approved == '0') : ?>
|
||||
<br /><em><?php _e('Your comment is awaiting moderation.','comicpress'); ?></em>
|
||||
<?php endif; ?>
|
||||
|
||||
</div>
|
||||
|
||||
<?php if (get_comment_type() == 'comment') { ?>
|
||||
<div class="comment-text">
|
||||
<?php comment_text(); ?>
|
||||
</div>
|
||||
<?php } else { ?>
|
||||
<div class="clear"></div>
|
||||
<?php }
|
||||
}
|
||||
|
||||
/**
|
||||
* Ends the display of individual comments
|
||||
* Uses the callback parameter for wp_list_comments
|
||||
* Needs to be used in conjunction with comicpress_comments_callback
|
||||
* Not needed but used just in case something is changed
|
||||
*
|
||||
* @since 0.2.3
|
||||
*/
|
||||
function comicpress_comments_end_callback() {
|
||||
echo '</li>';
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets a class for each comment
|
||||
* Sets alt, odd/even, and author/user classes
|
||||
* Adds author, user, and reader classes
|
||||
*
|
||||
* @since 0.2
|
||||
*/
|
||||
function comicpress_comment_class() {
|
||||
global $comment;
|
||||
static $comment_alt;
|
||||
$classes = array();
|
||||
|
||||
if(function_exists('get_comment_class'))
|
||||
$classes = get_comment_class();
|
||||
|
||||
$classes[] = get_comment_type();;
|
||||
|
||||
/*
|
||||
* User classes
|
||||
*/
|
||||
if($comment->user_id > 0 && $user = get_userdata($comment->user_id)) :
|
||||
|
||||
$classes[] = 'user user-' . $user->user_nicename;
|
||||
|
||||
if($post = get_post($post_id)) :
|
||||
if($comment->user_id === $post->post_author)
|
||||
$classes[] = 'author author-' . $user->user_nicename;
|
||||
endif;
|
||||
else :
|
||||
$classes[] = 'reader';
|
||||
endif;
|
||||
|
||||
/*
|
||||
* 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));
|
||||
$classes[] = $microid;
|
||||
}
|
||||
$classes = join(' ', $classes);
|
||||
echo $classes;
|
||||
}
|
||||
|
||||
function list_pings($comment, $args, $depth) {
|
||||
$GLOBALS['comment'] = $comment; ?>
|
||||
<li id="comment-<?php comment_ID(); ?>">
|
||||
<?php comicpress_comment_author(); ?></li>
|
||||
<?php }
|
||||
|
||||
?>
|
|
@ -0,0 +1,68 @@
|
|||
<?php
|
||||
|
||||
// Custom Image Header
|
||||
define('HEADER_TEXTCOLOR', '000');
|
||||
define('HEADER_IMAGE', '%s/images/header-blank.png'); // %s is theme dir
|
||||
define('HEADER_IMAGE_WIDTH', $custom_image_header_width);
|
||||
define('HEADER_IMAGE_HEIGHT', $custom_image_header_height);
|
||||
|
||||
function theme_admin_header_style() {
|
||||
?>
|
||||
<style type="text/css">
|
||||
#headimg {
|
||||
width: <?php echo HEADER_IMAGE_WIDTH; ?>px;
|
||||
height: <?php echo HEADER_IMAGE_HEIGHT; ?>px;
|
||||
background: url(<?php header_image(); ?>) no-repeat center;
|
||||
}
|
||||
|
||||
#headimg h1, #headimg .description
|
||||
{
|
||||
text-decoration: none;
|
||||
<?php
|
||||
if ( 'blank' == get_header_textcolor() ) { ?>
|
||||
display: none;
|
||||
<?php } else {
|
||||
// Otherwise, set the color to be the user selected one
|
||||
?>
|
||||
color: #<?php header_textcolor();?>;
|
||||
<?php } ?>
|
||||
}
|
||||
</style>
|
||||
<?php
|
||||
}
|
||||
|
||||
function theme_header_style() {
|
||||
?>
|
||||
<style type="text/css">
|
||||
#header
|
||||
{
|
||||
width: <?php echo HEADER_IMAGE_WIDTH; ?>px;
|
||||
height: <?php echo HEADER_IMAGE_HEIGHT; ?>px;
|
||||
background: url(<?php header_image(); ?>) no-repeat center;
|
||||
}
|
||||
|
||||
<?php
|
||||
// Has the text been hidden?
|
||||
// If so, set display to equal none
|
||||
if ( 'blank' == get_header_textcolor() ) { ?>
|
||||
#header h1, #header .description {
|
||||
display: none;
|
||||
}
|
||||
<?php } else {
|
||||
// Otherwise, set the color to be the user selected one
|
||||
?>
|
||||
#header *
|
||||
{
|
||||
color: #<?php header_textcolor();?>;
|
||||
}
|
||||
}
|
||||
<?php } ?>
|
||||
</style>
|
||||
<?php
|
||||
}
|
||||
|
||||
if ( function_exists('add_custom_image_header') ) {
|
||||
add_custom_image_header('theme_header_style', 'theme_admin_header_style');
|
||||
}
|
||||
|
||||
?>
|
|
@ -0,0 +1,162 @@
|
|||
<?php
|
||||
/*
|
||||
Plugin Name: WP-PageNavi
|
||||
Plugin URI: http://lesterchan.net/portfolio/programming/php/
|
||||
Description: Adds a more advanced paging navigation to your WordPress blog.
|
||||
Version: 2.40
|
||||
Author: Lester 'GaMerZ' Chan
|
||||
Author URI: http://lesterchan.net
|
||||
*/
|
||||
|
||||
|
||||
/*
|
||||
Copyright 2008 Lester Chan (email : lesterchan@gmail.com)
|
||||
|
||||
This program is free software; you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation; either version 2 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program; if not, write to the Free Software
|
||||
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
*/
|
||||
|
||||
|
||||
### Function: Page Navigation: Boxed Style Paging
|
||||
function wp_pagenavi($before = '', $after = '') {
|
||||
global $wpdb, $wp_query;
|
||||
pagenavi_init(); //Calling the pagenavi_init() function
|
||||
if (!is_single()) {
|
||||
$request = $wp_query->request;
|
||||
$posts_per_page = intval(get_query_var('posts_per_page'));
|
||||
$paged = intval(get_query_var('paged'));
|
||||
$pagenavi_options = get_option('pagenavi_options');
|
||||
$numposts = $wp_query->found_posts;
|
||||
$max_page = $wp_query->max_num_pages;
|
||||
/*
|
||||
$numposts = 0;
|
||||
if(strpos(get_query_var('tag'), " ")) {
|
||||
preg_match('#^(.*)\sLIMIT#siU', $request, $matches);
|
||||
$fromwhere = $matches[1];
|
||||
$results = $wpdb->get_results($fromwhere);
|
||||
$numposts = count($results);
|
||||
} else {
|
||||
preg_match('#FROM\s*+(.+?)\s+(GROUP BY|ORDER BY)#si', $request, $matches);
|
||||
$fromwhere = $matches[1];
|
||||
$numposts = $wpdb->get_var("SELECT COUNT(DISTINCT ID) FROM $fromwhere");
|
||||
}
|
||||
$max_page = ceil($numposts/$posts_per_page);
|
||||
*/
|
||||
if(empty($paged) || $paged == 0) {
|
||||
$paged = 1;
|
||||
}
|
||||
$pages_to_show = intval($pagenavi_options['num_pages']);
|
||||
$pages_to_show_minus_1 = $pages_to_show-1;
|
||||
$half_page_start = floor($pages_to_show_minus_1/2);
|
||||
$half_page_end = ceil($pages_to_show_minus_1/2);
|
||||
$start_page = $paged - $half_page_start;
|
||||
if($start_page <= 0) {
|
||||
$start_page = 1;
|
||||
}
|
||||
$end_page = $paged + $half_page_end;
|
||||
if(($end_page - $start_page) != $pages_to_show_minus_1) {
|
||||
$end_page = $start_page + $pages_to_show_minus_1;
|
||||
}
|
||||
if($end_page > $max_page) {
|
||||
$start_page = $max_page - $pages_to_show_minus_1;
|
||||
$end_page = $max_page;
|
||||
}
|
||||
if($start_page <= 0) {
|
||||
$start_page = 1;
|
||||
}
|
||||
if($max_page > 1 || intval($pagenavi_options['always_show']) == 1) {
|
||||
$pages_text = str_replace("%CURRENT_PAGE%", number_format_i18n($paged), $pagenavi_options['pages_text']);
|
||||
$pages_text = str_replace("%TOTAL_PAGES%", number_format_i18n($max_page), $pages_text);
|
||||
echo $before.'<div id="paginav"><ul>'."\n";
|
||||
switch(intval($pagenavi_options['style'])) {
|
||||
case 1:
|
||||
if(!empty($pages_text)) {
|
||||
echo '<li class="paginav-pages">'.$pages_text.'</li>';
|
||||
}
|
||||
if ($start_page >= 2 && $pages_to_show < $max_page) {
|
||||
$first_page_text = str_replace("%TOTAL_PAGES%", number_format_i18n($max_page), $pagenavi_options['first_text']);
|
||||
echo '<li><a href="'.clean_url(get_pagenum_link()).'" title="'.$first_page_text.'">'.$first_page_text.'</a></li>';
|
||||
if(!empty($pagenavi_options['dotleft_text'])) {
|
||||
echo '<li class="paginav-extend">'.$pagenavi_options['dotleft_text'].'</li>';
|
||||
}
|
||||
}
|
||||
echo '<li class="paginav-previous">';
|
||||
previous_posts_link($pagenavi_options['prev_text']);
|
||||
echo '</li>';
|
||||
for($i = $start_page; $i <= $end_page; $i++) {
|
||||
if($i == $paged) {
|
||||
$current_page_text = str_replace("%PAGE_NUMBER%", number_format_i18n($i), $pagenavi_options['current_text']);
|
||||
echo '<li class="paginav-current">'.$current_page_text.'</li>';
|
||||
} else {
|
||||
$page_text = str_replace("%PAGE_NUMBER%", number_format_i18n($i), $pagenavi_options['page_text']);
|
||||
echo '<li><a href="'.clean_url(get_pagenum_link($i)).'" title="'.$page_text.'">'.$page_text.'</a></li>';
|
||||
}
|
||||
}
|
||||
echo '<li class="paginav-next">';
|
||||
next_posts_link($pagenavi_options['next_text'], $max_page);
|
||||
echo '</li>';
|
||||
if ($end_page < $max_page) {
|
||||
if(!empty($pagenavi_options['dotright_text'])) {
|
||||
echo '<li class="paginav-extend">'.$pagenavi_options['dotright_text'].'</li>';
|
||||
}
|
||||
$last_page_text = str_replace("%TOTAL_PAGES%", number_format_i18n($max_page), $pagenavi_options['last_text']);
|
||||
echo '<li><a href="'.clean_url(get_pagenum_link($max_page)).'" title="'.$last_page_text.'">'.$last_page_text.'</a></li>';
|
||||
}
|
||||
break;
|
||||
case 2;
|
||||
echo '<form action="'.htmlspecialchars($_SERVER['PHP_SELF']).'" method="get">'."\n";
|
||||
echo '<select size="1" onchange="document.location.href = this.options[this.selectedIndex].value;">'."\n";
|
||||
for($i = 1; $i <= $max_page; $i++) {
|
||||
$page_num = $i;
|
||||
if($page_num == 1) {
|
||||
$page_num = 0;
|
||||
}
|
||||
if($i == $paged) {
|
||||
$current_page_text = str_replace("%PAGE_NUMBER%", number_format_i18n($i), $pagenavi_options['current_text']);
|
||||
echo '<option value="'.clean_url(get_pagenum_link($page_num)).'" selected="selected" class="current">'.$current_page_text."</option>\n";
|
||||
} else {
|
||||
$page_text = str_replace("%PAGE_NUMBER%", number_format_i18n($i), $pagenavi_options['page_text']);
|
||||
echo '<option value="'.clean_url(get_pagenum_link($page_num)).'">'.$page_text."</option>\n";
|
||||
}
|
||||
}
|
||||
echo "</select>\n";
|
||||
echo "</form>\n";
|
||||
break;
|
||||
}
|
||||
echo '</ul></div>'.$after."\n";
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
### Function: Page Navigation Options
|
||||
add_action('activate_wp-pagenavi/wp-pagenavi.php', 'pagenavi_init');
|
||||
function pagenavi_init() {
|
||||
// Add Options
|
||||
$pagenavi_options = array();
|
||||
$pagenavi_options['pages_text'] = __('Page %CURRENT_PAGE% of %TOTAL_PAGES%','wp-pagenavi');
|
||||
$pagenavi_options['current_text'] = '%PAGE_NUMBER%';
|
||||
$pagenavi_options['page_text'] = '%PAGE_NUMBER%';
|
||||
$pagenavi_options['first_text'] = __('« First','wp-pagenavi');
|
||||
$pagenavi_options['last_text'] = __('Last »','wp-pagenavi');
|
||||
$pagenavi_options['next_text'] = __('»','wp-pagenavi');
|
||||
$pagenavi_options['prev_text'] = __('«','wp-pagenavi');
|
||||
$pagenavi_options['dotright_text'] = __('...','wp-pagenavi');
|
||||
$pagenavi_options['dotleft_text'] = __('...','wp-pagenavi');
|
||||
$pagenavi_options['style'] = 1;
|
||||
$pagenavi_options['num_pages'] = 5;
|
||||
$pagenavi_options['always_show'] = 0;
|
||||
add_option('pagenavi_options', $pagenavi_options, 'PageNavi Options');
|
||||
}
|
||||
?>
|
|
@ -98,6 +98,15 @@ acronym, abbr {
|
|||
border-bottom: 1px dashed #000;
|
||||
}
|
||||
|
||||
pre {
|
||||
background: #eee;
|
||||
padding: 5px;
|
||||
border: 1px solid #999;
|
||||
overflow: hidden;
|
||||
margin: 0 0 15px 0;
|
||||
font-family: Courier, Monospace;
|
||||
}
|
||||
|
||||
form {
|
||||
margin: 0;
|
||||
}
|
||||
|
|
|
@ -22,22 +22,27 @@ class widget_comicpress_comic_date extends WP_Widget {
|
|||
|
||||
echo $before_widget;
|
||||
$title = empty($instance['title']) ? '' : apply_filters('widget_title', $instance['title']);
|
||||
if ( !empty( $title ) ) { echo $title; } ?> <?php the_time('F jS, Y'); ?>
|
||||
if ( !empty( $title ) ) { echo $title; } ?> <?php the_time($instance['format']); ?>
|
||||
<?php echo $after_widget;
|
||||
}
|
||||
|
||||
function update($new_instance, $old_instance) {
|
||||
$instance = $old_instance;
|
||||
$instance['title'] = strip_tags($new_instance['title']);
|
||||
$instance['format'] = strip_tags($new_instance['format']);
|
||||
if (empty($instance['format'])) $instance['format'] = 'F jS, Y';
|
||||
return $instance;
|
||||
}
|
||||
|
||||
function form($instance) {
|
||||
$instance = wp_parse_args( (array) $instance, array( 'title' => '' ) );
|
||||
$instance = wp_parse_args( (array) $instance, array( 'title' => '', 'format' => '' ) );
|
||||
$title = strip_tags($instance['title']);
|
||||
$format = strip_tags($instance['format']);
|
||||
if (empty($format)) $format = 'F jS, Y';
|
||||
?>
|
||||
<p><label for="<?php echo $this->get_field_id('title'); ?>">Words to use before date:<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 attribute_escape($title); ?>" /></label></p>
|
||||
|
||||
<p><label for="<?php echo $this->get_field_id('format'); ?>">Format of the Time/Date:<br /><input class="widefat" id="<?php echo $this->get_field_id('format'); ?>" name="<?php echo $this->get_field_name('format'); ?>" type="text" value="<?php echo attribute_escape($format); ?>" /></label></p>
|
||||
|
||||
<?php
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue