
위와같이 중간에 등록하거나 수정을하면 상단에 배치되는데요
20150101
20150102
20150103
중간에 등록하든 상관없이
요로케 날짜별로 정렬되게 하는 법 없을까요?
오름차순이면 더 좋구요~~
Copy
<??><table width=100% cellpadding=0 cellspacing=0><? for ($i=0; $i<count($list); $i++) { ?><tr> <td colspan=4 align=center> <table width=280> <tr> <td height=20 align="left"><img src="http://jjcy.or.kr/skin/latest/bara_latest/img/latest_icon.gif"> <? $date = substr($list[$i]['link'][1], 7); echo $date; ?> <? echo $list[$i]['icon_reply'] . " "; echo "<a href='{$list[$i]['href']}'>"; if ($list[$i]['is_notice']) echo "<font style='font-family:돋움; font-size:10pt; color:#2C88B9;'><strong>{$list[$i]['subject']}</strong></font>"; else echo "<font style='font-family:돋움; font-size:10pt; color:#6A6A6A;'>{$list[$i]['subject']}</font>"; echo "</a>"; ?> </td></tr> </table></td></tr> <tr><td height='1' colspan='2' background='<?=$g4[path]?>/2014_index/line.gif'></td></tr><? } ?><? if (count($list) == 0) { ?><tr align=left><td colspan=4 align=center height=50><font color=#6A6A6A>게시물이 없습니다.</a></td></tr><? } ?></table>
답변 1개 / 댓글 8개
채택된 답변
+20 포인트
$list를 뽑아오는 쿼리문을 보여주세요 ^^
쿼리문으로 정렬하는거라 쿼리문 뒤의 order by 날짜 desc 하시면 되요~
답변에 대한 댓글 8개
/lib/latest.lib.php 에보니까 아래소스가 있어요
두번째줄 //를 풀고 원래 활성화되어있던 세번째줄 소스를 //막으니 ㅋ 사이트가 안떠서 금새 원상태로 바꿨어요 ㅋ
깜놀~
아래 소스가 맞을까요??
[code] $tmp_write_table = $g4['write_prefix'] . $bo_table; // 게시판 테이블 전체이름
//$sql = " select * from $tmp_write_table where wr_is_comment = 0 order by wr_id desc limit 0, $rows ";
// 위의 코드 보다 속도가 빠름
$sql = " select * from $tmp_write_table where wr_is_comment = 0 order by wr_num limit 0, $rows ";
//explain($sql);
$result = sql_query($sql);
for ($i=0; $row = sql_fetch_array($result); $i++)
$list[$i] = get_list($row, $board, $latest_skin_path, $subject_len);
ob_start();
include "$latest_skin_path/latest.skin.php";
$content = ob_get_contents();
ob_end_clean();
return $content;
} [/code]
두번째줄 //를 풀고 원래 활성화되어있던 세번째줄 소스를 //막으니 ㅋ 사이트가 안떠서 금새 원상태로 바꿨어요 ㅋ
깜놀~
아래 소스가 맞을까요??
[code] $tmp_write_table = $g4['write_prefix'] . $bo_table; // 게시판 테이블 전체이름
//$sql = " select * from $tmp_write_table where wr_is_comment = 0 order by wr_id desc limit 0, $rows ";
// 위의 코드 보다 속도가 빠름
$sql = " select * from $tmp_write_table where wr_is_comment = 0 order by wr_num limit 0, $rows ";
//explain($sql);
$result = sql_query($sql);
for ($i=0; $row = sql_fetch_array($result); $i++)
$list[$i] = get_list($row, $board, $latest_skin_path, $subject_len);
ob_start();
include "$latest_skin_path/latest.skin.php";
$content = ob_get_contents();
ob_end_clean();
return $content;
} [/code]
답변을 작성하려면 로그인이 필요합니다.
어느파일을 찾아봐야할런지요 (^-^*)a 으흐흐