В чем может быть проблема ? с хостингом?
установили вордпресс -лезет вначале и сам блог отражается в кодировке уникод -тоже в нечитаемом виде!
Что делаем не так? что попросить сделать хостера (если беда в хостинге)? или что мы делаем не так?
ERE ID = ‘$post_ID’"); $post = get_post($post_ID); if ( !empty($page_template) ) $post->page_template = $page_template; wp_transition_post_status($post_status, $previous_status, $post); if ( $update) do_action(‘edit_post’, $post_ID, $post); do_action(‘save_post’, $post_ID, $post); do_action(‘wp_insert_post’, $post_ID, $post); return $post_ID; } function wp_update_post($postarr = array()) { global $wpdb; if ( is_object($postarr) ) $postarr = get_object_vars($postarr); // First, get all of the original fields $post = wp_get_single_post($postarr[‘ID’- , ARRAY_A); // Escape data pulled from DB. $post = add_magic_quotes($post); // Passed post category list overwrites existing category list if not empty. if ( isset($postarr[‘post_category’]) && is_array($postarr[‘post_category’]) && 0 != count($postarr[‘post_category’]) ) $post_cats = $postarr[‘post_category’]; else $post_cats = $post[‘post_category’]; // Drafts shouldn’t be assigned a date unless explicitly done so by the user if ( in_array($post[‘post_status’], array(‘draft’, ‘pending’)) && empty($postarr[‘edit_date’]) && empty($postarr[‘post_date’]) && (‘0000-00-00 00:00:00’ == $post[‘post_date’]) ) $clear_date = true; else $clear_date = false; // Merge old and new fields with new fields overwriting old ones. $postarr = array_merge($post, $postarr); $postarr[‘post_category’] = $post_cats; if ( $clear_date ) { $postarr[‘post_date’] = ”; $postarr[‘post_date_gmt’] = ”; } if ($postarr[‘post_type’] == ‘attachment’) return wp_insert_attachment($postarr); return wp_insert_post($postarr); } function wp_publish_post($post_id) { global $wpdb; $post = get_post($post_id); if ( empty($post) ) return; if ( ‘publish’ == $post->post_status ) return; $wpdb->query( "UPDATE $wpdb->posts SET post_status = ‘publish’ WHERE ID = ‘$post_id’" ); $old_status = $post->post_status; $post->post_status = ‘publish’; wp_transition_post_status(‘publish’, $old_status, $post); do_action(‘edit_post’, $post_id, $post); do_action(‘save_post’, $post_id, $post); do_action(‘wp_insert_post’, $post_id, $post); } function wp_add_post_tags($post_id = 0, $tags = ”) { return wp_set_post_tags($post_id, $tags, true); } function wp_set_post_tags( $post_id = 0, $tags = ”, $append = false ) { /* $append – true = don’t delete existing tags, just add on, false = replace the tags with the new tags */ global $wpdb; $post_id = (int) $post_id; if ( !$post_id ) return false; if ( empty($tags) ) $tags = array(); $tags = (is_array($tags)) ? $tags : explode( ‘,’, $tags ); wp_set_object_terms($post_id, $tags, ‘post_tag’, $append); } function wp_set_post_categories($post_ID = 0, $post_categories = array()) { global $wpdb; $post_ID = (int) $post_ID; // If $post_categories isn’t already an array, make it one: if (!is_array($post_categories) || 0 == count($post_categories) || empty($post_categories)) $post_categories = array(get_option(‘default_category’)); else if ( 1 == count($post_categories) && ” == $post_categories[0] ) return true; $post_categories = array_map(‘intval’, $post_categories); $post_categories = array_unique($post_categories); return wp_set_object_terms($post_ID, $post_categories, ‘category’); } // wp_set_post_categories() function wp_transition_post_status($new_status, $old_status, $post) { if ( $new_status != $old_status ) { do_action(‘transition_post_status’, $new_status, $old_status, $post); do_action("${old_status}_to_$new_status", $post); } do_action("${new_status}_$post->post_type", $post->ID, $post); } // // Trackback and ping functions // function add_ping($post_id, $uri) { // Add a URL to those already pung global $wpdb; $pung = $wpdb->get_var("SELECT pinged FROM $wpdb->posts WHERE ID = $post_id"); $pung = trim($pung); $pung = preg_split(‘/\s/’, $pung); $pung
= $uri; $new = implode("\n", $pung); $new = apply_filters(‘add_ping’, $new); return $wpdb->query("UPDATE $wpdb->posts SET pinged = ‘$new’ WHERE ID = $post_id"); } function get_enclosed($post_id) { // Get enclosures already enclosed for a post global $wpdb; $custom_fields = get_post_custom( $post_id ); $pung = array(); if ( !is_array( $custom_fields ) ) return $pung; foreach ( $custom_fields as $key => $val ) { if ( ‘enclosure’ != $key || !is_array( $val ) ) continue; foreach( $val as $enc ) { $enclosure = split( "\n", $enc ); $pung[] = trim( $enclosure[ 0 ] ); } } $pung = apply_filters(‘get_enclosed’, $pung); return $pung; } function get_pung($post_id) { // Get URLs already pung for a post global $wpdb; $pung = $wpdb->get_var("SELECT pinged FROM $wpdb->posts WHERE ID = $post_id"); $pung = trim($pung); $pung = preg_split(‘/\s/’, $pung); $pung = apply_filters(‘get_pung’, $pung); return $pung; } function get_to_ping($post_id) { // Get any URLs in the todo list global $wpdb; $to_ping = $wpdb->get_var("SELECT to_ping FROM $wpdb->posts WHERE ID = $post_id"); $to_ping = trim($to_ping); $to_ping = preg_split(‘/\s/’, $to_ping, -1, PREG_SPLIT_NO_EMPTY); $to_ping = apply_filters(‘get_to_ping’, $to_ping); return $to_ping; } // do trackbacks for a list of urls // accepts a comma-separated list of trackback urls and a post id function trackback_url_list($tb_list, $post_id) { if (!empty($tb_list)) { // get post data $postdata = wp_get_single_post($post_id, ARRAY_A); // import postdata as variables extract($postdata, EXTR_SKIP); // form an excerpt $excerpt = strip_tags($post_excerpt?$post_excerpt:$post_content); if (strlen($excerpt) > 255) { $excerpt = substr($excerpt,0,252) . ‘…’; } $trackback_urls = explode(‘,’, $tb_list); foreach($trackback_urls as $tb_url) { $tb_url = trim($tb_url); trackback($tb_url, stripslashes($post_title), $excerpt, $post_id); } } } // // Page functions // function get_all_page_ids() { global $wpdb; if ( ! $page_ids = wp_cache_get(‘all_page_ids’, ‘pages’) ) { $page_ids = $wpdb->get_col("SELECT ID FROM $wpdb->posts WHERE post_type = ‘page’"); wp_cache_add(‘all_page_ids’, $page_ids, ‘pages’); } return $page_ids; } // Retrieves page data given a page ID or page object. // Handles page caching. function &get_page(&$page, $output = OBJECT, $filter = ‘raw’) { global $wpdb, $blog_id; if ( empty($page) ) { if ( isset( $GLOBALS[‘page’] ) && isset( $GLOBALS[‘page’]->ID ) ) { $_page = & $GLOBALS[‘page’]; wp_cache_add($_page->ID, $_page, ‘pages’); } else { // shouldn’t we just return NULL at this point? ~ Mark $_page = null; } } elseif ( is_object($page) ) { if ( ‘post’ == $page->post_type ) return get_post($page, $output, $filter); wp_cache_add($page->ID, $page, ‘pages’); $_page = $page; } else { $page = (int) $page; // first, check the cache if ( ! ( $_page = wp_cache_get($page, ‘pages’) ) ) { // not in the page cache? if ( isset($GLOBALS[‘page’]->ID) && ($page == $GLOBALS[‘page’]->ID) ) { // for is_page() views // I don’t think this code ever gets executed ~ Mark $_page = & $GLOBALS[‘page’]; wp_cache_add($_page->ID, $_page, ‘pages’); } elseif ( isset($GLOBALS[‘post_cache’][$blog_id][$page]) ) { // it’s actually a page, and is cached return get_post($page, $output, $filter); } else { // it’s not in any caches, so off to the DB we go // Why are we using assignment for this query? $_page = & $wpdb->get_row("SELECT * FROM $wpdb->posts WHERE ID= ‘$page’ LIMIT 1"); if ( ‘post’ == $_page->post_type ) return get_post($_page, $output, $filter); // Potential issue: we’re not checking to see if the post_type = ‘page’ // So all non-‘post’ posts will get cached as pages. wp_cache_add($_page->ID, $_page, ‘pages’); } } } $_page = sanitize_post($_page, $filter); // at this point, one way or another, $_post contains the page object if ( $output == OBJECT ) { return $_page; } elseif ( $output == ARRAY_A ) { return get_object_vars($_page); } elseif ( $output == ARRAY_N ) { return array_values(get_object_vars($_page)); } else { return $_page; } } function get_page_by_path($page_path, $output = OBJECT) { global $wpdb; $page_path = rawurlencode(urldecode($page_path)); $page_path = str_replace(‘%2F’, ‘/’, $page_path); $page_path = str_replace(‘%20’, ‘ ‘, $page_path); $page_paths = ‘/’ . trim($page_path, ‘/’); $leaf_path = sanitize_title(basename($page_paths)); $page_paths = explode(‘/’, $page_paths); foreach($page_paths as $pathdir) $full_path .= ($pathdir!=”?’/’:”) . sanitize_title($pathdir); $pages = $wpdb->get_results("SELECT ID, post_name, post_parent FROM $wpdb->posts WHERE post_name = ‘$leaf_path’ AND post_type=’page’"); if ( empty($pages) ) return NULL; foreach ($pages as $page) { $path = ‘/’ . $leaf_path; $curpage = $page; while ($curpage->post_parent != 0) { $curpage = $wpdb->get_row("SELECT ID, post_name, post_parent FROM $wpdb->posts WHERE ID = ‘$curpage->post_parent’ and post_type=’page’"); $path = ‘/’ . $curpage->post_name . $path; } if ( $path == $full_path ) return get_page($page->ID, $output); } return NULL; } function get_page_by_title($page_title, $output = OBJECT) { global $wpdb; $page_title = $wpdb->escape($page_title); $page = $wpdb->get_var("SELECT ID FROM $wpdb->posts WHERE post_title = ‘$page_title’ AND post_type=’page’"); if ( $page ) return get_page($page, $output)