최신글 추출하려고 했는데요.... > 그누3질답

그누3질답

최신글 추출하려고 했는데요.... 정보

그누보드 최신글 추출하려고 했는데요....

본문

최신글의 내용을 추출하려고 했는데요..
게시판에서 보여지듯이 그렇게 보여지게 하는 방법이 없을까요?
아직 초보라... 저녁내내 소스를 들여다봤는데.. 어렵네요...
<?=$list[$i][content]?> <-- 이걸 사용하면
http://www.oraeta.com/?doc=bbs/mblogin.php
이렇게 됩니다...
게시판에서 보여지는 내용대로 보여지게 하려면 어떻게 해야 할까요...
염치없이 질문만 해대네요.. ㅠ.ㅠ
  • 복사

댓글 전체

7쟁이님의 아래와 같은 에러 메세지로봐서
>select a.*, mb_open from gb_write_갤러리 a left join gb_member b on (b.mb_id = a.mb_id) where >a.wr_comment = 0 order by a.wr_num, a.wr_datetime desc limit 0, 1
>
>1146 : Table '2209fill.gb_write_갤러리' doesn't exist

latest2 호출시 게시판아이디 자리에 아래와 같이 '갤러리'를 입력하신것 같은데..
<? latest2('게시물스킨',갤러리, 1, 150) ?>
'갤러리'라는 게시판이 없다고 나오는 에러 메세지 입니다.
이렇게 나오네요~~~
 

select a.*, mb_open from gb_write_갤러리 a left join gb_member b on (b.mb_id = a.mb_id) where a.wr_comment = 0 order by a.wr_num, a.wr_datetime desc limit 0, 1

1146 : Table '2209fill.gb_write_갤러리' doesn't exist
------메인입니다
<?
if (!defined("_GNUBOARD_")) exit; // 개별 페이지 접근 불가

define("_DOCTYPE_", "DESIGN");

$html_title = "그누보드3";

include "./lib/latest.lib.php";

// 쇼핑몰
$is_shop = false;
if (file_exists($cfg[shop_dir])) {
    include "./$cfg[shop_dir]/shop.lib.php";
    $is_shop = true;
}

?>
 <td width="616" height="277" bgcolor="white" align="left" valign="top">
                <table cellpadding="0" cellspacing="0">
                    <tr>
                        <td width="300">
                            <p>&nbsp;</p>
                        </td>
                        <td width="300">
                            <p>&nbsp;</p>
                        </td>
                    </tr>
                    <tr>
                        <td width="300" height="167" align="left" valign="top">
                            <p><?=latest2('basic_gallery',갤러리, 1, 150);?>
</p>
                        </td>
                        <td width="300" height="167">
                            <p>&nbsp;</p>
                        </td>
                    </tr>
                </table>
            </td>
        </tr>
<? if ($is_shop) { ?>
<p>
<table width='100%' cellpadding=0 cellspacing=1>
<tr><td height=1 background='./<?=$cfg[bbs_dir]?>/line.gif'></td></tr>
<tr><td class='subject subjectbg ht' align=center>신상품</td></tr>
<tr><td height=1 background='./<?=$cfg[bbs_dir]?>/line.gif'></td></tr>
</table>
<!-- 공백 -->
<table width='100%' cellpadding=0 cellspacing=0><tr><td height=5></td></tr></table>
<? group('', 1, 3); ?>

<p>
<table width='100%' cellpadding=0 cellspacing=1>
<tr><td height=1 background='./<?=$cfg[bbs_dir]?>/line.gif'></td></tr>
<tr><td class='subject subjectbg ht' align=center>추천상품</td></tr>
<tr><td height=1 background='./<?=$cfg[bbs_dir]?>/line.gif'></td></tr>
</table>
<!-- 공백 -->
<table width='100%' cellpadding=0 cellspacing=0><tr><td height=5></td></tr></table>
<? group('', 2, 6, 50, 50); ?>
<? } ?>
오호.. 이런 차이가 있는 거였군요...
역시.. 사람은 공부를 해야.. ㅡ.ㅡ;;; 감사합니다. kaja님.. ^^
7쟁이님.. ^^;;; <?=latest2('게시물스킨',게시판아이디, 1, 150);?> 이게 아니라
<? latest2('게시물스킨',게시판아이디, 1, 150) ?> 래요. ^^;;;;
저기...
답답해서 그러는데요^^*
메인에다 <?=latest2('게시물스킨',게시판아이디, 1, 150);?> 이걸붙이니까
_DOCTYPE_ 오류 : NONE , STYLE , DESIGN 중 하나를 사용하세요.

