" title="Sandbox" /> */ ?> @import url(); */ ?> " title="Sandbox" /> Skip navigation

\n"; } function sandbox_globalnav() { $options = get_option('sandbox_options'); if ( empty($options['globalnav']) ) return; if ( function_exists('wp_list_pages') ) { echo ' \n"; } else { // OTHER NAV CODE, WAIT, WHAT 'OTHER' NAV CODE? ;-) } } function sandbox_body_class() { global $wp_query; $c = array('wordpress'); sandbox_date_classes(time(), $c); is_home() ? $c[] = 'home' : null; is_page() ? $c[] = 'page' : 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; // CSS does not allow a digit as first character if ( is_author() ) { global $wp_query; $author = $wp_query->get_queried_object(); $c[] = 'author'; $c[] = 'author-' . $author->user_nicename; } if ( is_category() ) { global $wp_query; $cat = $wp_query->get_queried_object(); $c[] = 'category'; $c[] = 'category-' . $cat->category_nicename; } if ( is_single() ) { $c[] = 'single'; if ( isset($wp_query->post->post_date) ) sandbox_date_classes(mysql2date('U', $wp_query->post->post_date), $c, 's-'); } echo join(' ', apply_filters('body_class', $c)); } function sandbox_post_class() { global $post, $sandbox_post_alt; $c = array($post->post_type, $post->post_status); $c[] = 'author-' . get_the_author_login(); foreach ( (array) get_the_category() as $cat ) $c[] = 'category-' . $cat->category_nicename; sandbox_date_classes(mysql2date('U', $post->post_date), $c); if ( ++$sandbox_post_alt % 2 ) $c[] = 'alt'; echo 'hentry post'; echo join(' ', apply_filters('post_class', $c)); } $sandbox_post_alt = 1; function sandbox_comment_class() { global $comment, $post, $sandbox_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 > 0 && $comment->user_id === $post->post_author ) $c[] = 'bypostauthor'; sandbox_date_classes(mysql2date('U', $comment->comment_date), $c, 'c-'); if ( ++$sandbox_comment_alt % 2 ) $c[] = 'alt'; if ( is_trackback() ) { $c[] = 'trackback'; } echo join(' ', apply_filters('comment_class', $c)); } function sandbox_date_classes($t, &$c, $p = '') { $t = $t + (get_settings('gmt_offset') * 3600); $c[] = $p . 'y' . gmdate('Y', $t); // Year $c[] = $p . 'm' . gmdate('m', $t); // Month $c[] = $p . 'd' . gmdate('d', $t); // Day $c[] = $p . 'h' . gmdate('h', $t); // Hour } function widget_sandbox_search($args) { extract($args); if ( empty($title) ) $title = __('Search', 'sandbox'); ?>
'

', 'title_after'=>'

')); } else { // I don't like WP 2.0x links. } } register_sidebar_widget(__('Links', 'sandbox'), 'widget_sandbox_links'); function widget_links_control() { $options = $newoptions = get_option('widget_links'); if ( $_POST["links-submit"] ) { $newoptions['title'] = strip_tags(stripslashes($_POST["links-title"])); } if ( $options != $newoptions ) { $options = $newoptions; update_option('widget_links', $options); } $title = htmlspecialchars($options['title'], ENT_QUOTES); ?>

'

', 'after_title' => "

\n", ); $p['name'] = __('Primary Sidebar', 'sandbox'); $s['name'] = __('Secondary Sidebar', 'sandbox'); if ( function_exists('register_sidebar') ) { register_sidebar($p); register_sidebar($s); } if ( function_exists('register_sidebar_widget') ) register_sidebar_widget(__('Search'), 'widget_sandbox_search'); } add_action('init', 'sandbox_init'); function sandbox_admin_menu() { add_theme_page(__('Sandbox Options', 'sandbox'), __('Sandbox Options', 'sandbox'), 'edit_themes', basename(__FILE__), 'sandbox_options_page'); } add_action('admin_menu', 'sandbox_admin_menu'); function sandbox_options_page() { $styles = array(); $defaults = array('style' => '2c-r'); $options = array_merge($defaults, (array) get_option('sandbox_options')); if ( $GLOBALS['pagenow'] == 'themes.php' && $_GET['page'] == basename(__FILE__) && isset($_POST['sandbox_submit']) ) { $options['style'] = wp_filter_kses($_POST['style']); $options['globalnav'] = empty($_POST['globalnav']) ? false : true; if ( update_option('sandbox_options', $options) ) echo "\n

".__('Options saved successfully.', 'sandbox')."

\n"; } $_styles = glob(ABSPATH.'wp-content/themes/sandbox/styles/*.css'); foreach ( $_styles as $k => $v ) { $info = array(); preg_match('/\/([^\/]+).css$/i', $v, $matches); if ( !empty($matches[1]) ) $style = file($v); $info['desc'] = stripslashes(wp_filter_kses(trim($style[0], "\r\n\t/* "))); $png = str_replace('.css', '.png', $v); if ( file_exists($png) ) { $png_url = get_template_directory_uri() . '/styles/' . $matches[1] . '.png'; $info['img'] = ""; } else { $info['img'] = false; } $styles[$matches[1]] = $info; } ?>

/styles/ folder', 'sandbox') ?>

$info ) : extract($info); ?>
/> Mouseover thumbnails for a larger preview
/>

" />