Make WordPress Core

Changeset 1979


Ignore:
Timestamp:
12/19/2004 02:30:40 AM (20 years ago)
Author:
saxmatt
Message:

New aggregation code (hat tip: Chris Davis/Jesuit), tweaked style, fixed login updater, new dashboard.

Location:
trunk
Files:
2 added
5 edited

Legend:

Unmodified
Added
Removed
  • trunk/wp-admin/index.php

    r1976 r1979  
    33$title = __('Dashboard');
    44require_once('admin-header.php');
     5require_once (ABSPATH . WPINC . '/rss-functions.php');
    56
    67$today = current_time('mysql');
     
    1415?>
    1516<div>
    16 <h3><?php _e('Posts'); ?></h3>
     17<h3><?php _e('Posts'); ?> <a href="edit.php" title="<?php _e('More posts...'); ?>">&raquo;</a></h3>
    1718<ul>
    1819<?php
     
    5051?>
    5152<div>
    52 <h3><?php _e('Comments'); ?></h3>
     53<h3><?php _e('Comments'); ?> <a href="edit-comments.php" title="<?php _e('More comments...'); ?>">&raquo;</a></h3>
    5354<ul>
    5455<?php
     
    6364if ( $numcomments = $wpdb->get_var("SELECT COUNT(*) FROM $tablecomments WHERE comment_approved = '0'") ) :
    6465?>
    65 <p><a href="moderation.php"><?php echo sprintf(__('There are comments in moderation (%s)'), number_format($numcomments) ); ?> &raquo;</a></p>
     66<p><strong><a href="moderation.php"><?php echo sprintf(__('There are comments in moderation (%s)'), number_format($numcomments) ); ?> &raquo;</a></strong></p>
    6667<?php endif; ?>
    6768</div>
     
    8687</div>
    8788
    88 <h2><?php _e('Dashboard'); ?></h2>
     89<h2><?php _e('Dashboard'); ?></h2>
     90<p><?php _e('Below is the latest news from the official WordPress development blog, click on a title to read the full entry.'); ?></p>
     91<?php
     92$rss = @fetch_rss('http://wordpress.org/development/feed/');
     93if ( $rss ) {
     94?>
     95<h3>WordPress Development Blog</h3>
     96<?php
     97$rss->items = array_slice($rss->items, 0, 4);
     98foreach ($rss->items as $item ) {
     99?>
     100<h4><a href='<?php echo $item['link']; ?>'><?php echo wp_specialchars($item['title']); ?></a></h4>
     101<p><?php echo $item['description']; ?></p>
     102<?php
     103    }
     104}
     105?>
    89106<br clear="all" />
    90107</div>
     108<?php
     109$drafts = $wpdb->get_results("SELECT ID, post_title FROM $wpdb->posts WHERE post_status = 'draft' AND post_author = $user_ID");
     110if ($drafts) {
     111?>
    91112<div class="wrap">
    92 <p>
    93         <strong>
    94         <?php _e('Your Drafts:') ?>
    95         </strong>
    96 <br />
    97         <?php
    98 get_currentuserinfo();
    99 $drafts = $wpdb->get_results("SELECT ID, post_title FROM $tableposts WHERE post_status = 'draft' AND post_author = $user_ID");
    100 if ($drafts) {
    101     ?>
     113
     114    <p><strong><?php _e('Your Drafts:') ?></strong>
    102115    <?php
    103116    $i = 0;
     
    108121        if ($draft->post_title == '')
    109122            $draft->post_title = sprintf(__('Post #%s'), $draft->ID);
    110         echo "<a href='post.php?action=edit&post=$draft->ID' title='" . __('Edit this draft') . "'>$draft->post_title</a>";
     123        echo "<a href='post.php?action=edit&amp;post=$draft->ID' title='" . __('Edit this draft') . "'>$draft->post_title</a>";
    111124        ++$i;
    112125        }
    113         }else{
    114          echo ('No Entries found.');
    115          }
    116         ?>
    117     </p>
    118         </div>
     126    ?>
     127    .</p>
     128</div>
     129<?php } ?>
    119130<?php
    120131require('./admin-footer.php');
  • trunk/wp-admin/wp-admin.css

    r1978 r1979  
    66    padding: 1em;
    77    border: 1px solid #69c;
     8    margin-left: 1em;
    89}
    910
  • trunk/wp-includes/functions.php

    r1972 r1979  
    373373
    374374    // If the new and old values are the same, no need to update.
    375     if ($newvalue == get_settings($option_name)) {
     375    if ($newvalue == get_option($option_name)) {
    376376        return true;
    377377    }
     378
     379    // If it's not there add it
     380    if ( !$wpdb->get_var("SELECT option_name FROM $wpdb->options WHERE option_name = '$option_name'") )
     381        add_option($option_name);
    378382
    379383    $newvalue = $wpdb->escape($newvalue);
     
    385389
    386390// thx Alex Stapleton, http://alex.vort-x.net/blog/
    387 function add_option($name, $value = '', $description = '') {
     391function add_option($name, $value = '', $description = '', $autoload = 'yes') {
    388392    global $wpdb;
    389393    if ( is_array($value) || is_object($value) )
     
    394398        $value = $wpdb->escape($value);
    395399        $description = $wpdb->escape($description);
    396         $wpdb->query("INSERT INTO $wpdb->options (option_name, option_value, option_description) VALUES ('$name', '$value', '$description')");
     400        $wpdb->query("INSERT INTO $wpdb->options (option_name, option_value, option_description, autoload) VALUES ('$name', '$value', '$description', '$autoload')");
    397401
    398402        if($wpdb->insert_id) {
  • trunk/wp-includes/version.php

    r1874 r1979  
    33// This just holds the version number, in a separate file so we can bump it without cluttering the CVS
    44
    5 $wp_version = '1.3-alpha-5';
     5$wp_version = '1.5-alpha-6';
    66
    77?>
  • trunk/wp-login.php

    r1974 r1979  
    1111
    1212// If someone has moved WordPress let's try to detect it
    13 if ( dirname('http://' . $_SERVER['HTTP_HOST'] . $_SERVER['SCRIPT_NAME']) != get_settings('siteurl') )
    14     update_option('siteurl', dirname('http://' . $_SERVER['HTTP_HOST'] . $_SERVER['SCRIPT_NAME']) );
     13if ( dirname('http://' . $_SERVER['HTTP_HOST'] . $_SERVER['PHP_SELF']) != get_settings('siteurl') )
     14    update_option('siteurl', dirname('http://' . $_SERVER['HTTP_HOST'] . $_SERVER['PHP_SELF']) );
    1515
    1616switch($action) {
Note: See TracChangeset for help on using the changeset viewer.