Esempio n. 1
0
function Main(&$argv)
{
    print "\n\n";
    print "POL Config organizer by Austin\n";
    print "----------\n";
    if (Preg_Match("/\\.cfg/i", $argv[1])) {
        $template = GetTemplate($argv[2]);
        CleanUpElems($argv[1], $template);
    } else {
        print "Command: php cfgformat.php <file-to-clean> (template-file)\n\n";
    }
    return 1;
}
Esempio n. 2
0
function stampa($j, $d, $i, $f = 1, $l = "")
{
    /* $j => numero file/dir 
       $d => directory 
       $f => se file 0, se dir 1*/
    if (!$f) {
        $url = 'javascript: changedir(\'' . $l . $i . '/\')';
        $img = 'folder';
        $dimension = whichsize($d . $i);
        $resto = '<a href="javascript: zipunzip(\'zip\',\'' . $d . $i . '\');"><img src="img/btn_icons/zip.gif" alt="zip"/></a><a href="javascript: clr(\'' . str_replace("./", "", $d) . $i . '\');"><img src="img/btn_icons/cleardir.gif" alt="cleardir"/></a>';
    } else {
        $e = array_pop(explode(".", $i));
        $url = $d . $i;
        $img = whichimg($e);
        $dimension = byteConvert(filesize($d . $i));
        $resto = zipedit($e, $d, $i);
    }
    eval("stampa_t(\"" . GetTemplate("lib/templates/list.html") . "\");");
    if (in_array($e, array(gif, png, jpg, jpeg))) {
        return $i;
    }
}
Esempio n. 3
0
}
echo '<table class="tabl">';
echo "\n    <!-- DIRECTORIES -->\n    " . '<tr><td><img src="img/ext_icons/folder.gif" alt="folder"/></td><td class="tc"><a href="javascript: changedir(\'' . $back . '\');" >..</a></td><td></td><td></td><td></td></div>' . "\n";
$files = array_diff(scandir($dir), array(".", ".."));
foreach ($files as $key => $value) {
    if (is_dir($dir . "/" . $value)) {
        $dirlist[$key] = $files[$key];
    } else {
        $filelist[$key] = $files[$key];
    }
}
foreach ($dirlist as $key => $value) {
    stampa($key, $dir, $value, 0, $d);
}
echo "    <!-- FILES -->\n";
foreach ($filelist as $key => $value) {
    stampa($key, $dir, $value);
    if (in_array(array_pop(explode(".", $value)), array(gif, png, jpg, jpeg))) {
        array_push($piclist, $value);
    }
    //inserisco le immagini nella lista pic
}
eval("stampa_t(\"" . GetTemplate("lib/templates/bottomlist.html") . "\");");
if (count($piclist) > 0) {
    echo "   <!-- GALLERY -->\n   <center>\n";
    foreach ($piclist as $i) {
        eval("stampa_t(\"" . GetTemplate("lib/templates/galist.html") . "\");");
    }
    echo "   </center>\n";
}
echo "\n";
Esempio n. 4
0
function stampa($j, $d, $i, $f = 1, $l = "")
{
    /* $j => numero file/dir 
       $d => directory 
       $f => se file 0, se dir 1*/
    if (!$f) {
        $url = 'javascript: changedir(\'' . str_replace("//", "/", $l . $i) . '/\')';
        $img = 'folder';
        $dimension = whichsize($d . $i);
    } else {
        $e = array_pop(explode(".", $i));
        $url = str_replace("//", "/", $d . $i);
        $img = whichimg($e);
        $dimension = byteConvert(filesize($d . $i));
    }
    eval("stampa_t(\"" . GetTemplate("templates/minilist.html") . "\");");
}