Ticket #4517: 4517-add-sandbox-0.9.5-theme.diff

File 4517-add-sandbox-0.9.5-theme.diff, 237.2 kB (added by Speedboxer, 1 year ago)

Add Sandbox 0.9.5 Theme and Add it to wp-includes/theme.php

  • wp-content/themes/sandbox/footer.php

    old new  
     1 
     2        <div id="footer"> 
     3                <span id="generator-link"><a href="http://wordpress.org/" title="<?php _e('WordPress', 'sandbox'); ?>" rel="generator"><?php _e('WordPress', 'sandbox'); ?></a></span> 
     4                <span class="meta-sep">|</span> 
     5                <span id="theme-link"><a href="http://www.plaintxt.org/themes/sandbox/" title="<?php _e('Sandbox for WordPress', 'sandbox'); ?>" rel="designer"><?php _e('Sandbox', 'sandbox'); ?></a></span> 
     6        </div><!-- #footer --> 
     7 
     8</div><!-- #wrapper .hfeed --> 
     9 
     10<?php wp_footer() ?> 
     11 
     12</body> 
     13</html> 
  • wp-content/themes/sandbox/style.css

    old new  
     1/* 
     2THEME NAME: Sandbox 
     3THEME URI: http://www.plaintxt.org/themes/sandbox/ 
     4DESCRIPTION: A theme rich with powerful and dynamic semantic class selectors; a canvas for CSS artists 
     5VERSION: 0.9.5 
     6AUTHOR: <a href="http://andy.wordpress.com/">Andy Skelton</a> &amp; <a href="http://www.plaintxt.org/">Scott Allan Wallick</a> 
     7AUTHOR URI: 
     8*/ 
     9 
     10/* Two-column with sidebar on left from the /sandbox-layouts/ folder  */ 
     11@import url('sandbox-layouts/2c-l.css'); 
     12 
     13/* Just some example content */ 
     14div#header{text-align:center;margin-bottom:2em;} 
     15div#access div.skip-link{position:absolute;top:1em;right:1em;} 
     16div#menu{font-size:0.9em;height:1.5em;padding-top:0.3em;background:#eee;width:100%;} 
     17div#menu ul a{font-weight:700;text-decoration:none;} 
     18div#menu ul,div#menu ul ul,div#menu ul li{list-style:none;margin:0;padding:0;} 
     19div#menu ul li{float:left;} 
     20div#menu ul li a{background:#eee;padding:0.3em 0.5em;} 
     21div#menu ul ul{display:none;} 
     22div#menu ul ul li{float:none;} 
     23div#menu ul ul li a{margin:0;padding:0;} 
     24div#menu ul li:hover ul{display:block;font-size:0.9em;padding-top:0.5em;position:absolute;} 
     25div#menu ul li:hover ul li a{background:#f5f5f5;border:none;display:block;padding:0.1em;width:10em;} 
     26 
     27.entry-title{clear:both;} 
     28div#container,div.sidebar{margin-top:2em;} 
     29div#nav-above,div#nav-below{width:100%;height:1em;} 
     30div#nav-above{margin-bottom:1em;} 
     31div#nav-below{margin-top:1em;} 
     32.alignleft,div.nav-previous{float: left;} 
     33.alignright,div.nav-next{float: right;} 
     34form#commentform .form-label{margin:1em 0 0;} 
     35form#commentform span.req-field{background:#fff;color:red;} 
     36form#commentform,form#commentform p{padding:0;} 
     37input#author,input#email,input#url{width:50%;} 
     38input#author,input#email,input#url,textarea#comment{padding:0.2em;} 
     39div.comments ol li{margin:0 0 3.5em;} 
     40textarea#comment{height:13em;margin:0 0 0.5em;overflow:auto;width:66%;} 
     41 
     42div.sidebar div,div.sidebar h3,div.sidebar ul,div.sidebar li{margin:0;padding:0;} 
     43div.sidebar h3{font-size:1.2em;} 
     44div.sidebar input#s{width:7em;} 
     45div.sidebar li{list-style:none;margin:0 0 1em;} 
     46div.sidebar li form{margin:0.2em 0 0;padding:0;} 
     47div.sidebar ul ul{margin:0 0 0 1em;} 
     48div.sidebar ul ul li{list-style:disc;margin:0;} 
     49div.sidebar ul ul ul{margin:0 0 0 0.5em;} 
     50div.sidebar ul ul ul li{list-style:circle;} 
     51 
     52div#footer{text-align:center;} 
  • wp-content/themes/sandbox/author.php

    old new  
     1<?php get_header() ?> 
     2 
     3        <div id="container"> 
     4                <div id="content"> 
     5 
     6<?php the_post() ?> 
     7 
     8                        <h2 class="page-title author"><?php printf(__('Author Archives: <span class="vcard">%s</span>', 'sandbox'), "<a class='url fn n' href='$authordata->user_url' title='$authordata->display_name' rel='me'>$authordata->display_name</a>") ?></h2> 
     9                        <div class="archive-meta"><?php if ( !(''== $authordata->user_description) ) : echo apply_filters('archive_meta', $authordata->user_description); endif; ?></div> 
     10 
     11                        <div id="nav-above" class="navigation"> 
     12                                <div class="nav-previous"><?php next_posts_link(__('<span class="meta-nav">&laquo;</span> Older posts', 'sandbox')) ?></div> 
     13                                <div class="nav-next"><?php previous_posts_link(__('Newer posts <span class="meta-nav">&raquo;</span>', 'sandbox')) ?></div> 
     14                        </div> 
     15 
     16<?php rewind_posts(); while (have_posts()) : the_post(); ?> 
     17 
     18                        <div id="post-<?php the_ID(); ?>" class="<?php sandbox_post_class(); ?>"> 
     19                                <h3 class="entry-title"><a href="<?php the_permalink() ?>" title="<?php printf(__('Permalink to %s', 'sandbox'), wp_specialchars(get_the_title(), 1)) ?>" rel="bookmark"><?php the_title(); ?></a></h3> 
     20                                <div class="entry-date"><abbr class="published" title="<?php the_time('Y-m-d\TH:i:sO'); ?>"><?php unset($previousday); printf(__('%1$s &#8211; %2$s', 'sandbox'), the_date('', '', '', false), get_the_time()) ?></abbr></div> 
     21                                <div class="entry-content "> 
     22<?php the_excerpt(''.__('Read More <span class="meta-nav">&raquo;</span>', 'sandbox').'') ?> 
     23 
     24                                </div> 
     25                                <div class="entry-meta"> 
     26                                        <span class="cat-links"><?php printf(__('Posted in %s', 'sandbox'), get_the_category_list(', ')) ?></span> 
     27                                        <span class="meta-sep">|</span> 
     28<?php edit_post_link(__('Edit', 'sandbox'), "\t\t\t\t\t<span class=\"edit-link\">", "</span>\n\t\t\t\t\t<span class=\"meta-sep\">|</span>\n"); ?> 
     29                                        <span class="comments-link"><?php comments_popup_link(__('Comments (0)', 'sandbox'), __('Comments (1)', 'sandbox'), __('Comments (%)', 'sandbox')) ?></span> 
     30                                </div> 
     31                        </div><!-- .post --> 
     32 
     33<?php endwhile ?> 
     34 
     35                        <div id="nav-below" class="navigation"> 
     36                                <div class="nav-previous"><?php next_posts_link(__('<span class="meta-nav">&laquo;</span> Older posts', 'sandbox')) ?></div> 
     37                                <div class="nav-next"><?php previous_posts_link(__('Newer posts <span class="meta-nav">&raquo;</span>', 'sandbox')) ?></div> 
     38                        </div> 
     39         
     40                </div><!-- #content --> 
     41        </div><!-- #container --> 
     42 
     43<?php get_sidebar() ?> 
     44<?php get_footer() ?> 
  • wp-content/themes/sandbox/archives.php

    old new  
     1<?php 
     2/* 
     3Template Name: Archives Page 
     4*/ 
     5?> 
     6<?php get_header() ?> 
     7         
     8        <div id="container"> 
     9                <div id="content"> 
     10 
     11<?php the_post() ?> 
     12 
     13                        <div id="post-<?php the_ID() ?>" class="<?php sandbox_post_class() ?>"> 
     14                                <h2 class="entry-title"><?php the_title() ?></h2> 
     15                                <div class="entry-content"> 
     16<?php the_content(); ?> 
     17 
     18                                        <ul id="archives-page" class="xoxo"> 
     19                                                <li id="category-archives" class="content-column"> 
     20                                                        <h3><?php _e('Archives by Category', 'sandbox') ?></h3> 
     21                                                        <ul> 
     22                                                                <?php wp_list_cats('sort_column=name&optioncount=1&feed=RSS') ?>  
     23                                                        </ul> 
     24                                                </li> 
     25                                                <li id="monthly-archives" class="content-column"> 
     26                                                        <h3><?php _e('Archives by Month', 'sandbox') ?></h3> 
     27                                                        <ul> 
     28                                                                <?php wp_get_archives('type=monthly&show_post_count=1') ?> 
     29                                                        </ul> 
     30                                                </li> 
     31                                        </ul> 
     32<?php edit_post_link(__('Edit', 'sandbox'),'<span class="edit-link">','</span>') ?> 
     33 
     34                                </div> 
     35                        </div><!-- .post --> 
     36 
     37<?php if ( get_post_custom_values('comments') ) comments_template() // Add a key/value of "comments" to enable comments on pages! ?> 
     38 
     39                </div><!-- #content --> 
     40        </div><!-- #container --> 
     41 
     42<?php get_sidebar() ?> 
     43<?php get_footer() ?> 
  • wp-content/themes/sandbox/search.php

    old new  
     1<?php get_header() ?> 
     2 
     3        <div id="container"> 
     4                <div id="content"> 
     5 
     6<?php if (have_posts()) : ?> 
     7 
     8                <h2 class="page-title"><?php _e('Search Results for:', 'sandbox') ?> <span id="search-terms"><?php echo wp_specialchars(stripslashes($_GET['s']), true); ?></span></h2> 
     9 
     10                        <div id="nav-above" class="navigation"> 
     11                                <div class="nav-previous"><?php next_posts_link(__('<span class="meta-nav">&laquo;</span> Older posts', 'sandbox')) ?></div> 
     12                                <div class="nav-next"><?php previous_posts_link(__('Newer posts <span class="meta-nav">&raquo;</span>', 'sandbox')) ?></div> 
     13                        </div> 
     14 
     15<?php while ( have_posts() ) : the_post(); ?> 
     16 
     17                        <div id="post-<?php the_ID() ?>" class="<?php sandbox_post_class() ?>"> 
     18                                <h3 class="entry-title"><a href="<?php the_permalink() ?>" title="<?php printf(__('Permalink to %s', 'sandbox'), wp_specialchars(get_the_title(), 1)) ?>" rel="bookmark"><?php the_title() ?></a></h3> 
     19                                <div class="entry-date"><abbr class="published" title="<?php the_time('Y-m-d\TH:i:sO'); ?>"><?php unset($previousday); printf(__('%1$s &#8211; %2$s', 'sandbox'), the_date('', '', '', false), get_the_time()) ?></abbr></div> 
     20                                <div class="entry-content"> 
     21<?php the_excerpt(''.__('Read More <span class="meta-nav">&raquo;</span>', 'sandbox').'') ?> 
     22 
     23                                </div> 
     24                                <div class="entry-meta"> 
     25                                        <span class="author vcard"><?php printf(__('By %s', 'sandbox'), '<a class="url fn n" href="'.get_author_link(false, $authordata->ID, $authordata->user_nicename).'" title="' . sprintf(__('View all posts by %s', 'sandbox'), $authordata->display_name) . '">'.get_the_author().'</a>') ?></span> 
     26                                        <span class="meta-sep">|</span> 
     27                                        <span class="cat-links"><?php printf(__('Posted in %s', 'sandbox'), get_the_category_list(', ')) ?></span> 
     28                                        <span class="meta-sep">|</span> 
     29<?php edit_post_link(__('Edit', 'sandbox'), "\t\t\t\t\t<span class=\"edit-link\">", "</span>\n\t\t\t\t\t<span class=\"meta-sep\">|</span>\n"); ?> 
     30                                        <span class="comments-link"><?php comments_popup_link(__('Comments (0)', 'sandbox'), __('Comments (1)', 'sandbox'), __('Comments (%)', 'sandbox')) ?></span> 
     31                                </div> 
     32                        </div><!-- .post --> 
     33 
     34<?php endwhile; ?> 
     35 
     36                        <div id="nav-below" class="navigation"> 
     37                                <div class="nav-previous"><?php next_posts_link(__('<span class="meta-nav">&laquo;</span> Older posts', 'sandbox')) ?></div> 
     38                                <div class="nav-next"><?php previous_posts_link(__('Newer posts <span class="meta-nav">&raquo;</span>', 'sandbox')) ?></div> 
     39                        </div> 
     40 
     41<?php else : ?> 
     42 
     43                        <div id="post-0" class="post noresults"> 
     44                                <h2 class="entry-title"><?php _e('Nothing Found', 'sandbox') ?></h2> 
     45                                <div class="entry-content"> 
     46                                        <p><?php _e('Sorry, but nothing matched your search criteria. Please try again with some different keywords.', 'sandbox') ?></p> 
     47                                </div> 
     48                                <form id="searchform" method="get" action="<?php bloginfo('home') ?>"> 
     49                                        <div> 
     50                                                <input id="s" name="s" type="text" value="<?php echo wp_specialchars(stripslashes($_GET['s']), true) ?>" size="40" /> 
     51                                                <input id="searchsubmit" name="searchsubmit" type="submit" value="<?php _e('Find', 'sandbox') ?>" /> 
     52                                        </div> 
     53                                </form> 
     54                        </div><!-- .post --> 
     55 
     56<?php endif; ?> 
     57 
     58                </div><!-- #content --> 
     59        </div><!-- #container --> 
     60 
     61<?php get_sidebar() ?> 
     62<?php get_footer() ?> 
  • wp-content/themes/sandbox/index.php

    old new  
     1<?php get_header() ?> 
     2 
     3        <div id="container"> 
     4                <div id="content"> 
     5 
     6                        <div id="nav-above" class="navigation"> 
     7                                <div class="nav-previous"><?php next_posts_link(__('<span class="meta-nav">&laquo;</span> Older posts', 'sandbox')) ?></div> 
     8                                <div class="nav-next"><?php previous_posts_link(__('Newer posts <span class="meta-nav">&raquo;</span>', 'sandbox')) ?></div> 
     9                        </div> 
     10 
     11<?php while ( have_posts() ) : the_post() ?> 
     12                        <div id="post-<?php the_ID() ?>" class="<?php sandbox_post_class() ?>"> 
     13                                <h2 class="entry-title"><a href="<?php the_permalink() ?>" title="<?php printf(__('Permalink to %s', 'sandbox'), wp_specialchars(get_the_title(), 1)) ?>" rel="bookmark"><?php the_title() ?></a></h2> 
     14                                <div class="entry-date"><abbr class="published" title="<?php the_time('Y-m-d\TH:i:sO'); ?>"><?php unset($previousday); printf(__('%1$s &#8211; %2$s', 'sandbox'), the_date('', '', '', false), get_the_time()) ?></abbr></div> 
     15                                <div class="entry-content"> 
     16<?php the_content(''.__('Read More <span class="meta-nav">&raquo;</span>', 'sandbox').''); ?> 
     17 
     18<?php link_pages("\t\t\t\t\t<div class='page-link'>".__('Pages: ', 'sandbox'), "</div>\n", 'number'); ?> 
     19                                </div> 
     20                                <div class="entry-meta"> 
     21                                        <span class="author vcard"><?php printf(__('By %s', 'sandbox'), '<a class="url fn n" href="'.get_author_link(false, $authordata->ID, $authordata->user_nicename).'" title="' . sprintf(__('View all posts by %s', 'sandbox'), $authordata->display_name) . '">'.get_the_author().'</a>') ?></span> 
     22                                        <span class="meta-sep">|</span> 
     23                                        <span class="cat-links"><?php printf(__('Posted in %s', 'sandbox'), get_the_category_list(', ')) ?></span> 
     24                                        <span class="meta-sep">|</span> 
     25<?php edit_post_link(__('Edit', 'sandbox'), "\t\t\t\t\t<span class=\"edit-link\">", "</span>\n\t\t\t\t\t<span class=\"meta-sep\">|</span>\n"); ?> 
     26                                        <span class="comments-link"><?php comments_popup_link(__('Comments (0)', 'sandbox'), __('Comments (1)', 'sandbox'), __('Comments (%)', 'sandbox')) ?></span> 
     27                                </div> 
     28                        </div><!-- .post --> 
     29 
     30<?php comments_template() ?> 
     31<?php endwhile ?> 
     32 
     33                        <div id="nav-below" class="navigation"> 
     34                                <div class="nav-previous"><?php next_posts_link(__('<span class="meta-nav">&laquo;</span> Older posts', 'sandbox')) ?></div> 
     35                                <div class="nav-next"><?php previous_posts_link(__('Newer posts <span class="meta-nav">&raquo;</span>', 'sandbox')) ?></div> 
     36                        </div> 
     37 
     38                </div><!-- #content --> 
     39        </div><!-- #container --> 
     40 
     41<?php get_sidebar() ?> 
     42<?php get_footer() ?> 
  • wp-content/themes/sandbox/404.php

    old new  
     1<?php get_header() ?> 
     2 
     3        <div id="container"> 
     4                <div id="content"> 
     5 
     6                        <div id="post-0" class="post error404"> 
     7                                <h2 class="entry-title"><?php _e('Not Found', 'sandbox') ?></h2> 
     8                                <div class="entry-content"> 
     9                                        <p><?php _e('Apologies, but we were unable to find what you were looking for. Perhaps  searching will help.', 'sandbox') ?></p> 
     10                                </div> 
     11                                <form id="searchform" method="get" action="<?php bloginfo('home') ?>"> 
     12                                        <div> 
     13                                                <input id="s" name="s" type="text" value="<?php echo wp_specialchars(stripslashes($_GET['s']), true) ?>" size="40" /> 
     14                                                <input id="searchsubmit" name="searchsubmit" type="submit" value="<?php _e('Find', 'sandbox') ?>" /> 
     15                                        </div> 
     16                                </form> 
     17                        </div><!-- .post --> 
     18 
     19                </div><!-- #content --> 
     20        </div><!-- #container --> 
     21 
     22<?php get_sidebar() ?> 
     23<?php get_footer() ?> 
  • wp-content/themes/sandbox/functions.php

    old new  
     1<?php 
     2// Produces a list of pages in the header without whitespace -- er, I mean negative space. 
     3function sandbox_globalnav() { 
     4        echo '<div id="menu"><ul>'; 
     5        $menu = wp_list_pages('title_li=&sort_column=post_title&echo=0'); // Params for the page list in header.php 
     6        echo str_replace(array("\r", "\n", "\t"), '', $menu); 
     7        echo "</ul></div>\n"; 
     8} 
     9 
     10// Checks for WP 2.1.x language_attributes() function 
     11function sandbox_blog_lang() { 
     12        if ( function_exists('language_attributes') ) 
     13                return language_attributes(); 
     14} 
     15 
     16// Generates semantic classes for BODY element 
     17function sandbox_body_class( $print = true ) { 
     18        global $wp_query, $current_user; 
     19         
     20        // It's surely a WordPress blog, right? 
     21        $c = array('wordpress'); 
     22 
     23        // Applies the time- and date-based classes (below) to BODY element 
     24        sandbox_date_classes(time(), $c); 
     25 
     26        // Generic semantic classes for what type of content is displayed 
     27        is_home()       ? $c[] = 'home'       : null; 
     28        is_archive()    ? $c[] = 'archive'    : null; 
     29        is_date()       ? $c[] = 'date'       : null; 
     30        is_search()     ? $c[] = 'search'     : null; 
     31        is_paged()      ? $c[] = 'paged'      : null; 
     32        is_attachment() ? $c[] = 'attachment' : null; 
     33        is_404()        ? $c[] = 'four04'     : null; // CSS does not allow a digit as first character 
     34 
     35        // Special classes for BODY element when a single post 
     36        if ( is_single() ) { 
     37                $postID = $wp_query->post->ID; 
     38                the_post(); 
     39                $c[] = 'single postid-' . $postID; 
     40                if ( isset($wp_query->post->post_date) ) 
     41                        sandbox_date_classes(mysql2date('U', $wp_query->post->post_date), $c, 's-'); 
     42                foreach ( (array) get_the_category() as $cat ) 
     43                        $c[] = 's-category-' . $cat->category_nicename; 
     44                        $c[] = 's-author-' . sanitize_title_with_dashes(strtolower(get_the_author('login'))); 
     45                rewind_posts(); 
     46        } 
     47 
     48        // Author name classes for BODY on author archives 
     49        else if ( is_author() ) { 
     50                $author = $wp_query->get_queried_object(); 
     51                $c[] = 'author'; 
     52                $c[] = 'author-' . $author->user_nicename; 
     53        } 
     54 
     55        // Category name classes for BODY on category archvies 
     56        else if ( is_category() ) { 
     57                $cat = $wp_query->get_queried_object(); 
     58                $c[] = 'category'; 
     59                $c[] = 'category-' . $cat->category_nicename; 
     60        } 
     61 
     62        // Page author for BODY on 'pages' 
     63        else if ( is_page() ) { 
     64                $pageID = $wp_query->post->ID; 
     65                the_post(); 
     66                $c[] = 'page pageid-' . $pageID; 
     67                $c[] = 'page-author-' . sanitize_title_with_dashes(strtolower(get_the_author('login'))); 
     68                rewind_posts(); 
     69        } 
     70 
     71        // For when a visitor is logged in while browsing 
     72        if ( $current_user->ID ) 
     73                $c[] = 'loggedin'; 
     74 
     75        // Paged classes; for 'page X' classes of index, single, etc. 
     76        if ( ( ( $page = $wp_query->get("paged") ) || ( $page = $wp_query->get("page") ) ) && $page > 1 ) { 
     77                $c[] = 'paged-'.$page.''; 
     78                if ( is_single() ) { 
     79                        $c[] = 'single-paged-'.$page.''; 
     80                } else if ( is_page() ) { 
     81                        $c[] = 'page-paged-'.$page.''; 
     82                } else if ( is_category() ) { 
     83                        $c[] = 'category-paged-'.$page.''; 
     84                } else if ( is_date() ) { 
     85                        $c[] = 'date-paged-'.$page.''; 
     86                } else if ( is_author() ) { 
     87                        $c[] = 'author-paged-'.$page.''; 
     88                } else if ( is_search() ) { 
     89                        $c[] = 'search-paged-'.$page.''; 
     90                } 
     91        } 
     92 
     93        // Separates classes with a single space, collates classes for BODY 
     94        $c = join(' ', apply_filters('body_class',  $c)); 
     95 
     96        // And tada! 
     97        return $print ? print($c) : $c; 
     98} 
     99 
     100// Generates semantic classes for each post DIV element 
     101function sandbox_post_class( $print = true ) { 
     102        global $post, $sandbox_post_alt; 
     103 
     104        // hentry for hAtom compliace, gets 'alt' for every other post DIV, describes the post type and p[n] 
     105        $c = array('hentry', "p$sandbox_post_alt", $post->post_type, $post->post_status); 
     106 
     107        // Author for the post queried 
     108        $c[] = 'author-' . sanitize_title_with_dashes(strtolower(get_the_author('login'))); 
     109 
     110        // Category for the post queried 
     111        foreach ( (array) get_the_category() as $cat ) 
     112                $c[] = 'category-' . $cat->category_nicename; 
     113 
     114        // For password-protected posts 
     115        if ( $post->post_password ) 
     116                $c[] = 'protected'; 
     117 
     118        // Applies the time- and date-based classes (below) to post DIV 
     119        sandbox_date_classes(mysql2date('U', $post->post_date), $c); 
     120 
     121        // If it's the other to the every, then add 'alt' class 
     122        if ( ++$sandbox_post_alt % 2 ) 
     123                $c[] = 'alt'; 
     124 
     125        // Separates classes with a single space, collates classes for post DIV 
     126        $c = join(' ', apply_filters('post_class', $c)); 
     127 
     128        // And tada! 
     129        return $print ? print($c) : $c; 
     130} 
     131 
     132// Define the num val for 'alt' classes (in post DIV and comment LI) 
     133$sandbox_post_alt = 1; 
     134 
     135// Generates semantic classes for each comment LI element 
     136function sandbox_comment_class( $print = true ) { 
     137        global $comment, $post, $sandbox_comment_alt; 
     138 
     139        // Collects the comment type (comment, trackback), 
     140        $c = array($comment->comment_type); 
     141 
     142        // Counts trackbacks (t[n]) or comments (c[n]) 
     143        if ($comment->comment_type == 'trackback') { 
     144                $c[] = "t$sandbox_comment_alt"; 
     145        } else { 
     146                $c[] = "c$sandbox_comment_alt"; 
     147        } 
     148 
     149        // If the comment author has an id (registered), then print the log in name 
     150        if ( $comment->user_id > 0 ) { 
     151                $user = get_userdata($comment->user_id); 
     152 
     153                // For all registered users, 'byuser'; to specificy the registered user, 'commentauthor+[log in name]' 
     154                $c[] = "byuser comment-author-".strtolower($user->user_login); 
     155 
     156                // For comment authors who are the author of the post 
     157                if ( $comment->user_id === $post->post_author ) 
     158                        $c[] = 'bypostauthor'; 
     159        } 
     160 
     161        // If it's the other to the every, then add 'alt' class; collects time- and date-based classes 
     162        sandbox_date_classes(mysql2date('U', $comment->comment_date), $c, 'c-'); 
     163        if ( ++$sandbox_comment_alt % 2 ) 
     164                $c[] = 'alt'; 
     165 
     166        // Separates classes with a single space, collates classes for comment LI 
     167        $c = join(' ', apply_filters('comment_class', $c)); 
     168 
     169        // Tada again! 
     170        return $print ? print($c) : $c; 
     171} 
     172 
     173// Generates time- and date-based classes for BODY, post DIVs, and comment LIs; relative to GMT (UTC) 
     174function sandbox_date_classes($t, &$c, $p = '') { 
     175        $t = $t + (get_settings('gmt_offset') * 3600); 
     176        $c[] = $p . 'y' . gmdate('Y', $t); // Year 
     177        $c[] = $p . 'm' . gmdate('m', $t); // Month 
     178        $c[] = $p . 'd' . gmdate('d', $t); // Day 
     179        $c[] = $p . 'h' . gmdate('H', $t); // Hour 
     180} 
     181 
     182// For category lists on category archives, returns other categorys except the current one (redundant) 
     183function sandbox_cats_meow($glue) { 
     184        $current_cat = single_cat_title('', false); 
     185        $separator = "\n"; 
     186        $cats = explode($separator, get_the_category_list($separator)); 
     187 
     188        foreach ( $cats as $i => $str ) { 
     189                if ( strstr($str, ">$current_cat<") ) { 
     190                        unset($cats[$i]); 
     191                        break; 
     192                } 
     193        } 
     194 
     195        if ( empty($cats) ) 
     196                return false; 
     197 
     198        return trim(join($glue, $cats)); 
     199} 
     200 
     201// Widget: Search; to match the Sandbox style and replace Widget plugin default 
     202function widget_sandbox_search($args) { 
     203        extract($args); 
     204        if ( empty($title) ) 
     205                $title = __('Search', 'sandbox'); 
     206?> 
     207                <?php echo $before_widget ?> 
     208                        <?php echo $before_title ?><label for="s"><?php echo $title ?></label><?php echo $after_title ?> 
     209                        <form id="searchform" method="get" action="<?php bloginfo('home') ?>"> 
     210                                <div> 
     211                                        <input id="s" name="s" type="text" value="<?php echo wp_specialchars(stripslashes($_GET['s']), true) ?>" size="10" tabindex="1" /> 
     212                                        <input id="searchsubmit" name="searchsubmit" type="submit" value="<?php _e('Find', 'sandbox') ?>" tabindex="2" /> 
     213                                </div> 
     214                        </form> 
     215                <?php echo $after_widget ?> 
     216 
     217<?php 
     218} 
     219 
     220// Widget: Meta; to match the Sandbox style and replace Widget plugin default 
     221function widget_sandbox_meta($args) { 
     222        extract($args); 
     223        if ( empty($title) ) 
     224                $title = __('Meta', 'sandbox'); 
     225?> 
     226                <?php echo $before_widget; ?> 
     227                        <?php echo $before_title . $title . $after_title; ?> 
     228                        <ul> 
     229                                <?php wp_register() ?> 
     230                                <li><?php wp_loginout() ?></li> 
     231                                <?php wp_meta() ?> 
     232                        </ul> 
     233                <?php echo $after_widget; ?> 
     234<?php 
     235} 
     236 
     237// Widget: RSS links; to match the Sandbox style 
     238function widget_sandbox_rsslinks($args) { 
     239        extract($args); 
     240        $options = get_option('widget_sandbox_rsslinks'); 
     241        $title = empty($options['title']) ? __('RSS Links', 'sandbox') : $options['title']; 
     242?> 
     243                <?php echo $before_widget; ?> 
     244                        <?php echo $before_title . $title . $after_title; ?> 
     245                        <ul> 
     246                                <li><a href="<?php bloginfo('rss2_url') ?>" title="<?php echo wp_specialchars(get_bloginfo('name'), 1) ?> <?php _e('Posts RSS feed', 'sandbox'); ?>" rel="alternate" type="application/rss+xml"><?php _e('All posts', 'sandbox') ?></a></li> 
     247                                <li><a href="<?php bloginfo('comments_rss2_url') ?>" title="<?php echo wp_specialchars(bloginfo('name'), 1) ?> <?php _e('Comments RSS feed', 'sandbox'); ?>" rel="alternate" type="application/rss+xml"><?php _e('All comments', 'sandbox') ?></a></li> 
     248                        </ul> 
     249                <?php echo $after_widget; ?> 
     250<?php 
     251} 
     252 
     253// Widget: RSS links; element controls for customizing text within Widget plugin 
     254function widget_sandbox_rsslinks_control() { 
     255        $options = $newoptions = get_option('widget_sandbox_rsslinks'); 
     256        if ( $_POST["rsslinks-submit"] ) { 
     257                $newoptions['title'] = strip_tags(stripslashes($_POST["rsslinks-title"])); 
     258        } 
     259        if ( $options != $newoptions ) { 
     260                $options = $newoptions; 
     261                update_option('widget_sandbox_rsslinks', $options); 
     262        } 
     263        $title = htmlspecialchars($options['title'], ENT_QUOTES); 
     264?> 
     265                        <p><label for="rsslinks-title"><?php _e('Title:'); ?> <input style="width: 250px;" id="rsslinks-title" name="rsslinks-title" type="text" value="<?php echo $title; ?>" /></label></p> 
     266                        <input type="hidden" id="rsslinks-submit" name="rsslinks-submit" value="1" /> 
     267<?php 
     268} 
     269 
     270// Widget and Sandbox function: creates bookmark links (blogrolls) for WP 2.0.x or WP 2.1.x 
     271function widget_sandbox_links() { 
     272        // Checks for WP 2.1.x bookmarks function 
     273        if ( function_exists('wp_list_bookmarks') ) { 
     274                wp_list_bookmarks(array('title_before'=>'<h3>', 'title_after'=>'</h3>', 'show_images'=>true)); 
     275        } else { 
     276                // If not WP 2.1.x, then on the database . . . 
     277                global $wpdb; 
     278 
     279                // Nasty bit of code to make pretty WP 2.0.x blogrolls 
     280                $cats = $wpdb->get_results(" 
     281                        SELECT DISTINCT link_category, cat_name, show_images,  
     282                                show_description, show_rating, show_updated, sort_order,  
     283                                sort_desc, list_limit 
     284                        FROM `$wpdb->links`  
     285                        LEFT JOIN `$wpdb->linkcategories` ON (link_category = cat_id) 
     286                        WHERE link_visible =  'Y' 
     287                                AND list_limit <> 0 
     288                        ORDER BY cat_name ASC", ARRAY_A); 
     289 
     290                // Sorts blogroll categorys by name 
     291                if ($cats) { 
     292                        foreach ($cats as $cat) { 
     293                                $orderby = $cat['sort_order']; 
     294                                $orderby = (bool_from_yn($cat['sort_desc'])?'_':'') . $orderby; 
     295 
     296                                // Display the category name 
     297                                echo '  <li id="linkcat-' . $cat['link_category'] . '"><h3>' . $cat['cat_name'] . "</h3>\n\t<ul>\n"; 
     298 
     299                                // Call get_links() with all the appropriate params 
     300                                get_links($cat['link_category'], 
     301                                        '<li>',"</li>","\n", 
     302                                        bool_from_yn($cat['show_images']), 
     303                                        $orderby, 
     304                                        bool_from_yn($cat['show_description']), 
     305                                        bool_from_yn($cat['show_rating']), 
     306                                        $cat['list_limit'], 
     307                                        bool_from_yn($cat['show_updated'])); 
     308         
     309                                // Closes any oustanding accounts 
     310                                echo "\n\t</ul>\n</li>\n"; 
     311                        } 
     312                } 
     313        } 
     314} 
     315 
     316// Widgets plugin: intializes the plugin after the widgets above have passed snuff 
     317function sandbox_widgets_init() { 
     318        if ( !function_exists('register_sidebars') ) 
     319                return; 
     320 
     321        // Uses H3-level headings with all widgets to match Sandbox style 
     322        $p = array( 
     323                'before_title' => "<h3 class='widgettitle'>", 
     324                'after_title' => "</h3>\n", 
     325        ); 
     326 
     327        // Table for how many? Two? This way, please. 
     328        register_sidebars(2, $p); 
     329 
     330        // Finished intializing Widgets plugin, now let's load the Sandbox default widgets 
     331        register_sidebar_widget(__('Search', 'sandbox'), 'widget_sandbox_search', null, 'search'); 
     332        unregister_widget_control('search'); 
     333        register_sidebar_widget(__('Meta', 'sandbox'), 'widget_sandbox_meta', null, 'meta'); 
     334        unregister_widget_control('meta'); 
     335        register_sidebar_widget(__('Links', 'sandbox'), 'widget_sandbox_links', null, 'links'); 
     336        unregister_widget_control('links'); 
     337        register_sidebar_widget(array(__('RSS Links', 'sandbox'), 'widgets'), 'widget_sandbox_rsslinks'); 
     338        register_widget_control(array(__('RSS Links', 'sandbox'), 'widgets'), 'widget_sandbox_rsslinks_control', 300, 90); 
     339} 
     340 
     341// Translate, if applicable 
     342load_theme_textdomain('sandbox'); 
     343 
     344// Runs our code at the end to check that everything needed has loaded 
     345add_action('init', 'sandbox_widgets_init'); 
     346 
     347// Adds filters so that things run smoothly 
     348add_filter('archive_meta', 'wptexturize'); 
     349add_filter('archive_meta', 'convert_smilies'); 
     350add_filter('archive_meta', 'convert_chars'); 
     351add_filter('archive_meta', 'wpautop'); 
     352 
     353// Remember: a Sandbox is for play. 
     354?> 
  • wp-content/themes/sandbox/sidebar.php

    old new  
     1        <div id="primary" class="sidebar"> 
     2                <ul class="xoxo"> 
     3<?php if (!function_exists('dynamic_sidebar') || !dynamic_sidebar(1) ) : // begin primary sidebar widgets ?> 
     4 
     5                        <li id="pages"> 
     6                                <h3><?php _e('Pages', 'sandbox') ?></h3> 
     7                                <ul> 
     8<?php wp_list_pages('title_li=&sort_column=post_title' ) ?> 
     9                                </ul> 
     10                        </li> 
     11 
     12                        <li id="categories"> 
     13                                <h3><?php _e('Categories', 'sandbox'); ?></h3> 
     14                                <ul> 
     15<?php wp_list_cats('sort_column=name&hierarchical=1') ?> 
     16 
     17                                </ul> 
     18                        </li> 
     19 
     20                        <li id="archives"> 
     21                                <h3><?php _e('Archives', 'sandbox') ?></h3> 
     22                                <ul> 
     23<?php wp_get_archives('type=monthly') ?> 
     24 
     25                                </ul> 
     26                        </li> 
     27<?php endif; // end primary sidebar widgets  ?> 
     28                </ul> 
     29        </div><!-- #primary .sidebar --> 
     30 
     31        <div id="secondary" class="sidebar"> 
     32                <ul class="xoxo"> 
     33<?php if (!function_exists('dynamic_sidebar') || !dynamic_sidebar(2) ) : // begin  secondary sidebar widgets ?> 
     34                        <li id="search"> 
     35                                <h3><label for="s"><?php _e('Search', 'sandbox') ?></label></h3> 
     36                                <form id="searchform" method="get" action="<?php bloginfo('home') ?>"> 
     37                                        <div> 
     38                                                <input id="s" name="s" type="text" value="<?php echo wp_specialchars(stripslashes($_GET['s']), true) ?>" size="10" tabindex="1" /> 
     39                                                <input id="searchsubmit" name="searchsubmit" type="submit" value="<?php _e('Find', 'sandbox') ?>" tabindex="2" /> 
     40                                        </div> 
     41                                </form> 
     42                        </li> 
     43 
     44<?php widget_sandbox_links() ?> 
     45 
     46                        <li id="rss-links"> 
     47                                <h3><?php _e('RSS Feeds', 'sandbox') ?></h3> 
     48                                <ul> 
     49                                        <li><a href="<?php bloginfo('rss2_url') ?>" title="<?php echo wp_specialchars(get_bloginfo('name'), 1) ?> <?php _e('Posts RSS feed', 'sandbox'); ?>" rel="alternate" type="application/rss+xml"><?php _e('All posts', 'sandbox') ?></a></li> 
     50                                        <li><a href="<?php bloginfo('comments_rss2_url') ?>" title="<?php echo wp_specialchars(bloginfo('name'), 1) ?> <?php _e('Comments RSS feed', 'sandbox'); ?>" rel="alternate" type="application/rss+xml"><?php _e('All comments', 'sandbox') ?></a></li> 
     51                                </ul> 
     52                        </li> 
     53 
     54                        <li id="meta"> 
     55                                <h3><?php _e('Meta', 'sandbox') ?></h3> 
     56                                <ul> 
     57                                        <?php wp_register() ?> 
     58 
     59                                        <li><?php wp_loginout() ?></li> 
     60                                        <?php wp_meta() ?> 
     61 
     62                                </ul> 
     63                        </li> 
     64<?php endif; // end secondary sidebar widgets  ?> 
     65                </ul> 
     66        </div><!-- #secondary .sidebar --> 
  • wp-content/themes/sandbox/readme.html

    old new  
     1<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> 
     2<html xmlns="http://www.w3.org/1999/xhtml"> 
     3<head profile="http://gmpg.org/xfn/11"> 
     4        <title>The Sandbox &middot; An explanation</title> 
     5        <meta http-equiv="content-type" content="text/html; charset=UTF-8" /> 
     6        <meta http-equiv="content-language" content="en-us" /> 
     7        <meta name="description" content="Sandbox: a highly semantic theme with powerful, dynamic class selectors" /> 
     8        <meta name="keywords" content="sandbox,xhtml,hatom,hcard,microformats,semantics,css,wordpress" /> 
     9        <style type="text/css" media="all"> 
     10        /*<![CDATA[*/ 
     11        body{background:#fcfcfc;color:#444;font:normal 70%/150% verdana,geneva,sans-serif;margin:0;padding:0;} 
     12        body blockquote{border-left:5px solid #f6f6f6;padding-left:0.5em;} 
     13        body code,body pre{font:1em/150% consolas,"courier new",courier,monospace;} 
     14        body div#readme{background:#fff;border-left:3px solid #f9f9f9;border-right:3px solid #f9f9f9;color:#444;margin:0 auto;padding:1em 2em;width:50em;} 
     15        body div#readme div#footer{margin:3em auto 1em;text-align:center;} 
     16        body div#readme div#footer p{background:#ffd;color:#666;display:inline;padding:0.2em 0.5em;} 
     17        body div#readme div#header{margin:0 auto;text-align:center;} 
     18        body div#readme div#header div.readme-version{font-size:0.9em;margin:0 0 0.5em;text-transform:uppercase;letter-spacing:0.1em;} 
     19        body h1{font-size:3.2em;} 
     20        body h1,body h2,body h3{font-family:garamond,georgia,times,serif;font-weight:400;} 
     21        body h2{font-size:2em;margin-top:3em;} 
     22        body h3{font-size:1.6em;margin-top:2em;} 
     23        body ol li ol li,body ol li#features ol li ol li{list-style:decimal;} 
     24        body ol li#functions h3{font-size:1.5em;} 
     25        body ol li#functions ol{list-style:lower-alpha;margin:0 0 0 2em;padding:0;} 
     26        body ol li#license blockquote a{color:#222;text-decoration:none;} 
     27        body ol li#license blockquote strong{font-size:0.9em;font-weight:400;text-transform:uppercase;} 
     28        body ol li,body ol#menu li ol li{list-style:upper-roman;} 
     29        body ol ul li{list-style:square;} 
     30        body ol#menu li{list-style:none;} 
     31        body ol#menu li ol li ol li,body ol li#functions ol li,body ol li#features ol li{list-style:lower-roman;} 
     32        body pre span,body span.bold{font-weight:700;} 
     33        body span.vcard span.family-name,body span.vcard span.additional-name{display:none;} 
     34        table{border-collapse:separate;border-color:#aaa;border-spacing:0;border-style:solid;border-width:1px;padding:0 0.5em;} 
     35        table tbody td{border-collapse:separate;border-color:#aaa;border-style:solid;border-width:0.5px 0;padding:0.2em 0.5em;} 
     36        table tbody th{border-bottom:1px solid #aaa;font-size:0.8em;text-align:left;text-transform:uppercase;} 
     37        table tbody tr.alt{background:#f5f5f5;} 
     38        table tfoot th{font-size:0.8em;padding-top:1em;text-align:left;text-transform:uppercase;} 
     39        table thead th{padding:0.5em;} 
     40        /*]]>*/ 
     41        </style> 
     42</head> 
     43<body> 
     44        <div id="readme"> 
     45 
     46                <div id="header"> 
     47                        <h1 id="title">The Sandbox</h1> 
     48                        <div class="readme-version">Version 0.9.5</div> 
     49                        <div class="readme-subtitle">A theme rich with powerful and dynamic semantic class selectors</div> 
     50                </div><!-- #header --> 
     51 
     52                <ol id="menu" class="xoxo"> 
     53                        <li> 
     54                                <h2>Table of contents</h2> 
     55                                <ol> 
     56                                        <li><a href="#introduction" title="Skip to Introduction">Introduction</a></li> 
     57                                        <li><a href="#installing" title="Skip to Installing">Installing</a></li> 
     58                                        <li><a href="#functions" title="Skip to Class functions">Class functions</a> 
     59                                                <ol> 
     60                                                        <li><a href="#body-class" title="Skip to Class functions: sandbox_body_class()"><code>sandbox_body_class()</code></a></li> 
     61                                                        <li><a href="#post-cla