"; if ( !is_front_page() ) { ?>
  • \n"; } // Produces an hCard for the "admin" user function simplr_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 simplr_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 simplr_body_class( $print = true ) { global $wp_query, $current_user; $c = array('wordpress'); simplr_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) ) simplr_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 simplr_post_class( $print = true ) { global $post, $simplr_post_alt; $c = array('hentry', "p$simplr_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; simplr_date_classes(mysql2date('U', $post->post_date), $c); if ( ++$simplr_post_alt % 2 ) $c[] = 'alt'; $c = join(' ', apply_filters('post_class', $c)); return $print ? print($c) : $c; } $simplr_post_alt = 1; // Produces semantic classes for the each individual comment li; Originally from the Sandbox, http://www.plaintxt.org/themes/sandbox/ function simplr_comment_class( $print = true ) { global $comment, $post, $simplr_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'; } simplr_date_classes(mysql2date('U', $comment->comment_date), $c, 'c-'); if ( ++$simplr_comment_alt % 2 ) $c[] = 'alt'; $c[] = "c$simplr_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 simplr_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 simplr_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 simplr_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 simplr_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 simplr_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 simplr-style Search widget function widget_simplr_search($args) { extract($args); $options = get_option('widget_simplr_search'); $title = empty($options['title']) ? __( 'Search', 'simplr' ) : $options['title']; $button = empty($options['button']) ? __( 'Find', 'simplr' ) : $options['button']; ?>

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

    have_posts()) : ?>
      have_posts()) : $r->the_post(); ?>


    get_results("SELECT comment_author, comment_author_url, comment_ID, comment_post_ID, SUBSTRING(comment_content,1,65) AS comment_excerpt FROM $wpdb->comments LEFT OUTER JOIN $wpdb->posts ON ($wpdb->comments.comment_post_ID = $wpdb->posts.ID) WHERE comment_approved = '1' AND comment_type = '' AND post_password = '' ORDER BY comment_date_gmt DESC LIMIT $count"); ?>
      comment_post_ID) . '#comment-' . $comment->comment_ID . '\';">' . sprintf(__('%1$s wrote: %2$s ... On %3$s'), get_comment_author_link(), strip_tags($comment->comment_excerpt), '' . get_the_title($comment->comment_post_ID) . '') . ''; endforeach; endif;?>


    "

    ", 'after_title' => "

    \n", ); register_sidebars(2, $p); // Finished intializing Widgets plugin, now let's load the Simplr default widgets; first, Simplr search widget $widget_ops = array( 'classname' => 'widget_search', 'description' => __( "A search form for your blog (Simplr)", "simplr" ) ); wp_register_sidebar_widget( 'search', __( 'Search', 'simplr' ), 'widget_simplr_search', $widget_ops ); unregister_widget_control('search'); wp_register_widget_control( 'search', __( 'Search', 'simplr' ), 'widget_simplr_search_control' ); // Simplr Meta widget $widget_ops = array( 'classname' => 'widget_meta', 'description' => __( "Log in/out and administration links (Simplr)", "simplr" ) ); wp_register_sidebar_widget( 'meta', __( 'Meta', 'simplr' ), 'widget_simplr_meta', $widget_ops ); unregister_widget_control('meta'); wp_register_widget_control( 'meta', __('Meta'), 'wp_widget_meta_control' ); //Simplr Home Link widget $widget_ops = array( 'classname' => 'widget_home_link', 'description' => __( "Link to the front page when elsewhere (Simplr)", "simplr" ) ); wp_register_sidebar_widget( 'home_link', __( 'Home Link', 'simplr' ), 'widget_simplr_homelink', $widget_ops ); wp_register_widget_control( 'home_link', __( 'Home Link', 'simplr' ), 'widget_simplr_homelink_control' ); //Simplr Recent Comments widget $widget_ops = array( 'classname' => 'widget_simplr_recent_entries', 'description' => __( "Semantic recent entries (Simplr)", "simplr" ) ); wp_register_sidebar_widget( 'simplr-recent-entries', __( 'Recent Entries', 'simplr' ), 'widget_simplr_recent_entries', $widget_ops ); wp_register_widget_control( 'simplr-recent-entries', __( 'Recent Entries', 'simplr' ), 'widget_simplr_recent_entries_control' ); //Simplr Recent Comments widget $widget_ops = array( 'classname' => 'widget_simplr_recent_comments', 'description' => __( "Semantic recent comments (Simplr)", "simplr" ) ); wp_register_sidebar_widget( 'simplr-recent-comments', __( 'Recent Comments', 'simplr' ), 'widget_simplr_recent_comments', $widget_ops ); wp_register_widget_control( 'simplr-recent-comments', __( 'Recent Comments', 'simplr' ), 'widget_simplr_recent_comments_control' ); //Simplr RSS Links widget $widget_ops = array( 'classname' => 'widget_rss_links', 'description' => __( "RSS links for both posts and comments (Simplr)", "simplr" ) ); wp_register_sidebar_widget( 'rss_links', __( 'RSS Links', 'simplr' ), 'widget_simplr_rsslinks', $widget_ops ); wp_register_widget_control( 'rss_links', __( 'RSS Links', 'simplr' ), 'widget_simplr_rsslinks_control' ); } // Loads the admin menu; sets default settings for each function simplr_add_admin() { if ( $_GET['page'] == basename(__FILE__) ) { if ( 'save' == $_REQUEST['action'] ) { check_admin_referer('simplr_save_options'); update_option( 'simplr_basefontsize', strip_tags( stripslashes( $_REQUEST['sr_basefontsize'] ) ) ); update_option( 'simplr_basefontfamily', strip_tags( stripslashes( $_REQUEST['sr_basefontfamily'] ) ) ); update_option( 'simplr_headingfontfamily', strip_tags( stripslashes( $_REQUEST['sr_headingfontfamily'] ) ) ); update_option( 'simplr_layoutwidth', strip_tags( stripslashes( $_REQUEST['sr_layoutwidth'] ) ) ); update_option( 'simplr_posttextalignment', strip_tags( stripslashes( $_REQUEST['sr_posttextalignment'] ) ) ); update_option( 'simplr_sidebarposition', strip_tags( stripslashes( $_REQUEST['sr_sidebarposition'] ) ) ); update_option( 'simplr_accesslinks', strip_tags( stripslashes( $_REQUEST['sr_accesslinks'] ) ) ); update_option( 'simplr_avatarsize', strip_tags( stripslashes( $_REQUEST['sr_avatarsize'] ) ) ); header("Location: themes.php?page=functions.php&saved=true"); die; } else if( 'reset' == $_REQUEST['action'] ) { check_admin_referer('simplr_reset_options'); delete_option('simplr_basefontsize'); delete_option('simplr_basefontfamily'); delete_option('simplr_headingfontfamily'); delete_option('simplr_layoutwidth'); delete_option('simplr_posttextalignment'); delete_option('simplr_sidebarposition'); delete_option('simplr_accesslinks'); delete_option('simplr_avatarsize'); header("Location: themes.php?page=functions.php&reset=true"); die; } add_action('admin_head', 'simplr_admin_head'); } add_theme_page( __( 'Simplr Theme Options', 'simplr' ), __( 'Theme Options', 'simplr' ), 'edit_themes', basename(__FILE__), 'simplr_admin' ); } function simplr_donate() { $form = '
    Donate with PayPal
    ' . "\n\t"; echo $form; } function simplr_admin_head() { // Additional CSS styles for the theme options menu ?>

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

    Thanks for selecting the Simplr 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.

    ', 'simplr'), simplr_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" />

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

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

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

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

    45em.', 'simplr'); ?>

    left.', 'simplr'); ?>

    Column 1 - Column 2.', 'simplr'); ?>

    show on mouseover.', 'simplr'); ?>

    " size="6" />

    40.', 'simplr'); ?>

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