체크박스 > 그누4 질문답변

그누4 질문답변

그누보드4 관련 질문은 QA 로 이전됩니다. QA 그누보드4 바로가기
기존 게시물은 열람만 가능합니다.

체크박스 정보

체크박스

본문

다운받은 갤러리 스킨에 체크박스가 없어서
'선택삭제/선택복사/선택이동'을 사용할 수가 없습니다.
짜집기해서 쓰는 실력이라 어떻게 넣어야 할지 모르겠습니다.
좀 건드려보기는 했는데 제대로 삭제 복사 이동이 안되요
도와주세요~~~

-----------------------------------------------------------------------------------------
<list.skin.php>

<?
if (!defined("_GNUBOARD_")) exit; // 
?><head>
<meta http-equiv="Content-Type" content="text/html; charset=euc-kr">
</head>

<?
$noIMG = $board_skin_path."/img/noimg.gif"; //[필수](URL)
$max = 120 ; //[필수](픽셀) 썸네일 이미지의 가로세로(긴쪽)의 최대치.
$resol = 90 ; //[필수](퍼센트%) 생성되는 썸네일의 JPG압축률.
$str = 15 ; //[필수](글자수) 썸네일 밑의 제목의 글자수.

function smaller( $W, $H ) {
global $max, $thum_W, $thum_H ;

if ( $W > $H ) { //가로형일 경우.
$thum_W = $max ;
$thum_H = ceil( $H * ( $max / $W ) );
}
if ( $W < $H ) { //세로형일 경우.
$thum_H = $max ;
$thum_W = ceil( $W * ( $max / $H ) );
}
if ( $W == $H ) { //정사각형일 경우.
$thum_W = ceil( $max * 0.8 );
$thum_H = ceil( $max * 0.8 );
}

return $thum_W ;
return $thum_H ;
}


function maker( $thum_W, $thum_H ) {
global $thum, $resol, $ori, $ori_info ;

//$newImg = ImageCreate($thum_W,$thum_H); // GD라이브러리 2.0 (이하일 경우)
$newImg = ImageCreateTrueColor($thum_W,$thum_H); // GD라이브러리 2.0 전용함수

if($ori_info[2]=="2") $origImg=ImageCreateFromjpeg($ori);
if($ori_info[2]=="3") $origImg=ImageCreateFrompng($ori);

//ImageCopyResized($newImg,$origImg,0,0,0,0,$thum_W,$thum_H,ImageSX($origImg),ImageSY($origImg));
imageCopyResampled($newImg,$origImg,0,0,0,0,$thum_W,$thum_H,ImageSX($origImg),ImageSY($origImg));

Imagejpeg($newImg, $thum, $resol );

chmod($thum,0707);
ImageDestroy($newImg);
ImageDestroy($origImg);

return $thum ;
}
?>


<table width="<?=$width?>" cellpadding=0 cellspacing=0 border=0>
<tr>
<td>
<? if (!$wr_id) {  ?>
<?
    $cnt = 1;
    $sql = " SELECT bo_category_list FROM $g4[board_table] WHERE bo_table = '$bo_table' ";
    $row = sql_fetch($sql);
    $arr = explode("|", $row[bo_category_list]); // 구분자가 , 로 되어 있음
    $str = "";
    $str .= "";
    for ($i=0; $i<count($arr); $i++)
        if (trim($arr[$i]))  {
        $sql1 = " SELECT count(*) as cCount FROM $write_table WHERE ca_name = '$arr[$i]' and wr_comment >= 0 ";
    $row1 = sql_fetch($sql1);       
            $str .= "<td><a href='./board.php?bo_table=$bo_table&page=$page&mode=$mode&sca=$arr[$i]'>$arr[$i] ($row1[cCount])</a>&nbsp;<font color='#838383'>|</font>&nbsp;</td>";
if ($cnt == 5) { $cnt = 1; $str .= ""; }
    $cnt++;
    }
   
    $sql2 = " SELECT count(*) as cCount FROM $write_table WHERE wr_comment >= 0 ";
    $row2 = sql_fetch($sql2);
    $Total_Cat = $row2[cCount]
?>
     
<? } ?>
</td>
</tr>
<tr>
<td height="32"  align=right>
<table border="0" cellspacing="0" cellpadding="0">
<tr>
<td>
<form name=fsearch method=get style="margin:0px;">
<input type=hidden name=bo_table value="<?=$bo_table?>">
<input type=hidden name=sca      value="<?=$sca?>">
<div align="center">
<table width="100%" border="0" cellspacing="1">
<tr>
<td width=* align="right">
<table border="0" width="100%" cellspacing="1">
<tr>
<!-- 검색시작
<td>
        <select name=sfl size="1">
            <option value='wr_subject'>제목</option>
            <option value='wr_content'>내용</option>
            <option value='wr_subject||wr_content'>제목+내용</option>
            <option value='mb_id,1'>회원아이디</option>
            <option value='mb_id,0'>회원아이디(코)</option>
            <option value='wr_name,1'>이름</option>
            <option value='wr_name,0'>이름(코)</option>
        </select></td>
