갤러리 첫화면을 앨범형으로 뜨게 하는법 > 그누4 질문답변

그누4 질문답변

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

갤러리 첫화면을 앨범형으로 뜨게 하는법 정보

갤러리 첫화면을 앨범형으로 뜨게 하는법

본문

오류가 나는곳의 주소를 알려주시면 더 빠르고 정확하게 답변 받을 수 있습니다.

오류 주소 : http://woodglobal.co.kr/gnuboard4/bbs/board.php?bo_table=new_shop

*******************************************************************
 갤러리 게시판에서 첫화면이 앨범형으로 뜨게 할려면 소스 어디를 수정햐야
하나요. 위에 홈주소 보시면 리스트형 앨범형이 있는데요. 첫화면을 앨범형으로
나오게 하려면 소스 어디를 수정해야 하나요. 고수님들 돠와 주세요.
밑에 소스 올림니다.
*******************************************************************

<?
if (!defined("_GNUBOARD_")) exit; // 개별 페이지 접근 불가
if (!function_exists("imagecopyresampled")) alert("GD 2.0.1 이상 버전이 설치되어 있어야 사용할 수 있는 갤러리 게시판 입니다.");

$data_path = $g4[path]."/data/file/$bo_table";

if ($L_Type == '1') {
$thumb_path = $data_path.'/thumb';
// 타입1 썸네일
$thumb_width = 160; //썸네일 가로길이
$thumb_height = 105; //썸네일 세로길이
}
else if ($L_Type == '1') {
$thumb_path = $data_path.'/thumb_l_type2';
// 타입2 썸네일
$thumb_width = 150; //썸네일 가로길이
$thumb_height = 113; //썸네일 세로길이
$list_line = 172; //썸네일 가로길이에서 22 더한 값
$list_line2 = 160; //list_line에서 12 뺀 값
$L_Type_2_S = 20;
} else {
$thumb_path = $data_path.'/thumb';
// 그외 썸네일
$thumb_width = 160; //썸네일 가로길이
$thumb_height = 105; //썸네일 세로길이
}
$thumb_quality = 100; //퀼리티 100이하로 설정

@mkdir($thumb_path, 0707);
@chmod($thumb_path, 0707);

$mod = $board[bo_gallery_cols];

// 선택옵션으로 인해 셀합치기가 가변적으로 변함
$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>
?>

<link rel='stylesheet' type='text/css' href='<?=$board_skin_path?>/board_style.css'>

<!-- 게시판 목록 시작 -->
<table width="<?=$width?>" align=center cellpadding=0 cellspacing=0 border='0'><tr><td valign="top">

<table width="100%" cellspacing="0" cellpadding="0" border="0">
<tr>
<td height="30">
<? if ($is_category) { ?>
<? 
$cnt_bo_1 = $bo_1[0] ? $bo_1[0] : 10; // 한줄당 분류 갯수(현재:10)
$cnt = 1;
$cnt0 = 0;
$bb_s=""; $bb_e="";
$b_s=""; $b_e="";
$arr = explode("|", $board[bo_category_list]); // 구분자가 , 로 되어 있음
$str = " |";
for ($i=0; $i<count($arr); $i++)
if (trim($arr[$i]))  {
if ($sca == $arr[$i]) { $cnt0++; $b_s="<b>"; $b_e="</b>"; } else {$b_s=""; $b_e="";}
$str .= " <a href='./board.php?bo_table=$bo_table&sca=".($arr[$i])."'><span class=L_Tcategory>$b_s$arr[$i]$b_e</span></a> <span class=L_line>|</span>";
if ($cnt == $cnt_bo_1) { $cnt = 0; $str .= "<br>"; }
$cnt++;
}
if ($cnt0 == 0 ) { $bb_s="<b>"; $bb_e="</b>"; }
?>
<?echo " <span class=L_line>|</span> ";echo $bb_s;?><a href='./board.php?bo_table=<?=$bo_table?>&page=<?=$page?>'><span class=L_Tcategory>전체</span></a><?=$bb_e?>
<span class=L_Tcategory><?=$str?></span><? } ?></td>
<td width="57" height="30">
<a href="<?=$g4['bbs_path']?>/board.php?bo_table=<?=$bo_table?>"><img src="<?=$board_skin_path?>/img/icon_02.gif" width="68" heihgt="20" border="0"></a></td>
<td width="5"></td>
<td width="57" height="30">
<a href="<?=$g4['bbs_path']?>/board.php?bo_table=<?=$bo_table?>&L_Type=2"><img src="<?=$board_skin_path?>/img/icon_01.gif" width="57" heihgt="20" border="0"></a></td>
</tr>
</table>

