Changeset 1108 for trunk/wp-includes/functions.php
- Timestamp:
- 04/20/2004 10:56:47 PM (21 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/wp-includes/functions.php
r1084 r1108 99 99 100 100 function get_lastpostdate($timezone = 'server') { 101 global $tableposts, $cache_lastpostdate, $ use_cache, $pagenow, $wpdb;101 global $tableposts, $cache_lastpostdate, $pagenow, $wpdb; 102 102 $add_seconds_blog = get_settings('gmt_offset') * 3600; 103 103 $add_seconds_server = date('Z'); 104 104 $now = current_time('mysql', 1); 105 if ( (!isset($cache_lastpostdate[$timezone])) OR (!$use_cache)) {105 if ( !isset($cache_lastpostdate[$timezone]) ) { 106 106 switch(strtolower($timezone)) { 107 107 case 'gmt': … … 123 123 124 124 function get_lastpostmodified($timezone = 'server') { 125 global $tableposts, $cache_lastpostmodified, $ use_cache, $pagenow, $wpdb;125 global $tableposts, $cache_lastpostmodified, $pagenow, $wpdb; 126 126 $add_seconds_blog = get_settings('gmt_offset') * 3600; 127 127 $add_seconds_server = date('Z'); 128 128 $now = current_time('mysql', 1); 129 if ( (!isset($cache_lastpostmodified[$timezone])) OR (!$use_cache)) {129 if ( !isset($cache_lastpostmodified[$timezone]) ) { 130 130 switch(strtolower($timezone)) { 131 131 case 'gmt': … … 151 151 152 152 function user_pass_ok($user_login,$user_pass) { 153 global $cache_userdata ,$use_cache;154 if ( (empty($cache_userdata[$user_login])) OR (!$use_cache)) {153 global $cache_userdata; 154 if ( empty($cache_userdata[$user_login]) ) { 155 155 $userdata = get_userdatabylogin($user_login); 156 156 } else { … … 174 174 175 175 function get_userdata($userid) { 176 global $wpdb, $cache_userdata, $ use_cache, $tableusers;177 if ( (empty($cache_userdata[$userid])) || (!$use_cache)) {176 global $wpdb, $cache_userdata, $tableusers; 177 if ( empty($cache_userdata[$userid]) ) { 178 178 $user = $wpdb->get_row("SELECT * FROM $tableusers WHERE ID = '$userid'"); 179 179 $user->user_nickname = stripslashes($user->user_nickname); … … 191 191 192 192 function get_userdatabylogin($user_login) { 193 global $tableusers, $cache_userdata, $ use_cache, $wpdb;194 if ( (empty($cache_userdata["$user_login"])) OR (!$use_cache)) {193 global $tableusers, $cache_userdata, $wpdb; 194 if ( empty($cache_userdata["$user_login"]) ) { 195 195 $user = $wpdb->get_row("SELECT * FROM $tableusers WHERE user_login = '$user_login'"); 196 196 $cache_userdata["$user_login"] = $user; … … 202 202 203 203 function get_userid($user_login) { 204 global $tableusers, $cache_userdata, $ use_cache, $wpdb;205 if ( (empty($cache_userdata["$user_login"])) OR (!$use_cache)) {204 global $tableusers, $cache_userdata, $wpdb; 205 if ( empty($cache_userdata["$user_login"]) ) { 206 206 $user_id = $wpdb->get_var("SELECT ID FROM $tableusers WHERE user_login = '$user_login'"); 207 207 … … 294 294 295 295 function get_settings($setting) { 296 global $wpdb, $cache_settings , $use_cache;296 global $wpdb, $cache_settings; 297 297 if (strstr($_SERVER['REQUEST_URI'], 'install.php')) { 298 298 return false; … … 302 302 $setting = str_replace('time_difference', 'gmt_offset', $setting); 303 303 304 if ( (empty($cache_settings)) OR (!$use_cache)) {304 if ( (empty($cache_settings)) ) { 305 305 $settings = get_alloptions(); 306 306 $cache_settings = $settings; … … 348 348 $wpdb->query("INSERT INTO $tableoptions (option_name, option_value) VALUES ('$name', '$value')"); 349 349 350 global $use_cache; 351 if($wpdb->insert_id && $use_cache) { 350 if($wpdb->insert_id) { 352 351 global $cache_settings; 353 352 $cache_settings->{$name} = $value; … … 413 412 414 413 function get_catname($cat_ID) { 415 global $tablecategories, $cache_catnames,$use_cache, $wpdb;416 if ( (!$cache_catnames) || (!$use_cache)) {414 global $tablecategories, $cache_catnames, $wpdb; 415 if ( !$cache_catnames) ) { 417 416 $results = $wpdb->get_results("SELECT * FROM $tablecategories") or die('Oops, couldn\'t query the db for categories.'); 418 417 foreach ($results as $post) { … … 475 474 } 476 475 } else if($phpver > "4.0") { 477 if(strstr($ HTTP_SERVER_VARS['HTTP_ACCEPT_ENCODING'], 'gzip')) {476 if(strstr($_SERVER['HTTP_ACCEPT_ENCODING'], 'gzip')) { 478 477 if(extension_loaded("zlib")) { 479 478 $do_gzip_compress = TRUE; … … 1003 1002 1004 1003 if ('' == $comment->comment_author_email || '' == $comment->comment_author) { 1005 $from = "From: \"$blogname\" <wordpress@" . $ HTTP_SERVER_VARS['SERVER_NAME'] . '>';1004 $from = "From: \"$blogname\" <wordpress@" . $_SERVER['SERVER_NAME'] . '>'; 1006 1005 } else { 1007 1006 $from = 'From: "' . stripslashes($comment->comment_author) . "\" <$comment->comment_author_email>"; … … 1062 1061 global $preview_userid,$preview_date,$preview_content,$preview_title,$preview_category,$preview_notify,$preview_make_clickable,$preview_autobr; 1063 1062 global $pagenow; 1064 global $HTTP_GET_VARS;1065 1063 if (!$preview) { 1066 1064 $id = $post->ID; … … 1069 1067 $postdata = array ( 1070 1068 'ID' => 0, 1071 'Author_ID' => $ HTTP_GET_VARS['preview_userid'],1072 'Date' => $ HTTP_GET_VARS['preview_date'],1073 'Content' => $ HTTP_GET_VARS['preview_content'],1074 'Excerpt' => $ HTTP_GET_VARS['preview_excerpt'],1075 'Title' => $ HTTP_GET_VARS['preview_title'],1076 'Category' => $ HTTP_GET_VARS['preview_category'],1069 'Author_ID' => $_GET['preview_userid'], 1070 'Date' => $_GET['preview_date'], 1071 'Content' => $_GET['preview_content'], 1072 'Excerpt' => $_GET['preview_excerpt'], 1073 'Title' => $_GET['preview_title'], 1074 'Category' => $_GET['preview_category'], 1077 1075 'Notify' => 1 1078 1076 );
Note: See TracChangeset
for help on using the changeset viewer.