Exemple #1
0
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
GNU General Public License for more details.
*/
include_once 'wp-css-functions.php';
define('WP_CSS_VERSION', '2.0.5');
define('WP_CSS_URL', get_option('siteurl') . '/' . PLUGINDIR . '/wp-css');
define('WP_CSS_PATH', ABSPATH . PLUGINDIR . '/wp-css');
define('WP_CSS_CACHE_PATH', WP_CSS_PATH . '/cache/');
define('TEMPLATEURL', get_theme_root_uri() . '/' . get_stylesheet());
if (!is_dir(WP_CSS_CACHE_PATH)) {
    @mkdir(WP_CSS_CACHE_PATH);
}
if (!defined('WP_ADMIN')) {
    wp_css_setting(array('u' => TEMPLATEURL, 'p' => get_theme_root() . '/' . get_stylesheet(), 'c' => wp_css_cache_time()));
}
function wp_css($file, $echo = true)
{
    $dir = explode('/', $file);
    array_shift($dir);
    // get rid of blank space
    array_pop($dir);
    // get rid of css file
    if (!file_exists(WP_CSS_CACHE_PATH . 'wp-css-settings.txt')) {
        $url_array = array('c' => wp_css_cache_time(), 'd' => implode('/', $dir), 'u' => TEMPLATEURL, 'p' => TEMPLATEPATH);
    } else {
        $url_array = array('d' => implode('/', $dir));
    }
    $wp_css_attributes = wp_css_url($url_array);
    if (wp_css_activation() == 'on') {
Released under the GPL v.2, http://www.gnu.org/copyleft/gpl.html

This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
GNU General Public License for more details.
*/
global $wp_css;
//include_once('../../../wp-config.php');
include_once 'wp-css-functions.php';
if (isset($_GET['f'])) {
    $wp_css['file'] = substr($_GET['f'], 0, 1) == '/' ? substr($_GET['f'], 1) : $_GET['f'];
    if (eregi('wp\\-config\\.php', $wp_css['file'])) {
        exit;
    }
    if ($wp_css['settings'] = wp_css_setting()) {
        $wp_css['url'] = $wp_css['settings']['u'] . '/';
        $wp_css['path'] = $wp_css['settings']['p'] . '/';
        $wp_css['cache'] = $wp_css['settings']['c'];
    } else {
        $wp_css['url'] = wp_css_decode_string($_GET['u']) . '/';
        $wp_css['path'] = wp_css_decode_string($_GET['p']) . '/';
        $wp_css['cache'] = wp_css_decode_string($_GET['c']);
    }
    if (isset($_GET['d'])) {
        $wp_css['dir'] = wp_css_decode_string($_GET['d']);
    }
    if (extension_loaded('zlib') && substr_count($_SERVER['HTTP_ACCEPT_ENCODING'], 'gzip')) {
        ob_start('ob_gzhandler');
        header('Content-Encoding: gzip');
    } else {