<form name="fboardlist" method="post" style="margin:0px;">
<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'>
<? for ($i=0; $i<count($list); $i++) {
if ($L_Type == '1') {
    $img = "<img src='$board_skin_path/img/no_img.gif' border=0 title='이미지 없음'>";
    $thumb = $thumb_path.'/'.$list[$i][wr_id];
    if (!file_exists($thumb))
    {
        $file = $list[$i][file][0][path] .'/'. $list[$i][file][0][file];
        if (preg_match("/\.(jp[e]?g|gif|png)$/i", $file) && file_exists($file))
        {
            $size = getimagesize($file);
            if ($size[2] == 1)
                $src = imagecreatefromgif($file);
            else if ($size[2] == 2)
                $src = imagecreatefromjpeg($file);
            else if ($size[2] == 3)
                $src = imagecreatefrompng($file);
            else
                continue;

            $rate = $thumb_width / $size[0];
            $height = (int)($size[1] * $rate);

            if ($height < $thumb_height)
                $dst = imagecreatetruecolor($thumb_width, $height);
            else
                $dst = imagecreatetruecolor($thumb_width, $thumb_height);
            imagecopyresampled($dst, $src, 0, 0, 0, 0, $thumb_width, $height, $size[0], $size[1]);
            imagejpeg($dst, $thumb_path.'/'.$list[$i][wr_id], $thumb_quality);
            chmod($thumb_path.'/'.$list[$i][wr_id], 0606);
        }
    }

    if (file_exists($thumb))
        $img = "<img src='$thumb' border=0>";

    $subject = "<span $style>".cut_str($list[$i][subject],1000)."</span>";
}
else if ($L_Type == '2') {
    if ($i && $i%$mod==0)
        echo "</tr><tr>";

    $img = "<img src='$board_skin_path/img/no_img.gif' border=0 title='이미지 없음'>";
    $thumb = $thumb_path.'/'.$list[$i][wr_id];
    if (!file_exists($thumb))
    {
        $file = $list[$i][file][0][path] .'/'. $list[$i][file][0][file];
        if (preg_match("/\.(jp[e]?g|gif|png)$/i", $file) && file_exists($file))
        {
            $size = getimagesize($file);
            if ($size[2] == 1)
                $src = imagecreatefromgif($file);
            else if ($size[2] == 2)
                $src = imagecreatefromjpeg($file);
            else if ($size[2] == 3)
                $src = imagecreatefrompng($file);
            else
                continue;

            $rate = $thumb_width / $size[0];
            $height = (int)($size[1] * $rate);

            if ($height < $thumb_height)
                $dst = imagecreatetruecolor($thumb_width, $height);
            else
                $dst = imagecreatetruecolor($thumb_width, $thumb_height);
            imagecopyresampled($dst, $src, 0, 0, 0, 0, $thumb_width, $height, $size[0], $size[1]);
            imagejpeg($dst, $thumb_path.'/'.$list[$i][wr_id], $thumb_quality);
            chmod($thumb_path.'/'.$list[$i][wr_id], 0606);
        }
    }

    if (file_exists($thumb))
        $img = "<img src='$thumb' border=0>";

    $subject = "<span $style>".cut_str($list[$i][subject],$L_Type_2_S)."</span>";
} else {
    $img = "<img src='$board_skin_path/img/no_img.gif' border=0 title='이미지 없음'>";
    $thumb = $thumb_path.'/'.$list[$i][wr_id];
    if (!file_exists($thumb))
    {
        $file = $list[$i][file][0][path] .'/'. $list[$i][file][0][file];
        if (preg_match("/\.(jp[e]?g|gif|png)$/i", $file) && file_exists($file))
        {
            $size = getimagesize($file);
            if ($size[2] == 1)
                $src = imagecreatefromgif($file);
            else if ($size[2] == 2)
                $src = imagecreatefromjpeg($file);
            else if ($size[2] == 3)
                $src = imagecreatefrompng($file);
            else
                continue;

            $rate = $thumb_width / $size[0];
            $height = (int)($size[1] * $rate);

            if ($height < $thumb_height)
                $dst = imagecreatetruecolor($thumb_width, $height);
            else
                $dst = imagecreatetruecolor($thumb_width, $thumb_height);
            imagecopyresampled($dst, $src, 0, 0, 0, 0, $thumb_width, $height, $size[0], $size[1]);
            imagejpeg($dst, $thumb_path.'/'.$list[$i][wr_id], $thumb_quality);
            chmod($thumb_path.'/'.$list[$i][wr_id], 0606);
        }
    }

    if (file_exists($thumb))
        $img = "<img src='$thumb' border=0>";

    $subject = "<span $style>".cut_str($list[$i][subject],1000)."</span>";
}
    $style = "";
    if ($list[$i][icon_new])
        $style = ""; // 읽지 않은 글??  style='font-weight:bold;'  추가

    $wr_content = "<span $style>".cut_str(get_text($list[$i][wr_content]),$list_content)."</span>";

    $comment_cnt = "";
    if ($list[$i][comment_cnt])
        $comment_cnt = " <span class='L_comment_cnt'>{$list[$i][comment_cnt]}</span>";

    $cehckbox = "";
    if ($is_checkbox)
        $cehckbox = "<input type=checkbox name=chk_wr_id[] value='{$list[$i][wr_id]}'>";

    $category = "";
    if ($is_category)
        $category = "<span class=L_line>┃</span><span class=L_category>{$list[$i][ca_name]}</span>";
?>

<? if ($L_Type == '1') { //L_Type_1 start ?>
<tr>
<td valign=bottom>
<table width="100%" cellspacing="0" cellpadding="0" border="0">
<tr>
<? if (file_exists($thumb)) { ?>
<td width="<?=$thumb_width?>" height="<?=$thumb_height?>" style="border:1px solid #CCCCCC; padding:3px" align="center" valign="top"><a href='<?=$list[$i][href]?>'><?=$img?></a></td>
<td width="15"></td>
<? } ?>
<td height="<?=$thumb_height?>" valign="top">
<table width="100%" cellspacing="0" cellpadding="0" border="0">
<tr>
<td style="padding:0 0 3 0px;" height="21">
<table width="100%" cellspacing="0" cellpadding="0" border="0">
<tr>
<td>
<?=$cehckbox?><a href='<?=$list[$i][href]?>'><span class=L_subject><?=$subject?></span></a><?=$category?> <?=$list[$i][icon_new]?></td>
<td width="80" align="right" valign="bottom">
<span class="L_hit">조회&nbsp;:&nbsp;<?=$list[$i][wr_hit]?></span></td>
</tr>
</table></td>
</tr>
<tr><td bgcolor="#e4e4e4" height="1"></td></tr>
<tr>
<td style="padding:5 0 5 0px;" height="88" valign="top">
<span class=L_wr>품명&nbsp;:&nbsp;<?=$list[$i][wr_1]?></span>
<p>
<span class=L_wr>규격&nbsp;:&nbsp;<?=$list[$i][wr_4]?></span>
<p>
<span class=L_wr>비고&nbsp;:&nbsp;<?=$list[$i][wr_2]?></span>

</td>
</tr>
</table></td>
</tr>
</table></td>
</tr>
<tr><td height='30'></td></tr>
<?
} //L_Type_1 end
else if ($L_Type == '2') { //L_Type_2 start
echo "<td align='center' valign='top'>";
echo "<table width='{$list_line}' border='0' cellspacing='0' cellpadding='0' align='center' valign='top'>";
echo "<tr>";
echo " <td>";
echo " <table border='0' cellspacing='0' cellpadding='0'>";
echo " <tr>";
echo " <td background='{$board_skin_path}/img/mosuri_01.gif' width='6' height='6'></td>";
echo " <td width='{$list_line2}'>";
echo " <table width='{$list_line2}' border='0' cellspacing='0' cellpadding='0'>";
echo " <tr><td bgcolor='#E2E2E2' width='{$list_line2}' height='1'></td></tr>";
echo " <tr><td height='5'></td></tr>";
echo " </table></td>";
echo " <td background='{$board_skin_path}/img/mosuri_02.gif' width='6' height='6'></td>";
echo " </tr>";
echo " </table></td>";
echo "</tr>";
echo "<tr>";
echo " <td>";
echo " <table border='0' cellspacing='0' cellpadding='0'>";
echo " <tr>";
echo " <td bgcolor='#E2E2E2' width='1'></td>";
echo " <td width='5'></td>";
echo " <td width='{$list_line2}'>";
echo "<table width='100%' cellspacing='0' cellpadding='0' border='0'>";
echo " <tr>";
echo " <td width='{$thumb_width}' height='{$thumb_height}' style='border:1px solid #CCCCCC; padding:3px;' align='center' valign='top'>";
echo "<div style='width:{$thumb_width}px; height:{$thumb_height}px; position: relative; overflow:hidden;' align='center'><a href='{$list[$i][href]}'>{$img}</a></div></td>";
echo " </tr>";
echo " <tr>";
echo " <td height='25'>";
echo "{$cehckbox}<a href='{$list[$i][href]}'><span class=L_subject>{$subject}</span></a></td>";
echo " </tr>";
echo " <tr>";
echo " <td bgcolor='#E2E2E2' height='1'></td>";
echo " </tr>";
echo " <tr><td height='3'></td></tr>";
echo " <tr>";
echo " <td height='20'>";
echo "<span class='L_wr'>품명&nbsp;:&nbsp;{$list[$i][wr_1]}</span></td>";
echo " </tr>";
echo " <tr>";
echo " <td height='20'>";
echo "<span class='L_wr'>규격&nbsp;:&nbsp;{$list[$i][wr_4]}</span></td>";
echo " </tr>";
echo " <tr>";
echo " <td height='20'>";
echo "<span class='L_wr'>비고&nbsp;:&nbsp;{$list[$i][wr_2]}</span></td>";
echo " </tr>";
echo "</table></td>";
echo " <td width='5'></td>";
echo " <td bgcolor='#E2E2E2' width='1'></td>";
echo " </tr>";
echo " </table></td>";
echo "</tr>";
echo "<tr>";
echo " <td>";
echo " <table border='0' cellspacing='0' cellpadding='0'>";
echo " <tr>";
echo " <td background='{$board_skin_path}/img/mosuri_03.gif' width='6' height='6'></td>";
echo " <td width='{$list_line2}'>";
echo " <table width='{$list_line2}' border='0' cellspacing='0' cellpadding='0'>";
echo " <tr><td width='{$list_line2}' height='5'></td></tr>";
echo " <tr><td bgcolor='#E2E2E2' height='1'></td></tr>";
echo " </table></td>";
echo " <td background='{$board_skin_path}/img/mosuri_04.gif' width='6' height='6'></td>";
echo " </tr>";
echo " </table></td>";
echo "</tr>";
echo "<tr><td height='20'></td></tr>";
echo "</table></td>\n";
}
//L_Type_2 end
else { //기본 start
?>
<tr>
<td valign=bottom>
<table width="100%" cellspacing="0" cellpadding="0" border="0">
<tr>
<? if (file_exists($thumb)) { ?>
<td width="<?=$thumb_width?>" height="<?=$thumb_height?>" style="border:1px solid #CCCCCC; padding:3px" align="center" valign="top"><a href='<?=$list[$i][href]?>'><?=$img?></a></td>
<td width="15"></td>
<? } ?>
<td height="<?=$thumb_height?>" valign="top">
<table width="100%" cellspacing="0" cellpadding="0" border="0">
<tr>
<td style="padding:0 0 3 0px;" height="21">
<table width="100%" cellspacing="0" cellpadding="0" border="0">
<tr>
<td>
<?=$cehckbox?><a href='<?=$list[$i][href]?>'><span class=L_subject><?=$subject?></span></a><?=$category?> <?=$list[$i][icon_new]?></td>
<td width="80" align="right" valign="bottom">
<span class="L_hit">조회 : <?=$list[$i][wr_hit]?></span></td>
</tr>
</table></td>
</tr>
<tr><td bgcolor="#e4e4e4" height="1"></td></tr>
<tr>
<td style="padding:5 0 5 0px;" height="88" valign="top">
<span class=L_wr>품명 : <?=$list[$i][wr_1]?></span>
<p>
<span class=L_wr>규격 : <?=$list[$i][wr_4]?></span>
<p>
<span class=L_wr>비고 : <?=$list[$i][wr_2]?></span>

</td>
</tr>
</table></td>
</tr>
</table></td>
</tr>
<tr><td height='30'></td></tr>
<?
} //기본 end
} //for end

