Ejemplo n.º 1
0
function GetFileList($path, &$a)
{
    $d = array();
    $f = array();
    $nd = 0;
    $nf = 0;
    $hndl = opendir($path);
    while ($file = readdir($hndl)) {
        if ($file == '.' || $file == '..') {
            continue;
        }
        if (is_dir($path . '/' . $file)) {
            $d[$nd++] = $path . '/' . $file;
        } else {
            $f[$nf++] = $path . '/' . $file;
        }
    }
    closedir($hndl);
    sort($d);
    sort($f);
    $n = 1;
    for ($i = 0; $i < count($d); $i++) {
        GetFileList($d[$i], $a[$n]);
        $a[$n++][0] = $d[$i];
    }
    for ($i = 0; $i < count($f); $i++) {
        $a[$n++] = $f[$i];
    }
}
Ejemplo n.º 2
0
function GetFileList($dir)
{
    if (file_exists($dir)) {
        $args = func_get_args();
        $pref = $args[1];
        $dh = opendir($dir);
        while ($files = readdir($dh)) {
            if ($files != "." && $files != "..") {
                if (is_dir($dir . $files)) {
                    $curdir = getcwd();
                    chdir($dir . $files);
                    $file = array_merge($file, GetFileList("{$pref}{$files}/"));
                    chdir($curdir);
                } else {
                    $file[] = $pref . $files;
                }
            }
        }
        closedir($dh);
    }
    return $file;
}
Ejemplo n.º 3
0
<?php

