Make WordPress Core

Changeset 2009


Ignore:
Timestamp:
12/30/2004 10:58:06 AM (22 years ago)
Author:
saxmatt
Message:

Moving default template stuff into wp-includes, uncluttering root

Location:
trunk
Files:
6 added
6 deleted
6 edited

Legend:

Unmodified
Added
Removed
  • trunk/index.php

    r1668 r2009  
    22/* Don't remove this line. */
    33require('./wp-blog-header.php');
    4 include(ABSPATH . '/wp-header.php');
     4get_header();
    55?>
    66
    … …  
    2828</div>
    2929
    30 <?php comments_template(); // Get wp-comments.php template ?>
     30<?php comments_template( is_single() ); // Get wp-comments.php template ?>
    3131
    3232<?php endwhile; else: ?>
    … …  
    3636<?php posts_nav_link(' &#8212; ', __('&laquo; Previous Page'), __('Next Page &raquo;')); ?>
    3737
    38 <?php include(ABSPATH . '/wp-footer.php'); ?>
     38<?php get_footer(); ?>
  • trunk/wp-admin/upgrade-schema.php

    r1997 r2009  
    211211        add_option('template', 'default');
    212212        add_option('stylesheet', 'default');
    213         add_option('comment_whitelist', 0);
     213        add_option('comment_whitelist', 1);
    214214        add_option('page_uris');
    215215
  • trunk/wp-includes/classes.php

    r2007 r2009  
    6666                if ('' != $qv['name']) {
    6767                        $this->is_single = true;
    68                 } else  if (($qv['p'] != '') && ($qv['p'] != 'all') && (intval($q['p']) != 0)) {
     68                } elseif ( intval( $q['p'] ) != 0 && $qv['p'] != 'all' ) {
    6969                        $this->is_single = true;           
    70                 }       else if (('' != $qv['hour']) && ('' != $qv['minute']) &&('' != $qv['second']) && ('' != $qv['year']) && ('' != $qv['monthnum']) && ('' != $qv['day'])) {
     70                } elseif (('' != $qv['hour']) && ('' != $qv['minute']) &&('' != $qv['second']) && ('' != $qv['year']) && ('' != $qv['monthnum']) && ('' != $qv['day'])) {
    7171                        // If year, month, day, hour, minute, and second are set, a single
    7272                  // post is being queried.       
    7373                        $this->is_single = true;
    74                 } else if ('' != $qv['static'] || '' != $qv['pagename'] || '' != $qv['page_id']) {
     74                } elseif ('' != $qv['static'] || '' != $qv['pagename'] || '' != $qv['page_id']) {
    7575                        $this->is_page = true;
    7676                        $this->is_single = false;
    77                 } else if (!empty($qv['s'])) {
     77                } elseif (!empty($qv['s'])) {
    7878                        $this->is_search = true;
    7979                } else {
  • trunk/wp-includes/comment-functions.php

    r1992 r2009  
    33// Template functions
    44
    5 function comments_template() {
    6         global $withcomments, $post, $wpdb, $id, $comment;
     5function comments_template( $show ) {
     6        global $wp_query, $withcomments, $post, $wpdb, $id, $comment;
    77
    88        if ( is_single() || is_page() || $withcomments ) :
    … …  
    1313                $comments = $wpdb->get_results("SELECT * FROM $wpdb->comments WHERE comment_post_ID = '$post->ID' AND comment_approved = '1' ORDER BY comment_date");
    1414
    15                 $template = get_template_directory();
    16                 $template .= "/comments.php";
    17 
    18                 if (file_exists($template)) {
    19                         include($template);
    20                 }       else {
    21                         include(ABSPATH . 'wp-comments.php');
    22                 }
     15        if ( file_exists( TEMPLATEPATH . '/comments.php') )
     16                require( TEMPLATEPATH . '/comments.php');
     17        else
     18                require( ABSPATH . 'wp-includes/wp-comments.php');
    2319
    2420        endif;
    … …  
    7369
    7470                if (empty ($file)) {
    75                         $template = TEMPLATEPATH . '/comments-popup.php';
    76                         if (file_exists($template)) {
    77                                 $wpcommentspopupfile = str_replace(ABSPATH, '', $template);
    78                         } else {
    79                                 $wpcommentspopupfile = 'wp-comments-popup.php';
    80                         }
     71                        if ( file_exists( TEMPLATEPATH . '/comments-popup.php') )
     72                                require( TEMPLATEPATH . '/comments-popup.php');
     73                        else
     74                                require( ABSPATH . 'wp-includes/wp-comments-popup.php');
    8175                } else {
    8276                        $wpcommentspopupfile = $file;
  • trunk/wp-includes/functions.php

    r1991 r2009  
    10591059        global $wp_query;
    10601060
    1061         if (! $wp_query->is_single) {
     1061        if ( !$wp_query->is_single )
    10621062                return false;
    1063         }
    1064 
    1065         if (empty($post)) {
    1066                 return true;
    1067         }
     1063
     1064        if ( empty( $post) )
     1065                return true;
    10681066
    10691067        $post_obj = $wp_query->get_queried_object();
    10701068
    1071         if ($post == $post_obj->ID) {
    1072                 return true;
    1073         } else if ($post == $post_obj->post_title) {
    1074                 return true;
    1075         } else if ($post == $post_obj->post_name) {
    1076                 return true;
    1077         }
     1069        if ( $post == $post_obj->ID )
     1070                return true;
     1071        elseif ( $post == $post_obj->post_title )
     1072                return true;
     1073        elseif ( $post == $post_obj->post_name )
     1074                return true;
    10781075
    10791076        return false;
  • trunk/wp-includes/template-functions-general.php

    r1997 r2009  
    22
    33/* Note: these tags go anywhere in the template */
     4
     5function get_header() {
     6        global $wpdb, $wp_query;
     7        if ( file_exists( TEMPLATEPATH . '/header.php') )
     8                require_once( TEMPLATEPATH . '/header.php');
     9        else
     10                require_once( ABSPATH . 'wp-includes/wp-header.php');
     11}
     12
     13function get_footer() {
     14        global $wpdb, $wp_query;
     15        if ( file_exists( TEMPLATEPATH . '/footer.php') )
     16                require_once( TEMPLATEPATH . '/footer.php');
     17        else
     18                require_once( ABSPATH . 'wp-includes/wp-footer.php');
     19}
     20
     21function get_sidebar() {
     22        global $wpdb, $wp_query;
     23        if ( file_exists( TEMPLATEPATH . '/sidebar.php') )
     24                require_once( TEMPLATEPATH . '/sidebar.php');
     25        else
     26                require_once( ABSPATH . 'wp-includes/wp-sidebar.php');
     27}
     28
    429
    530function wp_loginout() {
    … …  
    85110                $output = get_stylesheet();
    86111                if (empty($output) || $output == 'default') {
    87                         $output = get_settings('siteurl') . "/wp-layout.css";
     112                        $output = get_settings('siteurl') . "/wp-includes/wp-layout.css";
    88113                } else {
    89114                        $output = get_settings('siteurl') . "/wp-content/themes/$output/style.css";
Note: See TracChangeset for help on using the changeset viewer.