최신글 관련 질문좀 드리겠습니다..
<?
$mod = 6; // 한행당 몇개씩?
$image_width = 93; // 이미지 폭
$image_height = 80; // 이미지 높이
?>
$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>
<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개
19년 전
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 이런식으로 추가하시면되죠..
$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 이런식으로 추가하시면되죠..
skypic
19년 전
앗..감사합니다...잘 되네요....
조언 너무 감사드립니다..
조언 너무 감사드립니다..
게시판 목록
그누3질답
| 번호 | 제목 | 글쓴이 | 날짜 | 조회 |
|---|---|---|---|---|
| 공지 | 15년 전 | 7787 | ||
| 9343 |
xinbus
|
19년 전 | 3713 | |
| 9342 | 19년 전 | 3759 | ||
| 9341 | 19년 전 | 3685 | ||
| 9340 | 19년 전 | 3162 | ||
| 9339 |
4ever2u
|
19년 전 | 3228 | |
| 9338 | 19년 전 | 3508 | ||
| 9337 |
4ever2u
|
19년 전 | 3162 | |
| 9336 |
|
19년 전 | 3059 | |
| 9335 |
xinbus
|
19년 전 | 2970 | |
| 9334 | 19년 전 | 3298 | ||
| 9333 | 19년 전 | 2261 | ||
| 9332 | 19년 전 | 2202 | ||
| 9331 | 19년 전 | 2096 | ||
| 9330 | 19년 전 | 2682 | ||
| 9329 |
|
19년 전 | 2334 | |
| 9328 | 19년 전 | 2197 | ||
| 9327 |
cubrid
|
19년 전 | 2816 | |
| 9326 | 19년 전 | 1973 | ||
| 9325 | 19년 전 | 2043 | ||
| 9324 | 19년 전 | 2907 |
댓글 작성
댓글을 작성하시려면 로그인이 필요합니다.
로그인하기