Example #1
0
function pathConfiguration()
{
    global $xoopsModule;
    // Upload and Images Folders
    ss_collapsableBar('configtable', 'configtableicon', _AM_SS_PATHCONFIGURATION);
    echo "<br />";
    echo "<table width='100%' class='outer' cellspacing='1' cellpadding='3' border='0' ><tr>";
    echo "<td class='bg3'><b>" . _AM_SS_PATH_ITEM . "</b></td>";
    echo "<td class='bg3'><b>" . _AM_SS_PATH . "</b></td>";
    echo "<td class='bg3' align='center'><b>" . _AM_SS_STATUS . "</b></td></tr>";
    echo "<tr><td class='odd'>" . _AM_SS_PATH_FILES . "</td>";
    $upload_path = ss_getUploadDir();
    echo "<td class='odd'>" . $upload_path . "</td>";
    echo "<td class='even' style='text-align: center;'>" . ss_admin_getPathStatus('root') . "</td></tr>";
    echo "<tr><td class='odd'>" . _AM_SS_PATH_IMAGES . "</td>";
    $image_path = ss_getImageDir();
    echo "<td class='odd'>" . $image_path . "</td>";
    echo "<td class='even' style='text-align: center;'>" . ss_admin_getPathStatus('images') . "</td></tr>";
    echo "<tr><td class='odd'>" . _AM_SS_PATH_IMAGES_CATEGORY . "</td>";
    $image_path = ss_getImageDir('category');
    echo "<td class='odd'>" . $image_path . "</td>";
    echo "<td class='even' style='text-align: center;'>" . ss_admin_getPathStatus('images/category') . "</td></tr>";
    echo "<tr><td class='odd'>" . _AM_SS_PATH_IMAGES_ITEM . "</td>";
    $image_path = ss_getImageDir('item');
    echo "<td class='odd'>" . $image_path . "</td>";
    echo "<td class='even' style='text-align: center;'>" . ss_admin_getPathStatus('images/item') . "</td></tr>";
    echo "</table>";
    echo "<br />";
    ss_close_collapsable('configtable', 'configtableicon');
}
Example #2
0
function ss_getImageDir($item = '', $local = true)
{
    if ($item) {
        $item = "images/{$item}";
    } else {
        $item = 'images';
    }
    return ss_getUploadDir($local, $item);
}
Example #3
0
 // ou = $xoopsModuleConfig[max_imgsize]
 $max_imgwidth = 0;
 // ou = $xoopsModuleConfig['max_imgwidth']
 $max_imgheight = 0;
 // ou =$xoopsModuleConfig['max_imgheight']
 //$allowed_mimetypes = array('image/gif', 'image/jpeg', 'image/pjpeg', 'image/x-png');
 $allowed_mimetypes = '';
 include_once XOOPS_ROOT_PATH . "/class/uploader.php";
 // Retreive the filename to be uploaded
 $filename = $_POST["xoops_upload_file"][0];
 if (!empty($filename) || $filename != "") {
     if ($_FILES[$filename]['tmp_name'] == "" || !is_readable($_FILES[$filename]['tmp_name'])) {
         redirect_header('javascript:history.go(-1)', 2, _AM_SS_FILEUPLOAD_ERROR);
         exit;
     }
     $uploader = new XoopsMediaUploader(ss_getUploadDir(), $allowed_mimetypes, $max_size, null, null);
     $ext = preg_replace("/^.+\\.([^.]+)\$/sU", "\\1", $_FILES["my_file"]['name']);
     $new_name = time() . "." . $ext;
     $uploader->setTargetFileName($new_name);
     if ($uploader->fetchMedia($filename) && $uploader->upload()) {
         if (!$xoopsUser) {
             if ($xoopsModuleConfig['anonpost'] == 1) {
                 $uid = 0;
             } else {
                 redirect_header("index.php", 3, _NOPERM);
                 exit;
             }
         } else {
             $uid = $xoopsUser->uid();
         }
         $fileObj = $smartsection_file_handler->create();