최신글 추출 문제.....역시나 안되는군요? > 그누3질답

그누3질답

최신글 추출 문제.....역시나 안되는군요? 정보

그누보드 최신글 추출 문제.....역시나 안되는군요?

본문

박갑성님 말씀듣고 이리저리 뜯고 고쳐보지만 아무리 봐도 문제가 없는것 같은데 문제가 발쌩합니다.
여러개 최신글추츨을 하면 첫번째것만 추츨하고(함수한번만 실행하고)두번재부터는 실행이 되지않네요 *^^* 소스봐보시고 혹아시는분 해결좀...쩝....캅캅하네요 *^^*

댓글 전체

function newlist($skins, $bo_table, $subject, $rows, $subjectlen='')
{
    global $cfg, $absdir, $reldir, $uc1, $uc2, $uc3;

    $sql = " select * from $cfg[table_board] where bo_table = '$bo_table' ";
    $bd = sql_fetch_array($sql);

    if ($subjectlen == '') $subjectlen = $bd[bo_subject_len];

 
    $cfg[board_table_prefix] = "gb_write_"; // 게시판 테이블의 접두사
   
    $게시판제목 = $subject;       
    $게시판      = $bo_table;
    $절대경로    = $cfg[url];
    $새글스킨경로 = "$cfg[url]/$cfg[dir_skin]/";
    $스킨        = $skins;
   
 
    $table = "{$cfg[board_table_prefix]}{$bo_table}";
    $result = sql_query_error(" select * from $table where wr_comment = 0 order by wr_id desc limit {$rows} ");
echo "<table border='0' cellpadding='0' cellspacing='0' width='100%'><tr><td height=10 colspan=4></td></tr>";
    for ($i = 0; $row = mysql_fetch_array($result); $i++) {
 
           
        $temp[$i]->icon_file  = ($row[wr_file1] || $row[wr_file2]) ? true : false;
        $temp[$i]->icon_link  = ($row[wr_link1] || $row[wr_link2]) ? true : false;
        $temp[$i]->icon_new    = ($row[wr_datetime] >= date("Y-m-d H:i:s", time() - ($board[bo_new] * 3600))) ? true : false;
        $temp[$i]->icon_hot    = ($row[wr_hit] >= $bd[bo_hot]) ? true : false;
        $temp[$i]->icon_battle = ($row[wr_commentcnt] >= $bd[bo_battle]) ? true : false;
        $temp[$i]->icon_secret = $row[wr_secret] ? true : false;           
           

        $temp[$i]->wr_commentcnt  = ($row[wr_commentcnt]) ? $row[wr_commentcnt] : null;

        $temp[$i]->wr_subject  = get_text(cut_str($row[wr_subject], $subjectlen, '…'));
        $temp[$i]->wr_id      = $row[wr_id];
        $temp[$i]->bo_table    = $bo_table;
        $temp[$i]->wr_datetime = $row[wr_datetime];

echo "<tr height=20><td style='font-size:9pt;'>";
echo "<img src=$새글스킨경로/$스킨/images/arrow.gif border=0>&nbsp;";

if ($temp[$i]->icon_file) echo "<img src='$새글스킨경로/$스킨/images/icon_file.gif' align=absmiddle>";
        if ($temp[$i]->icon_link) echo "<img src='$새글스킨경로/$스킨/images/icon_link.gif' align=absmiddle>";
echo("
<a href='$절대경로/gbview.php?bo_table={$게시판}&wr_id={$temp[$i]->wr_id}&type=$type'>
{$temp[$i]->wr_subject};</a>
");
echo "
</td></tr>
<tr><td width=100% height=1 background='$새글스킨경로/images/underline.gif' colspan=4></td></tr>
";
    }
echo "</table>";
    mysql_free_result($result);



}
음...그래도 스킨포기하기는 그렇네요...*^^* 저도 어쩔수 없어서 님이 말씀하신방식대로 해보니 되네요 *^^*
그래도 문제를 찾아서 스킨방식으로 해야겠네요 *^^* 그전까지는
<?

// 새글 추출
function newlist($skins, $bo_table, $subject, $rows, $subjectlen='')
{
    global $cfg, $uc1, $uc2, $uc3;
   
    $sql = " select * from gb_board where bo_table = '$bo_table' ";
    $bd = sql_fetch_array($sql);

    if ($subjectlen == '') $subjectlen = $bd[bo_subject_len];

 
    $cfg[board_table_prefix] = "gb_write_"; // 게시판 테이블의 접두사
   
    $게시판제목  = $subject;       
    $게시판      = $bo_table;
    $절대경로    = $cfg[url];
    $새글스킨경로 = "$cfg[url]/$cfg[dir_skin]/";
    $스킨        = $skins;
   
       
    $table = "{$cfg[board_table_prefix]}{$bo_table}";
    $result = sql_query_error(" select * from $table where wr_comment = 0 order by wr_id desc limit {$rows} ");
    for ($i = 0; $row = mysql_fetch_array($result); $i++) {
           
        $temp[$i]->icon_file  = ($row[wr_file1] || $row[wr_file2]) ? true : false;
        $temp[$i]->icon_link  = ($row[wr_link1] || $row[wr_link2]) ? true : false;
        $temp[$i]->icon_new    = ($row[wr_datetime] >= date("Y-m-d H:i:s", time() - ($board[bo_new] * 3600))) ? true : false;
        $temp[$i]->icon_hot    = ($row[wr_hit] >= $board[bo_hot]) ? true : false;
        $temp[$i]->icon_battle = ($row[wr_commentcnt] >= $board[bo_battle]) ? true : false;
        $temp[$i]->icon_secret = $row[wr_secret] ? true : false;           

        $temp[$i]->wr_commentcnt  = ($row[wr_commentcnt]) ? $row[wr_commentcnt] : null;

        $temp[$i]->wr_subject  = get_text(cut_str($row[wr_subject], $subjectlen, '…'));
        $temp[$i]->wr_id      = $row[wr_id];
        $temp[$i]->bo_table    = $bo_table;
        $temp[$i]->wr_datetime = $row[wr_datetime];
    }
    mysql_free_result($result);

echo "
    <table border=0 cellpadding=0 cellspacing=0 width=100% align=center height=20 style='font-family:Verdana; font-size:9pt;'>
          <tr>
            <td width=22 height=22 style='font-size:9pt; font:돋움'>
                <img src='$새글스킨경로/$스킨/images/qaz_lost_02.gif' width='22' height='29' border='0'></td>                     
            <td height=22 width=343 background='$새글스킨경로/$스킨/images/qaz_lost_04.gif' >
                <b>$게시판제목</b></td>
            <td height=22 background='$새글스킨경로/$스킨/images/qaz_lost_04.gif' >
                <a href='$절대경로/gblist.php?bo_table=$게시판'>
                <img src='$새글스킨경로/$스킨/images/more.gif' width='40' height='15' border='0'></a></td>
            <td width=22 height=22 align=right>
                <img src='$새글스킨경로/$스킨/images/qaz_lost_03.gif' width='22' height='29' border='0'></td>
        </tr>
    </table>
 
   
        <tr>
            <td height=2 colspan=4></td>
        </tr>
        <tr>
              <td height=20 colspan=4 >
                <table border='0' cellpadding='0' cellspacing='0' width='100%'> ";
            for ($i=0; $i<count($temp); $i++) {             
            echo "
                    <tr>
                        <td style='font-size:9pt;'> <img src='$새글스킨경로/$스킨/images/arrow.gif' border=0>&nbsp; ";
   
                            if ($temp[$i]->icon_file) echo "<img src='$새글스킨경로/$스킨/images/icon_file.gif' align=absmiddle>";
                            if ($temp[$i]->icon_link) echo "<img src='$새글스킨경로/$스킨/images/icon_link.gif' align=absmiddle>";
   
   
                          echo "<a href='$절대경로/gbview.php?bo_table=$게시판&wr_id={$temp[$i]->wr_id}'>{$temp[$i]->wr_subject}</a>";


                            if ($temp[$i]->wr_commentcnt) echo "[{$temp[$i]->wr_commentcnt}]"; 
                       
                            if ($temp[$i]->icon_new) echo "<img src='$새글스킨경로/$스킨/images/icon_new.gif' align=absmiddle>";
                            if ($temp[$i]->icon_hot) echo "<img src='$새글스킨경로/$스킨/images/icon_hot.gif' align=absmiddle>";
                            if ($temp[$i]->icon_battle) echo "<img src='$새글스킨경로/$스킨/images/icon_battle.gif' align=absmiddle>";
                            if ($temp[$i]->icon_secret) echo "<img src='$새글스킨경로/$스킨/images/icon_secret.gif' align=absmiddle>";

                  echo "    </td>
                    </tr> ";
          }               
            echo "    </table>
   
              </td>
        </tr>
        <tr>
            <td width=100% height=1 background='$새글스킨경로/images/underline.gif' colspan=4></td>
        </tr>
    </table> ";
   


}
알아 냈습니다. 이유는 간단하군요. 최신글 뽑기 기능을 기존 gblist에서 사용하던것을 그대로 이용하여 스킨을 만드신분것을 저도 이용하다보니
발생한 문제인데요. lib.inc.php 와 스킨파일 둘중에 하나가 문제인데요
머 복잡한 내용은 필요없고 무엇을 고쳐야 하느냐면요

스킨파일을 포기하시고 직접 echo되도록 하세요. 그럼 해결됩니다.
userlib.inc.php 에 for문을 돌려서 최신글아이콘과 배틀아이콘등을 출력하도록 하는 부분있조? 그부분에
직접 스킨부분에서 출력하는부분을 따다 넣으세요.그리고 스킨링크 걸어놓는부분을 막아 놓으시구요.

전 그렇게 해결했습니다. 그럼..좀더 궁금한건 리플 달아주세요
전체 9,564
그누3질답 내용 검색

회원로그인

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