게시판 메뉴 자동생성에 관해서입니다. 정보
게시판 메뉴 자동생성에 관해서입니다.
본문
<table border="0" cellpadding="0" cellspacing="1" bgcolor="#000000">
<tr><td bgcolor="373737">
<table width="170" border="0" cellspacing="5" cellpadding="0">
<tr align="center" valign="top">
<td>
<table style="border:2px solid #FF0000;" width="160" cellpadding="0" cellspacing="5" align="center" valign="top">
<tr>
<td>
<table width="100%" border="1" cellpadding="0" cellspacing="1" bgcolor="#222222" bordercolordark="#222222" bordercolorlight="#222222">
<? // 메뉴 자동생성
$intime = date("Y-m-d H:i:s", time() - (int)(60 * 60 * 24));
// 오늘을 불러옵니다.
//아래는 community 부분이 그룹명입니다.
$sql = " select bo_table, bo_subject from $g4[board_table] where gr_id = 'community' ";
$result = sql_query($sql);
for ($i=0; $row=sql_fetch_array($result); $i++) {
<tr><td bgcolor="373737">
<table width="170" border="0" cellspacing="5" cellpadding="0">
<tr align="center" valign="top">
<td>
<table style="border:2px solid #FF0000;" width="160" cellpadding="0" cellspacing="5" align="center" valign="top">
<tr>
<td>
<table width="100%" border="1" cellpadding="0" cellspacing="1" bgcolor="#222222" bordercolordark="#222222" bordercolorlight="#222222">
<? // 메뉴 자동생성
$intime = date("Y-m-d H:i:s", time() - (int)(60 * 60 * 24));
// 오늘을 불러옵니다.
//아래는 community 부분이 그룹명입니다.
$sql = " select bo_table, bo_subject from $g4[board_table] where gr_id = 'community' ";
$result = sql_query($sql);
for ($i=0; $row=sql_fetch_array($result); $i++) {
//여기까지는 g4에서 그룹별로 게시판 제목을 불러오는 것입니다.
$tmp_write_table = $g4[write_prefix] . $row[bo_table];
// 여기는 새글표시를 위해 해당 게시판의 테이블명을 불러옵니다.
$tmp_write_table = $g4[write_prefix] . $row[bo_table];
// 여기는 새글표시를 위해 해당 게시판의 테이블명을 불러옵니다.
$sql2 = " select wr_datetime from $tmp_write_table where wr_datetime >= '$intime'";
// 여기는 오늘과 글쓴 날짜를 비교합니다.
// 여기는 오늘과 글쓴 날짜를 비교합니다.
$result2 = sql_query($sql2);
$total_count = mysql_num_rows($result2);
// 새로운 글이 몇개 있는지 확인합니다.
if ($total_count > 0) { echo "<tr><td height='47' bgcolor='#333333' bordercolordark='#797979' bordercolorlight='black' style='padding-left:15px;' class='left_menu'><a href='$g4[bbs_path]/board.php?bo_table=$row[bo_table]'>$row[bo_subject]</a> [$total_count]</td></tr>";}
//새로운 글이 있을 경우 게시판제목과 갯수, new아이콘을 붙여줍니다. 이때 <b></b>태그를 적용해도 됩니다만, 저의 홈에서는 문제가 있어서 그냥 표시합니다.
//변수지정을 해주면 if/else 문을 사용치 않아도 됩니다.
$total_count = mysql_num_rows($result2);
// 새로운 글이 몇개 있는지 확인합니다.
if ($total_count > 0) { echo "<tr><td height='47' bgcolor='#333333' bordercolordark='#797979' bordercolorlight='black' style='padding-left:15px;' class='left_menu'><a href='$g4[bbs_path]/board.php?bo_table=$row[bo_table]'>$row[bo_subject]</a> [$total_count]</td></tr>";}
//새로운 글이 있을 경우 게시판제목과 갯수, new아이콘을 붙여줍니다. 이때 <b></b>태그를 적용해도 됩니다만, 저의 홈에서는 문제가 있어서 그냥 표시합니다.
//변수지정을 해주면 if/else 문을 사용치 않아도 됩니다.
else { echo "<tr><td height='47' bgcolor='#333333' bordercolordark='#797979' bordercolorlight='black' style='padding-left:15px;' class='left_menu'><a href='$g4[bbs_path]/board.php?bo_table=$row[bo_table]'>$row[bo_subject]</a></td></tr>"; }
// 새글이 없을 경우 표시방법입니다.
//-- 그룹내 게시판에서 카테고리 선택
$i++;
}
?></table></td>
</tr></table>
</td></tr></table></td></tr></table>
제가 이소스를 쓰는데요
이걸 여분필드를 이용해서 순서를 맟출순 없을까요.
댓글 전체

$sql = " select bo_table, bo_subject from $g4[board_table] where gr_id = 'community' order by bo_1+0 ";

여분필드 bo_1 값에 따라 순서를 뽑아옴.
0
1
2
3
4
5
이런 형식으로 숫자가 낮으면 최상위.
0
1
2
3
4
5
이런 형식으로 숫자가 낮으면 최상위.

앗..정말 감사합니다..(__)