Exemplo n.º 1
0
      <td>
      <form action="dirLIST_files/process_upload.php" method="post" enctype="multipart/form-data" name="upload_form" id="upload_form">
  
        <input name="file" type="file" id="file" size="40" />
        <input name="submit" type="submit" id="submit" value="<?php 
    echo $local_text['upload'];
    ?>
" />
        <input name="folder" type="hidden" id="folder" value="<?php 
    echo $_GET['folder'];
    ?>
" /><?php 
    echo $local_text['filesize_limit'];
    ?>
: <?php 
    echo max_upload_size();
    ?>
B
<?php 
    if ($display_banned_files == 1) {
        echo '<br /><span class="banned_font">' . $local_text['banned_files'] . ': ';
        foreach ($banned_file_types as $val) {
            $string .= substr($val, 1) . " | ";
        }
        echo substr($string, 0, -3);
        echo '</span>';
    }
    ?>
</form></td></tr>
</table>
Exemplo n.º 2
0
    echo display_error_message("<b>Access Denied</b>");
    exit;
}
//Seurity feature -done
//Calculate table dimensions
$table_width = 50 + $width_of_files_column + $width_of_sizes_column + $width_of_dates_column;
//Any upload error is displayed here
switch (base64_decode($_GET['err'])) {
    case "upload_banned":
        echo display_error_message("<b><script> alert('Upload failed, banned file type ');</script></b>") . "<br/>";
        break;
    case "upload_error":
        echo display_error_message("<b><script> alert('Upload failed, an unknown error occured');</script></b>") . "<br />";
        break;
    case "size":
        echo display_error_message("<b>File size exceeded limit. Max allowed is " . max_upload_size() . "B</b>") . "<br />";
        break;
    case "nofile":
        echo display_error_message("<b>Please select a file to upload!</b>") . "<br />";
        break;
}
//Any upload error is displayed here -done
//Change excluded extensions to lowercase if $case_sensative_ext is disabled
if ($case_sensative_ext == 0) {
    foreach ($exclude_ext as $key => $val) {
        $exclude_ext[$key] = strtolower($val);
    }
}
//Initialize arrays
$folders = array();
$files = array();
Exemplo n.º 3
0
 /** @test */
 function it_registers_max_upload_size_helper()
 {
     $this->assertEquals(app()->make('transit.upload')->maxUploadSize(), max_upload_size());
 }
Exemplo n.º 4
0
// ========================== 文件说明 ==========================//
// 本文件说明:文章管理
// --------------------------------------------------------------//
// 本程序作者:angel
// --------------------------------------------------------------//
// 本程序版本:SaBlog-X Ver 2.0
// --------------------------------------------------------------//
// 本程序主页:http://www.sablog.net
// ==============================================================//
if (!defined('SABLOG_ROOT') || !isset($php_self) || !preg_match("/[\\/\\\\]cp\\.php\$/", $php_self)) {
    exit('Access Denied');
}
permission(array(1, 2));
// 加载附件相关函数
require_once SABLOG_ROOT . 'include/func/attachment.func.php';
$max_upload_size = max_upload_size();
$max_upload_size_unit = sizecount($max_upload_size);
$article = array();
if ($articleid) {
    $article = $DB->fetch_one_array("SELECT a.*,u.username FROM {$db_prefix}articles a\r\n\t\tLEFT JOIN {$db_prefix}users u ON u.userid=a.uid\r\n\t\tWHERE articleid='{$articleid}'");
    if (!$article) {
        redirect('日志不存在');
    }
}
if ($message) {
    $messages = array(1 => '标题不能为空并且不能超过120个字符<br />', 2 => '你还没有选择分类<br />', 3 => '内容不能为空并且不能少于4个字符<br />', 4 => '关键词不能超过10个<br />', 5 => '每个关键字不能超过30个字符<br />', 6 => '自定义URL只允许大小写字母、数字、下划线和减号<br />', 7 => '自定义URL名称已经存在<br />', 8 => '数据库中已存在一样的标题了,建议您换一个.<br />', 9 => '添加日志成功', 10 => sprintf('添加日志成功, <a href="' . $options['url'] . 'index.php?action=show&amp;id=%d" target="_blank">查看刚才发布的文章</a>', $articleid), 11 => '您不能修改或删除不是您写的日志', 12 => '修改日志成功', 13 => sprintf('修改日志成功, <a href="' . $options['url'] . 'index.php?action=show&amp;id=%d" target="_blank">查看刚才修改的文章</a>', $articleid), 14 => '日志不存在', 15 => '删除日志成功', 16 => '已经把《' . $article['title'] . '》设置为隐藏状态', 17 => '已经把《' . $article['title'] . '》设置为显示状态', 18 => '所选项目已隐藏', 19 => '所选项目已显示', 20 => '所选项目已置顶', 21 => '所选项目已取消置顶', 22 => '没有选择具体操作', 23 => '未选择任何项目');
}
$uquery = '';
if ($sax_group != 1) {
    $uquery = " AND uid='{$sax_uid}'";
}
Exemplo n.º 5
0
            <div id="fg_Upload_Close"><a href="javascript:fg_hideform('fg_formUpload','fg_backgroundUpload');">Close(X)</a></div>
        </div>

        <div id="fg_form_InnerUpload">
            <?php
             //File uploading
            if($file_uploads == 1 && $listing_mode == 0) 
            { 
            ?>
                <table width="<?PHP echo $table_width; ?>" border="0" cellpadding="2" cellspacing="2" class="table_border">
                    <tr class="top_row">
                        <td>
                            <form action="dirLIST_files/process_upload.php" method="post" enctype="multipart/form-data" name="upload_form" id="upload_form" maxlength="4"> 
                                <input name="file" type="file" id="file" size="40" />
                                <input name="submit" type="submit" id="submit" value="<?PHP echo $local_text['upload']; ?>" />
                                <input name="folder" type="hidden" id="folder" value="<?PHP echo $_GET['folder']; ?>" /><?PHP echo $local_text['filesize_limit']; ?>: <?PHP echo max_upload_size(); ?>
                            </form>
                        </td>
                    </tr>
                </table>

            <?PHP 
            //File uploading -done
            } ?>
        </div>
    </div>
    <!-- client-side Form Validations:
    Uses the excellent form validation script from JavaScript-coder.com-->

    <script type='text/javascript'>
    // <![CDATA[
