게시판 글쓰기 오류

게시판 글쓰기 오류

QA

게시판 글쓰기 오류

본문

 

갤러리 게시판 글쓰는건데 사진을 첨부하고 또 수정할때 사진을 여러개 넣으면

제목과 내용을 입력해달라고 에러가 납니다..

 

근데 사진첨부를 안하고 제목과 내용만 적고 글을 올리면 되거든요.

그렇게 해서 수정을 누르고 사진을 하나씩 첨부해야 글도 수정이 됩니다..

 

왜그런걸까요 ㅠ

 



<?php
if (!defined('_GNUBOARD_')) exit; //禁止单独访问此页
 
// add_stylesheet('css 文本', 显示顺序); 数字越小的优先显示
if ($bo_table != 'event') {
add_stylesheet('<link rel="stylesheet" href="'.$board_skin_url.'/style.css">', 0);
} else {
add_stylesheet('<link rel="stylesheet" href="'.$board_skin_url.'/event.css">', 0);
}?>
 
<section id="bo_w">
    <h2 id="container_title"><?php echo $g5['title'] ?></h2>
 
    <!-- 编辑主题/修改主题开始 { -->
    <form name="fwrite" id="fwrite" action="<?php echo $action_url ?>" onsubmit="return fwrite_submit(this);" method="post" enctype="multipart/form-data" autocomplete="off" style="width:<?php echo $width; ?>">
    <input type="hidden" name="uid" value="<?php echo get_uniqid(); ?>">
    <input type="hidden" name="w" value="<?php echo $w ?>">
    <input type="hidden" name="bo_table" value="<?php echo $bo_table ?>">
    <input type="hidden" name="wr_id" value="<?php echo $wr_id ?>">
    <input type="hidden" name="sca" value="<?php echo $sca ?>">
    <input type="hidden" name="sfl" value="<?php echo $sfl ?>">
    <input type="hidden" name="stx" value="<?php echo $stx ?>">
    <input type="hidden" name="spt" value="<?php echo $spt ?>">
    <input type="hidden" name="sst" value="<?php echo $sst ?>">
    <input type="hidden" name="sod" value="<?php echo $sod ?>">
    <input type="hidden" name="page" value="<?php echo $page ?>">
    <?php
    $option = '';
    $option_hidden = '';
    if ($is_notice || $is_html || $is_secret || $is_mail) {
        $option = '';
        if ($is_notice) {
            $option .= "\n".'<input type="checkbox" id="notice" name="notice" value="1" '.$notice_checked.'>'."\n".'<label for="notice">公告</label>';
        }
 
        if ($is_html) {
            if ($is_dhtml_editor) {
                $option_hidden .= '<input type="hidden" value="html1" name="html">';
            } else {
                $option .= "\n".'<input type="checkbox" id="html" name="html" onclick="html_auto_br(this);" value="'.$html_value.'" '.$html_checked.'>'."\n".'<label for="html">html</label>';
            }
        }
 
        if ($is_secret) {
            if ($is_admin || $is_secret==1) {
                $option .= "\n".'<input type="checkbox" id="secret" name="secret" value="secret" '.$secret_checked.'>'."\n".'<label for="secret">加密贴</label>';
            } else {
                $option_hidden .= '<input type="hidden" name="secret" value="secret">';
            }
        }
 
        if ($is_mail) {
            $option .= "\n".'<input type="checkbox" id="mail" name="mail" value="mail" '.$recv_email_checked.'>'."\n".'<label for="mail">邮件通知新回复</label>';
        }
    }
 
    echo $option_hidden;
    ?>
 
    <div class="tbl_frm01 tbl_wrap">
        <table>
        <tbody>
        <?php if ($is_name) { ?>
        <tr>
            <th scope="row"><label for="wr_name">姓名<strong class="sound_only"> 必选项</strong></label></th>
            <td><input type="text" name="wr_name" value="<?php echo $name ?>" id="wr_name" required class="frm_input required" size="10" maxlength="20"></td>
        </tr>
        <?php } ?>
 
        <?php if ($is_password) { ?>
        <tr>
            <th scope="row"><label for="wr_password">密码<strong class="sound_only"> 必选项</strong></label></th>
            <td><input type="password" name="wr_password" id="wr_password" <?php echo $password_required ?> class="frm_input <?php echo $password_required ?>" maxlength="20"></td>
        </tr>
        <?php } ?>
 
        <?php if ($is_email) { ?>
        <tr>
            <th scope="row"><label for="wr_email">邮件地址</label></th>
            <td><input type="text" name="wr_email" value="<?php echo $email ?>" id="wr_email" class="frm_input email" size="50" maxlength="100"></td>
        </tr>
        <?php } ?>
 
        <?php if ($is_homepage) { ?>
        <tr>
            <th scope="row"><label for="wr_homepage">网站主页</label></th>
            <td><input type="text" name="wr_homepage" value="<?php echo $homepage ?>" id="wr_homepage" class="frm_input" size="50"></td>
        </tr>
        <?php } ?>
 
        <?php if ($option) { ?>
        <tr>
            <th scope="row">选项</th>
            <td><?php echo $option ?></td>
        </tr>
        <?php } ?>
 
        <?php if ($is_category) { ?>
        <tr>
            <th scope="row"><label for="ca_name">分类<strong class="sound_only">必选项</strong></label></th>
            <td>
                <select name="ca_name" id="ca_name" required class="required" >
                    <option value="">请选择</option>
                    <?php echo $category_option ?>
                </select>
            </td>
        </tr>
        <?php } ?>
 
        <tr>
            <th scope="row"><label for="wr_subject">主题<strong class="sound_only">必选项</strong></label></th>
            <td>
                <div id="autosave_wrapper">
                    <input type="text" name="wr_subject" value="<?php echo $subject ?>" id="wr_subject" required class="frm_input required" size="50" maxlength="255">
                    <?php if ($is_member) { // 草稿箱功能 ?>
                    <script src="<?php echo G5_JS_URL; ?>/autosave.js"></script>
                    <button type="button" id="btn_autosave" class="btn_frmline">草稿箱 (<span id="autosave_count"><?php echo $autosave_count; ?></span>)</button>
                    <div id="autosave_pop">
                        <strong>草稿箱目录</strong>
                        <div><button type="button" class="autosave_close"><img src="<?php echo $board_skin_url; ?>/img/btn_close.gif" alt="关闭"></button></div>
                        <ul></ul>
                        <div><button type="button" class="autosave_close"><img src="<?php echo $board_skin_url; ?>/img/btn_close.gif" alt="关闭"></button></div>
                    </div>
                    <?php } ?>
                </div>
            </td>
        </tr>
 
        <tr>
            <th scope="row"><label for="wr_content">内容<strong class="sound_only">必选项</strong></label></th>
            <td class="wr_content">
                <?php if($write_min || $write_max) { ?>
                <!-- 开启最少、最多内容限制功能时 -->
                <p id="char_count_desc">当前版块发表主题要求为最少<strong><?php echo $write_min; ?></strong>字节以上, 最多不超过<strong><?php echo $write_max; ?></strong>字节以内的内容</p>
                <?php } ?>
                <?php echo $editor_html; // 开启编辑器时直接显示编辑器否则显示输入框textarea ?>
                <?php if($write_min || $write_max) { ?>
                <!-- 开启最少、最多内容限制功能时 -->
                <div id="char_count_wrap"><span id="char_count"></span>字节</div>
                <?php } ?>
            </td>
        </tr>
 
        <?php for ($i=1; $is_link && $i<=G5_LINK_COUNT; $i++) { ?>
        <tr>
            <th scope="row"><label for="wr_link<?php echo $i ?>">链接 #<?php echo $i ?></label></th>
            <td><input type="text" name="wr_link<?php echo $i ?>" value="<?php if($w=="u"){echo$write['wr_link'.$i];} ?>" id="wr_link<?php echo $i ?>" class="frm_input" size="50"></td>
        </tr>
        <?php } ?>
 
        <?php for ($i=0; $is_file && $i<$file_count; $i++) { ?>
        <tr>
            <th scope="row">附件 #<?php echo $i+1 ?></th>
            <td>
                <input type="file" name="bf_file[]" title="附件 <?php echo $i+1 ?> :  文件大小请勿超过<?php echo $upload_max_filesize ?>" class="frm_file frm_input">
                <?php if ($is_file_content) { ?>
                <input type="text" name="bf_content[]" value="<?php echo ($w == 'u') ? $file[$i]['bf_content'] : ''; ?>" title="请输入附件说明" class="frm_file frm_input" size="50">
                <?php } ?>
                <?php if($w == 'u' && $file[$i]['file']) { ?>
                <input type="checkbox" id="bf_file_del<?php echo $i ?>" name="bf_file_del[<?php echo $i;  ?>]" value="1"> <label for="bf_file_del<?php echo $i ?>"><?php echo $file[$i]['source'].'('.$file[$i]['size'].')';  ?> 删除附件</label>
                <?php } ?>
            </td>
        </tr>
        <?php } ?>
 
       
        </tbody>
        </table>
    </div>
 
    <div class="btn_confirm">
        <input type="submit" value="编辑完成" id="btn_submit" accesskey="s" class="btn_submit">
        <a href="./board.php?bo_table=<?php echo $bo_table ?>" class="btn_cancel">取消</a>
    </div>
    </form>
 
    <script>
    <?php if($write_min || $write_max) { ?>
    // 字节数显示
    var char_min = parseInt(<?php echo $write_min; ?>); // 最少
    var char_max = parseInt(<?php echo $write_max; ?>); // 最大
    check_byte("wr_content", "char_count");
 
    $(function() {
        $("#wr_content").on("keyup", function() {
            check_byte("wr_content", "char_count");
        });
    });
 
    <?php } ?>
    function html_auto_br(obj)
    {
        if (obj.checked) {
            result = confirm("需要开启自动换行功能吗?\n\n自动换行功能将自动将文本内容换行处代码更换为<BR>");
            if (result)
                obj.value = "html2";
            else
                obj.value = "html1";
        }
        else
            obj.value = "";
    }
 
    function fwrite_submit(f)
    {
        <?php echo $editor_js; // 检测文本输入是否完成   ?>
 
        var subject = "";
        var content = "";
        $.ajax({
            url: g5_bbs_url+"/ajax.filter.php",
            type: "POST",
            data: {
                "subject": f.wr_subject.value,
                "content": f.wr_content.value
            },
            dataType: "json",
            async: false,
            cache: false,
            success: function(data, textStatus) {
                subject = data.subject;
                content = data.content;
            }
        });
 
        if (subject) {
            alert("标题中包含禁用词组('"+subject+"')");
            f.wr_subject.focus();
            return false;
        }
 
        if (content) {
            alert("内容中包含禁用词组('"+content+"')");
            if (typeof(ed_wr_content) != "undefined")
                ed_wr_content.returnFalse();
            else
                f.wr_content.focus();
            return false;
        }
 
        if (document.getElementById("char_count")) {
            if (char_min > 0 || char_max > 0) {
                var cnt = parseInt(check_byte("wr_content", "char_count"));
                if (char_min > 0 && char_min > cnt) {
                    alert("内容至少需要"+char_min+"字节以上");
                    return false;
                }
                else if (char_max > 0 && char_max < cnt) {
                    alert("内容不可以超过"+char_max+"字节");
                    return false;
                }
            }
        }
 
        <?php echo $captcha_js; // 开启认证码时检测认证码  ?>
 
        document.getElementById("btn_submit").disabled = "disabled";
 
        return true;
    }
    </script>
</section>
<!-- } 编辑主题/修改主题结束 -->

이 질문에 댓글 쓰기 :

답변을 작성하시기 전에 로그인 해주세요.
전체 0
QA 내용 검색
  • 개별 목록 구성 제목 답변작성자조회작성일
  • 질문이 없습니다.

회원로그인

(주)에스아이알소프트 / 대표:홍석명 / (06211) 서울특별시 강남구 역삼동 707-34 한신인터밸리24 서관 1404호 / E-Mail: admin@sir.kr
사업자등록번호: 217-81-36347 / 통신판매업신고번호:2014-서울강남-02098호 / 개인정보보호책임자:김민섭(minsup@sir.kr)
© SIRSOFT