diff options
author | donncha <donncha@7be80a69-a1ef-0310-a953-fb0f7c49ff36> | 2007-06-21 16:41:02 +0000 |
---|---|---|
committer | donncha <donncha@7be80a69-a1ef-0310-a953-fb0f7c49ff36> | 2007-06-21 16:41:02 +0000 |
commit | a5fe68e002632c190ffbd85167671ed4d4961135 (patch) | |
tree | ae57f94603111507c50cb3c212a03bedf8f7dc5a /wp-content | |
parent | 4e38776b5b68c61a4593a84340f4654200f7568e (diff) | |
download | wordpress-mu-a5fe68e002632c190ffbd85167671ed4d4961135.tar.gz wordpress-mu-a5fe68e002632c190ffbd85167671ed4d4961135.tar.xz wordpress-mu-a5fe68e002632c190ffbd85167671ed4d4961135.zip |
WP Merge to WP 2.2.1
git-svn-id: http://svn.automattic.com/wordpress-mu/trunk@1005 7be80a69-a1ef-0310-a953-fb0f7c49ff36
Diffstat (limited to 'wp-content')
-rw-r--r-- | wp-content/themes/classic/style.css | 20 | ||||
-rw-r--r-- | wp-content/themes/default/archive.php | 17 | ||||
-rw-r--r-- | wp-content/themes/default/functions.php | 832 | ||||
-rw-r--r-- | wp-content/themes/default/sidebar.php | 8 |
4 files changed, 437 insertions, 440 deletions
diff --git a/wp-content/themes/classic/style.css b/wp-content/themes/classic/style.css index f5436b2..e09122d 100644 --- a/wp-content/themes/classic/style.css +++ b/wp-content/themes/classic/style.css @@ -48,9 +48,9 @@ blockquote { body { background: #fff; - border: 2px solid #565; - border-bottom: 1px solid #565; - border-top: 3px solid #565; + border: solid 2px #565; + border-bottom: solid 1px #565; + border-top: solid 3px #565; color: #000; font-family: 'Lucida Grande', 'Lucida Sans Unicode', Verdana, sans-serif; margin: 0; @@ -71,7 +71,7 @@ h2 { } h3 { - border-bottom: 1px dotted #eee; + border-bottom: dotted 1px #eee; font-family: "Times New Roman", Times, serif; margin-top: 0; } @@ -96,7 +96,7 @@ ul.post-meta span.post-meta-key { .credit { background: #90a090; - border-top: 3px double #aba; + border-top: double 3px #aba; color: #fff; font-size: 11px; margin: 10px 0 0 0; @@ -166,10 +166,10 @@ ul.post-meta span.post-meta-key { #header { background: #90a090; - border-bottom: 3px double #aba; - border-left: 1px solid #9a9; - border-right: 1px solid #565; - border-top: 1px solid #9a9; + border-bottom: double 3px #aba; + border-left: solid 1px #9a9; + border-right: solid 1px #565; + border-top: solid 1px #9a9; font: italic normal 230% 'Times New Roman', Times, serif; letter-spacing: 0.2em; margin: 0; @@ -188,7 +188,7 @@ ul.post-meta span.post-meta-key { #menu { background: #fff; border-left: 1px dotted #ccc; - border-top: 3px solid #e0e6e0; + border-top: solid 3px #e0e6e0; padding: 20px 0 10px 30px; position: absolute; right: 2px; diff --git a/wp-content/themes/default/archive.php b/wp-content/themes/default/archive.php index db6db4c..1d2b1de 100644 --- a/wp-content/themes/default/archive.php +++ b/wp-content/themes/default/archive.php @@ -4,21 +4,26 @@ <?php if (have_posts()) : ?> - <?php $post = $posts[0]; // Hack. Set $post so that the_date() works. ?> - <?php /* If this is a category archive */ if (is_category()) { ?> + <?php $post = $posts[0]; // Hack. Set $post so that the_date() works. ?> +<?php /* If this is a category archive */ if (is_category()) { ?> <h2 class="pagetitle">Archive for the ‘<?php single_cat_title(); ?>’ Category</h2> <?php /* If this is a daily archive */ } elseif (is_day()) { ?> <h2 class="pagetitle">Archive for <?php the_time('F jS, Y'); ?></h2> - <?php /* If this is a monthly archive */ } elseif (is_month()) { ?> + + <?php /* If this is a monthly archive */ } elseif (is_month()) { ?> <h2 class="pagetitle">Archive for <?php the_time('F, Y'); ?></h2> - <?php /* If this is a yearly archive */ } elseif (is_year()) { ?> + + <?php /* If this is a yearly archive */ } elseif (is_year()) { ?> <h2 class="pagetitle">Archive for <?php the_time('Y'); ?></h2> + <?php /* If this is an author archive */ } elseif (is_author()) { ?> <h2 class="pagetitle">Author Archive</h2> - <?php /* If this is a paged archive */ } elseif (isset($_GET['paged']) && !empty($_GET['paged'])) { ?> + + <?php /* If this is a paged archive */ } elseif (isset($_GET['paged']) && !empty($_GET['paged'])) { ?> <h2 class="pagetitle">Blog Archives</h2> - <?php } ?> + + <?php } ?> <div class="navigation"> diff --git a/wp-content/themes/default/functions.php b/wp-content/themes/default/functions.php index faf85ad..1ea54fc 100644 --- a/wp-content/themes/default/functions.php +++ b/wp-content/themes/default/functions.php @@ -1,416 +1,416 @@ -<?php
-if ( function_exists('register_sidebar') )
- register_sidebar(array(
- 'before_widget' => '<li id="%1$s" class="widget %2$s">',
- 'after_widget' => '</li>',
- 'before_title' => '<h2 class="widgettitle">',
- 'after_title' => '</h2>',
- ));
-
-function kubrick_head() {
- $head = "<style type='text/css'>\n<!--";
- $output = '';
- if ( kubrick_header_image() ) {
- $url = kubrick_header_image_url() ;
- $output .= "#header { background: url('$url') no-repeat bottom center; }\n";
- }
- if ( false !== ( $color = kubrick_header_color() ) ) {
- $output .= "#headerimg h1 a, #headerimg h1 a:visited, #headerimg .description { color: $color; }\n";
- }
- if ( false !== ( $display = kubrick_header_display() ) ) {
- $output .= "#headerimg { display: $display }\n";
- }
- $foot = "--></style>\n";
- if ( '' != $output )
- echo $head . $output . $foot;
-}
-
-add_action('wp_head', 'kubrick_head');
-
-function kubrick_header_image() {
- return apply_filters('kubrick_header_image', get_option('kubrick_header_image'));
-}
-
-function kubrick_upper_color() {
- if (strpos($url = kubrick_header_image_url(), 'header-img.php?') !== false) {
- parse_str(substr($url, strpos($url, '?') + 1), $q);
- return $q['upper'];
- } else
- return '69aee7';
-}
-
-function kubrick_lower_color() {
- if (strpos($url = kubrick_header_image_url(), 'header-img.php?') !== false) {
- parse_str(substr($url, strpos($url, '?') + 1), $q);
- return $q['lower'];
- } else
- return '4180b6';
-}
-
-function kubrick_header_image_url() {
- if ( $image = kubrick_header_image() )
- $url = get_template_directory_uri() . '/images/' . $image;
- else
- $url = get_template_directory_uri() . '/images/kubrickheader.jpg';
-
- return $url;
-}
-
-function kubrick_header_color() {
- return apply_filters('kubrick_header_color', get_option('kubrick_header_color'));
-}
-
-function kubrick_header_color_string() {
- $color = kubrick_header_color();
- if ( false === $color )
- return 'white';
-
- return $color;
-}
-
-function kubrick_header_display() {
- return apply_filters('kubrick_header_display', get_option('kubrick_header_display'));
-}
-
-function kubrick_header_display_string() {
- $display = kubrick_header_display();
- return $display ? $display : 'inline';
-}
-
-add_action('admin_menu', 'kubrick_add_theme_page');
-
-function kubrick_add_theme_page() {
- if ( $_GET['page'] == basename(__FILE__) ) {
- if ( 'save' == $_REQUEST['action'] ) {
- check_admin_referer('kubrick-header');
- if ( isset($_REQUEST['njform']) ) {
- if ( isset($_REQUEST['defaults']) ) {
- delete_option('kubrick_header_image');
- delete_option('kubrick_header_color');
- delete_option('kubrick_header_display');
- } else {
- if ( '' == $_REQUEST['njfontcolor'] )
- delete_option('kubrick_header_color');
- else {
- $fontcolor = preg_replace('/^.*(#[0-9a-fA-F]{6})?.*$/', '$1', $_REQUEST['njfontcolor']);
- update_option('kubrick_header_color', $fontcolor);
- }
- if ( preg_match('/[0-9A-F]{6}|[0-9A-F]{3}/i', $_REQUEST['njuppercolor'], $uc) && preg_match('/[0-9A-F]{6}|[0-9A-F]{3}/i', $_REQUEST['njlowercolor'], $lc) ) {
- $uc = ( strlen($uc[0]) == 3 ) ? $uc[0]{0}.$uc[0]{0}.$uc[0]{1}.$uc[0]{1}.$uc[0]{2}.$uc[0]{2} : $uc[0];
- $lc = ( strlen($lc[0]) == 3 ) ? $lc[0]{0}.$lc[0]{0}.$lc[0]{1}.$lc[0]{1}.$lc[0]{2}.$lc[0]{2} : $lc[0];
- update_option('kubrick_header_image', "header-img.php?upper=$uc&lower=$lc");
- }
-
- if ( isset($_REQUEST['toggledisplay']) ) {
- if ( false === get_option('kubrick_header_display') )
- update_option('kubrick_header_display', 'none');
- else
- delete_option('kubrick_header_display');
- }
- }
- } else {
-
- if ( isset($_REQUEST['headerimage']) ) {
- check_admin_referer('kubrick-header');
- if ( '' == $_REQUEST['headerimage'] )
- delete_option('kubrick_header_image');
- else {
- $headerimage = preg_replace('/^.*?(header-img.php\?upper=[0-9a-fA-F]{6}&lower=[0-9a-fA-F]{6})?.*$/', '$1', $_REQUEST['headerimage']);
- update_option('kubrick_header_image', $headerimage);
- }
- }
-
- if ( isset($_REQUEST['fontcolor']) ) {
- check_admin_referer('kubrick-header');
- if ( '' == $_REQUEST['fontcolor'] )
- delete_option('kubrick_header_color');
- else {
- $fontcolor = preg_replace('/^.*?(#[0-9a-fA-F]{6})?.*$/', '$1', $_REQUEST['fontcolor']);
- update_option('kubrick_header_color', $fontcolor);
- }
- }
-
- if ( isset($_REQUEST['fontdisplay']) ) {
- check_admin_referer('kubrick-header');
- if ( '' == $_REQUEST['fontdisplay'] || 'inline' == $_REQUEST['fontdisplay'] )
- delete_option('kubrick_header_display');
- else
- update_option('kubrick_header_display', 'none');
- }
- }
- //print_r($_REQUEST);
- wp_redirect("themes.php?page=functions.php&saved=true");
- die;
- }
- add_action('admin_head', 'kubrick_theme_page_head');
- }
- add_theme_page(__('Customize Header'), __('Header Image and Color'), 'edit_themes', basename(__FILE__), 'kubrick_theme_page');
-}
-
-function kubrick_theme_page_head() {
-?>
-<script type="text/javascript" src="../wp-includes/js/colorpicker.js"></script>
-<script type='text/javascript'>
-// <![CDATA[
- function pickColor(color) {
- ColorPicker_targetInput.value = color;
- kUpdate(ColorPicker_targetInput.id);
- }
- function PopupWindow_populate(contents) {
- contents += '<br /><p style="text-align:center;margin-top:0px;"><input type="button" value="<?php echo attribute_escape(__('Close Color Picker')); ?>" onclick="cp.hidePopup(\'prettyplease\')"></input></p>';
- this.contents = contents;
- this.populated = false;
- }
- function PopupWindow_hidePopup(magicword) {
- if ( magicword != 'prettyplease' )
- return false;
- if (this.divName != null) {
- if (this.use_gebi) {
- document.getElementById(this.divName).style.visibility = "hidden";
- }
- else if (this.use_css) {
- document.all[this.divName].style.visibility = "hidden";
- }
- else if (this.use_layers) {
- document.layers[this.divName].visibility = "hidden";
- }
- }
- else {
- if (this.popupWindow && !this.popupWindow.closed) {
- this.popupWindow.close();
- this.popupWindow = null;
- }
- }
- return false;
- }
- function colorSelect(t,p) {
- if ( cp.p == p && document.getElementById(cp.divName).style.visibility != "hidden" )
- cp.hidePopup('prettyplease');
- else {
- cp.p = p;
- cp.select(t,p);
- }
- }
- function PopupWindow_setSize(width,height) {
- this.width = 162;
- this.height = 210;
- }
-
- var cp = new ColorPicker();
- function advUpdate(val, obj) {
- document.getElementById(obj).value = val;
- kUpdate(obj);
- }
- function kUpdate(oid) {
- if ( 'uppercolor' == oid || 'lowercolor' == oid ) {
- uc = document.getElementById('uppercolor').value.replace('#', '');
- lc = document.getElementById('lowercolor').value.replace('#', '');
- hi = document.getElementById('headerimage');
- hi.value = 'header-img.php?upper='+uc+'&lower='+lc;
- document.getElementById('header').style.background = 'url("<?php echo get_template_directory_uri(); ?>/images/'+hi.value+'") center no-repeat';
- document.getElementById('advuppercolor').value = '#'+uc;
- document.getElementById('advlowercolor').value = '#'+lc;
- }
- if ( 'fontcolor' == oid ) {
- document.getElementById('header').style.color = document.getElementById('fontcolor').value;
- document.getElementById('advfontcolor').value = document.getElementById('fontcolor').value;
- }
- if ( 'fontdisplay' == oid ) {
- document.getElementById('headerimg').style.display = document.getElementById('fontdisplay').value;
- }
- }
- function toggleDisplay() {
- td = document.getElementById('fontdisplay');
- td.value = ( td.value == 'none' ) ? 'inline' : 'none';
- kUpdate('fontdisplay');
- }
- function toggleAdvanced() {
- a = document.getElementById('jsAdvanced');
- if ( a.style.display == 'none' )
- a.style.display = 'block';
- else
- a.style.display = 'none';
- }
- function kDefaults() {
- document.getElementById('headerimage').value = '';
- document.getElementById('advuppercolor').value = document.getElementById('uppercolor').value = '#69aee7';
- document.getElementById('advlowercolor').value = document.getElementById('lowercolor').value = '#4180b6';
- document.getElementById('header').style.background = 'url("<?php echo get_template_directory_uri(); ?>/images/kubrickheader.jpg") center no-repeat';
- document.getElementById('header').style.color = '#FFFFFF';
- document.getElementById('advfontcolor').value = document.getElementById('fontcolor').value = '';
- document.getElementById('fontdisplay').value = 'inline';
- document.getElementById('headerimg').style.display = document.getElementById('fontdisplay').value;
- }
- function kRevert() {
- document.getElementById('headerimage').value = '<?php echo js_escape(kubrick_header_image()); ?>';
- document.getElementById('advuppercolor').value = document.getElementById('uppercolor').value = '#<?php echo js_escape(kubrick_upper_color()); ?>';
- document.getElementById('advlowercolor').value = document.getElementById('lowercolor').value = '#<?php echo js_escape(kubrick_lower_color()); ?>';
- document.getElementById('header').style.background = 'url("<?php echo js_escape(kubrick_header_image_url()); ?>") center no-repeat';
- document.getElementById('header').style.color = '';
- document.getElementById('advfontcolor').value = document.getElementById('fontcolor').value = '<?php echo js_escape(kubrick_header_color_string()); ?>';
- document.getElementById('fontdisplay').value = '<?php echo js_escape(kubrick_header_display_string()); ?>';
- document.getElementById('headerimg').style.display = document.getElementById('fontdisplay').value;
- }
- function kInit() {
- document.getElementById('jsForm').style.display = 'block';
- document.getElementById('nonJsForm').style.display = 'none';
- }
- addLoadEvent(kInit);
-// ]]>
-</script>
-<style type='text/css'>
- #headwrap {
- text-align: center;
- }
- #kubrick-header {
- font-size: 80%;
- }
- #kubrick-header .hibrowser {
- width: 780px;
- height: 260px;
- overflow: scroll;
- }
- #kubrick-header #hitarget {
- display: none;
- }
- #kubrick-header #header h1 {
- font-family: 'Trebuchet MS', 'Lucida Grande', Verdana, Arial, Sans-Serif;
- font-weight: bold;
- font-size: 4em;
- text-align: center;
- padding-top: 70px;
- margin: 0;
- }
-
- #kubrick-header #header .description {
- font-family: 'Lucida Grande', Verdana, Arial, Sans-Serif;
- font-size: 1.2em;
- text-align: center;
- }
- #kubrick-header #header {
- text-decoration: none;
- color: <?php echo kubrick_header_color_string(); ?>;
- padding: 0;
- margin: 0;
- height: 200px;
- text-align: center;
- background: url('<?php echo kubrick_header_image_url(); ?>') center no-repeat;
- }
- #kubrick-header #headerimg {
- margin: 0;
- height: 200px;
- width: 100%;
- display: <?php echo kubrick_header_display_string(); ?>;
- }
- #jsForm {
- display: none;
- text-align: center;
- }
- #jsForm input.submit, #jsForm input.button, #jsAdvanced input.button {
- padding: 0px;
- margin: 0px;
- }
- #advanced {
- text-align: center;
- width: 620px;
- }
- html>body #advanced {
- text-align: center;
- position: relative;
- left: 50%;
- margin-left: -380px;
- }
- #jsAdvanced {
- text-align: right;
- }
- #nonJsForm {
- position: relative;
- text-align: left;
- margin-left: -370px;
- left: 50%;
- }
- #nonJsForm label {
- padding-top: 6px;
- padding-right: 5px;
- float: left;
- width: 100px;
- text-align: right;
- }
- .defbutton {
- font-weight: bold;
- }
- .zerosize {
- width: 0px;
- height: 0px;
- overflow: hidden;
- }
- #colorPickerDiv a, #colorPickerDiv a:hover {
- padding: 1px;
- text-decoration: none;
- border-bottom: 0px;
- }
-</style>
-<?php
-}
-
-function kubrick_theme_page() {
- if ( $_REQUEST['saved'] ) echo '<div id="message" class="updated fade"><p><strong>'.__('Options saved.').'</strong></p></div>';
-?>
-<div class='wrap'>
- <div id="kubrick-header">
- <h2><?php _e('Header Image and Color'); ?></h2>
- <div id="headwrap">
- <div id="header">
- <div id="headerimg">
- <h1><?php bloginfo('name'); ?></h1>
- <div class="description"><?php bloginfo('description'); ?></div>
- </div>
- </div>
- </div>
- <br />
- <div id="nonJsForm">
- <form method="post" action="">
- <?php wp_nonce_field('kubrick-header'); ?>
- <div class="zerosize"><input type="submit" name="defaultsubmit" value="<?php echo attribute_escape(__('Save')); ?>" /></div>
- <label for="njfontcolor"><?php _e('Font Color:'); ?></label><input type="text" name="njfontcolor" id="njfontcolor" value="<?php echo attribute_escape(kubrick_header_color()); ?>" /> <?php printf(__('Any CSS color (%s or %s or %s)'), '<code>red</code>', '<code>#FF0000</code>', '<code>rgb(255, 0, 0)</code>'); ?><br />
- <label for="njuppercolor"><?php _e('Upper Color:'); ?></label><input type="text" name="njuppercolor" id="njuppercolor" value="#<?php echo attribute_escape(kubrick_upper_color()); ?>" /> <?php printf(__('HEX only (%s or %s)'), '<code>#FF0000</code>', '<code>#F00</code>'); ?><br />
- <label for="njlowercolor"><?php _e('Lower Color:'); ?></label><input type="text" name="njlowercolor" id="njlowercolor" value="#<?php echo attribute_escape(kubrick_lower_color()); ?>" /> <?php printf(__('HEX only (%s or %s)'), '<code>#FF0000</code>', '<code>#F00</code>'); ?><br />
- <input type="hidden" name="hi" id="hi" value="<?php echo attribute_escape(kubrick_header_image()); ?>" />
- <input type="submit" name="toggledisplay" id="toggledisplay" value="<?php echo attribute_escape(__('Toggle Text')); ?>" />
- <input type="submit" name="defaults" value="<?php echo attribute_escape(__('Use Defaults')); ?>" />
- <input type="submit" class="defbutton" name="submitform" value=" <?php _e('Save'); ?> " />
- <input type="hidden" name="action" value="save" />
- <input type="hidden" name="njform" value="true" />
- </form>
- </div>
- <div id="jsForm">
- <form style="display:inline;" method="post" name="hicolor" id="hicolor" action="<?php echo $_SERVER['REQUEST_URI']; ?>">
- <?php wp_nonce_field('kubrick-header'); ?>
- <input type="button" onclick="tgt=document.getElementById('fontcolor');colorSelect(tgt,'pick1');return false;" name="pick1" id="pick1" value="<?php echo attribute_escape(__('Font Color')); ?>"></input>
- <input type="button" onclick="tgt=document.getElementById('uppercolor');colorSelect(tgt,'pick2');return false;" name="pick2" id="pick2" value="<?php echo attribute_escape(__('Upper Color')); ?>"></input>
- <input type="button" onclick="tgt=document.getElementById('lowercolor');colorSelect(tgt,'pick3');return false;" name="pick3" id="pick3" value="<?php echo attribute_escape(__('Lower Color')); ?>"></input>
- <input type="button" name="revert" value="<?php echo attribute_escape(__('Revert')); ?>" onclick="kRevert()" />
- <input type="button" value="<?php echo attribute_escape(__('Advanced')); ?>" onclick="toggleAdvanced()" />
- <input type="hidden" name="action" value="save" />
- <input type="hidden" name="fontdisplay" id="fontdisplay" value="<?php echo attribute_escape(kubrick_header_display()); ?>" />
- <input type="hidden" name="fontcolor" id="fontcolor" value="<?php echo attribute_escape(kubrick_header_color()); ?>" />
- <input type="hidden" name="uppercolor" id="uppercolor" value="<?php echo attribute_escape(kubrick_upper_color()); ?>" />
- <input type="hidden" name="lowercolor" id="lowercolor" value="<?php echo attribute_escape(kubrick_lower_color()); ?>" />
- <input type="hidden" name="headerimage" id="headerimage" value="<?php echo attribute_escape(kubrick_header_image()); ?>" />
- <p class="submit"><input type="submit" name="submitform" class="defbutton" value="<?php echo attribute_escape(__('Update Header »')); ?>" onclick="cp.hidePopup('prettyplease')" /></p>
- </form>
- <div id="colorPickerDiv" style="z-index: 100;background:#eee;border:1px solid #ccc;position:absolute;visibility:hidden;"> </div>
- <div id="advanced">
- <form id="jsAdvanced" style="display:none;" action="">
- <?php wp_nonce_field('kubrick-header'); ?>
- <label for="advfontcolor"><?php _e('Font Color (CSS):'); ?> </label><input type="text" id="advfontcolor" onchange="advUpdate(this.value, 'fontcolor')" value="<?php echo attribute_escape(kubrick_header_color()); ?>" /><br />
- <label for="advuppercolor"><?php _e('Upper Color (HEX):');?> </label><input type="text" id="advuppercolor" onchange="advUpdate(this.value, 'uppercolor')" value="#<?php echo attribute_escape(kubrick_upper_color()); ?>" /><br />
- <label for="advlowercolor"><?php _e('Lower Color (HEX):'); ?> </label><input type="text" id="advlowercolor" onchange="advUpdate(this.value, 'lowercolor')" value="#<?php echo attribute_escape(kubrick_lower_color()); ?>" /><br />
- <input type="button" name="default" value="<?php echo attribute_escape(__('Select Default Colors')); ?>" onclick="kDefaults()" /><br />
- <input type="button" onclick="toggleDisplay();return false;" name="pick" id="pick" value="<?php echo attribute_escape(__('Toggle Text Display')); ?>"></input><br />
- </form>
- </div>
- </div>
- </div>
-</div>
-<?php } ?>
+<?php +if ( function_exists('register_sidebar') ) + register_sidebar(array( + 'before_widget' => '<li id="%1$s" class="widget %2$s">', + 'after_widget' => '</li>', + 'before_title' => '<h2 class="widgettitle">', + 'after_title' => '</h2>', + )); + +function kubrick_head() { + $head = "<style type='text/css'>\n<!--"; + $output = ''; + if ( kubrick_header_image() ) { + $url = kubrick_header_image_url() ; + $output .= "#header { background: url('$url') no-repeat bottom center; }\n"; + } + if ( false !== ( $color = kubrick_header_color() ) ) { + $output .= "#headerimg h1 a, #headerimg h1 a:visited, #headerimg .description { color: $color; }\n"; + } + if ( false !== ( $display = kubrick_header_display() ) ) { + $output .= "#headerimg { display: $display }\n"; + } + $foot = "--></style>\n"; + if ( '' != $output ) + echo $head . $output . $foot; +} + +add_action('wp_head', 'kubrick_head'); + +function kubrick_header_image() { + return apply_filters('kubrick_header_image', get_option('kubrick_header_image')); +} + +function kubrick_upper_color() { + if (strpos($url = kubrick_header_image_url(), 'header-img.php?') !== false) { + parse_str(substr($url, strpos($url, '?') + 1), $q); + return $q['upper']; + } else + return '69aee7'; +} + +function kubrick_lower_color() { + if (strpos($url = kubrick_header_image_url(), 'header-img.php?') !== false) { + parse_str(substr($url, strpos($url, '?') + 1), $q); + return $q['lower']; + } else + return '4180b6'; +} + +function kubrick_header_image_url() { + if ( $image = kubrick_header_image() ) + $url = get_template_directory_uri() . '/images/' . $image; + else + $url = get_template_directory_uri() . '/images/kubrickheader.jpg'; + + return $url; +} + +function kubrick_header_color() { + return apply_filters('kubrick_header_color', get_option('kubrick_header_color')); +} + +function kubrick_header_color_string() { + $color = kubrick_header_color(); + if ( false === $color ) + return 'white'; + + return $color; +} + +function kubrick_header_display() { + return apply_filters('kubrick_header_display', get_option('kubrick_header_display')); +} + +function kubrick_header_display_string() { + $display = kubrick_header_display(); + return $display ? $display : 'inline'; +} + +add_action('admin_menu', 'kubrick_add_theme_page'); + +function kubrick_add_theme_page() { + if ( $_GET['page'] == basename(__FILE__) ) { + if ( 'save' == $_REQUEST['action'] ) { + check_admin_referer('kubrick-header'); + if ( isset($_REQUEST['njform']) ) { + if ( isset($_REQUEST['defaults']) ) { + delete_option('kubrick_header_image'); + delete_option('kubrick_header_color'); + delete_option('kubrick_header_display'); + } else { + if ( '' == $_REQUEST['njfontcolor'] ) + delete_option('kubrick_header_color'); + else { + $fontcolor = preg_replace('/^.*(#[0-9a-fA-F]{6})?.*$/', '$1', $_REQUEST['njfontcolor']); + update_option('kubrick_header_color', $fontcolor); + } + if ( preg_match('/[0-9A-F]{6}|[0-9A-F]{3}/i', $_REQUEST['njuppercolor'], $uc) && preg_match('/[0-9A-F]{6}|[0-9A-F]{3}/i', $_REQUEST['njlowercolor'], $lc) ) { + $uc = ( strlen($uc[0]) == 3 ) ? $uc[0]{0}.$uc[0]{0}.$uc[0]{1}.$uc[0]{1}.$uc[0]{2}.$uc[0]{2} : $uc[0]; + $lc = ( strlen($lc[0]) == 3 ) ? $lc[0]{0}.$lc[0]{0}.$lc[0]{1}.$lc[0]{1}.$lc[0]{2}.$lc[0]{2} : $lc[0]; + update_option('kubrick_header_image', "header-img.php?upper=$uc&lower=$lc"); + } + + if ( isset($_REQUEST['toggledisplay']) ) { + if ( false === get_option('kubrick_header_display') ) + update_option('kubrick_header_display', 'none'); + else + delete_option('kubrick_header_display'); + } + } + } else { + + if ( isset($_REQUEST['headerimage']) ) { + check_admin_referer('kubrick-header'); + if ( '' == $_REQUEST['headerimage'] ) + delete_option('kubrick_header_image'); + else { + $headerimage = preg_replace('/^.*?(header-img.php\?upper=[0-9a-fA-F]{6}&lower=[0-9a-fA-F]{6})?.*$/', '$1', $_REQUEST['headerimage']); + update_option('kubrick_header_image', $headerimage); + } + } + + if ( isset($_REQUEST['fontcolor']) ) { + check_admin_referer('kubrick-header'); + if ( '' == $_REQUEST['fontcolor'] ) + delete_option('kubrick_header_color'); + else { + $fontcolor = preg_replace('/^.*?(#[0-9a-fA-F]{6})?.*$/', '$1', $_REQUEST['fontcolor']); + update_option('kubrick_header_color', $fontcolor); + } + } + + if ( isset($_REQUEST['fontdisplay']) ) { + check_admin_referer('kubrick-header'); + if ( '' == $_REQUEST['fontdisplay'] || 'inline' == $_REQUEST['fontdisplay'] ) + delete_option('kubrick_header_display'); + else + update_option('kubrick_header_display', 'none'); + } + } + //print_r($_REQUEST); + wp_redirect("themes.php?page=functions.php&saved=true"); + die; + } + add_action('admin_head', 'kubrick_theme_page_head'); + } + add_theme_page(__('Customize Header'), __('Header Image and Color'), 'edit_themes', basename(__FILE__), 'kubrick_theme_page'); +} + +function kubrick_theme_page_head() { +?> +<script type="text/javascript" src="../wp-includes/js/colorpicker.js"></script> +<script type='text/javascript'> +// <![CDATA[ + function pickColor(color) { + ColorPicker_targetInput.value = color; + kUpdate(ColorPicker_targetInput.id); + } + function PopupWindow_populate(contents) { + contents += '<br /><p style="text-align:center;margin-top:0px;"><input type="button" value="<?php echo attribute_escape(__('Close Color Picker')); ?>" onclick="cp.hidePopup(\'prettyplease\')"></input></p>'; + this.contents = contents; + this.populated = false; + } + function PopupWindow_hidePopup(magicword) { + if ( magicword != 'prettyplease' ) + return false; + if (this.divName != null) { + if (this.use_gebi) { + document.getElementById(this.divName).style.visibility = "hidden"; + } + else if (this.use_css) { + document.all[this.divName].style.visibility = "hidden"; + } + else if (this.use_layers) { + document.layers[this.divName].visibility = "hidden"; + } + } + else { + if (this.popupWindow && !this.popupWindow.closed) { + this.popupWindow.close(); + this.popupWindow = null; + } + } + return false; + } + function colorSelect(t,p) { + if ( cp.p == p && document.getElementById(cp.divName).style.visibility != "hidden" ) + cp.hidePopup('prettyplease'); + else { + cp.p = p; + cp.select(t,p); + } + } + function PopupWindow_setSize(width,height) { + this.width = 162; + this.height = 210; + } + + var cp = new ColorPicker(); + function advUpdate(val, obj) { + document.getElementById(obj).value = val; + kUpdate(obj); + } + function kUpdate(oid) { + if ( 'uppercolor' == oid || 'lowercolor' == oid ) { + uc = document.getElementById('uppercolor').value.replace('#', ''); + lc = document.getElementById('lowercolor').value.replace('#', ''); + hi = document.getElementById('headerimage'); + hi.value = 'header-img.php?upper='+uc+'&lower='+lc; + document.getElementById('header').style.background = 'url("<?php echo get_template_directory_uri(); ?>/images/'+hi.value+'") center no-repeat'; + document.getElementById('advuppercolor').value = '#'+uc; + document.getElementById('advlowercolor').value = '#'+lc; + } + if ( 'fontcolor' == oid ) { + document.getElementById('header').style.color = document.getElementById('fontcolor').value; + document.getElementById('advfontcolor').value = document.getElementById('fontcolor').value; + } + if ( 'fontdisplay' == oid ) { + document.getElementById('headerimg').style.display = document.getElementById('fontdisplay').value; + } + } + function toggleDisplay() { + td = document.getElementById('fontdisplay'); + td.value = ( td.value == 'none' ) ? 'inline' : 'none'; + kUpdate('fontdisplay'); + } + function toggleAdvanced() { + a = document.getElementById('jsAdvanced'); + if ( a.style.display == 'none' ) + a.style.display = 'block'; + else + a.style.display = 'none'; + } + function kDefaults() { + document.getElementById('headerimage').value = ''; + document.getElementById('advuppercolor').value = document.getElementById('uppercolor').value = '#69aee7'; + document.getElementById('advlowercolor').value = document.getElementById('lowercolor').value = '#4180b6'; + document.getElementById('header').style.background = 'url("<?php echo get_template_directory_uri(); ?>/images/kubrickheader.jpg") center no-repeat'; + document.getElementById('header').style.color = '#FFFFFF'; + document.getElementById('advfontcolor').value = document.getElementById('fontcolor').value = ''; + document.getElementById('fontdisplay').value = 'inline'; + document.getElementById('headerimg').style.display = document.getElementById('fontdisplay').value; + } + function kRevert() { + document.getElementById('headerimage').value = '<?php echo js_escape(kubrick_header_image()); ?>'; + document.getElementById('advuppercolor').value = document.getElementById('uppercolor').value = '#<?php echo js_escape(kubrick_upper_color()); ?>'; + document.getElementById('advlowercolor').value = document.getElementById('lowercolor').value = '#<?php echo js_escape(kubrick_lower_color()); ?>'; + document.getElementById('header').style.background = 'url("<?php echo js_escape(kubrick_header_image_url()); ?>") center no-repeat'; + document.getElementById('header').style.color = ''; + document.getElementById('advfontcolor').value = document.getElementById('fontcolor').value = '<?php echo js_escape(kubrick_header_color_string()); ?>'; + document.getElementById('fontdisplay').value = '<?php echo js_escape(kubrick_header_display_string()); ?>'; + document.getElementById('headerimg').style.display = document.getElementById('fontdisplay').value; + } + function kInit() { + document.getElementById('jsForm').style.display = 'block'; + document.getElementById('nonJsForm').style.display = 'none'; + } + addLoadEvent(kInit); +// ]]> +</script> +<style type='text/css'> + #headwrap { + text-align: center; + } + #kubrick-header { + font-size: 80%; + } + #kubrick-header .hibrowser { + width: 780px; + height: 260px; + overflow: scroll; + } + #kubrick-header #hitarget { + display: none; + } + #kubrick-header #header h1 { + font-family: 'Trebuchet MS', 'Lucida Grande', Verdana, Arial, Sans-Serif; + font-weight: bold; + font-size: 4em; + text-align: center; + padding-top: 70px; + margin: 0; + } + + #kubrick-header #header .description { + font-family: 'Lucida Grande', Verdana, Arial, Sans-Serif; + font-size: 1.2em; + text-align: center; + } + #kubrick-header #header { + text-decoration: none; + color: <?php echo kubrick_header_color_string(); ?>; + padding: 0; + margin: 0; + height: 200px; + text-align: center; + background: url('<?php echo kubrick_header_image_url(); ?>') center no-repeat; + } + #kubrick-header #headerimg { + margin: 0; + height: 200px; + width: 100%; + display: <?php echo kubrick_header_display_string(); ?>; + } + #jsForm { + display: none; + text-align: center; + } + #jsForm input.submit, #jsForm input.button, #jsAdvanced input.button { + padding: 0px; + margin: 0px; + } + #advanced { + text-align: center; + width: 620px; + } + html>body #advanced { + text-align: center; + position: relative; + left: 50%; + margin-left: -380px; + } + #jsAdvanced { + text-align: right; + } + #nonJsForm { + position: relative; + text-align: left; + margin-left: -370px; + left: 50%; + } + #nonJsForm label { + padding-top: 6px; + padding-right: 5px; + float: left; + width: 100px; + text-align: right; + } + .defbutton { + font-weight: bold; + } + .zerosize { + width: 0px; + height: 0px; + overflow: hidden; + } + #colorPickerDiv a, #colorPickerDiv a:hover { + padding: 1px; + text-decoration: none; + border-bottom: 0px; + } +</style> +<?php +} + +function kubrick_theme_page() { + if ( $_REQUEST['saved'] ) echo '<div id="message" class="updated fade"><p><strong>'.__('Options saved.').'</strong></p></div>'; +?> +<div class='wrap'> + <div id="kubrick-header"> + <h2><?php _e('Header Image and Color'); ?></h2> + <div id="headwrap"> + <div id="header"> + <div id="headerimg"> + <h1><?php bloginfo('name'); ?></h1> + <div class="description"><?php bloginfo('description'); ?></div> + </div> + </div> + </div> + <br /> + <div id="nonJsForm"> + <form method="post" action=""> + <?php wp_nonce_field('kubrick-header'); ?> + <div class="zerosize"><input type="submit" name="defaultsubmit" value="<?php echo attribute_escape(__('Save')); ?>" /></div> + <label for="njfontcolor"><?php _e('Font Color:'); ?></label><input type="text" name="njfontcolor" id="njfontcolor" value="<?php echo attribute_escape(kubrick_header_color()); ?>" /> <?php printf(__('Any CSS color (%s or %s or %s)'), '<code>red</code>', '<code>#FF0000</code>', '<code>rgb(255, 0, 0)</code>'); ?><br /> + <label for="njuppercolor"><?php _e('Upper Color:'); ?></label><input type="text" name="njuppercolor" id="njuppercolor" value="#<?php echo attribute_escape(kubrick_upper_color()); ?>" /> <?php printf(__('HEX only (%s or %s)'), '<code>#FF0000</code>', '<code>#F00</code>'); ?><br /> + <label for="njlowercolor"><?php _e('Lower Color:'); ?></label><input type="text" name="njlowercolor" id="njlowercolor" value="#<?php echo attribute_escape(kubrick_lower_color()); ?>" /> <?php printf(__('HEX only (%s or %s)'), '<code>#FF0000</code>', '<code>#F00</code>'); ?><br /> + <input type="hidden" name="hi" id="hi" value="<?php echo attribute_escape(kubrick_header_image()); ?>" /> + <input type="submit" name="toggledisplay" id="toggledisplay" value="<?php echo attribute_escape(__('Toggle Text')); ?>" /> + <input type="submit" name="defaults" value="<?php echo attribute_escape(__('Use Defaults')); ?>" /> + <input type="submit" class="defbutton" name="submitform" value=" <?php _e('Save'); ?> " /> + <input type="hidden" name="action" value="save" /> + <input type="hidden" name="njform" value="true" /> + </form> + </div> + <div id="jsForm"> + <form style="display:inline;" method="post" name="hicolor" id="hicolor" action="<?php echo attribute_escape($_SERVER['REQUEST_URI']); ?>"> + <?php wp_nonce_field('kubrick-header'); ?> + <input type="button" onclick="tgt=document.getElementById('fontcolor');colorSelect(tgt,'pick1');return false;" name="pick1" id="pick1" value="<?php echo attribute_escape(__('Font Color')); ?>"></input> + <input type="button" onclick="tgt=document.getElementById('uppercolor');colorSelect(tgt,'pick2');return false;" name="pick2" id="pick2" value="<?php echo attribute_escape(__('Upper Color')); ?>"></input> + <input type="button" onclick="tgt=document.getElementById('lowercolor');colorSelect(tgt,'pick3');return false;" name="pick3" id="pick3" value="<?php echo attribute_escape(__('Lower Color')); ?>"></input> + <input type="button" name="revert" value="<?php echo attribute_escape(__('Revert')); ?>" onclick="kRevert()" /> + <input type="button" value="<?php echo attribute_escape(__('Advanced')); ?>" onclick="toggleAdvanced()" /> + <input type="hidden" name="action" value="save" /> + <input type="hidden" name="fontdisplay" id="fontdisplay" value="<?php echo attribute_escape(kubrick_header_display()); ?>" /> + <input type="hidden" name="fontcolor" id="fontcolor" value="<?php echo attribute_escape(kubrick_header_color()); ?>" /> + <input type="hidden" name="uppercolor" id="uppercolor" value="<?php echo attribute_escape(kubrick_upper_color()); ?>" /> + <input type="hidden" name="lowercolor" id="lowercolor" value="<?php echo attribute_escape(kubrick_lower_color()); ?>" /> + <input type="hidden" name="headerimage" id="headerimage" value="<?php echo attribute_escape(kubrick_header_image()); ?>" /> + <p class="submit"><input type="submit" name="submitform" class="defbutton" value="<?php echo attribute_escape(__('Update Header »')); ?>" onclick="cp.hidePopup('prettyplease')" /></p> + </form> + <div id="colorPickerDiv" style="z-index: 100;background:#eee;border:1px solid #ccc;position:absolute;visibility:hidden;"> </div> + <div id="advanced"> + <form id="jsAdvanced" style="display:none;" action=""> + <?php wp_nonce_field('kubrick-header'); ?> + <label for="advfontcolor"><?php _e('Font Color (CSS):'); ?> </label><input type="text" id="advfontcolor" onchange="advUpdate(this.value, 'fontcolor')" value="<?php echo attribute_escape(kubrick_header_color()); ?>" /><br /> + <label for="advuppercolor"><?php _e('Upper Color (HEX):');?> </label><input type="text" id="advuppercolor" onchange="advUpdate(this.value, 'uppercolor')" value="#<?php echo attribute_escape(kubrick_upper_color()); ?>" /><br /> + <label for="advlowercolor"><?php _e('Lower Color (HEX):'); ?> </label><input type="text" id="advlowercolor" onchange="advUpdate(this.value, 'lowercolor')" value="#<?php echo attribute_escape(kubrick_lower_color()); ?>" /><br /> + <input type="button" name="default" value="<?php echo attribute_escape(__('Select Default Colors')); ?>" onclick="kDefaults()" /><br /> + <input type="button" onclick="toggleDisplay();return false;" name="pick" id="pick" value="<?php echo attribute_escape(__('Toggle Text Display')); ?>"></input><br /> + </form> + </div> + </div> + </div> +</div> +<?php } ?> diff --git a/wp-content/themes/default/sidebar.php b/wp-content/themes/default/sidebar.php index 0fdccda..1cb2dea 100644 --- a/wp-content/themes/default/sidebar.php +++ b/wp-content/themes/default/sidebar.php @@ -2,14 +2,6 @@ <ul> <?php /* Widgetized sidebar, if you have the plugin installed. */ if ( !function_exists('dynamic_sidebar') || !dynamic_sidebar() ) : ?> -<?php if ( function_exists('dynamic_sidebar') && dynamic_sidebar() ) : ?> - - </ul> - </div> -<?php return; ?> - -<?php endif; ?> - <li> <?php include (TEMPLATEPATH . '/searchform.php'); ?> </li> |