コード例 #1
0
$listFolder->setBaseFolder($folder);
$listFolder->setFolder("");
$listFolder->setAllowedExtensions(implode(',', $uploadHash['allowedExtensions']));
$listFolder->setOrder('name', 'ASC');
//create the fake recordset
if (isset($isMysql)) {
    $tmp = $listFolder->Execute();
    if (!is_resource($tmp)) {
        die('Internal error');
    }
    $rsFiles = new KT_Recordset($tmp);
} else {
    $rsFiles = $listFolder->Execute();
    if (!is_object($rsFiles)) {
        die('Internal error');
    }
}
$totalRows_rsFiles = $rsFiles->RecordCount();
// end folder recordset
if (isset($uploadHash['thumbnail']['width']) && isset($uploadHash['thumbnail']['height']) || isset($uploadHash['thumbnail']['popupWidth']) && isset($uploadHash['thumbnail']['popupHeight'])) {
    $objDynamicThumb1 = new tNG_DynamicThumbnail("../../../", "KT_thumbnail_" . $reference);
    $objDynamicThumb1->setFolder($folder);
    $objDynamicThumb1->setRenameRule("{rsFiles.name}");
    if (isset($uploadHash['thumbnail']['width']) && isset($uploadHash['thumbnail']['height'])) {
        $objDynamicThumb1->setResize($uploadHash['thumbnail']['width'], $uploadHash['thumbnail']['height'], true);
    }
    if (isset($uploadHash['thumbnail']['popupWidth']) && isset($uploadHash['thumbnail']['popupHeight'])) {
        $objDynamicThumb1->setPopupSize($uploadHash['thumbnail']['popupWidth'], $uploadHash['thumbnail']['popupHeight'], true);
        $objDynamicThumb1->setPopupNavigation(false);
    }
}