Ejemplo n.º 1
0
    $upload_info .= $datas_lang["upload_info0"];
} else {
    if ($dimMaxArray[0] > 0 && $dimMaxArray[1] == 0) {
        $upload_info .= $datas_lang["upload_info1"];
    }
    if ($dimMaxArray[0] == 0 && $dimMaxArray[1] > 0) {
        $upload_info .= $datas_lang["upload_info2"];
    }
    if ($dimMaxArray[0] > 0 && $dimMaxArray[1] > 0) {
        $upload_info .= $datas_lang["upload_info3"];
    }
}
if ($dimThumbs != "") {
    $upload_info .= "<br>" . $datas_lang["upload_infoThumbs"];
}
$upload_info = str_replace("!!poidsmax!!", niceSize(POIDSMAX), $upload_info);
$upload_info = str_replace("!!wMax!!", $dimMaxArray[0], $upload_info);
$upload_info = str_replace("!!hMax!!", $dimMaxArray[1], $upload_info);
$upload_info = str_replace("!!dimThumbs!!", $dimThumbs, $upload_info);
$upload_info .= "<br>" . $datas_lang["upload_infoExtension"];
$exts = implode(",", $extensionsAuthorized);
$upload_info = str_replace("!!extensions!!", $exts, $upload_info);
$smarty->assign("upload_info", $upload_info);
$smarty->assign("wMax", $dimMaxArray[0]);
$smarty->assign("hMax", $dimMaxArray[1]);
$smarty->assign("poidsmax", POIDSMAX);
$smarty->assign("extensionsAuthorized", $exts);
$smarty->assign("dimThumbs", $dimThumbs);
////////////////////////// FIN UPLOAD ///////////////////////////////
/**
 * sanitizePath
Ejemplo n.º 2
0
function upload_info($src, $path, $dimMaxArray, $dimThumbs, $extensionsAuthorized, $multiFiles = 0)
{
    global $myAdmin;
    global $smarty;
    global $datas_lang;
    $upload_info = $datas_lang["upload_infoPoids"] . "<br>";
    if ($dimMaxArray[0] == 0 && $dimMaxArray[1] == 0) {
        $upload_info .= $datas_lang["upload_info0"];
    } else {
        if ($dimMaxArray[0] > 0 && $dimMaxArray[1] == 0) {
            $upload_info .= $datas_lang["upload_info1"];
        }
        if ($dimMaxArray[0] == 0 && $dimMaxArray[1] > 0) {
            $upload_info .= $datas_lang["upload_info2"];
        }
        if ($dimMaxArray[0] > 0 && $dimMaxArray[1] > 0) {
            $upload_info .= $datas_lang["upload_info3"];
        }
    }
    if ($dimThumbs != "") {
        $upload_info .= "<br>" . $datas_lang["upload_infoThumbs"];
    }
    $upload_info = str_replace("!!poidsmax!!", niceSize(POIDSMAX), $upload_info);
    $upload_info = str_replace("!!wMax!!", $dimMaxArray[0], $upload_info);
    $upload_info = str_replace("!!hMax!!", $dimMaxArray[1], $upload_info);
    $upload_info = str_replace("!!dimThumbs!!", $dimThumbs, $upload_info);
    $upload_info .= "<br>" . $datas_lang["upload_infoExtension"];
    if ($extensionsAuthorized == "images") {
        $extensionsAuthorized = $myAdmin->extentionsImagesOk;
    } else {
        if ($extensionsAuthorized == "") {
            $extensionsAuthorized = $myAdmin->extentionsOk;
        }
    }
    if (is_array($extensionsAuthorized)) {
        $exts = implode(",", $extensionsAuthorized);
    } else {
        $exts = $extensionsAuthorized;
    }
    $upload_info = str_replace("!!extensions!!", $exts, $upload_info);
    //    $smarty->assign("info",$upload_info);
    //    $smarty->assign("path",$path);
    //    $smarty->assign("wMax",$dimMaxArray[0]);
    //    $smarty->assign("hMax",$dimMaxArray[1]);
    //    $smarty->assign("poidsmax", POIDSMAX);
    //    $smarty->assign("extensionsAuthorized", $exts);
    //    $smarty->assign("dimThumbs", $dimThumbs);
    $upload_prop = array();
    $upload_prop["info"] = addslashes(utf8_encode($upload_info));
    $upload_prop["src"] = $src;
    $upload_prop["path"] = $path;
    $upload_prop["wMax"] = $dimMaxArray[0];
    $upload_prop["hMax"] = $dimMaxArray[1];
    $upload_prop["exts"] = $exts;
    $upload_prop["poidsmax"] = POIDSMAX;
    $upload_prop["dimThumbs"] = $dimThumbs;
    $upload_prop["sufThumbs"] = $myAdmin->suffixeVignettes;
    $upload_prop["multi"] = $multiFiles;
    $smarty->assign("upload_prop", $upload_prop);
    return $upload_prop;
}
Ejemplo n.º 3
0
            }
            $datas["preview"] = 1;
        }
        if ($fileUsed == 1) {
            // Voir que les fichiers Non utilisés
            $requetex = "SELECT count(id) AS cpt FROM " . $thisSite->PREFIXE_TBL_GEN . "medias" . " WHERE fichier_media='" . $real_path . $item[File_List::KEY_NAME] . "'";
            $resultx = $PDO->free_requete($requetex);
            $rowx = $resultx->fetch();
            if ($rowx["cpt"] > "0") {
                continue;
            }
        }
        $datas["icone"] = $item[File_List::KEY_TYPE] == File_List::TYPE_FOLDER ? 'folder.png' : 'file.png';
        $datas["typefic"] = $item[File_List::KEY_TYPE] == File_List::TYPE_FOLDER ? 'folder' : 'file';
        if ($displaySizes == 1) {
            $datas["niceSize"] = $item[File_List::KEY_TYPE] == File_List::TYPE_FILE ? niceSize($item[File_List::KEY_SIZE]) : '&nbsp;';
        }
        $datas["path"] = $path;
        $datas["real_path"] = $real_path;
        $datas["real_path_urlencode"] = urlencode($real_path);
        $datas["KEY_TYPE"] = $item[File_List::KEY_TYPE];
        $datas["KEY_NAME"] = $item[File_List::KEY_NAME];
        $datas["KEY_NAME_htmlsc"] = htmlspecialchars($item[File_List::KEY_NAME]);
        $datas["KEY_NAME_urlencode"] = urlencode($item[File_List::KEY_NAME]);
        $datas["KEY_DATE"] = date('d/m/y H:i:s', $item[File_List::KEY_DATE]);
        $listing_filtred[$xx] = $datas;
    }
    $smarty->assign("listing_filtred", $listing_filtred);
}
$smarty->assign("getLastItemCount", $file_list->getLastItemCount());
$smarty->assign("getPagination", getPagination($file_list->getLastItemCount(), $start, $limit));
Ejemplo n.º 4
0
    echo "</ul>\n";
}
//-->
if (sizeof($files) > 0) {
    $file_order = ($_GET['sort'] == 'filename' || !isset($_GET['sort'])) && $_GET['order'] != 'desc' ? '&amp;order=desc' : '&amp;order=asc';
    $size_order = $_GET['sort'] == 'size' && $_GET['order'] != 'desc' ? '&amp;order=desc' : '&amp;order=asc';
    $date_order = $_GET['sort'] == 'date' && $_GET['order'] != 'desc' ? '&amp;order=desc' : '&amp;order=asc';
    $file = str_replace('#', '&nbsp;', str_pad('Name', 90, '#', STR_PAD_RIGHT));
    $file = str_replace('Name', '<a href="?sort=filename' . $file_order . '">Name</a>', $file);
    $size = str_replace('#', '&nbsp;', str_pad('Size', 10, '#', STR_PAD_RIGHT));
    $size = str_replace('Size', '<a href="?sort=size' . $size_order . '">Size</a>', $size);
    $date = '<a href="?sort=date' . $date_order . '">Date</a>';
    echo "<h2>Files</h2>\n<ul>\n";
    echo "  <li class=\"lhead\">{$file}{$size}{$date}</li>\n";
    foreach ($files as $file) {
        $original = $file;
        $path_parts = pathinfo($file);
        $extension = strtolower($path_parts['extension']);
        if (file_exists('icons/' . $extension . '.png')) {
            $icon = "<img src=\"{$options['rootPath']}icons/{$extension}.png\" alt=\"{$file}\" /> ";
        } else {
            $icon = "<img src=\"{$options['rootPath']}icons/li.png\" alt=\"{$file}\" /> ";
        }
        $file = str_replace($original, '', str_replace('#', '&nbsp;', str_pad($original, 90, '#', STR_PAD_RIGHT)));
        $size = str_replace('#', '&nbsp;', str_pad(niceSize(@filesize($original)), 10, '#', STR_PAD_RIGHT));
        $date = date('Y.m.d H:i:s', @filemtime($original));
        echo "  <li>{$icon}<a href=\"{$original}\" title=\"{$original}\">{$original}</a>{$file}{$size}{$date}</li>\n";
    }
    echo "</ul>\n";
}
echo "</body>\n</html>";
Ejemplo n.º 5
0
                </thead>
                <tbody>
                    <?php 
// Iterate over the items in this folder
if ($file_list->getLastItemCount()) {
    foreach ($listing as $item) {
        print '<tr>';
        print '  <td width="20"><img src="' . ($item[File_List::KEY_TYPE] == File_List::TYPE_FOLDER ? 'folder.png' : 'file.png') . '" border="0" /></td>';
        // Directories are traversable in this example
        if ($item[File_List::KEY_TYPE] == File_List::TYPE_FOLDER) {
            print '  <td><a href="' . getOrderLink(false, false) . '&path=' . $path . '/' . urlencode($item[File_List::KEY_NAME]) . '">' . htmlspecialchars($item[File_List::KEY_NAME]) . '</a></td>';
        } else {
            print '  <td>' . htmlspecialchars($item[File_List::KEY_NAME]) . '</td>';
        }
        print '  <td>' . date('jS F, Y, g:i a', $item[File_List::KEY_DATE]) . '</td>';
        print '  <td>' . ($item[File_List::KEY_TYPE] == File_List::TYPE_FILE ? niceSize($item[File_List::KEY_SIZE]) : '&nbsp;') . '</td>';
        print '  <td>' . ($item[File_List::KEY_TYPE] == File_List::TYPE_FILE ? $item[File_List::KEY_EXT] : '&nbsp;') . '</td>';
        print '</tr>';
    }
    // Show pagination if there are enough items
    print '<tfoot>';
    print '  <tr>';
    if ($file_list->getLastItemCount() > $limit || $start != 0) {
        print '    <td colspan="3">' . getPagination($file_list->getLastItemCount(), $start, $limit) . '</td>';
    } else {
        print '    <td colspan="3">&nbsp;</td>';
    }
    print '    <td colspan="2" align="right">Showing ' . ($start + 1) . ' to ' . ($start + $limit > $file_list->getLastItemCount() ? $file_list->getLastItemCount() : $start + $limit) . ' of ' . $file_list->getLastItemCount() . ' files &nbsp; </td>';
    print '  </tr>';
    print '<tfoot>';
} else {