그누보드4 스킨 그누보드5에 적용

그누보드4 스킨 그누보드5에 적용

QA

그누보드4 스킨 그누보드5에 적용

본문

꼭 필요한 스킨이 그누보드 5에는 없고 4에는 있어서 코드를 수정해서

사용하려 수정을 했습니다. 홈페이지 내에서 목록의 출력엔 이상이 없는데,

글을 쓰려하면 올바른 방법으로 이용해달라는 내용이 출력되고, 댓글을 입력하려고 

댓글 버튼을 누르면 아무 반응이 없습니다.978860900_1576205134.907.png

978860900_1576205147.1952.png

어느부분을 어떻게 고치면 좋을지 조언을 구하고자 합니다....

보면 경로가 js에서 없는 파일을 불러온다던지 하는 것 같은데

그누보드4와 그누보드5의 변경점을 몰라서 ㅠㅠ


<?
if (!defined("_GNUBOARD_")) exit; // 개별 페이지 접근 불가 
if (!$board[bo_9]) alert("여유필드 9번 : 글쓰기 남길말");
if (!$board[bo_10]) alert("여유필드 10번 : 댓글쓰기 남길말");
$noLoginValue = $board[bo_9];
$noContentValue = $board[bo_10];
?>
 
<style>
.bbs_form  { margin:0; }
.bbs_linei { background-color:#D6D2C7; height:1px; }    //게시판 줄 색깔 바꾸기
.bbs_lineo { background-color:#FFFFFF; height:10px; }    //게시판 줄 색깔 바꾸기
.bbs_no    { background-color:blue; height:30px; }    //게시판 내용 글씨
.bbs_fs    { color:gray; font-size:11px; }             //게시판 날짜
.bbs_ft       {font-size: 9pt;  width:100%; font-family: "돋움", "굴림","seoul", "verdana", "arial"; background-color:#FFFFFF;color:#000000;border:1 solid cccccc;color:#000000;overflow: auto}
.bbs_tt    { CURSOR:pointer; }
.num { color:333333; margin-right:10; font-family:tahoma; font-size:7pt; }
.name { color:#000000;text-decoration:none font-size:8pt; }
.date { color:#aaaaaa; font-family:tahoma; font-size:7pt; }
.c_name { color:#aaaaaa; text-decoration:none font-size:8pt; }
.c_date { color:#aaaaaa; font-family:tahoma; font-size:7pt; }
    
a.bbs:link, a.bbs:visited, a.bbs:active { text-decoration:none;}
a.bbs:hover { text-decoration:none;  color:#3366cc; }
    
textarea {font-size: 9pt;  width:100%; font-family: "돋움", "굴림","seoul", "verdana", "arial"; background-color:#FFFFFF;color:#000000;border:1 solid cccccc;color:#000000;overflow: auto}
    
</style>
 
<script language="JavaScript">
// 글자수 제한
var char_min = parseInt(<?=$write_min?>); // 최소
var char_max = parseInt(<?=$write_max?>); // 최대
</script>
 
<?
if ($w == "") {
    $is_name = false;
    $is_password = false;
    if (!$member[mb_id] || ($is_admin && $w == 'u' && $member[mb_id] != $write[mb_id])) {
        $is_name = true;
        $is_password = true;
    }
    $password_required = "required";
    $content = $board[bo_insert_content];
    // 글자수 제한 설정값
    if ($is_admin)
    {
        $write_min = $write_max = 0;
    }
    else
    {
        $write_min = (int)$board[bo_write_min];
        $write_max = (int)$board[bo_write_max];
    }
    include_once("./norobot.inc.php");
}
if (!$subject) $subject = 1;
?>
<form name="ffwrite" method="post" action="javascript:fwrite_check(document.ffwrite);" enctype="multipart/form-data" autocomplete="off">
<input type=hidden name=w          value="">
<input type=hidden name=bo_table   value="<?=$bo_table?>">
<input type=hidden name=wr_id      value="">
<input type=hidden name=page       value="<?=$page?>">
<input type=hidden name=wr_subject value="<?=$subject?>">
<? if ($is_password) { ?><input type="hidden" name="wr_password"  value="<?=$norobot_str?>"><? } ?>
<? if ($is_norobot) { ?><input type="hidden" name="wr_key"  value="<?=$norobot_key?>"><? } ?>
<table width="<?=$width?>" align="center" cellpadding="5" cellspacing="0" bgcolor="#f6f6f6">
<tr><td height="1px" bgColor="#cccccc"></td></tr>
<tr><td align="center">
<table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr> 
<? if ($is_name) { ?>
<tr>
    <td>
        <table width="100%" border="0" cellspacing="0" cellpadding="0">
            <td>
                <input class="bbs_ft" maxLength="20" size="13" name="wr_name" itemname="이름" required style="height:23; padding:4;" value="손님" onFocus="clearText(this)"> ※ 손님은 등록만 가능하며 <span style="color:red">수정</span> 및 <span style="color:red">삭제</span>를 할 수 없습니다.
            </td>
            <td align="right" class=write_head><img id='kcaptcha_image' border='0' width=120 height=20 onclick="imageClick();" style="cursor:pointer;" title="글자가 잘안보이는 경우 클릭하시면 새로운 글자가 나옵니다."></td>
            <td align="right"><input class='ed' type=input size=10 name=wr_key itemname="자동등록방지" required></td>
        </table>
    </td>
</tr>    
<? } ?>
    
    
    <td>
        <textarea class="bbs_ft" name="wr_content" itemname="내용" required style="width:100%;height:60; padding:4;" onFocus="clearText(this)"><?= $noLoginValue ?></textarea>
    </td>
</tr>
<tr>    
    <td align="right" style="padding-top:5px; ">
        <input type="image" id="btn_submit" src="<?=$board_skin_url?>/img/btn_write.gif" border="0" align="absmiddle">
    </td>
</tr>
</table>
</td></tr><tr><td height="1px" bgColor="#cccccc"></td></tr></table>
</form>
<br>
<table width="<?=$width?>" align="center" cellpadding="0" cellspacing="0"><tr><td>
<!-- 게시판 리스트 시작 -->
<table width="100%" border="0" cellspacing="0" cellpadding="0">
<?
$wr_num = 0;
$tempArr= null;
for ($i=0; $i<count($list); $i++) {
$list_id = $list[$i][wr_id];
if($i == 0) $tempArr .= "\"$list_id\"";
else        $tempArr .= ",\"$list_id\"";
?>
<a name="c_<?=$list_id?>"></a>
<?
// 부모글
if($wr_num != $list[$i][wr_num]){
    
?>
<tr><td colspan="6" class="bbs_lineo"> </td></tr>
<tr><td colspan="6" class="bbs_linei"></td></tr>
<tr bgColor="#f1f1f1">    
    <td height="25" colspan="5" style="padding-left : 5px;">
        <span class=num>NO.<b><?= abs($list[$i][wr_num]) ?></b></span>
        <?=$list[$i][name]?>
        <span class=date>(<?=$list[$i][wr_datetime]?>)</span> 
    </td>
    <td align="right" style="padding-right:5px;">
        <a href="javascript:list_box('<?=$list_id?>', 'r');" title="댓글">댓글</a>
    <? if (($member[mb_id] && ($member[mb_id] == $list[$i][mb_id])) || $is_admin) { ?>
         | 
        <a href="javascript:list_box('<?=$list_id?>', 'u');">수정</a> | 
        <a href="javascript:if (confirm('삭제하시겠습니까?')) { location='./delete.php?w=d&bo_table=<?=$bo_table?>&wr_id=<?=$list[$i][wr_id]?>&page=<?=$page?>';}">삭제</a>        
    <? } ?>
    </td>
</tr>
<tr style="cursor:hand; " title="클릭하시면 답변을 쓸 수 있습니다." onClick="javascript:list_box('<?=$list_id?>', 'r');">
    <td colspan="6" style="padding-left : 5px; height:100px; ">
        <span id="content_<?= $list_id?>">
        <a href="javascript:list_box('<?=$list_id?>', 'r');" title="답변" class="bbs">
            <?= nl2br($list[$i][wr_content])?>
        </a>
        </span>
        
        
    </td>    
</tr>    
<?
    $Display = "none";
?>
<tr bgColor="#ffffff"> 
    <td colspan="6" class="bbs_pp">
        <textarea class="bbs_ft" id='save_content_<?=$list_id?>' type=text style='display:<?= $Display ?>;width:100%;height:40; padding:4;' required><?= $list[$i][wr_content]?></textarea>
        <span id='reply_<?=$list_id?>' style='display:<?= $Display ?>; width:100%; padding:5;'></span><!-- 답변 -->
        <span id='edit_<?=$list_id?>' style='display:<?= $Display ?>; width:100%; padding:5;'></span><!-- 수정 -->
    </td>
</tr>
<?
// 코멘트(댓글)
}else{
    $totalCount++;
    
?>
<tr bgColor="#f8f8f8">    
    <td colspan="6" style="padding-left : 5px;">
        <span id="comment_<?= $list_id?>">
        <?
        if(strlen($list[$i][wr_reply]) > 1){
            echo $list[$i][reply];
            echo $list[$i][icon_reply]; 
        }
        ?>        
        <span class="c_name"><NOBR><?=$list[$i][name]?></NOBR></span> : 
        <?= ($list[$i][wr_content])?> <span class="c_date">(<?=$list[$i][datetime]?>)</span> 
        
        <a href="javascript:list_box('<?=$list_id?>', 'r');" title="이 댓글에 댓글달기" class="bbs">
            <img src="<?=$board_skin_url?>/img/btn_reply.gif" title="이 댓글에 댓글달기" border="0" align="absmiddle">
        </a>
        <? if (($member[mb_id] && ($member[mb_id] == $list[$i][mb_id])) || $is_admin) { ?>
        <a href="javascript:list_box('<?=$list_id?>', 'u');" style="padding-right:2px; ">
            <img src="<?=$board_skin_url?>/img/btn_edit.gif" title="수정" border="0" align="absmiddle">
        </a>
        <a href="javascript:if (confirm('삭제하시겠습니까?')) { location='./delete.php?w=d&bo_table=<?=$bo_table?>&wr_id=<?=$list[$i][wr_id]?>&page=<?=$page?>';}">
            <img src="<?=$board_skin_url?>/img/btn_del.gif" title="삭제" border="0" align="absmiddle">
        </a>
        
        </span>
                
    <? } ?>
    </td>
</tr>

<?
    $Display = "none";
?>
<tr bgColor="#f8f8f8"> 
    <td colspan="6" class="bbs_pp">
        <img id='save_emoticon_<?=$list_id?>' style='display:<?= $Display ?>;' border="0" src="<?=$board_skin_url?>/emoticons/<?=$list[$i][subject]?>.gif">
        <textarea class="bbs_ft" id='save_content_<?=$list_id?>' type=text style='display:<?= $Display ?>;width:100%;height:40; padding:4;'><?= $list[$i][wr_content]?></textarea>
        <span id='reply_<?=$list_id?>' style='display:<?= $Display ?>; width:100%; padding:5;'></span><!-- 답변 -->
        <span id='edit_<?=$list_id?>' style='display:<?= $Display ?>; width:100%; padding:5;'></span><!-- 수정 -->
    </td>
</tr>
        
<? } ?>
<?
$wr_num = $list[$i][wr_num];
}
?>
<? if (count($list) == 0) { ?>
<tr><td height="100" align="center">게시물이 없습니다.</td></tr>
<? } ?>
</table>

<!-- 페이지 표시 시작 -->
<table width="100%" border="0" cellspacing="0" cellpadding="0">
<? if ($write_pages || $prev_part_href || $next_part_href ) { ?>
<tr>
    <td height="25" align="center" class="bbs_no">
        <? if ($prev_part_href) { echo "<a href='$prev_part_href'><img src='$board_skin_url/img/btn_search_prev.gif' width=50 height=20 border=0 align=absmiddle title='이전검색'></a>"; } ?>
        <?
        // 기본으로 넘어오는 페이지를 아래와 같이 변환하여 이미지로도 출력할 수 있습니다.
        //echo $write_pages;
        $write_pages = str_replace("처음", "<img src='$board_skin_url/img/page_first.gif' border='0' align='absmiddle' title='처음' width='38' height='15'>", $write_pages);
        $write_pages = str_replace("이전", "<img src='$board_skin_url/img/page_prev.gif' border='0' align='absmiddle' title='이전' width='17' height='15'>", $write_pages);
        $write_pages = str_replace("다음", "<img src='$board_skin_url/img/page_next.gif' border='0' align='absmiddle' title='다음' width='17' height='15'>", $write_pages);
        $write_pages = str_replace("맨끝", "<img src='$board_skin_url/img/page_end.gif' border='0' align='absmiddle' title='맨끝' width='38' height='15'>", $write_pages);
        $write_pages = preg_replace("/<span>([0-9]*)<\/span>/", "<font style=\"font-family:돋움; font-size:9pt; color:#797979\">$1</font>", $write_pages);
        $write_pages = preg_replace("/<b>([0-9]*)<\/b>/", "<font style=\"font-family:돋움; font-size:9pt; color:orange;\">$1</font>", $write_pages);
        ?>
        <?=$write_pages?>
        <? if ($next_part_href) { echo "<a href='$next_part_href'><img src='$board_skin_url/img/btn_search_next.gif' width=50 height=20 border=0 align=absmiddle title='다음검색'></a>"; } ?>
    </td>
</tr>
<? } ?>
</table>
<table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr> 
    <td width="" height="40">
        <? if ($admin_href) { ?><a href='<?=$admin_href?>'><img src="<?=$board_skin_url?>/img/btn_admin.gif" border="0" width="55" height="20" align="absmiddle" title="관리자"></a><?    } ?>
    </td>
</tr>
</table>
</td></tr></table>
<span id=list_write style='display:inline; width:100%; padding:10;'>
<form name="fwrite" method="post" action="javascript:fwrite_check(document.fwrite);" enctype="multipart/form-data" autocomplete="off">
<input type=hidden name=w          value="" id="list_w">
<input type=hidden name=bo_table   value="<?=$bo_table?>">
<input type=hidden name=wr_id      value="<?=$list[$i][wr_id]?>" id="list_id">
<input type=hidden name=page       value="<?=$page?>">
<input type=hidden name=wr_subject value="<?=$subject?>">
<? if ($is_password) { ?><input type="hidden" name="wr_password"  value="<?=$norobot_str?>"><? } ?>
<? if ($is_norobot) { ?><input type="hidden" name="wr_key"  value="<?=$norobot_key?>"><? } ?>

<table width="<?=$width?>" align="center" cellpadding="5" cellspacing="0" bgcolor="#f8f8f8"><tr><td align="center">
<table width="100%" border="0" cellspacing="0" cellpadding="0">
<? if ($is_name) { ?>
<tr>
    <td colspan="2">
    <table width="100%" border="0" cellspacing="0" cellpadding="0">
        <tr>
            <td>
                <table width="100%" border="0" cellspacing="0" cellpadding="0">
                    <td>
                        <input class="bbs_ft" maxLength="20" size="13" name="wr_name" itemname="이름" required style="height:23; padding:4;" value="손님" onFocus="clearText(this)"> ※ 손님은 등록만 가능하며 <span style="color:red">수정</span> 및 <span style="color:red">삭제</span>를 할 수 없습니다.
                    </td>
        
                    <td align="right" class=write_head><img id='kcaptcha_image_copy' border='0' width=120 height=20 onclick="imageClick();" style="cursor:pointer;" title="글자가 잘안보이는 경우 클릭하시면 새로운 글자가 나옵니다."></td>
                    <td align="right"><input class='ed' type=input size=10 name=wr_key itemname="자동등록방지" required></td>
        
                </table>
            </td>
        </tr>  
    </table>
           
    </td>
</tr>
<? } ?> 
<tr> 
    <td width="100%" style="padding-right:3px; ">
        <textarea class="bbs_ft" id="list_content" name="wr_content" itemname="내용" required style="height:33; padding:4;" onFocus="clearText(this)"><?= $noContentValue ?></textarea>
    </td>
    <td  align="right">
        <input type="image" id="btn_submit" src="<?=$board_skin_url?>/img/btn_write_comment.gif" border="0" align="absmiddle">
    </td>
    
</tr>
</table>
</td></tr></table>
</form>
</span>
<table width="<?=$width?>" cellspacing="0" cellpadding="0">
<tr>
    <form name=fsearch method=get>
    <input type=hidden name=bo_table value="<?=$bo_table?>">
    <input type=hidden name=sca      value="<?=$sca?>">
    <td width="100%" align="right">
        <select name=sfl class=select>
            <option value='wr_content'>내용</option>
            <option value='wr_name'>이름</option>
            <option value='mb_id'>회원아이디</option>
        </select>
        <INPUT maxLength=15 size=10 name=stx itemname="검색어" required value="<?=$stx?>" class=input>
        <SELECT name=sop class=select>
            <OPTION value=and>And</OPTION>
            <OPTION value=or>Or</OPTION>
        </SELECT>
    </td>
    <td width="10%" align="center"> <INPUT type=image  src="<?=$board_skin_url?>/img/search_btn.gif" align=absmiddle border=0></td>
    </form>
</tr>
</table><br>
        </td>
    </tr>
</table>
<script type="text/javascript"> var md5_norobot_key = ''; </script>
<script type="text/javascript" src="<?="G5_PATH/js/prototype.js"?>"></script>
<script type="text/javascript">
function imageClick() {
    var url = "<?=G5_BBS_PATH?>/kcaptcha_session.php";
    var para = "";
    var myAjax = new Ajax.Request(
        url, 
        {
            method: 'post', 
            asynchronous: true,
            parameters: para, 
            onComplete: imageClickResult
        });
}
function imageClickResult(req) { 
    var result = req.responseText;
    var img = document.createElement("IMG");
    img.setAttribute("src", "<?=G5_BBS_PATH?>/kcaptcha_image.php?t=" + (new Date).getTime());
    document.getElementById('kcaptcha_image').src = img.getAttribute('src');
    document.getElementById('kcaptcha_image_copy').src = img.getAttribute('src');
    md5_norobot_key = result;
}
<? if (!$is_member) { ?>Event.observe(window, "load", imageClick);<? } ?>
function clearText(thefield){
    if (thefield.defaultValue==thefield.value) thefield.value = "";
}
function fwrite_check(f)
{
    var s = "";
<?if($is_guest){ ?>    
    if (f.wr_name.value == "손님" ||
        false){
            
        f.wr_name.focus();
        
            
        alert("닉네임을 적어주세요.")
        return;
    }
<? } ?>    
    if (f.wr_content.value == "<?= $noLoginValue ?>" ||
        f.wr_content.value == "<?= $noContentValue ?>" ||
        false){
            
        f.wr_content.focus();
        
            
        alert("내용을 입력해 주세요...")
        return;
    }

<?if($is_guest){ ?>
    if (typeof(f.wr_key) != "undefined") {
        if (hex_md5(f.wr_key.value) != md5_norobot_key) {
            alert("자동등록방지용 빨간글자가 순서대로 입력되지 않았습니다.");
            f.wr_key.focus();
            return;
        }
    }
<? } ?>
    f.action = "./write_update.php";
    f.submit();
}
var old_id, new_id;
var save_html = document.getElementById('list_write').innerHTML;
function commentTotalClose(){
    
    var tempArr = Array(<?= $tempArr ?>);
    for($i = 0 ; $i < tempArr.length ; $i++){
        var commentObj = eval("document.getElementById('comment_" + tempArr[$i] + "')");
        
        if(commentObj != null)  commentObj.style.display = 'inline';
    }
}
function list_box(list_id, work)
{
            
    commentTotalClose();
            
    imageClick();
    // 답변, 수정
    if (list_id)
    {
        if (work == 'r')
            new_id = 'reply_' + list_id;
        else
            new_id = 'edit_' + list_id;
    }
    else
        new_id = 'list_write';
    if (old_id == new_id) {
        var mode = document.getElementById(new_id).style.display; 
        if (mode == 'inline') {
            document.getElementById(new_id).style.display = 'none';
        }
        else {
            document.getElementById(new_id).style.display = 'inline'; 
        }
    }
    else 
    {
        if (old_id)
        {
            document.getElementById(old_id).style.display = 'none';
            document.getElementById(old_id).innerHTML = '';
            
        }
        document.getElementById(new_id).style.display = 'inline';
        document.getElementById(new_id).innerHTML = save_html;
        // 수정
        if (work == 'u')
        {
            document.getElementById('list_content').value = document.getElementById('save_content_' + list_id).value;
            var commentObj = eval("document.getElementById('comment_" + list_id + "')");
        
            if(commentObj != null)
            if(commentObj.style.display == 'none')  commentObj.style.display = 'inline';
            else                                    commentObj.style.display = 'none';
    
        }
        document.getElementById('list_id').value = list_id;
        document.getElementById('list_w').value = work;
        old_id = new_id;
    }
}
list_box('', '');
new_id = 'list_write';
document.getElementById(new_id).style.display = 'none';
</script>
<?
if ($w == "") {
if (!$member[mb_id]) 
    echo "<script language='javascript' src='G5_PATH/js/md5.js'></script>\n";
// 필터
echo "<script language='javascript'> var g5_cf_filter_cf_filter = '$config[cf_filter],&nbsp'; </script>\n";
echo "<script language='javascript' src='G5_PATH/js/filter.js'></script>\n";
}
?>

 

이 질문에 댓글 쓰기 :

답변 1

소스를 길게 올려 놓으셔도 이걸 일일이 보면서 답변 달아 주시는 분은 안 계실겁니다.

제작의뢰를 추천 드립니다.

손이 많이 가는 일이라 Q&A 만으론 어려우실 겁니다.

답변을 작성하시기 전에 로그인 해주세요.
전체 10,628
QA 내용 검색

회원로그인

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