wp-config.php file. I need this before we can get started. Need more help? We got it. You can create a wp-config.php
file through a web interface, but this doesn't work for all server setups. The safest way is to manually create the file.");
require_once(dirname(__FILE__).'/' . '/wp-config.php');
require_once(dirname(__FILE__).'/' . 'wp-includes/wp-l10n.php');
// Process PATH_INFO, if set.
$path_info = array();
if (! empty($_SERVER['PATH_INFO'])) {
// Fetch the rewrite rules.
$rewrite = rewrite_rules('matches');
$pathinfo = $_SERVER['PATH_INFO'];
// Trim leading '/'.
$pathinfo = preg_replace("!^/!", '', $pathinfo);
if (! empty($rewrite)) {
// Get the name of the file requesting path info.
$req_uri = $_SERVER['REQUEST_URI'];
$req_uri = str_replace($pathinfo, '', $req_uri);
$req_uri = preg_replace("!/+$!", '', $req_uri);
$req_uri = explode('/', $req_uri);
$req_uri = $req_uri[count($req_uri)-1];
// Look for matches.
$pathinfomatch = $pathinfo;
foreach ($rewrite as $match => $query) {
// If the request URI is the anchor of the match, prepend it
// to the path info.
if ((! empty($req_uri)) && (strpos($match, $req_uri) === 0)) {
$pathinfomatch = $req_uri . '/' . $pathinfo;
}
if (preg_match("!^$match!", $pathinfomatch, $matches)) {
// Got a match.
// Trim the query of everything up to the '?'.
$query = preg_replace("!^.+\?!", '', $query);
// Substitute the substring matches into the query.
eval("\$query = \"$query\";");
// Parse the query.
parse_str($query, $path_info);
}
}
}
}
$wpvarstoreset = array('m','p','posts','w', 'cat','withcomments','s','search','exact', 'sentence','poststart','postend','preview','debug', 'calendar','page','paged','more','tb', 'pb','author','order','orderby', 'year', 'monthnum', 'day', 'hour', 'minute', 'second', 'name', 'category_name', 'feed', 'author_name');
for ($i=0; $i=')) {
header('Not Modified', TRUE, 304);
} else {
header('HTTP/1.x 304 Not Modified');
}
}
}
}
// Getting settings from DB
if (isset($doing_rss) && $doing_rss == 1)
$posts_per_page=get_settings('posts_per_rss');
if (!isset($posts_per_page) || $posts_per_page == 0)
$posts_per_page = get_settings('posts_per_page');
if (!isset($what_to_show))
$what_to_show = get_settings('what_to_show');
if (isset($showposts) && $showposts) {
$showposts = (int)$showposts;
$posts_per_page = $showposts;
}
$archive_mode = get_settings('archive_mode');
$use_gzipcompression = get_settings('gzipcompression');
$more_wpvars = array('posts_per_page', 'what_to_show', 'showposts');
// Construct the query string.
$query_string = '';
foreach (array_merge($wpvarstoreset, $more_wpvars) as $wpvar) {
if ($$wpvar != '') {
$query_string .= (strlen($query_string) < 1) ? '' : '&';
$query_string .= $wpvar . '=' . rawurlencode($$wpvar);
}
}
if ($pagenow != 'post.php') { timer_start(); }
// Update some caches.
update_user_cache();
update_category_cache();
// Call query posts to do the work.
$posts = query_posts($query_string);
// Update per post caches.
update_post_caches($posts);
if (1 == count($posts)) {
if ($p || $name) {
$more = 1;
$single = 1;
}
if ($s && empty($paged)) { // If they were doing a search and got one result
if (!strstr($_SERVER['PHP_SELF'], 'wp-admin')) // And not in admin section
header('Location: ' . get_permalink($posts[0]->ID));
}
}
if ($pagenow != 'wp-feed.php' && $feed != '') {
require(dirname(__FILE__) . '/wp-feed.php');
exit;
}
if ($pagenow != 'wp-trackback.php' && $tb == 1) {
require(dirname(__FILE__) . '/wp-trackback.php');
exit;
}
if ($pagenow != 'post.php' && $pagenow != 'edit.php') {
if ($use_gzipcompression) {
// gzipping the output of the script
gzip_compression();
}
}
?>