add a bunch of files to the repo

This commit is contained in:
John Bintz 2009-07-16 21:57:17 -04:00
parent 877f588c07
commit 44bc1e7ce8
21 changed files with 299 additions and 0 deletions

232
comment-functions.php Normal file
View File

@ -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 {
echo '<img src="'.get_bloginfo('stylesheet_directory').$avatar.'" class="avatar photo" />';
}
if($url == true && $url != 'http://')
echo '</a>';
}
/**
* 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>
<abbr 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()); ?>
</abbr>
<span class="separator">|</span> <a class="permalink" href="#comment-<?php echo str_replace('&', '&amp;', 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') : ?>
<em><?php _e('<span style=\"color:#ff0000;\">Your comment is awaiting moderation.</span>','comicpress'); ?></em>
<?php endif; ?>
</div>
<br class="clearfloat" />
<div class="comment-text">
<?php comment_text(); ?>
</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;
/*
* Alt classes
*/
if($comment_alt++ % 2) :
$classes[] = 'even';
$classes[] = 'alt';
else :
$classes[] = 'odd';
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;
}
/**
* 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;
}
?>

67
custom-image-header.php Normal file
View File

@ -0,0 +1,67 @@
<?php
// Custom Image Header
define('HEADER_TEXTCOLOR', '000');
define('HEADER_IMAGE', '%s/images/header-blank.png'); // %s is theme dir uri
define('HEADER_IMAGE_WIDTH', 760);
define('HEADER_IMAGE_HEIGHT', 140);
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');
}
?>

BIN
images/calendar.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.5 KiB

BIN
images/data_rss.gif Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 150 B

BIN
images/disabled_first.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 215 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.0 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.0 KiB

BIN
images/disabled_latest.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 209 B

BIN
images/disabled_next.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 215 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.7 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 215 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.7 KiB

BIN
images/firstroll.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 7.2 KiB

BIN
images/header-blank.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 746 B

BIN
images/lastroll.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.7 KiB

BIN
images/menubarbgdark.jpg Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 351 B

BIN
images/nextroll.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.1 KiB

BIN
images/pingback.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 646 B

BIN
images/previous.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.8 KiB

BIN
images/prevroll.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.2 KiB

BIN
images/trackback.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 507 B