Changeset 835

Show
Ignore:
Timestamp:
01/09/07 11:30:05 (2 years ago)
Author:
donncha
Message:

WP Merge to rev 4709

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • trunk/wp-admin/moderation.php

    r828 r835  
    124124<p><?php comment_date('M j, g:i A'); ?> &#8212; [ <?php 
    125125echo '<a href="comment.php?action=editcomment&amp;c='.$comment->comment_ID.'">' . __('Edit') . '</a> | '; 
    126 echo " <a href=\"post.php?action=deletecomment&amp;p=".$comment->comment_post_ID."&amp;comment=".$comment->comment_ID."\" onclick=\"return deleteSomething( 'comment', $comment->comment_ID, '" . js_escape(sprintf(__("You are about to delete this comment by &quot;%s&quot;.\n&quot;Cancel&quot; to stop, &quot;OK&quot; to delete."), $comment->comment_author )) . "', theCommentList );\">" . __('Delete ') . "</a> | "; ?> 
     126echo " <a href=\"post.php?action=deletecomment&amp;p=".$comment->comment_post_ID."&amp;comment=".$comment->comment_ID."\" onclick=\"return deleteSomething( 'comment', $comment->comment_ID, '" . js_escape(sprintf(__("You are about to delete this comment by '%s'.\n'Cancel' to stop, 'OK' to delete."), $comment->comment_author )) . "', theCommentList );\">" . __('Delete') . "</a> | "; ?> 
    127127<?php 
    128128$post = get_post($comment->comment_post_ID); 
  • trunk/wp-admin/upload.css

    r816 r835  
    106106} 
    107107 
     108.wrap h2 { 
     109        margin: .4em 0 .5em; 
     110        display: block; 
     111        border-bottom: .5em solid #e5f3ff; 
     112        color: #333; 
     113        font: normal 32px/5px serif; 
     114        clear: both; 
     115} 
     116 
     117* html .wrap h2 { 
     118        margin-top: 1em; 
     119} 
     120 
    108121.back { 
    109122        display: block; 
  • trunk/wp-admin/upload.php

    r828 r835  
    8080        add_action( 'admin_head', 'wp_upload_admin_head' ); 
    8181        include_once('admin-header.php'); 
    82         echo "<div class='wrap'>"; 
     82?> 
     83        <div class='wrap'> 
     84        <h2><?php _e('Uploads'); ?></h2> 
     85<?php 
    8386endif; 
    8487 
  • trunk/wp-content/themes/default/sidebar.php

    r810 r835  
    4747                        </li> 
    4848 
    49                         <?php wp_list_pages('title_li=<h2>Pages</h2>&sort_column=post_title&sort_order=ASC'); ?> 
     49                        <?php wp_list_pages('title_li=<h2>Pages</h2>' ); ?> 
    5050 
    5151                        <li><h2>Archives</h2> 
     
    5555                        </li> 
    5656 
    57                         <?php wp_list_categories('optioncount=1&hierarchical=0&title_li=<h2>Categories</h2>'); ?> 
     57                        <?php wp_list_categories('show_count=1&title_li=<h2>Categories</h2>'); ?> 
    5858 
    5959                        <?php /* If this is the frontpage */ if ( is_home() || is_page() ) { ?> 
  • trunk/wp-includes/category-template.php

    r819 r835  
    225225                'hierarchical' => true, 'title_li' => __('Categories')); 
    226226        $r = array_merge($defaults, $r); 
     227        if ( !isset($r['pad_counts']) && $r['show_count'] && $r['hierarchical'] ) 
     228                $r['pad_counts'] = true; 
    227229        if ( isset($r['show_date']) ) 
    228230                $r['include_last_update_time'] = $r['show_date']; 
  • trunk/wp-includes/category.php

    r823 r835  
    2222        $defaults = array('type' => 'post', 'child_of' => 0, 'orderby' => 'name', 'order' => 'ASC', 
    2323                'hide_empty' => true, 'include_last_update_time' => false, 'hierarchical' => 1, 'exclude' => '', 'include' => '', 
    24                 'number' => ''); 
     24                'number' => '', 'pad_counts' => false); 
    2525        $r = array_merge($defaults, $r); 
    2626        if ( 'count' == $r['orderby'] ) 
     
    110110 
    111111        // Update category counts to include children. 
    112         if ( $hierarchical ) { 
     112        if ( $pad_counts ) 
     113                _pad_category_counts($type, $categories); 
     114 
     115        // Make sure we show empty categories that have children. 
     116        if ( $hierarchical && $hide_empty ) { 
    113117                foreach ( $categories as $k => $category ) { 
    114                         $progeny = 'link' == $type ? $category->link_count : $category->category_count; 
    115                         if ( $children = _get_cat_children($category->cat_ID, $categories) ) { 
     118                        if ( ! $category->{'link' == $type ? 'link_count' : 'category_count'} ) { 
     119                               $children = _get_cat_children($category->cat_ID, $categories); 
    116120                                foreach ( $children as $child ) 
    117                                         $progeny += 'link' == $type ? $child->link_count : $child->category_count; 
     121                                        if ( $child->{'link' == $type ? 'link_count' : 'category_count'} ) 
     122                                                continue 2; 
     123 
     124                                // It really is empty 
     125                                unset($categories[$k]); 
    118126                        } 
    119                         if ( !$progeny && $hide_empty ) 
    120                                 unset($categories[$k]); 
    121                         else 
    122                                 $categories[$k]->{'link' == $type ? 'link_count' : 'category_count'} = $progeny; 
    123127                } 
    124128        } 
     
    257261} 
    258262 
     263// Recalculates link or post counts by including items from child categories 
     264// Assumes all relevant children are already in the $categories argument 
     265function _pad_category_counts($type, &$categories) { 
     266        global $wpdb; 
     267 
     268        // Set up some useful arrays 
     269        foreach ( $categories as $key => $cat ) { 
     270                $cats[$cat->cat_ID] = & $categories[$key]; 
     271                $cat_IDs[] = $cat->cat_ID; 
     272        } 
     273 
     274        // Get the relevant post2cat or link2cat records and stick them in a lookup table 
     275        if ( $type == 'post' ) { 
     276                $results = $wpdb->get_results("SELECT post_id, category_id FROM $wpdb->post2cat LEFT JOIN $wpdb->posts ON post_id = ID WHERE category_id IN (".join(',', $cat_IDs).") AND post_type = 'post' AND post_status = 'publish'"); 
     277                foreach ( $results as $row ) 
     278                        ++$cat_items[$row->category_id][$row->post_id]; 
     279        } else { 
     280                $results = $wpdb->get_results("SELECT $wpdb->link2cat.link_id, category_id FROM $wpdb->link2cat LEFT JOIN $wpdb->links USING (link_id) WHERE category_id IN (".join(',', $cat_IDs).") AND link_visible = 'Y'"); 
     281                foreach ( $results as $row ) 
     282                        ++$cat_items[$row->category_id][$row->link_id]; 
     283        } 
     284 
     285        // Touch every ancestor's lookup row for each post in each category 
     286        foreach ( $cat_IDs as $cat_ID ) { 
     287                $child = $cat_ID; 
     288                while ( $parent = $cats[$child]->category_parent ) { 
     289                        if ( !empty($cat_items[$cat_ID]) ) 
     290                                foreach ( $cat_items[$cat_ID] as $item_id => $touches ) 
     291                                        ++$cat_items[$parent][$item_id]; 
     292                        $child = $parent; 
     293                } 
     294        } 
     295 
     296        // Transfer the touched cells  
     297        foreach ( $cat_items as $id => $items ) 
     298                if ( isset($cats[$id]) ) 
     299                        $cats[$id]->{'link' == $type ? 'link_count' : 'category_count'} = count($items); 
     300} 
     301 
    259302?> 
  • trunk/wp-includes/comment.php

    r828 r835  
    332332                $comment_date = current_time('mysql'); 
    333333        if ( ! isset($comment_date_gmt) ) 
    334                 $comment_date_gmt = gmdate('Y-m-d H:i:s', strtotime($comment_date) ); 
     334                $comment_date_gmt = get_gmt_from_date($comment_date); 
    335335        if ( ! isset($comment_parent) ) 
    336336                $comment_parent = 0; 
     
    461461        $comment_content = apply_filters('comment_save_pre', $comment_content); 
    462462 
     463        $comment_date_gmt = get_gmt_from_date($comment_date); 
     464 
    463465        $result = $wpdb->query( 
    464466                "UPDATE $wpdb->comments SET 
     
    468470                        comment_approved     = '$comment_approved', 
    469471                        comment_author_url   = '$comment_author_url', 
    470                         comment_date         = '$comment_date' 
     472                        comment_date         = '$comment_date', 
     473                        comment_date_gmt     = '$comment_date_gmt' 
    471474                WHERE comment_ID = $comment_ID" ); 
    472475 
  • trunk/wp-includes/js/tinymce/themes/advanced/source_editor.htm

    r550 r835  
    1111                <div style="float: left" class="title">{$lang_theme_code_title}</div> 
    1212 
    13                 <div style="float: right"> 
    14                         <script language="javascript" type="text/javascript">renderWordWrap();</script
     13                <div id="wrapline" style="float: right"> 
     14                        <input type="checkbox" name="wraped" id="wraped" onclick="toggleWordWrap(this);" class="wordWrapCode" /><label for="wraped">{$lang_theme_code_wordwrap}</label
    1515                </div> 
     16 
     17                <br style="clear: both" /> 
    1618 
    1719                <textarea name="htmlSource" id="htmlSource" rows="15" cols="100" style="width: 100%; height: 100%; font-family: 'Courier New',Courier,mono; font-size: 12px" dir="ltr" wrap="off"></textarea>