s

최신글 관련 질문좀 드리겠습니다..

· 2006-07-07 (금) 20:25:09 · 2455 · 2
 <?
$mod = 6;   // 한행당 몇개씩?
$image_width  = 93; // 이미지 폭
$image_height = 80; // 이미지 높이
?>
<table width=277 cellpadding=0 cellspacing=1>
  <tr>
    <td colspan=2>
 
 </td>
  </tr>
  <tr>
    <? for ($i=0; $i<count($list); $i++) { ?>
    <?
    if (!file_exists($list[$i][file_image1])) { $list[$i][file_image1] = "$latest_skin/noimage.gif"; }
    if ($i>0 && $i%$mod==0) { echo "</tr><tr>"; }
    ?>
    <td valign=top align=center> <table cellpadding=3 border=0>
        <tr>
          <td align=center><table width="100%"  border="0" cellpadding="4" cellspacing="1" bgcolor="#CCCCCC">
            <tr>
              <td bgcolor="#FFFFFF"><div align="center"><a href='<?=$list[$i][href]?>' target="_top"><img src='<?=$list[$i][file_image1]?>' width='<?=$image_width?>' height='<?=$image_height?>' border=1 alt='<?=$list[$i][wr_subject]?>' style='border-color:#CCCCCC;'></a></div></td>
            </tr>
          </table></td>
        </tr>
      
      </table></td>
    <? } ?>
    <?
// td(열)의 나머지 갯수를 구한후 빈 td(열)을 출력한다.
$nam = ($i%$mod);
for ($k=$nam; $k<$mod && $nam; $k++) {
    echo "<td> </td>";
}
?>
    <? if (count($list) == 0) { echo "<td colspan=$mod align=center>게시물이 없습니다.</td>"; } ?>
  </tr>
</table>
 
 
 
 
최신글 관련 스킨 소스인데요...
 
최신글이 새로 게시판에 올리는게 위에 나오는데요...
 
거꾸로 나오게도 할 수 있을까요? 그러니깐 첨에 올린게 최신글 첫번째로...
 
즉 최신글이 그냥 고정되는거죠....뒤에 올릴수로 그냥 그 밑에 나오게 되는 식으로요..
 
여기서 고치는게 아니라 다른 곳에서 하는거면 말씀좀 부탁드리겠습니다.
|

댓글 2개

lib/latest.lib.php

$sql = " select *
from {$cfg[write_table_prefix]}{$bo_table}
where wr_comment = 0 and wr_reply <> 'A'
order by wr_id desc limit 0, $rows ";
$result = sql_query($sql);

이런문이 있습니다. 이게 쿼리해오는 문이죠..

desc 혹은 asc 이런식으로

order by 필드이름 desc 이런식으로 추가하시면되죠..
앗..감사합니다...잘 되네요....

조언 너무 감사드립니다..
댓글을 작성하시려면 로그인이 필요합니다.

그누3질답

9,564건
+
제목 글쓴이 날짜 조회
06-08-08 조회 2,503
06-08-06 조회 2,876
06-08-04 조회 2,345
06-08-03 조회 3,038
06-08-02 조회 2,402
06-08-02 조회 2,359
06-07-31 조회 2,465
06-07-31 조회 2,774
06-07-26 조회 2,103
06-07-25 조회 2,370
06-07-23 조회 3,474
06-07-21 조회 2,688
06-07-19 조회 3,280
06-07-19 조회 2,484
06-07-18 조회 3,672
06-07-15 조회 2,644
06-07-13 조회 2,750
06-07-12 조회 2,465
06-07-10 조회 2,673
06-07-07 조회 2,456