コード例 #1
0
function _readFolderStructure($dir, $except, &$result)
{
    $files = readFolderFiles($dir, $except);
    $subdirs = readSubFolders($dir);
    if (is_array($subdirs)) {
        foreach ($subdirs as $key => $subdir) {
            if (inExcept($dir, $subdir, $except)) {
                unset($subdirs[$key]);
                continue;
            }
            _readFolderStructure($dir . '/' . $subdir, $except, $result);
        }
    }
    $result[$dir] = array_merge($files, $subdirs);
    return $result;
}
コード例 #2
0
<?php

include $REX['INCLUDE_PATH'] . "/layout/top.php";
include_once $REX['INCLUDE_PATH'] . '/addons/' . $page . '/functions/function_folder.inc.php';
if (isset($function) and $function == "clear_cache") {
    $c = 0;
    $files = readFolderFiles($REX['HTDOCS_PATH'] . "files/");
    if (is_array($files)) {
        foreach ($files as $var) {
            if (eregi('^' . $REX['TEMP_PREFIX'] . 'cache_resize___', $var)) {
                unlink($REX['HTDOCS_PATH'] . "files/" . $var);
                $c++;
            }
        }
    }
    $msg = "Cache cleared - {$c} cachefiles removed";
}
rex_title('Image Resize Addon ', '&nbsp;&nbsp;&nbsp;<a href="index.php?page=image_resize&amp;function=clear_cache" onClick="return confirm(\'Resize Cache wirklich löschen?\')">Resize Cache löschen</a>');
if (isset($msg) and $msg != "") {
    echo '<table border="0" cellpadding="5" cellspacing="1" width="770"><tr><td class="warning">' . $msg . '</td></tr></table><br />';
}
?>

<table border="0" cellpadding="5" cellspacing="1" width="770">
  <tbody>
  <tr>
    <th colspan="2" align="left">Instructions</th>
  </tr>
  <tr>
    <td class="grey" valign="top" width="50%"><br />
    <b>Features:</b><br /><br />
コード例 #3
0
 function deleteCache($filename = '')
 {
     global $REX;
     require_once $REX['INCLUDE_PATH'] . '/addons/image_resize/functions/function_folder.inc.php';
     $folders = array();
     $folders[] = $REX['INCLUDE_PATH'] . '/generated/files/';
     $folders[] = $REX['HTDOCS_PATH'] . 'files/';
     $c = 0;
     foreach ($folders as $folder) {
         $files = readFolderFiles($folder);
         if (is_array($files)) {
             foreach ($files as $var) {
                 if (eregi('^' . $REX['TEMP_PREFIX'] . 'cache_resize___', $var)) {
                     if ($filename == '' || $filename != '' && $filename == substr($var, strlen($filename) * -1)) {
                         unlink($folder . $var);
                         $c++;
                     }
                 }
             }
         }
     }
     return $c;
 }