//$L_Type_2
if ($L_Type == '2') {
// 나머지 td 를 채운다.
if (($cnt = $i%$board[bo_gallery_cols]) != 0)
    for ($k=$cnt; $k<$board[bo_gallery_cols]; $k++)
        echo "<td>&nbsp;</td>\n";
}
?>
<? if (count($list) == 0) { echo "<tr><td colspan='$mod' height=100 align=center>등록된 상품이 없습니다.</td></tr>"; } ?>
</table>
</form>

<!-- 페이지 -->
<table width="100%" cellspacing="0" cellpadding="0">
<tr>
    <td height="37" align="center">
        <table width="100%" border="0" cellspacing="0" cellpadding="0">
        <tr>
            <td width="100%" align="center">
                <? if ($prev_part_href) { echo "<a href='$prev_part_href'><img src='$board_skin_path/img/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/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/end.gif' border='0' align='absmiddle' title='맨끝'>", $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_path/img/search_next.gif' width=50 height=20 border=0 align=absmiddle title='다음검색'></a>"; } ?>
            </td>
        </tr>
        </table></td>
</tr>
</table>

<!-- 버튼 링크 -->
<form name=fsearch method=get style="margin:0px;">
<input type=hidden name=bo_table value="<?=$bo_table?>">
<input type=hidden name=sca      value="<?=$sca?>">
<table width=100% cellpadding=0 cellspacing=0>
<tr>
    <td width="50%" height="40">
        <? if ($list_href) { ?><a href="<?=$list_href?>"><img src="<?=$board_skin_path?>/img/list.gif" border="0"></a><? } ?>
        <? if ($write_href) { ?><a href="<?=$write_href?>"><img src="<?=$board_skin_path?>/img/write.gif" border="0"></a><? } ?>
        <? if ($is_checkbox) { ?>
            <a href="javascript:select_delete();"><img src="<?=$board_skin_path?>/img/delete.gif" border="0"></a>
            <a href="javascript:select_copy('copy');"><img src="<?=$board_skin_path?>/img/copy.gif" border="0"></a>
            <a href="javascript:select_copy('move');"><img src="<?=$board_skin_path?>/img/move.gif" border="0"></a>
        <? } ?>
    </td>
    <td width="50%" align="right">
<? if ($admin_href) { ?>
        <select name=sfl class=L_select>
            <option value='wr_subject||wr_content'>제목+내용</option>
            <option value='wr_subject'>제목</option>
            <option value='wr_content'>내용</option>
            <option value='mb_id'>회원아이디</option>
            <option value='wr_name'>이름</option>
        </select>
    <input name=stx maxlength=15 size=10 itemname="검색어" required value="<?=$stx?>" class=L_input>
<select name=sop class=L_select>
            <option value=and>and</option>
            <option value=or>or</option>
        </select>
            <input type=image src="<?=$board_skin_path?>/img/search.gif" border=0 align=absmiddle><? } ?></td>
</tr>
</table>
</form></td>
</tr></table>

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

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

****************************************************************************
  • 복사

댓글 전체

© SIRSOFT
현재 페이지 제일 처음으로