"; if ( !is_front_page() ) { ?>
  • \n"; } // Produces an hCard for the "admin" user function veryplaintxt_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 veryplaintxt_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 veryplaintxt_body_class( $print = true ) { global $wp_query, $current_user; $c = array('wordpress'); veryplaintxt_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) ) veryplaintxt_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(); } else if ( is_author() ) { $author = $wp_query->get_queried_object(); $c[] = 'author'; $c[] = 'author-' . $author->user_nicename; } else if ( is_category() ) { $cat = $wp_query->get_queried_object(); $c[] = 'category'; $c[] = 'category-' . $cat->category_nicename; } else if ( 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 veryplaintxt_post_class( $print = true ) { global $post, $veryplaintxt_post_alt; $c = array('hentry', "p$veryplaintxt_post_alt", $post->post_type, $post->post_status); $c[] = 'author-' . get_the_author_login(); if ( is_attachment() ) $c[] = 'attachment'; foreach ( (array) get_the_category() as $cat ) $c[] = 'category-' . $cat->category_nicename; veryplaintxt_date_classes(mysql2date('U', $post->post_date), $c); if ( ++$veryplaintxt_post_alt % 2 ) $c[] = 'alt'; $c = join(' ', apply_filters('post_class', $c)); return $print ? print($c) : $c; } $veryplaintxt_post_alt = 1; // Produces semantic classes for the each individual comment li; Originally from the Sandbox, http://www.plaintxt.org/themes/sandbox/ function veryplaintxt_comment_class( $print = true ) { global $comment, $post, $veryplaintxt_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'; } veryplaintxt_date_classes(mysql2date('U', $comment->comment_date), $c, 'c-'); if ( ++$veryplaintxt_comment_alt % 2 ) $c[] = 'alt'; $c[] = "c$veryplaintxt_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 veryplaintxt_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 veryplaintxt_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 veryplaintxt_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 veryplaintxt_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 veryplaintxt_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 veryplaintxt-style Search widget function widget_veryplaintxt_search($args) { extract($args); $options = get_option('widget_veryplaintxt_search'); $title = empty($options['title']) ? __( 'Search', 'veryplaintxt' ) : $options['title']; $button = empty($options['button']) ? __( 'Find', 'veryplaintxt' ) : $options['button']; ?>

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

    "

    ", 'after_title' => "

    \n", ); register_sidebars(1, $p); // Finished intializing Widgets plugin, now let's load the veryplaintxt default widgets; first, veryplaintxt search widget $widget_ops = array( 'classname' => 'widget_search', 'description' => __( "A search form for your blog (veryplaintxt)", "veryplaintxt" ) ); wp_register_sidebar_widget( 'search', __( 'Search', 'veryplaintxt' ), 'widget_veryplaintxt_search', $widget_ops ); unregister_widget_control('search'); wp_register_widget_control( 'search', __( 'Search', 'veryplaintxt' ), 'widget_veryplaintxt_search_control' ); // veryplaintxt Meta widget $widget_ops = array( 'classname' => 'widget_meta', 'description' => __( "Log in/out and administration links (veryplaintxt)", "veryplaintxt" ) ); wp_register_sidebar_widget( 'meta', __( 'Meta', 'veryplaintxt' ), 'widget_veryplaintxt_meta', $widget_ops ); unregister_widget_control('meta'); wp_register_widget_control( 'meta', __('Meta'), 'wp_widget_meta_control' ); //veryplaintxt Home Link widget $widget_ops = array( 'classname' => 'widget_home_link', 'description' => __( "Link to the front page when elsewhere (veryplaintxt)", "veryplaintxt" ) ); wp_register_sidebar_widget( 'home_link', __( 'Home Link', 'veryplaintxt' ), 'widget_veryplaintxt_homelink', $widget_ops ); wp_register_widget_control( 'home_link', __( 'Home Link', 'veryplaintxt' ), 'widget_veryplaintxt_homelink_control' ); //veryplaintxt RSS Links widget $widget_ops = array( 'classname' => 'widget_rss_links', 'description' => __( "RSS links for both posts and comments (veryplaintxt)", "veryplaintxt" ) ); wp_register_sidebar_widget( 'rss_links', __( 'RSS Links', 'veryplaintxt' ), 'widget_veryplaintxt_rsslinks', $widget_ops ); wp_register_widget_control( 'rss_links', __( 'RSS Links', 'veryplaintxt' ), 'widget_veryplaintxt_rsslinks_control' ); } // Loads the admin menu; sets default settings for each function veryplaintxt_add_admin() { if ( $_GET['page'] == basename(__FILE__) ) { if ( 'save' == $_REQUEST['action'] ) { check_admin_referer('veryplaintxt_save_options'); update_option( 'veryplaintxt_basefontsize', strip_tags( stripslashes( $_REQUEST['vp_basefontsize'] ) ) ); update_option( 'veryplaintxt_basefontfamily', strip_tags( stripslashes( $_REQUEST['vp_basefontfamily'] ) ) ); update_option( 'veryplaintxt_headingfontfamily', strip_tags( stripslashes( $_REQUEST['vp_headingfontfamily'] ) ) ); update_option( 'veryplaintxt_posttextalignment', strip_tags( stripslashes( $_REQUEST['vp_posttextalignment'] ) ) ); update_option( 'veryplaintxt_layoutwidth', strip_tags( stripslashes( $_REQUEST['vp_layoutwidth'] ) ) ); update_option( 'veryplaintxt_maxwidth', strip_tags( stripslashes( $_REQUEST['vp_maxwidth'] ) ) ); update_option( 'veryplaintxt_minwidth', strip_tags( stripslashes( $_REQUEST['vp_minwidth'] ) ) ); update_option( 'veryplaintxt_sidebarposition', strip_tags( stripslashes( $_REQUEST['vp_sidebarposition'] ) ) ); update_option( 'veryplaintxt_sidebartextalignment', strip_tags( stripslashes( $_REQUEST['vp_sidebartextalignment'] ) ) ); update_option( 'veryplaintxt_avatarsize', strip_tags( stripslashes( $_REQUEST['vp_avatarsize'] ) ) ); header("Location: themes.php?page=functions.php&saved=true"); die; } else if( 'reset' == $_REQUEST['action'] ) { check_admin_referer('veryplaintxt_reset_options'); delete_option('veryplaintxt_basefontsize'); delete_option('veryplaintxt_basefontfamily'); delete_option('veryplaintxt_headingfontfamily'); delete_option('veryplaintxt_posttextalignment'); delete_option('veryplaintxt_layoutwidth'); delete_option('veryplaintxt_maxwidth'); delete_option('veryplaintxt_minwidth'); delete_option('veryplaintxt_sidebarposition'); delete_option('veryplaintxt_sidebartextalignment'); delete_option('veryplaintxt_avatarsize'); header("Location: themes.php?page=functions.php&reset=true"); die; } add_action('admin_head', 'veryplaintxt_admin_head'); } add_theme_page( __( 'veryplaintxt Theme Options', 'veryplaintxt' ), __( 'Theme Options', 'veryplaintxt' ), 'edit_themes', basename(__FILE__), 'veryplaintxt_admin' ); } function veryplaintxt_donate() { $form = '
    Donate with PayPal
    ' . "\n\t"; echo $form; } function veryplaintxt_admin_head() { // Additional CSS styles for the theme options menu ?>

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

    Thanks for selecting the veryplaintxt theme by Scott Allan Wallick. Please read the included documentation for more information about veryplaintxt 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.

    ', 'veryplaintxt'), veryplaintxt_donate(), get_template_directory_uri() . '/readme.html' ); ?>

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

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

    Times.', 'veryplaintxt'), 'web safe'); ?>

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

    Arial. ', 'veryplaintxt'), 'web safe'); ?>

    " tabindex="20" size="10" />

    80%.', 'veryplaintxt'); ?>

    " tabindex="21" size="10" />

    55em.', 'veryplaintxt'); ?>

    " tabindex="22" size="10" />

    35em.', 'veryplaintxt'); ?>

    left.', 'veryplaintxt'); ?>

    right of content.', 'veryplaintxt'); ?>

    centered.', 'veryplaintxt'); ?>

    " size="6" />

    40.', 'veryplaintxt'); ?>

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