"; if ( !is_front_page() ) { ?>
  • \n"; } // Produces an hCard for the "admin" user function plaintxtblog_admin_hCard() { global $wpdb, $user_info; $user_info = get_userdata(1); echo '' . $user_info->first_name . ' ' . $user_info->last_name . ''; } // Produces an hCard for post authors function plaintxtblog_author_hCard() { global $wpdb, $authordata; echo '' . get_the_author() . ''; } // Produces semantic classes for the body element; Originally from the Sandbox, http://www.plaintxt.org/themes/sandbox/ function plaintxtblog_body_class( $print = true ) { global $wp_query, $current_user; $c = array('wordpress'); plaintxtblog_date_classes(time(), $c); is_home() ? $c[] = 'home' : null; is_archive() ? $c[] = 'archive' : null; is_date() ? $c[] = 'date' : null; is_search() ? $c[] = 'search' : null; is_paged() ? $c[] = 'paged' : null; is_attachment() ? $c[] = 'attachment' : null; is_404() ? $c[] = 'four04' : null; if ( is_single() ) { the_post(); $c[] = 'single'; if ( isset($wp_query->post->post_date) ) plaintxtblog_date_classes(mysql2date('U', $wp_query->post->post_date), $c, 's-'); foreach ( (array) get_the_category() as $cat ) $c[] = 's-category-' . $cat->category_nicename; $c[] = 's-author-' . get_the_author_login(); rewind_posts(); } elseif ( is_author() ) { $author = $wp_query->get_queried_object(); $c[] = 'author'; $c[] = 'author-' . $author->user_nicename; } elseif ( is_category() ) { $cat = $wp_query->get_queried_object(); $c[] = 'category'; $c[] = 'category-' . $cat->category_nicename; } elseif ( is_page() ) { the_post(); $c[] = 'page'; $c[] = 'page-author-' . get_the_author_login(); rewind_posts(); } if ( $current_user->ID ) $c[] = 'loggedin'; $c = join(' ', apply_filters('body_class', $c)); return $print ? print($c) : $c; } // Produces semantic classes for the each individual post div; Originally from the Sandbox, http://www.plaintxt.org/themes/sandbox/ function plaintxtblog_post_class( $print = true ) { global $post, $plaintxtblog_post_alt; $c = array('hentry', "p$plaintxtblog_post_alt", $post->post_type, $post->post_status); $c[] = 'author-' . get_the_author_login(); foreach ( (array) get_the_category() as $cat ) $c[] = 'category-' . $cat->category_nicename; plaintxtblog_date_classes(mysql2date('U', $post->post_date), $c); if ( ++$plaintxtblog_post_alt % 2 ) $c[] = 'alt'; elseif ( $post->post_password ) $c[] = 'protected'; $c = join(' ', apply_filters('post_class', $c)); return $print ? print($c) : $c; } $plaintxtblog_post_alt = 1; // Produces semantic classes for the each individual comment li; Originally from the Sandbox, http://www.plaintxt.org/themes/sandbox/ function plaintxtblog_comment_class( $print = true ) { global $comment, $post, $plaintxtblog_comment_alt; $c = array($comment->comment_type); if ( $comment->user_id > 0 ) { $user = get_userdata($comment->user_id); $c[] = "byuser commentauthor-$user->user_login"; if ( $comment->user_id === $post->post_author ) $c[] = 'bypostauthor'; } plaintxtblog_date_classes(mysql2date('U', $comment->comment_date), $c, 'c-'); if ( ++$plaintxtblog_comment_alt % 2 ) $c[] = 'alt'; $c[] = "c$plaintxtblog_comment_alt"; if ( is_trackback() ) { $c[] = 'trackback'; } $c = join(' ', apply_filters('comment_class', $c)); return $print ? print($c) : $c; } // Produces date-based classes for the three functions above; Originally from the Sandbox, http://www.plaintxt.org/themes/sandbox/ function plaintxtblog_date_classes($t, &$c, $p = '') { $t = $t + (get_option('gmt_offset') * 3600); $c[] = $p . 'y' . gmdate('Y', $t); $c[] = $p . 'm' . gmdate('m', $t); $c[] = $p . 'd' . gmdate('d', $t); $c[] = $p . 'h' . gmdate('h', $t); } // Returns other categories except the current one (redundant); Originally from the Sandbox, http://www.plaintxt.org/themes/sandbox/ function plaintxtblog_other_cats($glue) { $current_cat = single_cat_title('', false); $separator = "\n"; $cats = explode($separator, get_the_category_list($separator)); foreach ( $cats as $i => $str ) { if ( strstr($str, ">$current_cat<") ) { unset($cats[$i]); break; } } if ( empty($cats) ) return false; return trim(join($glue, $cats)); } // Returns other tags except the current one (redundant); Originally from the Sandbox, http://www.plaintxt.org/themes/sandbox/ function plaintxtblog_other_tags($glue) { $current_tag = single_tag_title('', '', false); $separator = "\n"; $tags = explode($separator, get_the_tag_list("", "$separator", "")); foreach ( $tags as $i => $str ) { if ( strstr($str, ">$current_tag<") ) { unset($tags[$i]); break; } } if ( empty($tags) ) return false; return trim(join($glue, $tags)); } // Produces an avatar image with the hCard-compliant photo class function plaintxtblog_commenter_link() { $commenter = get_comment_author_link(); if ( ereg( ']* class=[^>]+>', $commenter ) ) { $commenter = ereg_replace( '(]* class=[\'"]?)', '\\1url ' , $commenter ); } else { $commenter = ereg_replace( '(' . $commenter . ''; } // Our gallery short code; styles used in style.css file function plaintxtblog_gallery($attr) { global $post; extract( shortcode_atts( array( 'orderby' => 'menu_order ASC, ID ASC', 'id' => $post->ID, 'itemtag' => 'dl', 'icontag' => 'dt', 'captiontag' => 'dd', 'columns' => 3, 'size' => 'thumbnail', ), $attr ) ); $id = intval($id); $orderby = addslashes($orderby); $attachments = get_children("post_parent=$id&post_type=attachment&post_mime_type=image&orderby=\"{$orderby}\""); if ( empty($attachments) ) return ''; if ( is_feed() ) { $output = "\n"; foreach ( $attachments as $id => $attachment ) $output .= wp_get_attachment_link( $id, $size, true ) . "\n"; return $output; } $listtag = tag_escape($listtag); $itemtag = tag_escape($itemtag); $captiontag = tag_escape($captiontag); $columns = intval($columns); $itemwidth = $columns > 0 ? floor(100/$columns) : 100; $output = "
    "; foreach ( $attachments as $id => $attachment ) { $link = wp_get_attachment_link( $id, $size, true ); $output .= "<{$itemtag} class='gallery-item' style='width:{$itemwidth}%;'>"; $output .= "<{$icontag} class='gallery-icon'>$link"; if ( $captiontag && trim($attachment->post_excerpt) ) { $output .= "<{$captiontag} class='gallery-caption'>{$attachment->post_excerpt}"; } $output .= ""; if ( $columns > 0 && ++$i % $columns == 0 ) { $gallery_count = 2; $output .= "\n
    \n
    \n"; $gallery_count++; } } $output .= "
    \n"; return $output; } // Loads a plaintxtblog-style Search widget function widget_plaintxtblog_search($args) { extract($args); $options = get_option('widget_plaintxtblog_search'); $title = empty($options['title']) ? __( 'Search', 'plaintxtblog' ) : $options['title']; $button = empty($options['button']) ? __( 'Find', 'plaintxtblog' ) : $options['button']; ?>

    except the home.', 'plaintxtblog'); ?>

    "

    ", 'after_title' => "

    \n", ); register_sidebars(2, $p); // Finished intializing Widgets plugin, now let's load the plaintxtBlog default widgets; first, plaintxtBlog search widget $widget_ops = array( 'classname' => 'widget_search', 'description' => __( "A search form for your blog (plaintxtBlog)", "plaintxtblog" ) ); wp_register_sidebar_widget( 'search', __( 'Search', 'plaintxtblog' ), 'widget_plaintxtblog_search', $widget_ops ); unregister_widget_control('search'); wp_register_widget_control( 'search', __( 'Search', 'plaintxtblog' ), 'widget_plaintxtblog_search_control' ); // plaintxtBlog Meta widget $widget_ops = array( 'classname' => 'widget_meta', 'description' => __( "Log in/out and administration links (plaintxtBlog)", "plaintxtblog" ) ); wp_register_sidebar_widget( 'meta', __( 'Meta', 'plaintxtblog' ), 'widget_plaintxtblog_meta', $widget_ops ); unregister_widget_control('meta'); wp_register_widget_control( 'meta', __('Meta'), 'wp_widget_meta_control' ); //plaintxtBlog Home Link widget $widget_ops = array( 'classname' => 'widget_home_link', 'description' => __( "Link to the front page when elsewhere (plaintxtBlog)", "plaintxtblog" ) ); wp_register_sidebar_widget( 'home_link', __( 'Home Link', 'plaintxtblog' ), 'widget_plaintxtblog_homelink', $widget_ops ); wp_register_widget_control( 'home_link', __( 'Home Link', 'plaintxtblog' ), 'widget_plaintxtblog_homelink_control' ); //plaintxtBlog RSS Links widget $widget_ops = array( 'classname' => 'widget_rss_links', 'description' => __( "RSS links for both posts and comments (plaintxtBlog)", "plaintxtblog" ) ); wp_register_sidebar_widget( 'rss_links', __( 'RSS Links', 'plaintxtblog' ), 'widget_plaintxtblog_rsslinks', $widget_ops ); wp_register_widget_control( 'rss_links', __( 'RSS Links', 'plaintxtblog' ), 'widget_plaintxtblog_rsslinks_control' ); } // Loads the admin menu; sets default settings for each function plaintxtblog_add_admin() { if ( $_GET['page'] == basename(__FILE__) ) { if ( 'save' == $_REQUEST['action'] ) { check_admin_referer('plaintxtblog_save_options'); update_option( 'plaintxtblog_basefontsize', strip_tags( stripslashes( $_REQUEST['ptb_basefontsize'] ) ) ); update_option( 'plaintxtblog_basefontfamily', strip_tags( stripslashes( $_REQUEST['ptb_basefontfamily'] ) ) ); update_option( 'plaintxtblog_headingfontfamily', strip_tags( stripslashes( $_REQUEST['ptb_headingfontfamily'] ) ) ); update_option( 'plaintxtblog_posttextalignment', strip_tags( stripslashes( $_REQUEST['ptb_posttextalignment'] ) ) ); update_option( 'plaintxtblog_sidebarposition', strip_tags( stripslashes( $_REQUEST['ptb_sidebarposition'] ) ) ); update_option( 'plaintxtblog_sidebartextalignment', strip_tags( stripslashes( $_REQUEST['ptb_sidebartextalignment'] ) ) ); update_option( 'plaintxtblog_singlelayout', strip_tags( stripslashes( $_REQUEST['ptb_singlelayout'] ) ) ); update_option( 'plaintxtblog_avatarsize', strip_tags( stripslashes( $_REQUEST['ptb_avatarsize'] ) ) ); header("Location: themes.php?page=functions.php&saved=true"); die; } else if( 'reset' == $_REQUEST['action'] ) { check_admin_referer('plaintxtblog_reset_options'); delete_option('plaintxtblog_basefontsize'); delete_option('plaintxtblog_basefontfamily'); delete_option('plaintxtblog_headingfontfamily'); delete_option('plaintxtblog_posttextalignment'); delete_option('plaintxtblog_sidebarposition'); delete_option('plaintxtblog_sidebartextalignment'); delete_option('plaintxtblog_singlelayout'); delete_option('plaintxtblog_avatarsize'); header("Location: themes.php?page=functions.php&reset=true"); die; } add_action('admin_head', 'plaintxtblog_admin_head'); } add_theme_page( __( 'plaintxtBlog Theme Options', 'plaintxtblog' ), __( 'Theme Options', 'plaintxtblog' ), 'edit_themes', basename(__FILE__), 'plaintxtblog_admin' ); } function plaintxtblog_donate() { $form = '
    Donate with PayPal
    ' . "\n\t"; echo $form; } function plaintxtblog_admin_head() { // Additional CSS styles for the theme options menu ?>

    View site.', 'plaintxtblog'), get_bloginfo('home') . '/'); ?>

    Thanks for selecting the plaintxtBlog theme by Scott Allan Wallick. Please read the included documentation for more information about the blog.txt and its advanced features. If you find this theme useful, please consider . You must click on Save Options to save any changes. You can also discard your changes and reload the default settings by clicking on Reset.

    ', 'plaintxtblog'), plaintxtblog_donate(), get_template_directory_uri() . '/readme.html' ); ?>

    " tabindex="1" size="10" />

    70%.', 'plaintxtblog'); ?>

    tabindex="2" />
    tabindex="3" />
    tabindex="4" />
    tabindex="5" />
    tabindex="6" />
    tabindex="7" />
    tabindex="8" />
    tabindex="9" />
    tabindex="10" />

    Verdana.', 'plaintxtblog'), 'web safe'); ?>

    tabindex="11" />
    tabindex="12" />
    tabindex="13" />
    tabindex="14" />
    tabindex="15" />
    tabindex="16" />
    tabindex="17" />
    tabindex="18" />
    tabindex="19" />

    Verdana. ', 'plaintxtblog'), 'web safe'); ?>

    left.', 'plaintxtblog'); ?>

    left of content.', 'plaintxtblog'); ?>

    right.', 'plaintxtblog'); ?>

    post layout can either be three column (normal) or one column (minimal). Default is normal layout (3 columns). ', 'plaintxtblog'); ?>

    " size="6" />

    24.', 'plaintxtblog'); ?>

    Save Options. A reset does not affect the actual theme files in any way. If you are uninstalling plaintxtBlog, please reset before removing the theme files to clear your databse.', 'plaintxtblog'); ?>