<td>
<input name=stx maxlength=15 size=34 itemname="검색어" required value="<?=$stx?>"></td>
<td>
<select name=sop size="1">
<option value=and>and</option>
<option value=or>or</option></select></td>
</tr>
</table>
</td>
<td align=right width="33">
<input type=image src="<?=$board_skin_path?>/img/search_btn.gif" border=0 align=absmiddle name="I1"></td>
검색 끝 -->
<td align=right>
        <? if ($admin_href) { ?><a href="../basic/<?=$admin_href?>"><img src="../basic/<?=$board_skin_path?>/img/btn_admin.gif" title="관리자" width="63" height="22" border="0" align="absmiddle"></a><?}?>
</td>
</tr>
</table>
</div>
</form></td>
</tr>
</table></td>
</tr>
<tr>
<td valign="top">
<form name="fboardlist" method="post">
<input type="hidden" name="bo_table" value="<?=$bo_table?>">
<input type="hidden" name="sfl"  value="<?=$sfl?>">
<input type="hidden" name="stx"  value="<?=$stx?>">
<input type="hidden" name="spt"  value="<?=$spt?>">
<input type="hidden" name="page" value="<?=$page?>">
<input type="hidden" name="sw"  value="">
<table width="100%" cellpadding="0" cellspacing="0" border=0> <!-- 전체테두리:사진끼리연결-->
<tr>
<td height="10" ></td >
</tr>
<tr>
        <? for ($i=0; $i<count($list); $i++) {
  // Thumbnail
                  $image = urlencode($list[$i][file][0][file]);
                  $ori="$g4[path]/data/file/$bo_table/" . $image;
                  $ext = strtolower(substr(strrchr($ori,"."), 1)); //확장자
                  if ( $ext=="gif"||$ext=="jpg"||$ext=="jpeg"||$ext=="png"||$ext=="bmp"||$ext=="tif"||$ext=="tiff") $ori_info=getimagesize($ori); else $ori_info="";
                  if ( $ori_info[2]=="2" || $ori_info[2]=="3" ) { //원파일이 [ 2JPG, 2JPEG, 3PNG ] 경우.
          $thum = $ori."" ;
          if ( file_exists($thum) ) { // Thumbnail [O] 경우
        $thum_info = getimagesize ($thum);
    $thum_W = $thum_info[0] ;
    $thum_H = $thum_info[1] ;
            } else { // Thumbnail [X] 경우
      if ( smaller( $ori_info[0], $ori_info[1] ) ) {
maker( $thum_W, $thum_H );
    }
        }
                } else if ( $ori_info[2]=="1" || $ori_info[2]=="6" || $ori_info[2]=="7" ) { //원파일이 [ 1GIF,6BMP,7TIF ] 경우.
    if ( smaller( $ori_info[0], $ori_info[1] ) ) {
$thum = $ori ;
    }
              } else { //원파일이 [ 1,2,3,6,7 ] 아닐 경우.
              $thum = $noIMG ;
              }
              ?>
       
            <td height="10" valign="top" >
<table border="0" width="100%" cellspacing="0" cellpadding="0">
<tr>
<td valign="top" width="1">
<table border="0" cellspacing="0" cellpadding="0">
<tr>
<td valign="top" >
<table border="0" cellspacing="1" bgcolor="#E1E1E1" cellpadding="3">
<tr>
<td bgcolor="#FFFFFF">
<p align="center">
<a href="<?=$list[$i][href]?>"><img src='<?=$thum?>' alt='상세보기' width="280" height="230" border=0 ></a></td>
</tr>
</table></td>
</tr>
<tr><td>&nbsp;</td></tr>
</table></td>

<td width="5">&nbsp;</td>
<td valign="top">
<table border="0" width="100%" cellspacing="0" cellpadding="0">
<tr>
  <td width=20>&nbsp;</td>
<td>
<table border="0" width="100%" cellspacing="0" cellpadding="0">
<tr>
<td>
<table border="0" width="100%" cellspacing="2" >
<tr>
<td width="70" height=30 bgcolor=#F9f9f9 align=center>제&nbsp;품&nbsp;명</td>
<td bgcolor=#ffffff>
<b><font color="#000000">
--------------------------------------------------->바로 이 아랫줄이요<---------------------------------                                    <input type=checkbox  name=chk_wr_id[] value='{$list[$i][wr_id]}' onClick="a href=javascript:check_confirm(str)">
<?=$list[$i][subject]?></font></b>
<?=$list[$i][comment_cnt]?>&nbsp;<?=$list[$i][icon_new]?>&nbsp;<?=$list[$i][icon_hot]?></td>
</tr>
<tr>
<td width="70"  height=30 bgcolor=#F9f9f9 align=center>게&nbsp;시&nbsp;일</td>
<td bgcolor=#ffffff cellpadding=5>&nbsp;<?=$list[$i][datetime]?></td>
</tr>
<tr>
<td width="70"  height=30 bgcolor=#F9f9f9 align=center>분&nbsp; &nbsp; &nbsp;류</td>
<td bgcolor=#ffffff>&nbsp;<?=$list[$i][ca_name]?></td>
</tr>
<tr>
<td width=70  height=70 bgcolor=#F9f9f9  align=center>기본정보</td>
<td  bgcolor=#ffffff>
<table cellpadding=5><tr><td><?=cut_str(strip_tags($list[$i][wr_content]),90,"...")?></td></tr></table></td>
</tr>
<tr>
<td width=70  height=70 bgcolor=#F9f9f9  align=center>상세정보</td>
<td  bgcolor=#ffffff>
<table cellpadding=5><tr><td><?=cut_str(strip_tags($list[$i][wr_content]),90,"...")?></td></tr></table></td>
</tr>

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

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

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

      <!-- <?php
        if($i % 2 == 1){
          echo "</tr><tr>";
        }
        ?>  한줄에 두개씩-->
        </tr><tr><td width=50>&nbsp;<br><Br><br><br></td></tr><tr>
        <? } ?>
          </tr>
