Пример #1
0
function buildImageList()
{
    global $a_img;
    global $a_path;
    global $imgdir;
    global $imgstring;
    getDirContent('');
    $totimg = count($a_img);
    // total image number
    $totalsize = 0;
    // build image data array
    for ($x = 0; $x < $totimg; $x++) {
        // get root dir
        while (substr($imgdir, -1) == '/') {
            $imgdir = substr($imgdir, 0, -1);
        }
        $tmp = $imgdir;
        // add any subdir names
        if ($a_path[$x] != "") {
            $tmp .= $a_path[$x];
        }
        // get image information
        $size = @getimagesize($tmp . '/' . $a_img[$x]);
        $filesize = @filesize($tmp . '/' . $a_img[$x]);
        $halfwidth = ceil($size[0] / 2);
        $halfheight = ceil($size[1] / 2);
        $imgstring[$x][0] = $a_img[$x];
        if ($a_path[$x] != "") {
            $imgstring[$x][0] = $a_path[$x] . '/' . $a_img[$x];
        }
        $imgstring[$x][1] = $size[0];
        $imgstring[$x][2] = $size[1];
        $imgstring[$x][3] = $filesize;
        // type is string after last dot
        $tmp = strtolower(substr($a_img[$x], -(strlen($a_img[$x]) - 1 - strrpos($a_img[$x], "."))));
        if ($tmp == "jpeg") {
            $tmp = "jpg";
        }
        $imgstring[$x][4] = $tmp;
        $totalsize += $filesize;
    }
    $smarty = TikiLib::lib('smarty');
    $smarty->assign('totimg', $totimg);
    $smarty->assign('totalsize', $totalsize);
    $smarty->assign('imgstring', $imgstring);
}
Пример #2
0
function buildFileList()
{
    global $a_file;
    global $a_path;
    global $filedir, $smarty;
    global $filestring;
    getDirContent('');
    $totfile = count($a_file);
    // total file number
    $totalsize = 0;
    // build file data array
    foreach ($a_file as $x => $file) {
        $path = $a_path[$x];
        // get root dir
        $filedir = rtrim($filedir, '/');
        $tmp = $filedir;
        // add any subdir names
        if ($path != "") {
            $tmp .= $path;
        }
        // get file information
        $filesize = @filesize($tmp . '/' . $file);
        $filestring[$x][0] = $file;
        if ($path) {
            $filestring[$x][0] = $path . '/' . $file;
        }
        $filestring[$x][1] = $filesize;
        // type is string after last dot
        $tmp = strtolower(substr($file, -(strlen($file) - 1 - strrpos($file, "."))));
        $filestring[$x][2] = $tmp;
        $totalsize += $filesize;
    }
    $smarty->assign('totfile', $totfile);
    $smarty->assign('totalsize', $totalsize);
    $smarty->assign('filestring', $filestring);
}
    }
}
TopCodeAdmin();
ContentBlockHead("");
if (strlen($action_result)) {
    echo "\r\n<center>\r\n\t<div class=\"err\" style=\"margin: 5px;\">{$action_result}</div>\r\n</center>";
}
?>

<div style="margin-left: auto; margin-right: auto; text-align: center;">
	<form action="<?php 
echo $_SERVER['PHP_SELF'];
?>
" name="css_file" method="post" style="margin: 0px;">
		Select CSS file you want edit:&nbsp;<?php 
echo getDirContent($path, "document.forms['css_file'].submit();", $fname);
if (strlen($fname) && $fname != '0' && file_exists($path . $fname) && is_file($path . $fname)) {
    $fp = fopen($path . $fname, 'r');
    $content = '';
    if ($fp) {
        while (!feof($fp)) {
            $content .= fgets($fp, 4096);
        }
        fclose($fp);
    }
    ?>
		<br /><br />
		<div style="padding-left: 4px; padding-right: 4px; text-align: left;">
			Editing file <b><?php 
    echo $fname;
    ?>
function buildFileList()
{
    global $a_file;
    global $a_path;
    global $filedir, $smarty;
    global $filestring;
    getDirContent('');
    $totfile = count($a_file);
    // total file number
    $totalsize = 0;
    // build file data array
    for ($x = 0; $x < $totfile; $x++) {
        // get root dir
        while (substr($filedir, -1) == '/') {
            $filedir = substr($filedir, 0, -1);
        }
        $tmp = $filedir;
        // add any subdir names
        if ($a_path[$x] != "") {
            $tmp .= $a_path[$x];
        }
        // get file information
        $filesize = @filesize($tmp . '/' . $a_file[$x]);
        $filestring[$x][0] = $a_file[$x];
        if ($a_path[$x] != "") {
            $filestring[$x][0] = $a_path[$x] . '/' . $a_file[$x];
        }
        $filestring[$x][1] = $filesize;
        // type is string after last dot
        $tmp = strtolower(substr($a_file[$x], -(strlen($a_file[$x]) - 1 - strrpos($a_file[$x], "."))));
        $filestring[$x][2] = $tmp;
        $totalsize += $filesize;
    }
    $smarty->assign('totfile', $totfile);
    $smarty->assign('totalsize', $totalsize);
    $smarty->assign('filestring', $filestring);
}