/** * Konstruktor - Initializes the variables. */ function uploader() { $this->file = array(); $this->path = dirname(__FILE__) . DIRECTORY_SEPARATOR; $this->file_types = array(); $this->new_filename = null; $this->error = null; $this->max_filesize = function_exists('ini_maxupload') ? ini_maxupload() : 0; $this->max_image_width = 0; $this->max_image_height = 0; $this->copy_func = 'move_uploaded_file'; }
$my_uploader->set_path($path); if ($my_uploader->upload('file')) { $my_uploader->save_file(); } if ($my_uploader->upload_failed()) { $error = $my_uploader->get_error(); } $image_file = $path . $my_uploader->fileinfo('filename'); if (!file_exists($image_file)) { $error = $lang->phrase('admin_cms_file_does_not_exist'); } $image_file = str_replace(realpath($config['fpath']) . DIRECTORY_SEPARATOR, '', $image_file); $image_file = str_replace(DIRECTORY_SEPARATOR, '/', $image_file); } } $filesize = formatFilesize(ini_maxupload()); $htmlhead .= '<script type="text/javascript" src="templates/editor/wysiwyg-popup.js"></script>'; echo head(' onLoad="loadImage();"'); ?> <form method="post" action="admin.php?action=cms&job=doc_insert_image&wysiwyg=<?php echo $wysiwyg; ?> " enctype="multipart/form-data"> <table class="border" border="0" cellspacing="0" cellpadding="4" align="center" style="width: 700px;"> <tr> <td class="obox" colspan="3"><?php echo $lang->phrase('admin_wysiwyg_upload_x'); ?> </td> </tr> <tr class="mbox">
function exec_query_form($query = '') { global $db; $tables = $db->list_tables(); ?> <form name="form" method="post" action="admin.php?action=db&job=query2"> <table class="border" border="0" cellspacing="0" cellpadding="4" align="center"> <tr> <td class="obox" colspan="2"><b>Execute Queries</b></td> </tr> <tr> <td class="mbox" width="90%"> <span style="float: right;">semicolon-separated list</span><strong>Queries:</strong> <textarea name="query" id="query" rows="10" cols="90" class="texteditor" style="width: 100%; height: 200px;"><?php echo iif(!empty($query), $query); ?> </textarea> </td> <td class="mbox" width="10%"> <strong>Tables:</strong> <div style="overflow: scroll; height: 200px; width: 150px; border: 1px solid #336699; padding: 2px;"> <?php foreach ($tables as $table) { ?> <a href="javascript:InsertTags('query', '`<?php echo $table; ?> `', '');"><?php echo $table; ?> </a><br /> <?php } ?> </div> </td> </tr> <tr> <td class="ubox" colspan="2" align="center"><input type="submit" name="Submit" value="Submit"></td> </tr> </table> </form> <br /> <?php if (empty($query)) { ?> <form name="form" method="post" action="admin.php?action=db&job=query2&type=1" enctype="multipart/form-data"> <table class="border" border="0" cellspacing="0" cellpadding="4" align="center"> <tr> <td class="obox"><b>Import SQL File</b></td> </tr> <tr> <td class="mbox"> <input type="file" name="upload" size="80" /><br /> <span class="stext">Allowed file types: .sql, .zip - Maximum file size: <?php echo formatFilesize(ini_maxupload()); ?> </span> </td> </tr> <tr> <td class="ubox" align="center"><input type="submit" name="Submit" value="Submit"></td> </tr> </table> </form> <br /> <?php } }
<?php echo foot(); } elseif ($job == 'package_import2') { echo head(); $del = $gpc->get('delete', int); $versioncheck = $gpc->get('version', int); $server = $gpc->get('server', none); $inserterrors = array(); $sourcefile = ''; if (!empty($_FILES['upload']['name'])) { require "classes/class.upload.php"; $dir = 'temp/'; $my_uploader = new uploader(); $my_uploader->file_types(array('zip')); $my_uploader->set_path($dir); $my_uploader->max_filesize(ini_maxupload()); if ($my_uploader->upload('upload')) { if ($my_uploader->save_file()) { $sourcefile = $dir . $my_uploader->fileinfo('filename'); } } if ($my_uploader->upload_failed()) { array_push($inserterrors, $my_uploader->get_error()); } } elseif (file_exists($server)) { $ext = get_extension($server); if ($ext == 'zip') { $sourcefile = $server; } else { $inserterrors[] = $lang->phrase('admin_packages_err_selected_file_is_not_a_zipfile'); }
// 500KB $filetypes = 'ttf'; $dir = realpath('./classes/fonts/'); $url = 'admin.php?action=misc&job=captcha_fonts'; } elseif ($cfg == 'captcha_noises') { $ups = 1; $filesize = 200; // 200KB $filetypes = 'jpg'; $dir = realpath('./classes/graphic/noises/'); $url = 'admin.php?action=misc&job=captcha_noises'; $imgwidth = 300; $imgheight = 80; } else { $ups = $uploadfields; $filesize = ini_maxupload(); $filetypes = ''; $path = $gpc->get('path'); $dir = realpath($path); $url = 'admin.php?action=explorer&path=' . urlencode($ServerNavigator->realPath($path)); } $filesize *= 1024; $filetypes = explode('|', $filetypes); foreach ($filetypes as $key => $value) { if (empty($value)) { unset($filetypes[$key]); } } $insertuploads = array(); $inserterrors = array(); require "classes/class.upload.php";
function exec_query_form($query = '') { global $db, $lang; $tables = $db->list_tables(); $lang->assign('maxfilesize', formatFilesize(ini_maxupload())); ?> <script type="text/javascript" src="templates/editor/bbcode.js"></script> <form name="form" method="post" action="admin.php?action=db&job=query2"> <table class="border" border="0" cellspacing="0" cellpadding="4" align="center"> <tr> <td class="obox" colspan="2"><?php echo $lang->phrase('admin_db_execute_queries'); ?> </td> </tr> <tr> <td class="mbox" width="90%"> <span style="float: right;"><?php echo $lang->phrase('admin_db_semicolon_sep_list'); ?> </span><strong><?php echo $lang->phrase('admin_db_queries'); ?> </strong> <textarea name="query" id="query" rows="10" cols="90" class="texteditor" style="width: 100%; height: 200px;"><?php echo iif(!empty($query), $query); ?> </textarea> </td> <td class="mbox" width="10%"> <strong><?php echo $lang->phrase('admin_db_tables'); ?> </strong> <div style="overflow: scroll; height: 200px; width: 150px; border: 1px solid #336699; padding: 2px;"> <?php foreach ($tables as $table) { ?> <a href="javascript:InsertTags('query', '`<?php echo $table; ?> `', '');"><?php echo $table; ?> </a><br /> <?php } ?> </div> </td> </tr> <tr> <td class="ubox" colspan="2" align="center"><input type="submit" name="Submit" value="<?php echo $lang->phrase('admin_db_form_submit'); ?> "></td> </tr> </table> </form> <br /> <?php if (empty($query)) { ?> <form name="form" method="post" action="admin.php?action=db&job=query2&type=1" enctype="multipart/form-data"> <table class="border" border="0" cellspacing="0" cellpadding="4" align="center"> <tr> <td class="obox"><b><?php echo $lang->phrase('admin_db_import_sql_file'); ?> </b></td> </tr> <tr> <td class="mbox"> <input type="file" name="upload" size="80" /><br /> <span class="stext"><?php echo $lang->phrase('admin_db_allowed_filetypes_max_filesize'); ?> </span> </td> </tr> <tr> <td class="ubox" align="center"><input type="submit" name="Submit" value="<?php echo $lang->phrase('admin_db_form_submit'); ?> "></td> </tr> </table> </form> <br /> <?php } }
$htmlhead .= '<script type="text/javascript"> function onloader() { WYSIWYG_ColorInst.init(); loadImage(); } </script>'; echo head(' onLoad="onloader();"'); ?> <form method="post" action="admin.php?action=cms&job=doc_insert_image&wysiwyg=<?php echo $wysiwyg; ?> " enctype="multipart/form-data"> <input type="hidden" id="dir" name="dir" value=""> <table class="border" border="0" cellspacing="0" cellpadding="4" align="center" style="width: 700px;"> <tr> <td class="obox" colspan="4">Insert Image</td> <td class="obox">Select Image</td> </tr> <tr class="mbox"> <td width="120">Upload:<br /><span class="stext">Max Filesize: <?php echo formatFilesize(ini_maxupload()); ?> </span></td> <td colspan="3" width="330"> <input type="file" name="file" size="30" /> <?php if ($error !== null) { echo '<br /><span class="stext">' . $error . '</span>'; } ?> </td> <td rowspan="8" width="250"> <iframe id="chooser" height="260" width="250" frameborder="0" src="admin.php?action=cms&job=doc_select_image&dir=<?php echo urlencode($dir); ?> "></iframe>