<tr>
<td  height="10"></td>
</tr>
</table>

        <? if (count($list) == 0) { echo "  <table width=100% border=0 cellpadding=0 cellspacing=0 ><tr><td height=100 align=center> 아직없음.</td></tr></table>"; } ?>
      </form></td>
</tr>
<tr>
<td height=2 bgcolor=#EFEFEF></td>
</tr>
<tr>
<td bgcolor=#0A7299 height=2></td>
</tr>
<tr>
<td valign="top">
      <table width="100%" cellspacing="0" cellpadding="0">
<tr>
<td width="60">
<table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
                <? if ($list_href) { ?>
                <td><a href="<?=$list_href?>">
<img src="<?=$board_skin_path?>/img/btn_list.gif" vspace="10" border="0"></a></td>
                <? } ?>
                <td>
                  <? if ($is_checkbox) { ?>
                  <a href="javascript:select_delete();">
<img src="<?=$board_skin_path?>/img/btn_select_delete.gif" hspace="2" vspace="10" border="0"></a></td>
<td><a href="javascript:select_copy('copy');">
<img src="<?=$board_skin_path?>/img/btn_select_copy.gif" vspace="10" border="0"></a></td>
<td><a href="javascript:select_copy('move');">
<img src="<?=$board_skin_path?>/img/btn_select_move.gif" hspace="2" vspace="10" border="0"></a><? } ?></td>
</tr>
</table></td>
<td align="center" height=58>&nbsp;
            <? if ($prev_part_href) { echo "<a href='$prev_part_href'><img src='$board_skin_path/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_path/img/begin.gif' border='0' align='absmiddle' title='처음'>", $write_pages);
        $write_pages = str_replace("이전", "<img src='$board_skin_path/img/prev.gif' border='0' align='absmiddle' title='이전'>", $write_pages);
        $write_pages = str_replace("다음", "<img src='$board_skin_path/img/next.gif' border='0' align='absmiddle' title='다음'>", $write_pages);
        $write_pages = str_replace("맨끝", "<img src='$board_skin_path/img/end.gif' border='0' align='absmiddle' title='맨끝'>", $write_pages);
        $write_pages = preg_replace("/<span>([0-9]*)<\/span>/", "<b><font style=\"font-family:; font-size:9pt; \">$1</font></b>", $write_pages);
        $write_pages = preg_replace("/<b>([0-9]*)<\/b>/", "<b><font style=\"font-family:; font-size:9pt; color:#FF6600;\">$1</font></b>", $write_pages);
        ?>
            <?=$write_pages?>
            <? if ($next_part_href) { echo "<a href='$next_part_href'><img src='$board_skin_path/img/btn_search_next.gif' width=50 height=20 border=0 align=absmiddle title='다음검색'></a>"; } ?>
          </td>
<td width="60" align="right">
            <? if ($write_href) { ?>
            <a href="<?=$write_href?>">
<img src="<?=$board_skin_path?>/img/btn_write.gif" vspace="10" border="0"></a>
            <? } ?>
          </td>
</tr>
</table></td>
</tr>
<tr>
<td valign="top"><br></td>
</tr>
</table>

<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=396, height=550, scrollbars=1");

    f.sw.value = sw;
    f.target = "move";
    f.action = "./move.php";
    f.submit();
}
</script>

<!-- 게시판 목록 끝 -->

댓글 전체

전체 66,554 |RSS
그누4 질문답변 내용 검색

회원로그인

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