최신글 관련 질문좀 드리겠습니다..
<?
$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질답
| 번호 | 제목 | 글쓴이 | 날짜 | 조회 |
|---|---|---|---|---|
| 9264 | 19년 전 | 2540 | ||
| 9263 | 19년 전 | 2189 | ||
| 9262 | 19년 전 | 2224 | ||
| 9261 | 19년 전 | 2222 | ||
| 9260 | 19년 전 | 2734 | ||
| 9259 | 19년 전 | 2899 | ||
| 9258 |
porgy
|
19년 전 | 2098 | |
| 9257 | 19년 전 | 1974 | ||
| 9256 |
진짜사나이
|
19년 전 | 2330 | |
| 9255 |
4ever2u
|
19년 전 | 2142 | |
| 9254 | 19년 전 | 2063 | ||
| 9253 | 19년 전 | 2113 | ||
| 9252 | 19년 전 | 2287 | ||
| 9251 | 19년 전 | 2843 | ||
| 9250 | 19년 전 | 2353 | ||
| 9249 | 19년 전 | 2812 | ||
| 9248 |
4ever2u
|
19년 전 | 2476 | |
| 9247 | 19년 전 | 1931 | ||
| 9246 | 19년 전 | 1893 | ||
| 9245 | 19년 전 | 2729 |
댓글 작성
댓글을 작성하시려면 로그인이 필요합니다.
로그인하기