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

스킨 리스트 관련 질문 드립니다 채택완료

방문객광고 9년 전 조회 3,400

스킨 리스트 오류 관련 질문 드립니다.

 

오류사이트: http://addpang.com/bbs/board.php?bo_table=chbook">http://addpang.com/bbs/board.php?bo_table=chbook

 

사용중인 스킨: http://sir.kr/g4_skin/133565?sfl=wr_subject%7C%7Cwr_content&stx=%EC%A4%91%EA%B3%A0">http://sir.kr/g4_skin/133565?sfl=wr_subject%7C%7Cwr_content&stx=%EC%A4%91%EA%B3%A0
http://addpang.com/bbs/board.php?bo_table=chbook">

 

오류내용. 

리스트에서 판매가격이 마지막에 작성한 가격으로 바뀌어서 나옵니다.

앞전에 작성한 게시물의 가격도 마지막에 작성한 가격으로 바뀌어서 출력 됩니다. 

 

어느파일 에서 어떻게 수정을 해야 할지 모르겠습니다.

도움 부탁 드립니다.

 

list.skin.php 파일  

 

<?
if (!defined("_GNUBOARD_")) exit; // 개별 페이지 접근 불가

// 선택옵션으로 인해 셀합치기가 가변적으로 변함
$colspan = 5;

//if ($is_category) $colspan++;
if ($is_checkbox) $colspan++;
if ($is_good) $colspan++;
if ($is_nogood) $colspan++;

// 제목이 두줄로 표시되는 경우 이 코드를 사용해 보세요.
// <nobr style='display:block; overflow:hidden; width:000px;'>제목</nobr>
?>

<?
$noIMG = $board_skin_path."/img/empty.gif"; //[필수](URL)
$max = 88 ; //[필수](픽셀) 썸네일 이미지의 가로세로(긴쪽)의 최대치.
$resol = 80 ; //[필수](퍼센트%) 생성되는 썸네일의 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 ;
}
?>

<style>
.board_top { clear:both; }