Exemplo n.º 6
0
    protected function _event_home()
    {
        global $warning;
        $v = $this->__(array('e_title', 'e_text', 'e_time' => array(0), 'e_artists' => array(0)));
        $v_check = array('e_title' => 'INVALID_NAME', 'e_cat' => 'INVALID_CATEGORY');
        foreach ($v_check as $vk => $vv) {
            if (empty($v->{$vk})) {
                $warning->set($vv);
            }
        }
        if (!$warning->exist) {
            $v['e_alias'] = _alias($v['e_title']);
            if (empty($v['e_alias'])) {
                $arning->set('INVALID_ALIAS');
            }
        }
        if (!$warning->exist) {
            $sql = 'SELECT cat_id
				FROM _events_category
				WHERE cat_id = ?';
            if (!sql_fieldrow(sql_filter($sql, $v->e_cat))) {
                $this->warning->set('invalid_category');
            }
        }
        if (!$this->warning->exist) {
            $core->require('upload');
            $core->upload->init();
            $f = $core->upload->process(LIB . 'tmp/', $_FILES['e_flyer'], w('jpg'), max_upload_size());
            if ($f === false && count($core->upload->warning)) {
                $this->warning->set($core->upload->warning);
            }
        }
        if (!$this->warning->exist()) {
            $sql_insert = array('alias' => $v['e_alias'], 'subject' => str_normalize($v['e_title']), 'text' => str_normalize($v['e_text']), 'approved' => 0, 'views' => 0, 'posts' => 0, 'start' => $e_start, 'end' => $e_end, 'images' => 0);
            sql_put('_events', prefix('event', $sql_insert));
            $v['e_id'] = sql_nextid();
            if (is_array($v->e_artists)) {
                foreach ($v['e_artists'] as $row) {
                    $sql_insert = array('id' => (int) $v['e_id'], 'artist' => (int) $row);
                    sql_put('_events_artists', prefix('event', $sql_insert));
                }
            }
            foreach ($f as $row) {
                $f2 = $upload->resize($row, LIB . 'tmp', LIB . 'events/future/', $v['e_id'], array(600, 400), false, false, true);
                if ($f2 === false) {
                    continue;
                }
                $f3 = $upload->resize($row, LIB . 'events/future/', LIB . 'events/preview/', $v['e_id'], array(210, 210), false, false);
            }
            redirect(_link('events', $v['e_alias']));
        }
        return;
    }