Make WordPress Core

Changeset 1513


Ignore:
Timestamp:
08/07/2004 01:22:17 AM (21 years ago)
Author:
saxmatt
Message:

Define COOKIEHASH and new get_profile function. TODO: re-org function soup

Location:
trunk
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/wp-includes/functions.php

    r1500 r1513  
    1111        return ((float) $string);
    1212    }
     13}
     14
     15function get_profile($field, $user = false) {
     16    global $wpdb;
     17    if (!$user)
     18        $user = $wpdb->escape($_COOKIE['wordpressuser_' . COOKIEHASH]);
     19    return $wpdb->get_var("SELECT $field FROM $wpdb->users WHERE user_login = '$user'");
    1320}
    1421
     
    166173function get_userdata($userid) {
    167174    global $wpdb, $cache_userdata;
     175    $userid = (int) $userid;
    168176    if ( empty($cache_userdata[$userid]) ) {
    169177        $cache_userdata[$userid] =
  • trunk/wp-settings.php

    r1449 r1513  
    6262$wpdb->show_errors();
    6363
    64 if (!strstr($_SERVER['PHP_SELF'], 'install.php') && !strstr($_SERVER['PHP_SELF'], 'wp-admin/import')) {
    65 
     64if (!strstr($_SERVER['PHP_SELF'], 'install.php') && !strstr($_SERVER['PHP_SELF'], 'wp-admin/import')) :
    6665    $querystring_start = '?';
    6766    $querystring_equal = '=';
    6867    $querystring_separator = '&';
    69     //}
    70     // Used to guarantee unique cookies
     68
     69    // Used to guarantee unique hash cookies
    7170    $cookiehash = md5(get_settings('siteurl'));
    72 
    73 } //end !$_wp_installing
     71    define('COOKIEHASH', $cookiehash);
     72endif;
    7473
    7574require (ABSPATH . WPINC . '/vars.php');
Note: See TracChangeset for help on using the changeset viewer.