테스트 사이트 - 개발 중인 베타 버전입니다

권한별 버튼 이미지 보이게 하기.. 채택완료

왕득이 10년 전 조회 4,654

삭제 버튼을 최상위 관리자만 보이게 하려고 합니다. 그림파일은 select_delete.gif 입니다.

최상위 관리자만 삭제버튼이 보이게 하려고 합니다.

 

어디서부터 손을 봐야될지 모르겟습니다 ㅠ.ㅠ

도와주세요.. 고수형들..ㅠ.ㅠ 

 


<div id="pagingNew"> <?=$write_pages?></div>

<div style="clear:both; margin-top:7px; height:31px;">
    <div style="float:left;">
    <? if ($list_href) { ?>
    <a href="<?=$list_href?>"><img src="<?=$board_skin_path?>/img/btn_list.gif" align=absmiddle border="0"></a>
    <? } ?>
 <? if ($write_href) { ?><a href="<?=$write_href?>"><img src="<?=$board_skin_path?>/img/btn_write.gif" border="0"></a><? } ?>
    <a href="javascript:select_delete();"><img src="<?=$board_skin_path?>/img/btn_select_delete.gif" align=absmiddle border="0"></a>
    </div>

    <div style="float:right;">
   
    </div>
</div>

</td>
</tr></table>
</td>
</tr></table>

<script language="JavaScript">
if ('<?=$sca?>') document.fcategory.sca.value = '<?=$sca?>';
if ('<?=$wr_7?>') document.fcategory.wr_7.value = '<?=$wr_7?>';
if ('<?=$wr_8?>') document.fcategory.wr_8.value = '<?=$wr_8?>';
if ('<?=$wr_10?>') document.fcategory.wr_10.value = '<?=$wr_10?>';
if ('<?=$stx?>') {
    document.fsearch.sfl.value = '<?=$sfl?>';
    document.fsearch.sop.value = '<?=$sop?>';
}
</script>

<? if ($is_checkbox) { ?>
<script language="JavaScript">
function all_checked(sw) {
    var f = document.fboardlist;

    for (var i=0; i<f.length; i++) {
        if (f.elements[i].name == "chk_wr_id[]")
            f.elements[i].checked = sw;
    }
}

function check_confirm(str) {
    var f = document.fboardlist;
    var chk_count = 0;

    for (var i=0; i<f.length; i++) {
        if (f.elements[i].name == "chk_wr_id[]" && f.elements[i].checked)
            chk_count++;
    }

    if (!chk_count) {
        alert(str + "할 게시물을 하나 이상 선택하세요.");
        return false;
    }
    return true;
}

// 선택한 게시물 삭제
function select_delete() {
    var f = document.fboardlist;

    str = "삭제";
    if (!check_confirm(str))
        return;

    if (!confirm("선택한 게시물을 정말 "+str+" 하시겠습니까?\n\n한번 "+str+"한 자료는 복구할 수 없습니다"))
        return;

    f.action = "./delete_all.php";
    f.submit();
}

// 선택한 게시물 복사 및 이동
function select_copy(sw) {
    var f = document.fboardlist;

    if (sw == "copy")
        str = "복사";
    else
        str = "이동";
                      
    if (!check_confirm(str))
        return;

    var sub_win = window.open("", "move", "left=50, top=50, width=500, height=550, scrollbars=1");

    f.sw.value = sw;
    f.target = "move";
    f.action = "./move.php";
    f.submit();
}
</script>
<? } ?>
<!-- 게시판 목록 끝 -->​

댓글을 작성하려면 로그인이 필요합니다.

답변 3개

채택된 답변
+20 포인트

</strong><span style="color: rgb(72, 72, 72); font-family: 돋움, Dotum, sans-serif; font-size: 14.003999710083px; line-height: 25.2071990966797px;">​</span></p><p><span style="color: rgb(72, 72, 72); font-family: 돋움, Dotum, sans-serif; font-size: 14.003999710083px; line-height: 25.2071990966797px;"></span><font color="#484848" face="돋움, Dotum, sans-serif"><span style="font-size: 14.003999710083px; line-height: 25.2071990966797px;"><?php if ($is_admin) {  ?></span></font><span style="color: rgb(72, 72, 72); font-family: 돋움, Dotum, sans-serif; font-size: 14.003999710083px; line-height: 25.2071990966797px;">​</span></p><p><span style="color: rgb(72, 72, 72); font-family: 돋움, Dotum, sans-serif; font-size: 14.003999710083px; line-height: 25.2071990966797px;"><a href="javascript:select_delete();"><img src="<?=$board_skin_path?>/img/btn_select_delete.gif" align=absmiddle border="0"></a></span></p><p><span style="color: rgb(72, 72, 72); font-family: 돋움, Dotum, sans-serif; font-size: 14.003999710083px; line-height: 25.2071990966797px;"></span><font color="#484848" face="돋움, Dotum, sans-serif"><span style="font-size: 14.003999710083px; line-height: 25.2071990966797px;"><?php }  ?></span></font><span style="color: rgb(72, 72, 72); font-family: 돋움, Dotum, sans-serif; font-size: 14.003999710083px; line-height: 25.2071990966797px;">​</span></p><p><span style="font-size: 11pt; line-height: 1.5;">​</span><strong style="color: rgb(127, 127, 127); font-family: 돋움, Dotum, sans-serif; font-size: 12px; line-height: normal;">

 

이런 식으로 관리자일 경우에만 노출로 처리하면 관리자인 경우에만 나올 겁니다. 

로그인 후 평가할 수 있습니다

댓글을 작성하려면 로그인이 필요합니다.

소스를 봐야 알겠는데요. 오랜만에 와서 해결하셨을라나.

로그인 후 평가할 수 있습니다

댓글을 작성하려면 로그인이 필요합니다.

10년 전

정말 감사합니다 ㅠ.ㅠ 잘되는데요. 적용을 하면  그림 양옆에 ? << 요게 하나씩 뜨는데 왜 그런지 알수 있을까요?? 현재 그누보드4 사용중입니다. ㅠ.ㅠ

로그인 후 평가할 수 있습니다

댓글을 작성하려면 로그인이 필요합니다.

답변을 작성하려면 로그인이 필요합니다.

로그인