Example #1
0
////////////////////////////////////////////////////////////////////////////////
//   Copyright (C) ReloadCMS Development Team                                 //
//   http://reloadcms.sf.net                                                  //
//                                                                            //
//   This program is distributed in the hope that it will be useful,          //
//   but WITHOUT ANY WARRANTY, without even the implied warranty of           //
//   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.                     //
//                                                                            //
//   This product released under GNU General Public License v2                //
////////////////////////////////////////////////////////////////////////////////
rcms_loadAdminLib('file-uploads');
/******************************************************************************
* Perform uploading                                                           *
******************************************************************************/
if (!empty($_FILES['upload'])) {
    if (fupload_array($_FILES['upload'])) {
        rcms_showAdminMessage(__('Files uploaded'));
    } else {
        rcms_showAdminMessage(__('Error occurred'));
    }
}
/******************************************************************************
* Perform deletion                                                            *
******************************************************************************/
if (!empty($_POST['delete'])) {
    $result = '';
    foreach ($_POST['delete'] as $file => $cond) {
        $file = basename($file);
        if (!empty($cond)) {
            if (fupload_delete($file)) {
                $result .= __('File removed') . ': ' . $file . '<br>';
////////////////////////////////////////////////////////////////////////////////
//   Copyright (C) 2004 ReloadCMS Development Team                            //
//   http://reloadcms.sf.net                                                  //
//                                                                            //
//   This program is distributed in the hope that it will be useful,          //
//   but WITHOUT ANY WARRANTY, without even the implied warranty of           //
//   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.                     //
//                                                                            //
//   This product released under GNU General Public License v2                //
////////////////////////////////////////////////////////////////////////////////
rcms_loadAdminLib('file-uploads');
/******************************************************************************
* Perform uploading                                                           *
******************************************************************************/
if (!empty($_FILES['upload'])) {
    $res = fupload_array($_FILES['upload']);
    rcms_showAdminMessage($lang['results']['general'][$res]);
}
/******************************************************************************
* Perform deletion                                                            *
******************************************************************************/
if (!empty($_POST['delete'])) {
    $result = '';
    foreach ($_POST['delete'] as $file => $cond) {
        $file = basename($file);
        if (!empty($cond)) {
            $res = fupload_delete($file);
            $result .= $lang['results']['general'][$res];
        }
    }
    if (!empty($result)) {
Example #3
0
<?php

////////////////////////////////////////////////////////////////////////////////
//   Copyright (C) ReloadCMS Development Team                                 //
//   http://reloadcms.com                                                     //
//   This product released under GNU General Public License v2                //
////////////////////////////////////////////////////////////////////////////////
rcms_loadAdminLib('file-uploads');
$gallery = new gallery();
// Uploading
if (!empty($_FILES['upload'])) {
    $result = '';
    if (fupload_array($_FILES['upload'], GALLERY_UPLOAD_DIR, $gallery->img_preg)) {
        $new_names = $gallery->scanForNewImages();
        foreach ($_FILES['upload']['name'] as $key => $name) {
            $keywords = (!empty($_POST['gkeywords']) ? $_POST['gkeywords'] : '') . (!empty($_POST['keywords'][$key]) ? (!empty($_POST['gkeywords']) ? ';' : '') . $_POST['keywords'][$key] : '');
            if (!empty($keywords)) {
                $gallery->setKeywords(@$new_names[$name], $keywords);
            }
            if (!empty($_POST['title'][$key])) {
                $gallery->setDataValue(@$new_names[$name], 'title', $_POST['title'][$key]);
                $result .= '<br/>' . __('Filename') . ': ' . @$new_names[$name] . ' ' . __('Title') . ': ' . $_POST['title'][$key];
            } elseif (!empty($_POST['gtitle'])) {
                if (!empty($_POST['gadd'])) {
                    $skey = (int) $_POST['gstart'] + $key;
                    $snum = str_pad($skey, $_POST['gdigits'], '0', STR_PAD_LEFT);
                } else {
                    $snum = '';
                }
                $title = $_POST['gtitle'] . $snum;
                $gallery->setDataValue(@$new_names[$name], 'title', $title);
Example #4
0
////////////////////////////////////////////////////////////////////////////////
// Initialisation
rcms_loadAdminLib('file-uploads');
rcms_loadAdminLib('download');
rcms_loadAdminLib('archive');
$installerPath = DATA_PATH . 'installer/';
if (!is_dir($installerPath)) {
    @mkdir($installerPath, 0777);
}
$installer = parse_ini_file(CONFIG_PATH . 'installer.ini', true);
$uninstaller = parse_ini_file(CONFIG_PATH . 'uninstaller.ini', true);
$ignored_modules = @parse_ini_file(CONFIG_PATH . 'ignored.ini', true);
$status = '';
// Perform uploading
if (!empty($_FILES['upload'])) {
    if (fupload_array($_FILES['upload'], $installerPath)) {
        rcms_showAdminMessage(__('Files uploaded'));
    } else {
        rcms_showAdminMessage(__('Error occurred'));
    }
}
// Restore ignored modules
if (!empty($_POST['restore'])) {
    $result = '';
    foreach ($_POST['restore'] as $filename => $cond) {
        $filename = basename($filename);
        if (!empty($cond)) {
            $name = explode('_', $filename);
            $installer[$name[0]] = $ignored_modules[$name[0]];
            rcms_remove_index($name[0], $ignored_modules, true);
            write_ini_file($ignored_modules, CONFIG_PATH . 'ignored.ini', true);