게시물 복사/이동시 날짜 순으로 들어가게 할 수 없을까요? 정보
게시물 복사/이동시 날짜 순으로 들어가게 할 수 없을까요?본문
오래된 게시물을 복사하면 그 게시물이 전부다 최근글 인것처럼 올라가 버리는데요 (날짜는 옛날이지만)
두 게시판을 합치려고 하는데.. 게시물 날짜순으로 정리되게 합치는 기능은 없나요?
한쪽 게시판이 게시물량이 많이 적어서 그냥 이동시켜 버리면 되는데.. 제일 위로 가버려서요.
두 게시판을 합치려고 하는데.. 게시물 날짜순으로 정리되게 합치는 기능은 없나요?
한쪽 게시판이 게시물량이 많이 적어서 그냥 이동시켜 버리면 되는데.. 제일 위로 가버려서요.
댓글 전체
게시판 관리에서 게시물 정렬을 날짜순으로 해주시면 될껍니다.
<?
// sort
if ($fadmin =='sort') {
$write_table = $g4[write_prefix].$bo_table;
$data = array();
$sql = "select wr_id, wr_num from {$write_table} where wr_is_comment=0 and wr_reply='' order by wr_datetime";
$qry = sql_query($sql);
while ($row = sql_fetch_array($qry)) $data[] = $row;
sql_query("update {$write_table} set wr_num = wr_num * -1");
$wr_num = 0;
foreach ($data as $row)
{
$wr_num--;
$row[wr_num] *= -1;
$sql = "update {$write_table} set wr_num = '{$wr_num}' where wr_num = '{$row[wr_num]}'";
//echo "$sql<br />";
sql_query($sql);
}
echo "Has been completed";
}
?>
<input type='button' value='날짜정렬' onclick="document.location.href='<?php echo $g4['bbs_path'];?>/board.php?bo_table=<?php echo $bo_table?>&fadmin=sort';" class='bt01'>
사용하는 스킨의 list.skin.php 상단에 넣은후 버튼을 눌러보세요..
// sort
if ($fadmin =='sort') {
$write_table = $g4[write_prefix].$bo_table;
$data = array();
$sql = "select wr_id, wr_num from {$write_table} where wr_is_comment=0 and wr_reply='' order by wr_datetime";
$qry = sql_query($sql);
while ($row = sql_fetch_array($qry)) $data[] = $row;
sql_query("update {$write_table} set wr_num = wr_num * -1");
$wr_num = 0;
foreach ($data as $row)
{
$wr_num--;
$row[wr_num] *= -1;
$sql = "update {$write_table} set wr_num = '{$wr_num}' where wr_num = '{$row[wr_num]}'";
//echo "$sql<br />";
sql_query($sql);
}
echo "Has been completed";
}
?>
<input type='button' value='날짜정렬' onclick="document.location.href='<?php echo $g4['bbs_path'];?>/board.php?bo_table=<?php echo $bo_table?>&fadmin=sort';" class='bt01'>
사용하는 스킨의 list.skin.php 상단에 넣은후 버튼을 눌러보세요..
아예 게시물 번호부터 날짜순으로 재배열 하게 하려면 많이 복잡해 질까요
게시물이동후 날짜정렬