$fcount = count($ifiles); for ($i = 0; $i < $fcount; $i++) { $dummyimage = XOOPS_CACHE_PATH.'/_dummyimage'.$i.time(); $fp = @fopen($dummyimage, 'wb'); @fwrite($fp, $ifiles[$i]->getVar('imgsetimg_body')); @fclose($fp); $downloader->addBinaryFile($dummyimage, $tplset.'/images/'.$ifiles[$i]->getVar('imgsetimg_file')); @unlink($dummyimage); $xml .= " \r\n <image name=\"".$ifiles[$i]->getVar('imgsetimg_file')."\"></image>"; } */ } //$xml .= "\r\n </images> $xml .= "\r\n</tplset>"; $downloader->addFileData($xml, $tplset . '/tplset.xml', time()); echo $downloader->download($tplset, true); } else { xoops_cp_header(); xoops_error(_MD_NOZLIB); xoops_cp_footer(); } } break; case 'generatetpl': xoops_cp_header(); xoops_confirm(array('tplset' => $tplset, 'moddir' => $moddir, 'file' => $file, 'type' => $type, 'op' => 'generatetpl_go', 'fct' => 'tplsets'), 'admin.php', _MD_PLZGENERATE, _MD_GENERATE); xoops_cp_footer(); break; case 'generatetpl_go': if (!$GLOBALS['xoopsSecurity']->check()) { redirect_header('admin.php?fct=tplsets', 3, implode('<br />', $GLOBALS['xoopsSecurity']->getErrors()));
// end if } // end for $export_string .= "INSERT INTO `{$table}` VALUES (" . implode(', ', $values) . ");\n"; unset($values); } // 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");