$write_local_dir		= directory where to write. only if $write_local = true.
$list_only					= true if only list files
$get_file						= filename to get. empty if do not return any files
$_POST['total']								= total number of themes
$_POST['import_install_0']		= non-empty if install theme
$_POST['import_default']			= number of default style or -1 or empty
*/
if (empty($list_only)) {
    $list_only = false;
}
$lang['xs_import_back'] = str_replace('{URL}', append_sid('xs_import.' . PHP_EXT), $lang['xs_import_back']);
// list of text types. only last 4 characters of filename
$text_types = array('.tpl', '.htm', 'html', '.txt', '.css', '.cfg', '.php', '.xml');
// list of image types. if you add type make sure you add content-type header in code below
$img_types = array('.gif', '.jpg', '.jpe', 'jpeg', '.png');
$file = XS_TEMP_DIR . xs_fix_dir($filename);
$header = xs_get_style_header($file);
if ($header === false) {
    if (defined('XS_CLONING')) {
        @unlink($tmp_filename);
    }
    xs_error($lang['xs_style_header_error_reason'] . $xs_header_error . '<br /><br />' . $lang['xs_import_back']);
}
if ($header['filesize'] != filesize($file)) {
    if (defined('XS_CLONING')) {
        @unlink($tmp_filename);
    }
    xs_error($lang['xs_style_header_error_incomplete'] . '<br /><br />' . $lang['xs_import_back']);
}
$f = @fopen($file, 'rb');
if (!$f) {
Example #2
0
    print_r($actions);
    echo "\n\n\$ftp_log dump:\n\n";
    print_r($ftp_log);
    echo "\n\n -->";
    @unlink($local_filename);
    if ($res) {
        xs_message($lang['Information'], $lang['xs_edit_file_saved'] . '<br /><br />' . $return_url);
    }
    xs_error($ftp_error . '<br /><br />' . $return_url);
}
/*
* show edit form
*/
if (isset($HTTP_GET_VARS['edit'])) {
    $file = stripslashes($HTTP_GET_VARS['edit']);
    $file = xs_fix_dir($file);
    $fullfile = $current_dir_root . $file;
    $localfile = '../' . $fullfile;
    $hash = md5($localfile);
    if (!@file_exists($localfile)) {
        xs_error($lang['xs_edit_not_found'] . '<br /><br />' . $return_url);
    }
    $content = @file($localfile);
    if (!is_array($content)) {
        xs_error($lang['xs_edit_not_found'] . '<br /><br />' . $return_url);
    }
    $content = implode('', $content);
    if (isset($HTTP_GET_VARS['download']) && !defined('DEMO_MODE')) {
        xs_download_file($file, $content);
        xs_exit();
    }