header("content-Type: text/html; charset=utf-8");
require "private.php";
InitParam();
$GLOBALS["sAction"] = strtoupper(TrimGet("action"));
if ($GLOBALS["sAction"] == "FILE") {
    OutScript(GetFileList());
} else {
    $GLOBALS["sAction"] = "FOLDER";
    OutScript(GetFolderList());
}
function GetFileList()
{
    $s_ReturnFlag = TrimGet("returnflag");
    $s_FolderType = TrimGet("foldertype");
    $s_Dir = TrimGet("dir");
    $s_CurrDir = "";
    $s_Dir = UTF8_to_Pagecode($s_Dir, true);
    switch ($s_FolderType) {
        case "upload":
            $s_CurrDir = $GLOBALS["sUploadDir"];
            break;
        case "shareimage":
            $GLOBALS["sAllowExt"] = "";
            $s_CurrDir = $GLOBALS["sPathShareImage"];
            break;
        case "shareflash":
            $GLOBALS["sAllowExt"] = "";
            $s_CurrDir = $GLOBALS["sPathShareFlash"];
            break;
Ejemplo n.º 4
0
?>
</head>
<body>
<?php 
require "{$phpdir}/template/body.inc";
?>

<?php 
navInsertMarkup("release");
?>

<?php 
require "{$phpdir}/common.php";
$pdir = "me6000";
$dirname = "{$qa_reportdir}/{$pdir}";
$flist = GetFileList($dirname);
?>
<h4>Release matrix</h4>

<p>Under construction</p>

<?php 
navInsertLeads("release");
?>

<?php 
require "{$phpdir}/template/foot.inc";
?>
</body>
</html>
Ejemplo n.º 5
0
    function PrintThumbs()
    {
        global $config, $title, $i, $id;
        if (!$id) {
            header("location:?xl=Gallery&ID=1");
        }
        if ($id >= $i) {
            $msg = "Thể loại này không có thực<br>- Xin chọn thể loại từ danh mục có sẵn.";
            $page = "?xl=Home";
            page_load2($msg, $page);
            return false;
        }
        if (!file_exists($config['fulls'])) {
            $msg = "Thư mục chứa dữ liệu của <b>{$title}</b> chưa được tạo.";
            $page = "?xl=Home";
            page_load2($msg, $page);
            return false;
        }
        if (!file_exists($config['thumbs'])) {
            if (!@mkdir($config['thumbs'], 0755)) {
                $msg = "Không thể tạo được thư mục Thumbnail cho <b>{$title}</b>.<br>- Kiểm tra lại quyền truy xuất cho thư mục này.";
                $page = "?xl=Home";
                page_load2($msg, $page);
                return false;
            }
        }
        $imagelist = GetFileList($config['fulls']);
        $config['start'] = $config['page'] * $config['cols'] * $config['rows'];
        $config['max'] = $config['page'] * $config['cols'] * $config['rows'] + $config['cols'] * $config['rows'];
        if ($config['max'] > count($imagelist)) {
            $config['max'] = count($imagelist);
        }
        if ($config['start'] > count($imagelist)) {
            $config['start'] = 0;
        }
        echo '<table border="0" cellpadding="0" cellspacing="0" align="center" width="95%">';
        echo "<tr>\n<td colspan=\"{$config['cols']}\" class=\"entries\"></td></tr>";
        echo "<tr><td colspan=\"{$config['cols']}\" width=\"100%\"><br></td></tr>";
        $column_counter = 1;
        echo "<tr>\n";
        for ($i = $config['start']; $i < $config['max']; $i++) {
            $thumb_image = $config['thumbs'] . $imagelist[$i];
            $thumb_exists = file_exists($thumb_image);
            if (!$thumb_exists) {
                set_time_limit(30);
                if (!($thumb_exists = ResizeImageUsingGD("{$config['fulls']}{$imagelist[$i]}", $thumb_image, $config['size']))) {
                    $msg = "Không thể tạo Thumbnail cho <b>{$title}</b>.<br>- Kiểm tra lại quyền truy xuất cho thư mục này.";
                    $page = "?xl=Home";
                    page_load2($msg, $page);
                    return false;
                }
            }
            $imagelist[$i] = rawurlencode($imagelist[$i]);
            echo '<td align=center>';
            echo '<br><a href="' . $config['fulls'] . $imagelist[$i] . '" title="[ xGallery ]-> ' . $title . ' -> ' . $imagelist[$i] . '" rel="lightbox[roadtrip]">';
            echo '<img src="' . $config['thumbs'] . $imagelist[$i] . '" title="[ Xem ảnh ]" style="border: 2px dotted #aebbc7;">';
            echo "</a><br><a title=\"Xoá : {$imagelist[$i]}\" href='?xl=Gallery&ID={$id}&act=Del&Filename={$imagelist[$i]}'>[ Xóa ]</a>&nbsp;";
            echo '</td>' . "\n";
            if ($column_counter == $config['cols'] && $i + 1 != $config['max']) {
                echo "</tr>\n\n<tr>";
                echo "<tr><td colspan=\"{$config['cols']}\" width=\"100%\"><hr width=\"90%\"></td></tr>";
                echo "<td colspan=\"{$config['cols']}\" class=\"spacer\"></td></tr>\n\n<tr>\n";
                $column_counter = 0;
            }
            $column_counter++;
        }
        if ($config['start'] == $config['max']) {
            echo "<td colspan=\"{$config['cols']}\" class=\"entries\" align=center><br>Chưa có dữ liệu<br><br></td>\n";
        } elseif ($column_counter != $config['cols'] + 1) {
            echo "<td colspan=\"" . ($config['cols'] - $column_counter + 1) . "\">&nbsp;</td>\n";
        }
        echo "</tr>\n\n";
        echo "<tr><td colspan=\"{$config['cols']}\" width=\"100%\"><hr width=\"90%\"></td></tr>";
        echo "<tr>\n<td colspan=\"{$config['cols']}\" class=\"pagenumbers\">\n";
        echo "</td>\n</tr>\n\n";
        echo "</td></tr></table>\n";
        echo '<table border="0" cellpadding="0" cellspacing="0">
				<tr><td align=\\"left\\"><br><b>';
        GetPageNumbers(count($imagelist));
        echo '<br><br>	</td></tr>
			</table>';
    }
Ejemplo n.º 6
0
<head>
<title><?php 
echo crumbGet();
?>
</title>
<?php 
require "{$phpdir}/template/head.inc";
?>
</head>
<body>
<?php 
require "{$phpdir}/template/body.inc";
?>
<p></p>
<ul>
<?php 
require "{$phpdir}/common.php";
$flist = GetFileList("{$qa_logsdir}/zodiac", false);
$read_content = GetFileContents("{$filename}", "", true);
while ($fpath = array_shift($flist)) {
    $filename = basename($fpath);
    print "<li><a href=\"/tests/logs/zodiac/{$filename}\" title=\"{$filename}\">{$filename}</a></li>\n";
}
?>
</ul>
<?php 
require "{$phpdir}/template/foot.inc";
?>
</body>
</html>
Ejemplo n.º 7
0
<head>
<title><?php 
echo crumbGet();
?>
</title>
<?php 
require "{$phpdir}/template/head.inc";
?>
</head>
<body>
<?php 
require "{$phpdir}/template/body.inc";
?>
<p></p>
<ul>
<?php 
require "{$phpdir}/common.php";
$flist = GetFileList($qa_toolsdir, false);
$read_content = GetFileContents("{$filename}", "", true);
while ($fpath = array_shift($flist)) {
    $filename = basename($fpath);
    print "<li><a href=\"/tests/tools/{$filename}\" title=\"{$filename}\">{$filename}</a></li>\n";
}
?>
</ul>
<?php 
require "{$phpdir}/template/foot.inc";
?>
</body>
</html>
Ejemplo n.º 8
0
function PrintThumbs()
{
    global $config;
    // full directory error check
    if (!file_exists($config['fulls'])) {
        Oops("Fullsize image directory <b>{$config['fulls']}</b> does not exist.");
    }
    // thumb directory error check
    if (!file_exists($config['thumbs'])) {
        if (!@mkdir($config['thumbs'], 0755)) {
            Oops("Thumbnail image directory <b>{$config['thumbs']}</b> does not exist and can not be created. Check directory write permissions.");
        }
    }
    // get the list of all the fullsize images
    $imagelist = GetFileList($config['fulls']);
    // number of and which images on current page
    $config['start'] = $config['page'] * $config['cols'] * $config['rows'];
    $config['max'] = $config['page'] * $config['cols'] * $config['rows'] + $config['cols'] * $config['rows'];
    if ($config['max'] > count($imagelist)) {
        $config['max'] = count($imagelist);
    }
    if ($config['start'] > count($imagelist)) {
        $config['start'] = 0;
    }
    // start table
    echo '<table border="0" cellpadding="0" cellspacing="0" align="center" class="gallery">';
    echo "<tr>\n<td colspan=\"{$config['cols']}\" class=\"entries\">";
    // "showing results"
    if ($config['max'] == "0") {
        echo "Showing results <b>0 - 0</b> of <b>0</b></td></tr>\n";
    } else {
        echo "Showing results <b>" . ($config['start'] + 1) . " - {$config['max']}</b> of <b>" . count($imagelist) . "</b> entries</td>\n</tr>\n\n";
    }
    $column_counter = 1;
    // start row
    echo "<tr>\n";
    // for the images on the page
    for ($i = $config['start']; $i < $config['max']; $i++) {
        $thumb_image = $config['thumbs'] . $imagelist[$i];
        $thumb_exists = file_exists($thumb_image);
        // create thumb if not exist
        if (!$thumb_exists) {
            set_time_limit(30);
            if (!($thumb_exists = ResizeImageUsingGD("{$config['fulls']}{$imagelist[$i]}", $thumb_image, $config['size']))) {
                Oops("Creating Thumbnail image of <strong>{$config['fulls']}{$imagelist[$i]}</strong> failed. Possible directory write permission errors.");
            }
        }
        $imagelist[$i] = rawurlencode($imagelist[$i]);
        #########################################################
        # print out the image and link to the page
        #########################################################
        echo '<td>';
        echo '<a href="' . $config['fulls'] . $imagelist[$i] . '" title="' . $imagelist[$i] . ' rel="lightbox" " target="_blank">';
        echo '<img src="' . $config['thumbs'] . $imagelist[$i] . '" alt="' . $imagelist[$i] . '">';
        echo '</a>';
        echo '</td>' . "\n";
        #########################################################
        //if the max columns is reached, start new col
        if ($column_counter == $config['cols'] && $i + 1 != $config['max']) {
            echo "</tr>\n\n<tr><td colspan=\"{$config['cols']}\" class=\"spacer\"></td></tr>\n\n<tr>\n";
            $column_counter = 0;
        }
        $column_counter++;
    }
    //for(images on the page)
    // if there are no images found
    if ($config['start'] == $config['max']) {
        echo "<td colspan=\"{$config['cols']}\" class=\"entries\">No Entries found</td>\n";
    } elseif ($column_counter != $config['cols'] + 1) {
        echo "<td colspan=\"" . ($config['cols'] - $column_counter + 1) . "\">&nbsp;</td>\n";
    }
    // end row
    echo "</tr>\n\n";
    // print out page number list
    echo "<tr>\n<td colspan=\"{$config['cols']}\" class=\"pagenumbers\">\n";
    GetPageNumbers(count($imagelist));
    echo "</td>\n</tr>\n\n";
    // end table
    echo "</td></tr></table>\n";
}
Ejemplo n.º 9
0
<head>
<title><?php 
echo crumbGet();
?>
</title>
<?php 
require "{$phpdir}/template/head.inc";
?>
</head>
<body>
<?php 
require "{$phpdir}/template/body.inc";
?>
<p></p>
<ul>
<?php 
require "{$phpdir}/common.php";
$flist = GetFileList($qa_docsdir, false);
$read_content = GetFileContents("{$filename}", "", true);
while ($fpath = array_shift($flist)) {
    $filename = basename($fpath);
    print "<li><a href=\"/tests/docs/{$filename}\" title=\"{$filename}\">{$filename}</a></li>\n";
}
?>
</ul>
<?php 
require "{$phpdir}/template/foot.inc";
?>
</body>
</html>
Ejemplo n.º 10
0
<head>
<title><?php 
echo crumbGet();
?>
</title>
<?php 
require "{$phpdir}/template/head.inc";
?>
</head>
<body>
<?php 
require "{$phpdir}/template/body.inc";
?>
<p></p>
<ul>
<?php 
require "{$phpdir}/common.php";
$flist = GetFileList("{$qa_logsdir}/statmux", false);
$read_content = GetFileContents("{$filename}", "", true);
while ($fpath = array_shift($flist)) {
    $filename = basename($fpath);
    print "<li><a href=\"/tests/logs/statmux/{$filename}\" title=\"{$filename}\">{$filename}</a></li>\n";
}
?>
</ul>
<?php 
require "{$phpdir}/template/foot.inc";
?>
</body>
</html>