Licensed under the MIT License, Copyright 2004 Owen Winkler.
Version: 3.1.1
Author: Owen Winkler
Author URI: http://www.asymptomatic.net
Thanks to Stephen, aka "gravity", for help debugging the ob_ functions.
*/
/*
EzStatic - Allows easy display of static content within
the WP blog context.
Copyright (c) 2005 Owen Winkler
Permission is hereby granted, free of charge, to any person
obtaining a copy of this software and associated
documentation files (the "Software"), to deal in the
Software without restriction, including without limitation
the rights to use, copy, modify, merge, publish,
distribute, sublicense, and/or sell copies of the Software,
and to permit persons to whom the Software is furnished to
do so, subject to the following conditions:
The above copyright notice and this permission notice shall
be included in all copies or substantial portions of the
Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY
KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE
WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR
PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS
OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR
OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
*/
/*
INSTRUCTIONS:
Detailed instructions at:
http://redalt.com/wiki/EzStatic
No edits to the WordPress source are required.
Just drop this into your WordPress plugins directory, and then
Activate it on the Plugins tab of the WordPress admin console.
If you are a user of high enough level and you check the new
option checkbox that appears below the post editing area, then
posts that contain PHP tags will be executed in the posts that
you write.
Also, you can include existing files into
your WordPress template:
Add a querystring to your URL that points to your static file.
Like this:
http://www.example.com/index.php?static=mystaticfile
EzStatic will try to open in order from your blog directory:
mystaticfile
mystaticfile.php
mystaticfile.htm
If the static file specified is PHP, it will execute the file
and display the results. This file may contain WordPress
template tags and functions.
For plugin developers:
You can use EzStatic in your own functions to create static-like
pages from your plugins!
Simply dump all of your output into a variable, then send it
with a new page title to the function EzStatic_force().
EzStatic will automatically insert your content in place of the
default post listing.
If you receive reports that EzStatic isn't working, turn OFF
gzip support in your WordPress admin panel. (Options, Reading)
*/
if(!function_exists('EzStatic_include_up')) :
function EzStatic_include_up($filename) {
$c=0;
while(!is_file($filename)) {
$filename = '../' . $filename;
$c++;
if($c==30) {
echo 'Could not find ' . basename($filename) . '.';
return '';
}
}
return $filename;
}
endif;
if(!defined('ABSPATH')) {
// Things to do when the file is called solo
include(EzStatic_include_up('wp-config.php'));
$ezs_options = get_settings('ezstatic');
if($ezs_options == '') {
$ezs_options = array(
'qs_key' => 'static',
'fileexts' => array('.php', '.htm', '.html', '.txt', '.asp'),
'block' => array('htaccess'),
'page_template' => '',
);
update_option('ezstatic', $ezs_options);
}
if(isset($_POST['config'])) {
// Things to do when the Ajax gets ya
include_once(ABSPATH.'/wp-admin/admin-functions.php');
auth_redirect();
?>