Parse error: parse error in /home/hosting_users/2209fill/www/gnu3/main.php on line 18
이렇게 에러가 나구요 18라인은 보니까 태이블 만들어 붙인 자리더라구요~~~~~
kaja님 초보를 위해 적용 하는법을 조금만 알려주세요^*
아래소스를 복사하여 lib/developer.lib.php파일에 붙여 넣어시고..

<?=latest2('게시물스킨',게시판아이디, 1, 150);?>

불러오면 게시판 처럼 줄변환이 됩니다.

<?
//==============================================================================
//  최신글 관련 함수
//==============================================================================


// 최신글 추출
function latest2($skin_dir='', $bo_table, $rows=10, $len=40)
{
    global $latest_skin, $cfg;

    $tmp_latest_skin = $latest_skin;

    // 스킨디렉토리값이 넘어왔다면
    if ($skin_dir) {
        $latest_skin = "./$cfg[bbs_dir]/skin/latest/$skin_dir";
    }

    $sql = " select * from $cfg[table_board] where bo_table = '$bo_table' ";
    $bo = sql_fetch($sql);
    $bo_subject = $bo[bo_subject];

    $sql = " select a.*, mb_open
              from {$cfg[write_table_prefix]}{$bo_table} a
              left join $cfg[table_member] b on (b.mb_id = a.mb_id)
              where a.wr_comment = 0
              order by a.wr_num, a.wr_datetime desc limit 0, $rows ";
    $result = sql_query($sql);
    for ($i=0; $row = mysql_fetch_array($result); $i++) {
        $list[$i] = $row;

        $list[$i][href] = "./?doc=$cfg[bbs_dir]/gnuboard.php&bo_table=$bo_table&wr_id=$row[wr_id]";

        // 코멘트 카운트
        $list[$i][commentcnt] = "";
        if ($row[wr_commentcnt] > 0) {
            $list[$i][commentcnt] = "($row[wr_commentcnt])";
        }

        $list[$i][name] = gblayer($row[mb_id], cut_str($row[wr_name],10), $row[wr_email], $row[wr_homepage], $row[mb_open]);
        $list[$i][subject] = conv_subject($row[wr_subject], $len,"…");
        $list[$i][content] = get_text(cut_str($row[wr_content], 500, ' ...'));       
        $list[$i][date] = substr($row[wr_datetime],2,8);
        $list[$i][content] = nl2br(stripslashes($list[$i][content])) ;    //  추출 글 내용 줄 변환을 위해 

        $list[$i][icon_new] = "";
        if ($row[wr_datetime] >= date("Y-m-d H:i:s", time() - $bo[bo_new] * 3600)) {
            $list[$i][icon_new] = "<img src='$latest_skin/icon_new.gif' align=absmiddle> ";
        }

        for ($k=1; $k<=$cfg[file_count]; $k++) {
            if (@preg_match($cfg[image_extension], $row["wr_file".$k])) {
                $list[$i]["file_image".$k] = "./data/file/$bo_table/" . $row["wr_file".$k];
            }
        }

        for ($k=1; $k<=$cfg[link_count]; $k++) {
            if ($row["wr_link".$k]) {
                $link[$i]["link".$k] = set_http(get_text(cut_str($row["wr_link".$k], 255)));
                $link[$i]["link_href".$k] = "./?doc=$cfg[bbs_dir]/gblink.php&$qstr&wr_id=$row[wr_id]&index=$k";
            }
        }
    }
    mysql_free_result($result);
   
    include "$latest_skin/latest.skin.php";

    $latest_skin = $tmp_latest_skin;
}
?>
© SIRSOFT
현재 페이지 제일 처음으로