XPressME Integration Kit

Trac

Changeset 561


Ignore:
Timestamp:
Mar 23, 2010, 11:42:58 AM (14 years ago)
Author:
toemon
Message:

デフォルトテーマをWP3から導入されるカスタムメニュー対応にする Fixes #320
また、「ヘッダーの背景と文字の色」の編集に対応させる。

Location:
trunk/xpressme_integration_kit
Files:
1 added
1 deleted
5 edited

Legend:

Unmodified
Added
Removed
  • trunk/xpressme_integration_kit/include/xpress_render.php

    r560 r561  
    100100        } 
    101101         
     102        if ($xpess_config->is_theme_sidebar_disp){ 
     103                $xpress_class = 'xpress-body'; 
     104        } else { 
     105                $xpress_class = 'xpress-body onecolumn'; 
     106        } 
     107         
    102108        $pattern = '<body\s*([^>]*)>'; 
    103         $body_class = 'class="xpress"'; 
     109        $body_class = 'class="' . $xpress_class . '"'; 
    104110        if(preg_match("/".$pattern."/s",  $contents, $body_matches)){ 
    105111                $body_tag_option = $body_matches[1]; 
     
    108114                if(preg_match("/".$pattern."/",  $body_tag_option, $class_matches)){ 
    109115                        $class_value = $class_matches[1]; 
    110                         $reprace = 'xpress '. $class_value; 
     116                        $reprace = $xpress_class . ' '. $class_value; 
    111117                        $body_class = preg_replace("/".$class_value."/",  $reprace, $body_tag_option); 
    112118                } else { 
    113                         $body_class = 'class="xpress" ' . $body_tag_option; 
     119                        $body_class = 'class="' . $xpress_class . '" ' . $body_tag_option; 
    114120                } 
    115121        } 
  • trunk/xpressme_integration_kit/wp-content/themes/xpress_default/functions.php

    r64 r561  
    88    )); 
    99 
     10        // This theme uses wp_nav_menu() 
     11        if ( function_exists('add_theme_support') )add_theme_support( 'nav-menus' ); 
     12 
    1013load_theme_textdomain('xpress'); 
    1114 
     
    1518        if ( xpress_header_image() ) { 
    1619                $url =  xpress_header_image_url() ; 
    17                 $output .= "#header { background: url('$url') no-repeat bottom center; }\n"; 
     20                $output .= "#header { background: url('$url') repeat-x bottom left; }\n"; 
    1821        } 
    1922        if ( false !== ( $color = xpress_header_color() ) ) { 
    20                 $output .= "#headerimg h1 a, #headerimg h1 a:visited, #headerimg .description { color: $color; }\n"; 
     23                $output .= "#xpress-header-bar-top a, #xpress-header-bar-top a:visited, #xpress-header-bar-top .xpress-description ,#xpress-header-bar-top .xpress-conditional-title,#access a, #xpress-menu a{ color: $color; }\n"; 
    2124        } 
    2225        if ( false !== ( $display = xpress_header_display() ) ) { 
     
    3942                return $q['upper']; 
    4043        } else 
    41                 return '69aee7'; 
     44                return 'ffffff'; 
    4245} 
    4346 
     
    4750                return $q['lower']; 
    4851        } else 
    49                 return '4180b6'; 
     52                return 'ffffff'; 
    5053} 
    5154 
     
    6669        $color = xpress_header_color(); 
    6770        if ( false === $color ) 
    68                 return 'white'; 
     71                return 'black'; 
    6972 
    7073        return $color; 
     
    279282                font-family: 'Trebuchet MS', 'Lucida Grande', Verdana, Arial, Sans-Serif; 
    280283                font-weight: bold; 
    281                 font-size: 4em; 
     284                font-size: 2em; 
    282285                text-align: center; 
    283286                padding-top: 70px; 
  • trunk/xpressme_integration_kit/wp-content/themes/xpress_default/header.php

    r524 r561  
    2525<?php wp_head(); ?> 
    2626</head> 
    27 <body> 
     27<body <?php if(function_exists('body_class')) body_class(); ?>> 
    2828<div id="xpress_page"> 
    29 <div id="xpress-header-bar"> 
    30         <div id="xpress-header-bar-top"> 
    31                 <div class="xpress-header-title"> 
    32                         <?php  if (xpress_selected_author_id('echo=0') && function_exists('get_avatar')) echo get_avatar(xpress_selected_author_id('echo=0'),$size = '32'); ?> 
    33                         <a href="<?php echo get_option('home'); ?>/"><?php bloginfo('name'); ?></a> 
     29        <div id="xpress-header-bar"> 
     30<div id="header" role="banner"> 
     31                        <div id="xpress-header-bar-top"> 
     32                        <div class="xpress-header-title"> 
     33                                <?php  if (xpress_selected_author_id('echo=0') && function_exists('get_avatar')) echo get_avatar(xpress_selected_author_id('echo=0'),$size = '32'); ?> 
     34                                <a href="<?php echo get_option('home'); ?>/"><?php bloginfo('name'); ?></a> 
     35                        </div> 
     36                        <div class="xpress-conditional-title"> 
     37                                &nbsp; <?php xpress_conditional_title();?>  
     38                        </div> 
     39                        <div class="xpress-description"> 
     40                                <?php bloginfo('description'); ?> 
     41                        </div> 
    3442                </div> 
    35                 <div class="xpress-conditional-title"> 
    36                         &nbsp; <?php xpress_conditional_title();?>  
    37                 </div> 
    38         </div> 
    39         <div class="xpress-description"> 
    40                 <?php bloginfo('description'); ?> 
    41         </div> 
    42         <div class="xpress-operation-link"> 
    43                 <?php 
    44                         if(xpress_is_multiblog()){ 
    45                                 $blog_details = get_blog_details(1); 
    46                                 $site_url = $blog_details->siteurl; 
    47                                 echo '<a href="' . $site_url . '/">' . __('Main Page','xpress') . '</a> | '; 
    48                         } 
    49                 ?> 
    50                 <a href="<?php echo get_option('home'); ?>/"><?php _e('Blogs Home','xpress')?></a>  
    51                 <?php if(xpress_is_contributor()) { echo ' | ' ; xpress_post_new_link('link_title='. __('Post New','xpress'). '&echo=1'); }?> 
    52         </div> 
    53 </div> 
    54 <hr class="xpress-border"></hr> 
     43         
     44                <div id="menu_div"> 
     45                        <div id="access"> 
     46                                <?php if (function_exists('wp_nav_menu')) wp_nav_menu( 'sort_column=menu_order&container_class=menu-header' ); ?> 
     47                        </div><!-- #access --> 
     48                        <div id="xpress-menu"> 
     49                                <div class="menu-header"> 
     50                                        <div class="menu"> 
     51                                                <ul> 
     52                                                        <?php 
     53                                                                if(xpress_is_multiblog()){ 
     54                                                                        $blog_details = get_blog_details(1); 
     55                                                                        $site_url = $blog_details->siteurl; 
     56                                                                        echo '<li><a href="' . $site_url . '/">' . __('Main Page','xpress') . '</a></li>'; 
     57                                                                } 
     58                                                        ?> 
     59                                                        <li><a href="<?php echo get_option('home'); ?>/"><?php _e('Blogs Home','xpress')?></a></li> 
     60                                                        <?php if(xpress_is_contributor()) { echo '<li>'. xpress_post_new_link('link_title='. __('Post New','xpress'). '&echo=0').'</li>'; }?> 
     61                                                </ul> 
     62                                        </div><!-- #menu --> 
     63                                </div><!-- #menu-header --> 
     64                        </div><!-- #xpress-menu --> 
     65                </div><!-- #menu_div --> 
     66        </div><!-- #xpress-header-bar --> 
     67        </div><!-- #xpress-header-bar --> 
  • trunk/xpressme_integration_kit/wp-content/themes/xpress_default/images/header-img.php

    r1 r561  
    11<?php 
    22 
    3 $img = 'kubrickheader.jpg'; 
     3$img = 'xpressheader.jpg'; 
    44 
    55// If we don't have image processing support, redirect. 
    66if ( ! function_exists('imagecreatefromjpeg') ) 
    7         die(header("Location: kubrickheader.jpg")); 
     7        die(header("Location: xpressheader.jpg")); 
    88 
    99// Assign and validate the color values 
     
    3333// Get the background color, define the rectangle height 
    3434$white = imagecolorat( $im, 15, 15 ); 
    35 $h = 182; 
     35$h = 84; 
    3636 
    3737// Define the boundaries of the rounded edges ( y => array ( x1, x2 ) ) 
     
    5151// Blank out the blue thing 
    5252for ( $i = 0; $i < $h; $i++ ) { 
    53         $x1 = 19; 
    54         $x2 = 740; 
    55         imageline( $im, $x1, 18 + $i, $x2, 18 + $i, $white ); 
     53        $x1 = 0; 
     54        $x2 = 800; 
     55        imageline( $im, $x1, $i, $x2, $i, $white ); 
    5656} 
    5757 
    5858// Draw a new color thing 
    5959for ( $i = 0; $i < $h; $i++ ) { 
    60         $x1 = 20; 
    61         $x2 = 739; 
     60        $x1 = 0; 
     61        $x2 = 800; 
    6262        $r = ( $r2 - $r1 != 0 ) ? $r1 + ( $r2 - $r1 ) * ( $i / $h ) : $r1; 
    6363        $g = ( $g2 - $g1 != 0 ) ? $g1 + ( $g2 - $g1 ) * ( $i / $h ) : $g1; 
    6464        $b = ( $b2 - $b1 != 0 ) ? $b1 + ( $b2 - $b1 ) * ( $i / $h ) : $b1; 
    6565        $color = imagecolorallocate( $im, $r, $g, $b ); 
    66         if ( array_key_exists($i, $corners) ) { 
    67                 imageline( $im, $x1, 18 + $i, $x2, 18 + $i, $white ); 
    68                 list ( $x1, $x2 ) = $corners[$i]; 
    69         } 
    70         imageline( $im, $x1, 18 + $i, $x2, 18 + $i, $color ); 
     66//      if ( array_key_exists($i, $corners) ) { 
     67//              imageline( $im, $x1, 18 + $i, $x2, 18 + $i, $white ); 
     68//              list ( $x1, $x2 ) = $corners[$i]; 
     69//      } 
     70        imageline( $im, $x1, $i, $x2, $i, $color ); 
    7171} 
    7272 
  • trunk/xpressme_integration_kit/wp-content/themes/xpress_default/style.css

    r446 r561  
    9191} 
    9292#xpress-header-bar-top { 
    93         height: 32px; 
    94         margin-bottom: 16px; 
     93        margin-bottom: 0px; 
    9594        } 
    9695#xpress-header-bar-top img{ 
     
    9897} 
    9998#xpress-header-bar #xpress-header-bar-top .xpress-header-title { 
     99        font-size: 24px; 
    100100        float: left; 
    101         font-size: 16px; 
    102 } 
    103 #xpress-header-bar #xpress-header-bar-top .xpress-conditional-title { 
    104         font-size: 14px; 
    105         margin-bottom: 20px; 
    106  
    107 } 
    108  
    109 #xpress-header-bar .xpress-description { 
    110         clear: both; 
     101} 
     102#xpress-header-bar #xpress-header-bar-top .xpress-description { 
     103        clear: both; 
     104        font-weight: bold; 
    111105        font-size: 12px; 
    112         float: left; 
     106        padding-top: 8px; 
     107        padding-left: 40px; 
     108 
     109} 
     110 
     111#xpress-header-bar .xpress-conditional-title { 
     112        font-weight: bold; 
     113        font-size: 12px; 
     114        padding-top: 14px; 
     115        padding-left: 40px; 
    113116} 
    114117 
     
    749752        color: #777; 
    750753        } 
     754         
     755 
     756/* =Menu 
     757-------------------------------------------------------------- */ 
     758#menu_div { 
     759        border-bottom: 1px solid #000; 
     760//      background: #fff; 
     761        margin: 0 auto; 
     762        display:block; 
     763        clear:both; 
     764        height:26px; 
     765//      float:left; 
     766} 
     767.xpress-header-title{ 
     768        padding-left: 5px; 
     769        padding-top: 5px; 
     770} 
     771#access{ 
     772//      background: #fff; 
     773        margin: 0 auto; 
     774        display:block; 
     775        padding-left: 5px; 
     776        float:left; 
     777} 
     778#xpress-menu { 
     779//      background: #fff; 
     780        margin: 0 auto; 
     781        display:block; 
     782        float:right; 
     783} 
     784#access .menu-header 
     785#xpress-menu .menu-header { 
     786        font-size: 13px; 
     787        margin-left: 12px; 
     788} 
     789#access .menu-header ul, 
     790#xpress-menu .menu-header ul { 
     791        list-style: none; 
     792        margin: 0; 
     793} 
     794#access .menu-header li, 
     795#xpress-menu .menu-header li { 
     796        float:left; 
     797        position: relative; 
     798} 
     799#access a, 
     800#xpress-menu a { 
     801        display:block; 
     802        text-decoration:none; 
     803//      color:#aaa; 
     804        padding:0 2px; 
     805        line-height:24px; 
     806} 
     807#access ul ul, 
     808#xpress-menu ul ul { 
     809        display:none; 
     810        position:absolute; 
     811        top:38px; 
     812        left:0; 
     813        float:left; 
     814        -webkit-box-shadow: 0px 3px 3px rgba(0,0,0,0.2); 
     815        -moz-box-shadow: 0px 3px 3px rgba(0,0,0,0.2); 
     816        box-shadow: 0px 3px 3px rgba(0,0,0,0.2); 
     817        z-index: 99999; 
     818} 
     819#access ul ul ul, 
     820#xpress-menu ul ul ul { 
     821        left:100%; 
     822        top:0; 
     823} 
     824#access ul ul a, 
     825#xpress-menu ul ul a { 
     826        background:#333; 
     827        height:auto; 
     828        line-height:1em; 
     829        padding:10px; 
     830        width: 130px; 
     831} 
     832#access li:hover > a, 
     833#access ul ul :hover > a, 
     834#xpress-menu li:hover > a, 
     835#xpress-menu ul ul :hover > a { 
     836        color:#fff; 
     837        background:#333; 
     838} 
     839 
     840#access ul li:hover > ul, 
     841#xpress-menu ul li:hover > ul { 
     842        display:block; 
     843} 
     844 
Note: See TracChangeset for help on using the changeset viewer.