// end while mysql_free_result($result); } $sqlfile_name = $prefix . '_' . date('YmdHis') . '.sql'; //by domifara for add action zip ,ta.gzdownload if (!empty($_POST['download_zip'])) { require_once XOOPS_ROOT_PATH . '/class/zipdownloader.php'; $downloader = new XoopsZipDownloader(); $downloader->addFileData($export_string, $sqlfile_name, time()); $downloader->download($sqlfile_name, true); exit; } else { if (!empty($_POST['download_tgz'])) { require_once XOOPS_ROOT_PATH . '/class/tardownloader.php'; $downloader = new XoopsTarDownloader(); $downloader->addFileData($export_string, $sqlfile_name, time()); $downloader->download($sqlfile_name, true); exit; } } //fix for mb_http_output setting and for add any browsers if (function_exists('mb_http_output')) { mb_http_output('pass'); } header("Pragma: public"); // required header("Expires: 0"); header("Cache-Control: must-revalidate, post-check=0, pre-check=0"); header("Cache-Control: private", false); // required for certain browsers header('Content-Type: Application/octet-stream');
$do_download = true; } else { if (!empty($_POST['as_dw_extension_tgz'])) { require_once XOOPS_ROOT_PATH . '/class/tardownloader.php'; $downloader = new XoopsTarDownloader(); $do_download = true; } } if (!empty($do_download)) { // make files for each tplsvars foreach ($tplsvarsinfo_total as $key => $val) { $name = substr($key, 1); $description = htmlspecialchars(xoops_utf8_encode(xoops_substr($val, 0, 256)), ENT_QUOTES); $snippet_body = sprintf($snippet_format, $name, $description); $file_name = strtr($key, '.', '_') . '.csn'; $downloader->addFileData($snippet_body, $dw_snippets_dirname . '/' . $file_name); } // make a mxi file per module foreach ($tplsvarsinfo_mod_tpl as $mod_name => $tplsvarsinfo_tpl) { $file_entries = ''; foreach ($tplsvarsinfo_tpl as $tpl_name => $tplsvarsinfo) { foreach ($tplsvarsinfo as $key => $val) { $name = substr($key, 1); $file_name = strtr($key, '.', '_') . '.csn'; $file_entries .= "\t\t" . '<file name="' . $dw_snippets_dirname . '/' . $file_name . '" destination="$Dreamweaver/Configuration/Snippets/XOOPS-' . $site_name . '/' . $tpl_name . '" />' . "\n"; } } $mxi_body = get_mxi_body($mod_name, $file_entries); $downloader->addFileData($mxi_body, $mod_name . '.mxi'); } echo $downloader->download('tplsvarsinfo', true);
// get_tplsvarsinfo.php // // - XOOPS templates admin module - // // GIJOE <http://www.peak.ne.jp/> // // ------------------------------------------------------------------------- // include_once '../../../include/cp_header.php'; if (!empty($_POST['download_zip'])) { require_once XOOPS_ROOT_PATH . '/class/zipdownloader.php'; $downloader = new XoopsZipDownloader(); $do_download = true; } else { if (!empty($_POST['download_tgz'])) { require_once XOOPS_ROOT_PATH . '/class/tardownloader.php'; $downloader = new XoopsTarDownloader(); $do_download = true; } } if (empty($do_download)) { exit; } $tplset = @$_POST['tplset']; if (!preg_match('/^[0-9A-Za-z_-]{1,16}$/', $tplset)) { die(_TPLSADMIN_ERR_INVALIDTPLSET); } $trs = $xoopsDB->query("SELECT distinct tpl_file,tpl_source,tpl_lastmodified FROM " . $xoopsDB->prefix("tplfile") . " NATURAL LEFT JOIN " . $xoopsDB->prefix("tplsource") . " WHERE tpl_tplset='" . addslashes($tplset) . "' ORDER BY tpl_file"); if ($xoopsDB->getRowsNum($trs) <= 0) { die(_TPLSADMIN_ERR_INVALIDTPLSET); } while (list($tpl_file, $tpl_source, $tpl_lastmodified) = $xoopsDB->fetchRow($trs)) { $downloader->addFileData($tpl_source, $tplset . '/' . $tpl_file, $tpl_lastmodified); } echo $downloader->download('template_' . $tplset, true);
} else { if( isset( $_POST['zip'] ) ){ require_once XOOPS_ROOT_PATH.'/class/zipdownloader.php'; $mydownload = new XoopsZipDownloader; } elseif( isset ( $_POST['tar'] ) ){ require_once XOOPS_ROOT_PATH.'/class/tardownloader.php'; $mydownload = new XoopsTarDownloader; } $res = $db->query( "SELECT tpl_id, tpl_tplset, tpl_file, tpl_lastmodified, tpl_source FROM ".$db->prefix("tplfile")." NATURAL LEFT JOIN ".$db->prefix("tplsource")." WHERE tpl_file LIKE '%.css' AND tpl_tplset='$selected' AND tpl_module='$mydirname'" ) ; if( ! $res ){ $errors = $selected ; redirect_header( XOOPS_URL."/modules/$mydirname/admin/index.php?page=export" , 2 , sprintf( _MD_DBCSS_ERROR_MESSEAGE , $errors ) ) ; exit(); } else { while( $content_row = $db->fetchArray( $res ) ) { $css_tpl = htmlspecialchars( $content_row['tpl_file'], ENT_QUOTES ); $name_string = explode($mydirname.'_',$css_tpl ,2 ) ; $name = $name_string[1]; $body = $myts->stripSlashesGPC( $content_row['tpl_source'] ) ; //$body = trim( $content_row['tpl_source'] ) ; $tplset = htmlspecialchars( $content_row['tpl_tplset'], ENT_QUOTES ); $tpl_lastmodified = intval( $content_row['tpl_lastmodified'] ) ; $mydownload->addFileData( $body, $tplset.'/'.$name, $tpl_lastmodified ); } } echo $mydownload->download($mydirname.'_css_template', true ) ; } } ?>