게시판 리스트 파일에서여러 테이블 읽어 들일수 있는 방법좀..

게시판 리스트 파일에서여러 테이블 읽어 들일수 있는 방법좀..

QA

게시판 리스트 파일에서여러 테이블 읽어 들일수 있는 방법좀..

본문

게시판에 리스트 파일인데

여러테이블을 가지고 와야 하는데.. 극초보라 링크를 따라가서 배우고 와도 잘 모르겠습니다.

한번만 부탁드리겠습니다.

어느쪽에 어떤 코드를 넣어야 하는지요

진심 부탁 드리겠습니다.

 


<?
if (!defined("_GNUBOARD_")) exit; // 개별 페이지 접근 불가 
include_once("$board_skin_path/lib/common.lib.php");
// 썸네일 생성
$thumb_width = "100"; //썸네일 가로길이
$thumb_height = "75"; //썸네일 세로길이
// 1차 디렉토리 (썸네일 폴더)
$thumb_path2 = $g4['path'] . "/data/thumb";
// 1차 디렉토리 생성 및 퍼미션
@mkdir($thumb_path2, 0707);
@chmod($thumb_path2, 0707);
// 2차 디렉토리 (게시판 폴더)
$thumb_path1 = $thumb_path2."/" . $bo_table;
// 1차 디렉토리 생성 및 퍼미션
@mkdir($thumb_path1, 0707);
@chmod($thumb_path1, 0707);
// 썸네일 디렉토리
$thumb_path = $thumb_path1 . "/" . $thumb_width . "x" . $thumb_height;
// 디렉토리 생성 및 퍼미션
@mkdir($thumb_path, 0707);
@chmod($thumb_path, 0707);
?>
<style>
.listL { background:url(<?=$board_skin_path?>/img/board_listL.gif) repeat-x;  }
.listR { background:url(<?=$board_skin_path?>/img/board_listR.gif) repeat-x;  }
.listBL { background:url(<?=$board_skin_path?>/img/board_listBL.gif) repeat-x;  }
.listBC { background:url(<?=$board_skin_path?>/img/board_listBC.gif) repeat-x;  }
.listBR { background:url(<?=$board_skin_path?>/img/board_listBR.gif) repeat-x;  }
.board_top { clear:both; }
.board_list { clear:both; width:100%; table-layout:fixed; margin:5px 0 0 0; }
.board_button { clear:both; margin:10px 0 0 0; }
.board_page { clear:both; text-align:center; margin:10px 0 0 0; }
.board_page a:link { color:#777; }
.board_top1 { border-top:1px solid #eee;margin:10px 0 0 0; }
.board_bottom { border-bottom:1px solid #eee; }
.board_search { text-align:center; margin:10px 0 0 70px; }
.board_search .stx { height:21px; border:1px solid #9A9A9A; border-right:1px solid #D8D8D8; border-bottom:1px solid #D8D8D8; }
</style>
 

 <table width=100% border=0 cellpadding=0 cellspacing=0 style="margin-top:0px;">
 <tr>
    <td valign=top>
    <?=mw_latest("mw.index.main", "admin3", 5, 40, 0)?>
    </td>
 </tr>
 </table>

<table width=100% border=0 cellpadding=0 cellspacing=0 style="margin-top:0px;">
<tr>
    <td valign=top>
    <div class="latest-block"><?=mw_latest("thumb_hidden_title_oneroom", "admin3", 4, 40,1)?></div>
 </td>
</tr>
</table>

<table width="100%" border="0" align="center" cellpadding="0" cellspacing="0"  style="margin-top:10px;">
<tr>
<td width="25%">
<A HREF="/bbs/board.php?bo_table=<?=$bo_table?>"><img src="<?=$board_skin_path?>/img/cate_00.gif" align="absmiddle" border='0'></A><? include_once ("$board_skin_path/navigation.php"); ?>
</td>
<td  width="75%" align="right">
<span style="color:#999999;">총 게시물 <?=number_format($total_count)?>건</span> 
<? if ($rss_href) { ?><a href='<?=$rss_href?>'><img src='<?=$board_skin_path?>/img/btn_rss.gif' border='0' align="absmiddle"></a><?}?>
<? if ($admin_href) { ?>
<a href="<?=$admin_href?>"><img src="<?=$board_skin_path?>/img/btn_admin.gif" border='0' title="관리자" align="absmiddle"></a><?}?>
</td>
</tr>
</table>
<table width="100%" border="0" align="center" cellpadding="0" cellspacing="0">
  <tr>
    <td>
        <table width="100%" cellpadding="0" cellspacing="0">
          <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>
<table width=100% border=0 cellpadding=0 cellspacing=0>
<tr height=42 align=center>
<td width="8"><img src="<?=$board_skin_path?>/img/board_listL.gif"></td>
<td width="90" background="<?=$board_skin_path?>/img/board_listC.gif">이미지</td>
<? if ($is_checkbox) { ?>
<td background="<?=$board_skin_path?>/img/board_listC.gif">
<input onclick="if (this.checked) all_checked(true); else all_checked(false);" type=checkbox></td><?}?>
<td align="center" background="<?=$board_skin_path?>/img/board_listC.gif">업체명/정보</td>
<!--<td width="100" background="<?=$board_skin_path?>/img/board_listC.gif">지역</td>-->
<td width="8"><img src="<?=$board_skin_path?>/img/board_listR.gif"></td>
</tr>
</table>
<table width="100%" cellpadding="0" cellspacing="0" >
<? for ($i=0; $i<count($list); $i++) { ?>
<?
$p_nine = explode("|",$list[$i][wr_9]);
$nine01 = $p_nine[0]; 
$nine02 = $p_nine[1]; 
$nine03 = $p_nine[2]; 
$nine04 = $p_nine[3]; 
$nine05 = $p_nine[4]; 
$nine06 = $p_nine[5];
$nine07 = $p_nine[6];
$nine08 = $p_nine[7];
$nine09 = $p_nine[8];
$nine10 = $p_nine[9]; 
$nine11 = $p_nine[10];
?>
<tr <? if ($list[$i][is_notice]) { ?><? } else if ($wr_id == $list[$i][wr_id]) { ?><? }?>>
 <td width="8"></td>
  <table width="100%" cellpadding="3" >
  <tr align="center">
  <td width="110" height="80" align="center">
  <table cellpadding="0" cellspacing="0">
  <tr>
  <td align="center" style="padding:2px 0 4px 0;">

  <? 
 // 이미지 체크
    $sql = " select bf_file, bf_datetime from $g4[board_file_table] where bo_table = '$bo_table' and wr_id = '{$list[$i][wr_id]}' and bf_type in (1,2,3) ";
    $listFile = sql_fetch($sql);
    if ($listFile['bf_file']) {
        $thumb = $thumb_path.'/'.$listFile['bf_file'];
        $thumb_file = image_path($bo_table, $listFile['bf_datetime'], $listFile['bf_file'], "path");
        $img_filename = $listFile['bf_file'];
        $save_mode = image_path($bo_table, $listFile['bf_datetime'], $listFile['bf_file'], "mode");
    } else {
        $thumb = $thumb_path.'/'.image_editor($g4['path'], $list[$i]['wr_content'], "file");
        $thumb_file = image_editor($g4['path'], $list[$i]['wr_content'], "url");
        $img_filename = image_editor($g4['path'], $list[$i]['wr_content'], "file");
        $save_mode = "false";
    }
    // 썸네일이 없다면
    if (!file_exists($thumb)) {
        if ($save_mode == 'true') {
            $thumb_file = image_save($thumb_file, $img_filename, $save_mode);
        } else {
        }
        // 확장자 체크
        if (preg_match("/\.(jp[e]?g|gif|png)$/i", $thumb_file)) {
            image_thumb($thumb_width, $thumb_height, $thumb_file, $thumb, true);
        }
    }
    // 파일이 있으면 출력.
    if (file_exists($thumb) && $img_filename) {
        $img = "<a href='".$list[$i][href]."'><img src='".$thumb."' align='absmiddle' border='0' style='border:1px #eeeeee solid;'></a>";
    } else {
        $img = "<a href='".$list[$i][href]."'><img src='".$board_skin_path."/img/noimg65x45.gif' width='".$thumb_width."' height='".$thumb_height."' align='absmiddle' border='0' style='border:1px #eeeeee solid;'></a>";
    }
?><?=$img?>
  </td>
   </tr>
   </table></td>
   <td align="left">
<table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr><td height="20">
<? if ($is_checkbox) { ?><input type=checkbox name=chk_wr_id[] value="<?=$list[$i][wr_id]?>"><? } ?><a href='<?=$list[$i][href]?>'><strong><?=$list[$i][subject]?></strong></a>
<? if ($list[$i][comment_cnt]) 
echo " <a href=\"{$list[$i][comment_href]}\"><span style='font-family:돋움; font-size:8pt; color:#ff6600;'><b>{$list[$i][comment_cnt]}</b></span></a>";
?>
</td>
 </tr>
 </tr>
 <tr>
  <td height="20"><?=$nine03?></td>
 </tr>
 <tr>
  <td height="20">☎ <?=$nine08?>) <?=$nine09?>-<?=$nine10?></td>
 </tr>
 <tr>
  <td height="20">
   <a href='<?=$list[$i][href]?>'><span style='font-family:돋움; font-size:8pt; color:#999999; line-height:13px; letter-spacing:-1px;'><?=$list[$i][wr_8]?></span></a>
   <?=$list[$i][icon_new]?>
   <?//=$list[$i][icon_hot]?></td>
 </tr>
</table>
  </td>
 </tr>
 <tr>
  <td colspan="2" height="1" bgcolor="eeeeee"></td>
 </tr>
 <? } ?>
</table>
</td>
             </tr>
                                 
                  <? if (count($list) == 0) { echo "<tr><td height=100 align=center> 게시물이 없습니다.</td></tr>"; } ?>
              </table>
  </form>
<!-- 페이지 -->
  <table cellspacing="0" cellpadding="0" width="100%">
  <tr><td colspan="3" align="center" style="padding:10px 0 4px 0;">
   
       <? 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>"; } ?>
   </td></tr>
   
<tr><td colspan="3" align="right" style="padding:10px 0 4px 0;">
 
        <? 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"  align="absmiddle" border='0'></a><? } ?>
</td></tr>
   </table>
 <!-- 검색 -->
        </td>
    </tr>
    </table>
</td>
    </tr>
    </table>
  
<script language="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 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=400, height=550, scrollbars=1");
    f.sw.value = sw;
    f.target = "move";
    f.action = "./move.php";
    f.submit();
}
</script>
<? } ?>​

이 질문에 댓글 쓰기 :

답변 1

스킨화일에서 할 성질이 아닙니다(bbs/list.php를 별도로 만들거나 수정해야합니다)

아래에서했던 부동산 스킨 질문과 같은 작업이라면 10개의 원룸 게시판을 합쳐서 가져오겠다는 것이겠죠?

합치는 명령어는 union all 이라는 것인데 세월이 갈 수록 홈페이지는 점점 느려질 것입니다

링크도 다르게 만들어야 할테고 하여튼 복잡합니다

 

방법을 바꾸는 것이 좋을 듯 합니다

카테고리를 사용하는지 모르겠는데요 열개의 게시판 대신 하나의 게시판에 10개의 카테고리를 만들어서

01 게시판을 사용하는 아이디로 접속하면 01분류만 출력

02 게시판을 사용하는 아이디로 접속하면 02분류만 출력....이런 방법으로 하는 것이 여러가지로 좋을 것입니다

 

답변을 작성하시기 전에 로그인 해주세요.
전체 3

회원로그인

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