.board_list { clear:both; width:100%; table-layout:fixed; margin:5px 0 0 0; }
.board_list th { font-weight:bold; font-size:12px; }
.board_list th { background:url(<?=$board_skin_path?>/img/title_bg.gif) repeat-x; }
.board_list th { white-space:nowrap; height:34px; overflow:hidden; text-align:center; }
.board_list th { border-top:1px solid #ddd; border-bottom:1px solid #ddd; }

.board_list tr.bg0 { background-color:#fafafa; }
.board_list tr.bg1 { background-color:#ffffff; }

.board_list td { padding:.5em; }
.board_list td { border-bottom:1px solid #ddd; }
.board_list td.num { color:#999999; text-align:center; }
.board_list td.checkbox { text-align:center; }
.board_list td.subject { overflow:hidden; }
.board_list td.name { padding:0 0 0 10px; }
.board_list td.datetime { font:normal 11px tahoma; color:#BABABA; text-align:center; }
.board_list td.hit { font:normal 11px tahoma; color:#BABABA; text-align:center; }
.board_list td.good { font:normal 11px tahoma; color:#BABABA; text-align:center; }
.board_list td.nogood { font:normal 11px tahoma; color:#BABABA; text-align:center; }

.board_list .notice { font-weight:normal; }
.board_list .current { font:bold 11px tahoma; color:#E15916; }
.board_list .comment { font-family:Tahoma; font-size:10px; color:#EE5A00; }

.board_button { clear:both; margin:10px 0 0 0; }

.board_page { clear:both; text-align:center; margin:3px 0 0 0; }
.board_page a:link { color:#777; }

.board_search { text-align:center; margin:10px 0 0 0; }
.board_search .stx { height:21px; border:1px solid #9A9A9A; border-right:1px solid #D8D8D8; border-bottom:1px solid #D8D8D8; }
</style>

<link rel="stylesheet" href="<?=$board_skin_path?>/style01.css" type="text/css">
<!-- 게시판 목록 시작 -->
<table width="<?=$width?>" align="center" cellpadding="0" cellspacing="0"><tr><td>

<table width='100%' border=0 cellpadding=0 cellspacing=0  bgcolor=#FFFFFF>
    <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=''>
<tr><td colspan=15 class=line></td></tr>
<tr class=bt>
    <td width=50 height=30><span class=bh>NO</span></td>
    <td><img src='<?=$board_skin_path?>/img/split01.gif'></td>
    <td width=75><span class=bh>IMAGE</span></td>
    <td><img src='<?=$board_skin_path?>/img/split01.gif'></td>
    <td><span class=bh>TITLE</span></td>
    <td><img src='<?=$board_skin_path?>/img/split01.gif'></td>
    <td width=100><span class=bh>OP</span></td>
    <td><img src='<?=$board_skin_path?>/img/split01.gif'></td>
    <td width=100><span class=bh>NAME</span></td>
    <td><img src='<?=$board_skin_path?>/img/split01.gif'></td>
    <td width=60><span class=bh>DATA</span></td>
    <td><img src='<?=$board_skin_path?>/img/split01.gif'></td>
    <td width=50><span class=bh>HITS</span></td>
    <!--
    <? if ($is_good) { ?><td><img src='<?=$board_skin?>/split<?=$skin_no?>.gif'></td><td width=40><span class=bh>GOOD</span></td><? } ?>
    <? if ($is_nogood) { ?><td width=1><img src='<?=$board_skin?>/split<?=$skin_no?>.gif'></td><td width=50><span class=bh>NOGOOD</span></td><? } ?>
    -->
</tr>
<tr><td colspan=15 class=line3></td></tr>
<?
// 번호에 이미지를 사용할 경우는 아래의 주석을 제거하고 $list[$i][num]의 내용을 수정후 사용하세요.
// if (!is_int($list[$i][num])) { $list[$i][num] = "<img src='$board_skin/img/arrow.gif'>"; }
?>
<?
for ($i=0; $i<count($list); $i++) {

$z = $list[$i][wr_datetime];
$dt_t1 = substr($z,0,10);
$dt_t2 = substr($z,10,6);
$or_t3 = substr($z,5,6); // 2004-11-27 로 하려면 앞의 5,6를 0,10 으로, 04-11-27 이렇게 하려면 5,6를 2,8로

if ($dt_t1 == $today) $list[$i][datetime]=$dt_t2; else $list[$i][datetime]=$or_t3;

$wr_1 = explode("|",$list[$i][wr_1]);
$op1 = $wr_1[0];
$op2 = $wr_1[1];
$op3 = $wr_1[2];
$op4 = $wr_1[3];
$op5 = $wr_1[4];
$op6 = $wr_1[5];
$op7 = $wr_1[6];
$op8 = $wr_1[7];
$op9 = $wr_1[8];
$op10 = $wr_1[9];
$op11 = $wr_1[10];
$op12 = $wr_1[11];

    if ($i > 0) {
        echo "<tr><td colspan=15 background='$board_skin/dotline.gif' height=1></td></tr>";
    }

    $no = "";
   
    if($list[$i][file_image1]) $img_1 = $list[$i][file_image1];
    else if($list[$i][file_image2]) $img_1 = $list[$i][file_image2];
    else {
        $img_1 = "$board_skin/no_img.gif";
        $no = "no";
    }

    $size = @getimagesize($img_1);

?>
<? if ($list[$i][num] == '공지') { $list[$i][num] = "<img src='$board_skin/icon_notice.gif' border=0>"; } // 공지를 이미지로 변환 ?>
<? if ($list[$i][num] == '<font color=crimson><b>→</b></font>') { $list[$i][num] = "<img src='$board_skin/icon_arrow.gif' border=0>"; } // 화살표표시를 이미지로 변환 ?>
                  <? 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.".Thum" ;
        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 ;
}
?>
<tr align=center>
    <td height=25 colspan=2><FONT style='font-size:8pt; font-family:돋움;'><?=$list[$i][num]?></FONT></td>
  
    <td colspan=2>
        <a href='<?=$list[$i][href]?>' onfocus="this.blur()">
        <img src='<?=$thum?>' width=70 height=50 align=absmiddle border="0"></a>
    </td>
    <td align=left>
        <? if ($is_checkbox) { ?><input type=checkbox name=chk_wr_id[] value="<?=$list[$i][wr_id]?>"><? } ?>&nbsp;
        <?=$list[$i][reply]?>
        <?=$list[$i][icon_reply]?>
        <a href='<?=$list[$i][href]?>'><? if ($list[$i][is_notice]) echo "<b><span class=notice>"; ?><?=$list[$i][subject]?><? if ($list[$i][is_notice]) echo "</span></b>"; ?></a>
        <?=$list[$i][icon_new]?>

</td>
    <td colspan=3 align=left>
        <FONT style='font-size:8pt; font-family:돋움;'>
            사용: <font color=#FF8000><?=$op1?></font> <?=$op2?>
            <br>배송: <font color=#FF8000><?=$op5?"".number_format($op5)."</font>원":"무료배송</font>"?>
            <br>판매: <font color=#FF8000><?=number_format($op7);?></font>원
        </FONT>
    </td>
    <td nowrap colspan=2><?=$list[$i][name]?></td>
    <td colspan=2><?=$list[$i][datetime]?></td>
    <td colspan=2><FONT style='font-size:8pt; font-family:돋움;'><?=$list[$i][wr_hit]?></FONT></td>
    <!--
    <? if ($is_good) { ?><td colspan=2><?=$list[$i][wr_good]?></td><? } ?>
    <? if ($is_nogood) { ?><td><?=$list[$i][wr_nogood]?></td><? } ?>
    -->
</tr>
<? } ?>
<? } ?>
<? if (count($list) == 0) { echo "<tr><td colspan=15 align=center height=100 class='content contentbg'>자료가 없습니다.</td></tr>"; } ?>

</form>
<tr><td colspan=15 class=line></td></tr>
</table>

<div class="board_button" style="clear:both; height:40px; background-color:#f4f4f4;">
    <div style="float:left; margin:10px 0px 0px 10px;">
            <span style="font:normal 8.5pt Arial; color:#a6a6a6;">Total : <?=number_format($total_count)?></span>
    </div>
 
    <div style="float:right; margin:5px 10px 0px 0px;">
        <? if ($list_href) { ?>
        <a href="<?=$list_href?>"><img src="<?=$board_skin_path?>/img/btn_list.gif" align="absmiddle" border='0'></a>
        <? } ?>
        <? if ($is_checkbox) { ?>
        <a href="javascript:select_delete();"><img src="<?=$board_skin_path?>/img/btn_select_delete.gif" align="absmiddle" border='0'></a>
        <a href="javascript:select_copy('copy');"><img src="<?=$board_skin_path?>/img/btn_select_copy.gif" align="absmiddle" border='0'></a>
        <a href="javascript:select_copy('move');"><img src="<?=$board_skin_path?>/img/btn_select_move.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><? } ?>   
        </div>
</div>
 
<div style="height:1px; line-height:1px; font-size:1px; background-color:#eee; clear:both;">&nbsp;</div>
<div style="height:1px; line-height:1px; font-size:1px; background-color:#ddd; clear:both;">&nbsp;</div>

    <!-- 페이지 -->
    <div class="board_page">
        <? if ($prev_part_href) { echo "<a href='$prev_part_href'><img src='$board_skin_path/img/page_search_prev.gif' border='0' align=absmiddle title='이전검색'></a>"; } ?>
        <?
        // 기본으로 넘어오는 페이지를 아래와 같이 변환하여 이미지로도 출력할 수 있습니다.
        //echo $write_pages;
        $write_pages = str_replace("처음", "<img src='$board_skin_path/img/page_begin.gif' border='0' align='absmiddle' title='처음'>", $write_pages);
        $write_pages = str_replace("이전", "<img src='$board_skin_path/img/page_prev.gif' border='0' align='absmiddle' title='이전'>", $write_pages);
        $write_pages = str_replace("다음", "<img src='$board_skin_path/img/page_next.gif' border='0' align='absmiddle' title='다음'>", $write_pages);
        $write_pages = str_replace("맨끝", "<img src='$board_skin_path/img/page_end.gif' border='0' align='absmiddle' title='맨끝'>", $write_pages);
        //$write_pages = preg_replace("/<span>([0-9]*)<\/span>/", "$1", $write_pages);
        $write_pages = preg_replace("/<b>([0-9]*)<\/b>/", "<b><span style=\"color:#4D6185; font-size:12px; text-decoration:underline;\">$1</span></b>", $write_pages);
        ?>
        <?=$write_pages?>
        <? if ($next_part_href) { echo "<a href='$next_part_href'><img src='$board_skin_path/img/page_search_next.gif' border='0' align=absmiddle title='다음검색'></a>"; } ?>
    </div>

<div style="overflow:hidden; height:5px;"></div>

    <!-- 검색 -->
        <form name="fsearch" method="get">
        <input type="hidden" name="bo_table" value="<?=$bo_table?>">
        <input type="hidden" name="sca"      value="<?=$sca?>">
<table width=100% cellpadding=0 cellspacing=0>
    <td height="50" align="center" bgcolor="#f7f7f7">       
        <select name="sfl">
            <option value="wr_subject||wr_content">제목+내용</option>
            <option value="wr_subject">제목</option>
            <option value="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>
        <input name="stx" class="stx" maxlength=15 size=45 itemname="검색어" required value='<?=stripslashes($stx)?>'>
        <select name=sop>
            <option value=and>and</option>
            <option value=or>or</option>
        </select>
        <input type="image" src="<?=$board_skin_path?>/img/search_btn.gif" border='0' align="absmiddle">
</tr>
</table>       
        </form>

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


<script type="text/javascript">
if ('<?=$sca?>') document.fcategory.sca.value = '<?=$sca?>';
if ('<?=$stx?>') {
    document.fsearch.sfl.value = '<?=$sfl?>';

    if ('<?=$sop?>' == 'and')
        document.fsearch.sop[0].checked = true;

    if ('<?=$sop?>' == 'or')
        document.fsearch.sop[1].checked = true;
} else {
    document.fsearch.sop[0].checked = true;
}
</script>

<? if ($is_checkbox) { ?>
<script type="text/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>
<? } ?>
<!-- 게시판 목록 끝 -->
 

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

답변 1개

채택된 답변
+20 포인트

여분필드 wr_1에 구분자 "|"로 입력되어 있는 부분을 보셔야 할 것 같구요.

해당 여분필드 wr_1에 입력되는 혹은 수정되는 로직을 보셔야 할 것 같네요.

 

물건 값을 wr_1에 구분자로 관리되는게 맞나요?

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

답변에 대한 댓글 4개

방문객광고
9년 전
mysql 에서 보면 1|개월|전국|1||14000|11000|창업하자 이러한 형태로 되어있는게 보입니다
곱슬대마왕
9년 전
그럼 "1|개월|전국|1||14000|11000|창업하자"에서 11000 부분이 일괄 세팅되지 않으신가요?
각 게시물 wr_1을 확인해보세요. 해당 값이 업데이트 되시는지도요.
방문객광고
9년 전
재가 끝까지 글을 작성 하지 안았습니다. 세팅은 일괄 되는걸로 보입니다. 각각의 게시물도 해당값은 잘 업되는것 같습니다. 1|개월|전국|1||12000|9000|창업하자|070-4038-4700|addpang@gmail.com|우체국|100073-02-358591 DB에서는 정상적인 입력이 됩니다. 각각ㄱ의 가격도 정상적으로 입력 되어 있구요. 이상하게 리스트에서 출력될때 마지막으로 작성한 가격으로 전체 게시물의 가격이 변경 되어 버린다는 것이 이해가 안되는 부분 입니다.
곱슬대마왕
9년 전
각 게시물의 wr_1값이 고유하게 잘 찍힌다면, 소스를 보지 않는 이상 에러사항을 보기가 어려울 것 같습니다.

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

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

로그인