리스트 중간에 새로운 게시물을 넣을수 있을까요??? 정보
리스트 중간에 새로운 게시물을 넣을수 있을까요???본문
정상적인 방법이 아니더라도..
DB에 직접 접근해서라도... 새로운 게시물을 리스트 중간에(원하는 위치에) 끼워 넣을 수 있을까요???
혹시 이런거 아시는분??
댓글 전체
대부분의 리스트는 반복문으로 출력되죠
대략 이정도의 소스를 응용하시면 될듯 하기도 합니다.
if ($i == 4) { print "출력할 내용"; }
라인이 출력되는 for문에 이처럼 소스를 넣어주시면
$i++ 의 값이 증감하다가 일치된 순간 출력돼도록 할것입니다.
더욱 자세한 소스를 알고 싶으시면 리스트 부분의 소스를 올려주세요
현재 제가 소스를 열어 확인하기엔 어려운 상황입니다.
대략 이정도의 소스를 응용하시면 될듯 하기도 합니다.
if ($i == 4) { print "출력할 내용"; }
라인이 출력되는 for문에 이처럼 소스를 넣어주시면
$i++ 의 값이 증감하다가 일치된 순간 출력돼도록 할것입니다.
더욱 자세한 소스를 알고 싶으시면 리스트 부분의 소스를 올려주세요
현재 제가 소스를 열어 확인하기엔 어려운 상황입니다.
일반리스트와 크게 차이는 없습니다.
"출력할 내용" 부분이 남감하네요~ ^^;;
---------------------------------------------------------------------------------------
<? for ($i=0; $i<count($list); $i++) { ?>
<tr>
<? if ($is_category) { ?>
<td height="29" style="padding-left:12"><a href="<?=$list[$i][ca_name_href]?>"><font color=gray><?=$list[$i][ca_name]?></font></a>
<? if ($list[$i][wr_10]) { ?> <a href="<?=$list[$i][ca_name_href]?>&sfl=wr_10&stx=<?=$list[$i][wr_10]?>&nca=<?=$list[$i][wr_10]?>"><font color=gray><?=$list[$i][wr_10]?></font></a><? } ?> <?=$list[$i][wr_3]?>호</td>
<? } ?>
<? if ($is_checkbox) { ?><td align="center"><input type=checkbox name=chk_wr_id[] value="<?=$list[$i][wr_id]?>"></td><? } ?>
<td align=left style='word-break:break-all; padding:3 3 3 6'>
<?
echo $nobr_begin;
echo $list[$i][reply];
echo $list[$i][icon_reply];
if ($list[$i][is_notice])
echo "<font color='#2C8CB9'><strong>{$list[$i][subject]}</strong></font>";
else
echo "<b><font color=00000>{$list[$i][subject]}</font></b>";
//if ($list[$i][comment_cnt])
// echo " <a href=\"{$list[$i][comment_href]}\"><span style='font-size:7pt;'>{$list[$i][comment_cnt]}</span></a>";
// if ($list[$i]['link']['count']) { echo "[{$list[$i]['link']['count']}]"; }
// if ($list[$i]['file']['count']) { echo "<{$list[$i]['file']['count']}>"; }
//echo " " . $list[$i][icon_new];
//echo " " . $list[$i][icon_file];
//echo " " . $list[$i][icon_hot];
//echo " " . $list[$i][icon_secret];
echo $nobr_end;
?>
<a href='#' onClick="window.open('<?=$list[$i][wr_link1]?>', '', 'left=154, top=93, width=860, height=531, scrollbars=0')"><?=$list[$i][icon_link]?></a>
<? if ($write_href) { echo "<a href='{$write_href}&w=u&wr_id={$list[$i][wr_id]}'><img src='$board_skin_path/img/icon_modify.gif' border=0 align=absmiddle></a> "; } ?>
</td>
<td style="padding-left:6" class="small"><?=$list[$i][content]?></td>
<td style="padding-left:6" class="small"><?=$list[$i][wr_1]?></td>
<? if ($is_good) { ?><td align="center"><?=$list[$i][wr_good]?></td><? } ?>
<? if ($is_nogood) { ?><td align="center"><?=$list[$i][wr_nogood]?></td><? } ?>
</tr>
<tr><td colspan=<?=$colspan?> height=1 bgcolor=#d3d3d3></td></tr>
<?}?>
"출력할 내용" 부분이 남감하네요~ ^^;;
---------------------------------------------------------------------------------------
<? for ($i=0; $i<count($list); $i++) { ?>
<tr>
<? if ($is_category) { ?>
<td height="29" style="padding-left:12"><a href="<?=$list[$i][ca_name_href]?>"><font color=gray><?=$list[$i][ca_name]?></font></a>
<? if ($list[$i][wr_10]) { ?> <a href="<?=$list[$i][ca_name_href]?>&sfl=wr_10&stx=<?=$list[$i][wr_10]?>&nca=<?=$list[$i][wr_10]?>"><font color=gray><?=$list[$i][wr_10]?></font></a><? } ?> <?=$list[$i][wr_3]?>호</td>
<? } ?>
<? if ($is_checkbox) { ?><td align="center"><input type=checkbox name=chk_wr_id[] value="<?=$list[$i][wr_id]?>"></td><? } ?>
<td align=left style='word-break:break-all; padding:3 3 3 6'>
<?
echo $nobr_begin;
echo $list[$i][reply];
echo $list[$i][icon_reply];
if ($list[$i][is_notice])
echo "<font color='#2C8CB9'><strong>{$list[$i][subject]}</strong></font>";
else
echo "<b><font color=00000>{$list[$i][subject]}</font></b>";
//if ($list[$i][comment_cnt])
// echo " <a href=\"{$list[$i][comment_href]}\"><span style='font-size:7pt;'>{$list[$i][comment_cnt]}</span></a>";
// if ($list[$i]['link']['count']) { echo "[{$list[$i]['link']['count']}]"; }
// if ($list[$i]['file']['count']) { echo "<{$list[$i]['file']['count']}>"; }
//echo " " . $list[$i][icon_new];
//echo " " . $list[$i][icon_file];
//echo " " . $list[$i][icon_hot];
//echo " " . $list[$i][icon_secret];
echo $nobr_end;
?>
<a href='#' onClick="window.open('<?=$list[$i][wr_link1]?>', '', 'left=154, top=93, width=860, height=531, scrollbars=0')"><?=$list[$i][icon_link]?></a>
<? if ($write_href) { echo "<a href='{$write_href}&w=u&wr_id={$list[$i][wr_id]}'><img src='$board_skin_path/img/icon_modify.gif' border=0 align=absmiddle></a> "; } ?>
</td>
<td style="padding-left:6" class="small"><?=$list[$i][content]?></td>
<td style="padding-left:6" class="small"><?=$list[$i][wr_1]?></td>
<? if ($is_good) { ?><td align="center"><?=$list[$i][wr_good]?></td><? } ?>
<? if ($is_nogood) { ?><td align="center"><?=$list[$i][wr_nogood]?></td><? } ?>
</tr>
<tr><td colspan=<?=$colspan?> height=1 bgcolor=#d3d3d3></td></tr>
<?}?>
$numbersss = "300";//출력될 번호의 위치를 지정합니다.
//$list[$i][num]이것이 게시물 번호일것으로 추측됩니다.
if ($numbersss == $list[$i][num]) {//변수로 지정한 번호와 게시물 번호가 일치하다면
print "{$list[0][subject]}";//게시물의 첫번째 항목을 출력합니다.
//$list[$i][subject]이것은 제목일 것으로 추측됩니다.
}
이것은 제 나름대로 예상하여 내놓은 해결책입니다.
다소 틀릴 수도 있습니다.
php보다는 perl에 더욱 익숙하기에 이해못할 부분도 일부 있었겠지만,
예상(변수들의 위치등)이 맞다면 확실할겁니다.
위의 소스는 게시물 출력부분에 끼워놓으시면 됩니다.
더 완성된 것을 원하신다면 소스의 전체적인 부분또는 게시물 리스트의 스킨전체가 필요할것 같습니다.
//$list[$i][num]이것이 게시물 번호일것으로 추측됩니다.
if ($numbersss == $list[$i][num]) {//변수로 지정한 번호와 게시물 번호가 일치하다면
print "{$list[0][subject]}";//게시물의 첫번째 항목을 출력합니다.
//$list[$i][subject]이것은 제목일 것으로 추측됩니다.
}
이것은 제 나름대로 예상하여 내놓은 해결책입니다.
다소 틀릴 수도 있습니다.
php보다는 perl에 더욱 익숙하기에 이해못할 부분도 일부 있었겠지만,
예상(변수들의 위치등)이 맞다면 확실할겁니다.
위의 소스는 게시물 출력부분에 끼워놓으시면 됩니다.
더 완성된 것을 원하신다면 소스의 전체적인 부분또는 게시물 리스트의 스킨전체가 필요할것 같습니다.
혹시 게시물이 아닌 게시판(table) 전체를 삽입하고 싶으시다면
의견을 달아주세요.
이 문제라면 더욱 간단히 해결될것 같습니다.
의견을 달아주세요.
이 문제라면 더욱 간단히 해결될것 같습니다.
답변 감사합니다.
파일을 첨부하려고 했는데 게시물 수정을 할 수가 없네요.
list.skin.php 스킨 소스 전체를 올립니다.
예를들어 새롭게 올라오는 글이 150번 글이라면
이글이 51번에 위치하게 하려고 합니다.(일반 리스트와 같은 형식으로..)
또 1개뿐만이 아니라 여러개가 될것 같기도 하구요.
150→51, 160→61, 170→71... 뭐 이런식으로 입니다.
설명해주신 글이 좀 어렵네요. 잘 모르다 보니까.. ^^;
===========================================
<?
if (!defined("_GNUBOARD_")) exit; // 개별 페이지 접근 불가
include_once "$board_skin_path/skin.lib.php";
// 선택옵션으로 인해 셀합치기가 가변적으로 변함
$colspan = 5;
if ($is_category) $colspan++;
if ($is_checkbox) $colspan++;
if ($is_good) $colspan++;
if ($is_nogood) $colspan++;
if ($is_category) {
$nc_category_location = "./board.php?bo_table=$bo_table&sca=$sca&sfl=wr_10&stx=";
$nc_category_option = get_nc_category_option($bo_table, $sca);
}
// 제목이 두줄로 표시되는 경우 이 코드를 사용해 보세요.
// <nobr style='display:block; overflow:hidden; width:000px;'>제목</nobr>
?>
<!-- 게시판 목록 시작 -->
<table width="<?=$width?>" align=center cellpadding=0 cellspacing=0><tr><td>
<!-- 분류 셀렉트 박스, 게시물 몇건, 관리자화면 링크 -->
<table width="100%" cellspacing="0" cellpadding="0">
<tr height="25">
<? if ($is_category) { ?>
<form name="fcategory" method="get">
<td width="50%">
<select name=sca onchange="location='<?=$category_location?>'+this.value;">
<option value=''>전체</option>
<?=$category_option?>
</select>
<? if ($sca) { ?>
<select name=nca onchange="location='<?=$nc_category_location?>'+this.value+'&nca='+this.value;">
<option value=''>전체</option>
<?=$nc_category_option?>
</select>
<? } ?>
<? if ($admin_href) { ?><a href="<?=$admin_href?>" target="_blank"><img src="<?=$board_skin_path?>/img/admin_button.gif" title="관리자" width="63" height="22" border="0" align="absmiddle"></a><? } ?>
</td>
</form>
<? } ?>
<form name=fsearch method=get style="margin:0px;">
<input type=hidden name=bo_table value="<?=$bo_table?>">
<input type=hidden name=sca value="<?=$sca?>">
<td align="right">
<!--게시물 <?=number_format($total_count)?>건 --><a href='<?=$rss_href?>'></a>
<select name=sfl>
<option value='wr_subject'>명칭</option>
<option value='wr_content'>주소</option>
</select><input name=stx maxlength=15 size=10 itemname="검색어" required value="<?=$stx?>"><select name=sop>
<option value=and>and</option>
<option value=or>or</option>
</select>
<input type=image src="<?=$board_skin_path?>/img/search_btn.gif" border=0 align=absmiddle>
</td>
</form>
</tr>
<tr><td height=5></td></tr>
</table>
<?
if ($stx && $nca) {
$stx = "";
$sfl = "";
$sop = "";
}
?>
<!-- 제목 -->
<form name="fboardlist" method="post" style="margin:0px;">
<input type="hidden" name="bo_table" value="<?=$bo_table?>">
<input type="hidden" name="sfl" value="<?=$sfl?>">
<input type="hidden" name="stx" value="<?=$stx?>">
<input type="hidden" name="spt" value="<?=$spt?>">
<input type="hidden" name="page" value="<?=$page?>">
<input type="hidden" name="sw" value="">
<table width=100% cellpadding=0 cellspacing=0>
<tr><td colspan=<?=$colspan?> height=2 bgcolor=#000000></td></tr>
<tr>
<? if ($is_category) { ?><td width=145><img src='<?=$board_skin_path?>/img/title_m_name.gif' border=0 align=absmiddle></td><?}?>
<? if ($is_checkbox) { ?><td width=20 align="center"><INPUT onclick="if (this.checked) all_checked(true); else all_checked(false);" type=checkbox></td><? } ?>
<td><img src='<?=$board_skin_path?>/img/title_name.gif' border="0" align="absmiddle" /></td>
<td width=140><img src='<?=$board_skin_path?>/img/title_add.gif' border="0" align="absmiddle" /></td>
<td width=48><img src='<?=$board_skin_path?>/img/title_keeper.gif' border="0" align="absmiddle" /></td>
<? if ($is_good) { ?><td width=40><?=subject_sort_link('wr_good', $qstr2, 1)?>추천</a></td><?}?>
<? if ($is_nogood) { ?><td width=40><?=subject_sort_link('wr_nogood', $qstr2, 1)?>비추천</a></td><?}?>
</tr>
<tr><td colspan=<?=$colspan?> height=1 bgcolor=#d3d3d3></td>
</tr>
<!-- 목록 -->
<? for ($i=0; $i<count($list); $i++) { ?>
<tr>
<? if ($is_category) { ?>
<td height="29" style="padding-left:12"><a href="<?=$list[$i][ca_name_href]?>"><font color=gray><?=$list[$i][ca_name]?></font></a>
<? if ($list[$i][wr_10]) { ?> <a href="<?=$list[$i][ca_name_href]?>&sfl=wr_10&stx=<?=$list[$i][wr_10]?>&nca=<?=$list[$i][wr_10]?>"><font color=gray><?=$list[$i][wr_10]?></font></a><? } ?> <?=$list[$i][wr_3]?>호</td>
<? } ?>
<? if ($is_checkbox) { ?><td align="center"><input type=checkbox name=chk_wr_id[] value="<?=$list[$i][wr_id]?>"></td><? } ?>
<td align=left style='word-break:break-all; padding:3 3 3 6'>
<?
echo $nobr_begin;
echo $list[$i][reply];
echo $list[$i][icon_reply];
if ($list[$i][is_notice])
echo "<font color='#2C8CB9'><strong>{$list[$i][subject]}</strong></font>";
else
echo "<b><font color=00000>{$list[$i][subject]}</font></b>";
//if ($list[$i][comment_cnt])
// echo " <a href=\"{$list[$i][comment_href]}\"><span style='font-size:7pt;'>{$list[$i][comment_cnt]}</span></a>";
// if ($list[$i]['link']['count']) { echo "[{$list[$i]['link']['count']}]"; }
// if ($list[$i]['file']['count']) { echo "<{$list[$i]['file']['count']}>"; }
//echo " " . $list[$i][icon_new];
//echo " " . $list[$i][icon_file];
//echo " " . $list[$i][icon_hot];
//echo " " . $list[$i][icon_secret];
echo $nobr_end;
?>
<a href='#' onClick="window.open('<?=$list[$i][wr_link1]?>', '', 'left=154, top=93, width=860, height=531, scrollbars=0')"><?=$list[$i][icon_link]?></a>
<? if ($write_href) { echo "<a href='{$write_href}&w=u&wr_id={$list[$i][wr_id]}'><img src='$board_skin_path/img/icon_modify.gif' border=0 align=absmiddle></a> "; } ?>
</td>
<td style="padding-left:6" class="small"><?=$list[$i][content]?></td>
<td style="padding-left:6" class="small"><?=$list[$i][wr_1]?></td>
<? if ($is_good) { ?><td align="center"><?=$list[$i][wr_good]?></td><? } ?>
<? if ($is_nogood) { ?><td align="center"><?=$list[$i][wr_nogood]?></td><? } ?>
</tr>
<tr><td colspan=<?=$colspan?> height=1 bgcolor=#d3d3d3></td></tr>
<?}?>
<? if (count($list) == 0) { echo "<tr><td colspan='$colspan' height=100 align=center>게시물이 없습니다.</td></tr>"; } ?>
<tr><td colspan=<?=$colspan?> bgcolor=#d3d3d3 height=1>
</table>
</form>
<!-- 페이지 -->
<table width="100%" cellspacing="0" cellpadding="0">
<tr>
<td width="100%" align="center" height=30 valign=bottom>
<? if ($prev_part_href) { echo "<a href='$prev_part_href'><img src='$board_skin_path/img/btn_search_prev.gif' width=50 height=20 border=0 align=absmiddle title='이전검색'></a>"; } ?>
<?
// 기본으로 넘어오는 페이지를 아래와 같이 변환하여 이미지로도 출력할 수 있습니다.
//echo $write_pages;
$write_pages = str_replace("처음", "<img src='$board_skin_path/img/begin.gif' border='0' align='absmiddle' title='처음'>", $write_pages);
$write_pages = str_replace("이전", "<img src='$board_skin_path/img/prev.gif' border='0' align='absmiddle' title='이전'>", $write_pages);
$write_pages = str_replace("다음", "<img src='$board_skin_path/img/next.gif' border='0' align='absmiddle' title='다음'>", $write_pages);
$write_pages = str_replace("맨끝", "<img src='$board_skin_path/img/end.gif' border='0' align='absmiddle' title='맨끝'>", $write_pages);
$write_pages = preg_replace("/<span>([0-9]*)<\/span>/", "<b><font style=\"font-family:돋움; font-size:9pt; color:#797979\">$1</font></b>", $write_pages);
$write_pages = preg_replace("/<b>([0-9]*)<\/b>/", "<b><font style=\"font-family:돋움; font-size:9pt; color:orange;\">$1</font></b>", $write_pages);
?>
<?=$write_pages?>
<? if ($next_part_href) { echo "<a href='$next_part_href'><img src='$board_skin_path/img/btn_search_next.gif' width=50 height=20 border=0 align=absmiddle title='다음검색'></a>"; } ?>
</td>
</tr>
</table>
<!-- 버튼 링크 -->
<table width=100% cellpadding=0 cellspacing=0>
<tr>
<td width="50%" height="40">
<? if ($list_href) { ?><a href="<?=$list_href?>"><img src="<?=$board_skin_path?>/img/btn_list.gif" border="0"></a><? } ?>
<? if ($write_href) { ?><a href="<?=$write_href?>"><img src="<?=$board_skin_path?>/img/btn_write.gif" border="0"></a><? } ?>
<? if ($is_checkbox) { ?>
<a href="javascript:select_delete();"><img src="<?=$board_skin_path?>/img/btn_select_delete.gif" border="0"></a>
<a href="javascript:select_copy('copy');"><img src="<?=$board_skin_path?>/img/btn_select_copy.gif" border="0"></a>
<a href="javascript:select_copy('move');"><img src="<?=$board_skin_path?>/img/btn_select_move.gif" border="0"></a>
<? } ?>
</td>
<td width="50%" align="right"> </td>
</tr>
</table>
</td></tr></table>
<script language="JavaScript">
if ("<?=$sca?>") document.fcategory.sca.value = "<?=$sca?>";
if ("<?=$nca?>") document.fcategory.nca.value = "<?=$nca?>";
if ("<?=$stx?>") {
document.fsearch.sfl.value = "<?=$sfl?>";
document.fsearch.sop.value = "<?=$sop?>";
}
</script>
<? if ($is_checkbox) { ?>
<script language="JavaScript">
function all_checked(sw)
{
var f = document.fboardlist;
for (var i=0; i<f.length; i++) {
if (f.elements[i].name == "chk_wr_id[]")
f.elements[i].checked = sw;
}
}
function check_confirm(str)
{
var f = document.fboardlist;
var chk_count = 0;
for (var i=0; i<f.length; i++) {
if (f.elements[i].name == "chk_wr_id[]" && f.elements[i].checked)
chk_count++;
}
if (!chk_count) {
alert(str + "할 게시물을 하나 이상 선택하세요.");
return false;
}
return true;
}
// 선택한 게시물 삭제
function select_delete()
{
var f = document.fboardlist;
str = "삭제";
if (!check_confirm(str))
return;
if (!confirm("선택한 게시물을 정말 "+str+" 하시겠습니까?\n\n한번 "+str+"한 자료는 복구할 수 없습니다"))
return;
f.action = "./delete_all.php";
f.submit();
}
// 선택한 게시물 복사 및 이동
function select_copy(sw)
{
var f = document.fboardlist;
if (sw == "copy")
str = "복사";
else
str = "이동";
if (!check_confirm(str))
return;
var sub_win = window.open("", "move", "left=50, top=50, width=396, height=550, scrollbars=1");
f.sw.value = sw;
f.target = "move";
f.action = "./move.php";
f.submit();
}
</script>
<? } ?>
<!-- 게시판 목록 끝 -->
파일을 첨부하려고 했는데 게시물 수정을 할 수가 없네요.
list.skin.php 스킨 소스 전체를 올립니다.
예를들어 새롭게 올라오는 글이 150번 글이라면
이글이 51번에 위치하게 하려고 합니다.(일반 리스트와 같은 형식으로..)
또 1개뿐만이 아니라 여러개가 될것 같기도 하구요.
150→51, 160→61, 170→71... 뭐 이런식으로 입니다.
설명해주신 글이 좀 어렵네요. 잘 모르다 보니까.. ^^;
===========================================
<?
if (!defined("_GNUBOARD_")) exit; // 개별 페이지 접근 불가
include_once "$board_skin_path/skin.lib.php";
// 선택옵션으로 인해 셀합치기가 가변적으로 변함
$colspan = 5;
if ($is_category) $colspan++;
if ($is_checkbox) $colspan++;
if ($is_good) $colspan++;
if ($is_nogood) $colspan++;
if ($is_category) {
$nc_category_location = "./board.php?bo_table=$bo_table&sca=$sca&sfl=wr_10&stx=";
$nc_category_option = get_nc_category_option($bo_table, $sca);
}
// 제목이 두줄로 표시되는 경우 이 코드를 사용해 보세요.
// <nobr style='display:block; overflow:hidden; width:000px;'>제목</nobr>
?>
<!-- 게시판 목록 시작 -->
<table width="<?=$width?>" align=center cellpadding=0 cellspacing=0><tr><td>
<!-- 분류 셀렉트 박스, 게시물 몇건, 관리자화면 링크 -->
<table width="100%" cellspacing="0" cellpadding="0">
<tr height="25">
<? if ($is_category) { ?>
<form name="fcategory" method="get">
<td width="50%">
<select name=sca onchange="location='<?=$category_location?>'+this.value;">
<option value=''>전체</option>
<?=$category_option?>
</select>
<? if ($sca) { ?>
<select name=nca onchange="location='<?=$nc_category_location?>'+this.value+'&nca='+this.value;">
<option value=''>전체</option>
<?=$nc_category_option?>
</select>
<? } ?>
<? if ($admin_href) { ?><a href="<?=$admin_href?>" target="_blank"><img src="<?=$board_skin_path?>/img/admin_button.gif" title="관리자" width="63" height="22" border="0" align="absmiddle"></a><? } ?>
</td>
</form>
<? } ?>
<form name=fsearch method=get style="margin:0px;">
<input type=hidden name=bo_table value="<?=$bo_table?>">
<input type=hidden name=sca value="<?=$sca?>">
<td align="right">
<!--게시물 <?=number_format($total_count)?>건 --><a href='<?=$rss_href?>'></a>
<select name=sfl>
<option value='wr_subject'>명칭</option>
<option value='wr_content'>주소</option>
</select><input name=stx maxlength=15 size=10 itemname="검색어" required value="<?=$stx?>"><select name=sop>
<option value=and>and</option>
<option value=or>or</option>
</select>
<input type=image src="<?=$board_skin_path?>/img/search_btn.gif" border=0 align=absmiddle>
</td>
</form>
</tr>
<tr><td height=5></td></tr>
</table>
<?
if ($stx && $nca) {
$stx = "";
$sfl = "";
$sop = "";
}
?>
<!-- 제목 -->
<form name="fboardlist" method="post" style="margin:0px;">
<input type="hidden" name="bo_table" value="<?=$bo_table?>">
<input type="hidden" name="sfl" value="<?=$sfl?>">
<input type="hidden" name="stx" value="<?=$stx?>">
<input type="hidden" name="spt" value="<?=$spt?>">
<input type="hidden" name="page" value="<?=$page?>">
<input type="hidden" name="sw" value="">
<table width=100% cellpadding=0 cellspacing=0>
<tr><td colspan=<?=$colspan?> height=2 bgcolor=#000000></td></tr>
<tr>
<? if ($is_category) { ?><td width=145><img src='<?=$board_skin_path?>/img/title_m_name.gif' border=0 align=absmiddle></td><?}?>
<? if ($is_checkbox) { ?><td width=20 align="center"><INPUT onclick="if (this.checked) all_checked(true); else all_checked(false);" type=checkbox></td><? } ?>
<td><img src='<?=$board_skin_path?>/img/title_name.gif' border="0" align="absmiddle" /></td>
<td width=140><img src='<?=$board_skin_path?>/img/title_add.gif' border="0" align="absmiddle" /></td>
<td width=48><img src='<?=$board_skin_path?>/img/title_keeper.gif' border="0" align="absmiddle" /></td>
<? if ($is_good) { ?><td width=40><?=subject_sort_link('wr_good', $qstr2, 1)?>추천</a></td><?}?>
<? if ($is_nogood) { ?><td width=40><?=subject_sort_link('wr_nogood', $qstr2, 1)?>비추천</a></td><?}?>
</tr>
<tr><td colspan=<?=$colspan?> height=1 bgcolor=#d3d3d3></td>
</tr>
<!-- 목록 -->
<? for ($i=0; $i<count($list); $i++) { ?>
<tr>
<? if ($is_category) { ?>
<td height="29" style="padding-left:12"><a href="<?=$list[$i][ca_name_href]?>"><font color=gray><?=$list[$i][ca_name]?></font></a>
<? if ($list[$i][wr_10]) { ?> <a href="<?=$list[$i][ca_name_href]?>&sfl=wr_10&stx=<?=$list[$i][wr_10]?>&nca=<?=$list[$i][wr_10]?>"><font color=gray><?=$list[$i][wr_10]?></font></a><? } ?> <?=$list[$i][wr_3]?>호</td>
<? } ?>
<? if ($is_checkbox) { ?><td align="center"><input type=checkbox name=chk_wr_id[] value="<?=$list[$i][wr_id]?>"></td><? } ?>
<td align=left style='word-break:break-all; padding:3 3 3 6'>
<?
echo $nobr_begin;
echo $list[$i][reply];
echo $list[$i][icon_reply];
if ($list[$i][is_notice])
echo "<font color='#2C8CB9'><strong>{$list[$i][subject]}</strong></font>";
else
echo "<b><font color=00000>{$list[$i][subject]}</font></b>";
//if ($list[$i][comment_cnt])
// echo " <a href=\"{$list[$i][comment_href]}\"><span style='font-size:7pt;'>{$list[$i][comment_cnt]}</span></a>";
// if ($list[$i]['link']['count']) { echo "[{$list[$i]['link']['count']}]"; }
// if ($list[$i]['file']['count']) { echo "<{$list[$i]['file']['count']}>"; }
//echo " " . $list[$i][icon_new];
//echo " " . $list[$i][icon_file];
//echo " " . $list[$i][icon_hot];
//echo " " . $list[$i][icon_secret];
echo $nobr_end;
?>
<a href='#' onClick="window.open('<?=$list[$i][wr_link1]?>', '', 'left=154, top=93, width=860, height=531, scrollbars=0')"><?=$list[$i][icon_link]?></a>
<? if ($write_href) { echo "<a href='{$write_href}&w=u&wr_id={$list[$i][wr_id]}'><img src='$board_skin_path/img/icon_modify.gif' border=0 align=absmiddle></a> "; } ?>
</td>
<td style="padding-left:6" class="small"><?=$list[$i][content]?></td>
<td style="padding-left:6" class="small"><?=$list[$i][wr_1]?></td>
<? if ($is_good) { ?><td align="center"><?=$list[$i][wr_good]?></td><? } ?>
<? if ($is_nogood) { ?><td align="center"><?=$list[$i][wr_nogood]?></td><? } ?>
</tr>
<tr><td colspan=<?=$colspan?> height=1 bgcolor=#d3d3d3></td></tr>
<?}?>
<? if (count($list) == 0) { echo "<tr><td colspan='$colspan' height=100 align=center>게시물이 없습니다.</td></tr>"; } ?>
<tr><td colspan=<?=$colspan?> bgcolor=#d3d3d3 height=1>
</table>
</form>
<!-- 페이지 -->
<table width="100%" cellspacing="0" cellpadding="0">
<tr>
<td width="100%" align="center" height=30 valign=bottom>
<? if ($prev_part_href) { echo "<a href='$prev_part_href'><img src='$board_skin_path/img/btn_search_prev.gif' width=50 height=20 border=0 align=absmiddle title='이전검색'></a>"; } ?>
<?
// 기본으로 넘어오는 페이지를 아래와 같이 변환하여 이미지로도 출력할 수 있습니다.
//echo $write_pages;
$write_pages = str_replace("처음", "<img src='$board_skin_path/img/begin.gif' border='0' align='absmiddle' title='처음'>", $write_pages);
$write_pages = str_replace("이전", "<img src='$board_skin_path/img/prev.gif' border='0' align='absmiddle' title='이전'>", $write_pages);
$write_pages = str_replace("다음", "<img src='$board_skin_path/img/next.gif' border='0' align='absmiddle' title='다음'>", $write_pages);
$write_pages = str_replace("맨끝", "<img src='$board_skin_path/img/end.gif' border='0' align='absmiddle' title='맨끝'>", $write_pages);
$write_pages = preg_replace("/<span>([0-9]*)<\/span>/", "<b><font style=\"font-family:돋움; font-size:9pt; color:#797979\">$1</font></b>", $write_pages);
$write_pages = preg_replace("/<b>([0-9]*)<\/b>/", "<b><font style=\"font-family:돋움; font-size:9pt; color:orange;\">$1</font></b>", $write_pages);
?>
<?=$write_pages?>
<? if ($next_part_href) { echo "<a href='$next_part_href'><img src='$board_skin_path/img/btn_search_next.gif' width=50 height=20 border=0 align=absmiddle title='다음검색'></a>"; } ?>
</td>
</tr>
</table>
<!-- 버튼 링크 -->
<table width=100% cellpadding=0 cellspacing=0>
<tr>
<td width="50%" height="40">
<? if ($list_href) { ?><a href="<?=$list_href?>"><img src="<?=$board_skin_path?>/img/btn_list.gif" border="0"></a><? } ?>
<? if ($write_href) { ?><a href="<?=$write_href?>"><img src="<?=$board_skin_path?>/img/btn_write.gif" border="0"></a><? } ?>
<? if ($is_checkbox) { ?>
<a href="javascript:select_delete();"><img src="<?=$board_skin_path?>/img/btn_select_delete.gif" border="0"></a>
<a href="javascript:select_copy('copy');"><img src="<?=$board_skin_path?>/img/btn_select_copy.gif" border="0"></a>
<a href="javascript:select_copy('move');"><img src="<?=$board_skin_path?>/img/btn_select_move.gif" border="0"></a>
<? } ?>
</td>
<td width="50%" align="right"> </td>
</tr>
</table>
</td></tr></table>
<script language="JavaScript">
if ("<?=$sca?>") document.fcategory.sca.value = "<?=$sca?>";
if ("<?=$nca?>") document.fcategory.nca.value = "<?=$nca?>";
if ("<?=$stx?>") {
document.fsearch.sfl.value = "<?=$sfl?>";
document.fsearch.sop.value = "<?=$sop?>";
}
</script>
<? if ($is_checkbox) { ?>
<script language="JavaScript">
function all_checked(sw)
{
var f = document.fboardlist;
for (var i=0; i<f.length; i++) {
if (f.elements[i].name == "chk_wr_id[]")
f.elements[i].checked = sw;
}
}
function check_confirm(str)
{
var f = document.fboardlist;
var chk_count = 0;
for (var i=0; i<f.length; i++) {
if (f.elements[i].name == "chk_wr_id[]" && f.elements[i].checked)
chk_count++;
}
if (!chk_count) {
alert(str + "할 게시물을 하나 이상 선택하세요.");
return false;
}
return true;
}
// 선택한 게시물 삭제
function select_delete()
{
var f = document.fboardlist;
str = "삭제";
if (!check_confirm(str))
return;
if (!confirm("선택한 게시물을 정말 "+str+" 하시겠습니까?\n\n한번 "+str+"한 자료는 복구할 수 없습니다"))
return;
f.action = "./delete_all.php";
f.submit();
}
// 선택한 게시물 복사 및 이동
function select_copy(sw)
{
var f = document.fboardlist;
if (sw == "copy")
str = "복사";
else
str = "이동";
if (!check_confirm(str))
return;
var sub_win = window.open("", "move", "left=50, top=50, width=396, height=550, scrollbars=1");
f.sw.value = sw;
f.target = "move";
f.action = "./move.php";
f.submit();
}
</script>
<? } ?>
<!-- 게시판 목록 끝 -->
일단은 약간 수정해봤습니다.
별로 건드린 부분은 없지만 아래 <!--목록--> 부분에서
주석을 달아놨습니다.
그 부분의 바로 아래$numbersss와 $gi변수의 값을 수정하시면 될것같습니다.
만약 실행시켜보시고 안된다면 다시 말씀해 주세요
######################################################
<?
if (!defined("_GNUBOARD_")) exit; // 개별 페이지 접근 불가
include_once "$board_skin_path/skin.lib.php";
// 선택옵션으로 인해 셀합치기가 가변적으로 변함
$colspan = 5;
if ($is_category) $colspan++;
if ($is_checkbox) $colspan++;
if ($is_good) $colspan++;
if ($is_nogood) $colspan++;
if ($is_category) {
$nc_category_location = "./board.php?bo_table=$bo_table&sca=$sca&sfl=wr_10&stx=";
$nc_category_option = get_nc_category_option($bo_table, $sca);
}
// 제목이 두줄로 표시되는 경우 이 코드를 사용해 보세요.
// <nobr style='display:block; overflow:hidden; width:000px;'>제목</nobr>
?>
<!-- 게시판 목록 시작 -->
<table width="<?=$width?>" align=center cellpadding=0 cellspacing=0><tr><td>
<!-- 분류 셀렉트 박스, 게시물 몇건, 관리자화면 링크 -->
<table width="100%" cellspacing="0" cellpadding="0">
<tr height="25">
<? if ($is_category) { ?>
<form name="fcategory" method="get">
<td width="50%">
<select name=sca onchange="location='<?=$category_location?>'+this.value;">
<option value=''>전체</option>
<?=$category_option?>
</select>
<? if ($sca) { ?>
<select name=nca onchange="location='<?=$nc_category_location?>'+this.value+'&nca='+this.value;">
<option value=''>전체</option>
<?=$nc_category_option?>
</select>
<? } ?>
<? if ($admin_href) { ?><a href="<?=$admin_href?>" target="_blank"><img src="<?=$board_skin_path?>/img/admin_button.gif" title="관리자" width="63" height="22" border="0" align="absmiddle"></a><? } ?>
</td>
</form>
<? } ?>
<form name=fsearch method=get style="margin:0px;">
<input type=hidden name=bo_table value="<?=$bo_table?>">
<input type=hidden name=sca value="<?=$sca?>">
<td align="right">
<!--게시물 <?=number_format($total_count)?>건 --><a href='<?=$rss_href?>'></a>
<select name=sfl>
<option value='wr_subject'>명칭</option>
<option value='wr_content'>주소</option>
</select><input name=stx maxlength=15 size=10 itemname="검색어" required value="<?=$stx?>"><select name=sop>
<option value=and>and</option>
<option value=or>or</option>
</select>
<input type=image src="<?=$board_skin_path?>/img/search_btn.gif" border=0 align=absmiddle>
</td>
</form>
</tr>
<tr><td height=5></td></tr>
</table>
<?
if ($stx && $nca) {
$stx = "";
$sfl = "";
$sop = "";
}
?>
<!-- 제목 -->
<form name="fboardlist" method="post" style="margin:0px;">
<input type="hidden" name="bo_table" value="<?=$bo_table?>">
<input type="hidden" name="sfl" value="<?=$sfl?>">
<input type="hidden" name="stx" value="<?=$stx?>">
<input type="hidden" name="spt" value="<?=$spt?>">
<input type="hidden" name="page" value="<?=$page?>">
<input type="hidden" name="sw" value="">
<table width=100% cellpadding=0 cellspacing=0>
<tr><td colspan=<?=$colspan?> height=2 bgcolor=#000000></td></tr>
<tr>
<? if ($is_category) { ?><td width=145><img src='<?=$board_skin_path?>/img/title_m_name.gif' border=0 align=absmiddle></td><?}?>
<? if ($is_checkbox) { ?><td width=20 align="center"><INPUT onclick="if (this.checked) all_checked(true); else all_checked(false);" type=checkbox></td><? } ?>
<td><img src='<?=$board_skin_path?>/img/title_name.gif' border="0" align="absmiddle" /></td>
<td width=140><img src='<?=$board_skin_path?>/img/title_add.gif' border="0" align="absmiddle" /></td>
<td width=48><img src='<?=$board_skin_path?>/img/title_keeper.gif' border="0" align="absmiddle" /></td>
<? if ($is_good) { ?><td width=40><?=subject_sort_link('wr_good', $qstr2, 1)?>추천</a></td><?}?>
<? if ($is_nogood) { ?><td width=40><?=subject_sort_link('wr_nogood', $qstr2, 1)?>비추천</a></td><?}?>
</tr>
<tr><td colspan=<?=$colspan?> height=1 bgcolor=#d3d3d3></td>
</tr>
<!-- 목록 -->
<? for ($i=0; $i<count($list); $i++) { ?>
<?
//////////////////////////////////////////////////////// 추가된 부분.
$numbersss = "50";//추가될 라인번호
$gi = "1000";//출력될 번호
if ($numbersss == $list[$i][num]) {?>
<tr>
<? if ($is_category) { ?>
<td height="29" style="padding-left:12"><a href="<?=$list[$gi][ca_name_href]?>"><font color=gray><?=$list[$gi][ca_name]?></font></a>
<? if ($list[$gi][wr_10]) { ?> <a href="<?=$list[$gi][ca_name_href]?>&sfl=wr_10&stx=<?=$list[$gi][wr_10]?>&nca=<?=$list[$gi][wr_10]?>"><font color=gray><?=$list[$gi][wr_10]?></font></a><? } ?> <?=$list[$gi][wr_3]?>호</td>
<? } ?>
<? if ($is_checkbox) { ?><td align="center"><input type=checkbox name=chk_wr_id[] value="<?=$list[$gi][wr_id]?>"></td><? } ?>
<td align=left style='word-break:break-all; padding:3 3 3 6'>
<?
echo $nobr_begin;
echo $list[$gi][reply];
echo $list[$gi][icon_reply];
if ($list[$gi][is_notice])
echo "<font color='#2C8CB9'><strong>{$list[$gi][subject]}</strong></font>";
else
echo "<b><font color=00000>{$list[$gi][subject]}</font></b>";
//if ($list[$gi][comment_cnt])
// echo " <a href=\"{$list[$gi][comment_href]}\"><span style='font-size:7pt;'>{$list[$gi][comment_cnt]}</span></a>";
// if ($list[$gi]['link']['count']) { echo "[{$list[$gi]['link']['count']}]"; }
// if ($list[$gi]['file']['count']) { echo "<{$list[$gi]['file']['count']}>"; }
//echo " " . $list[$gi][icon_new];
//echo " " . $list[$gi][icon_file];
//echo " " . $list[$gi][icon_hot];
//echo " " . $list[$gi][icon_secret];
echo $nobr_end;
?>
<a href='#' onClick="window.open('<?=$list[$gi][wr_link1]?>', '', 'left=154, top=93, width=860, height=531, scrollbars=0')"><?=$list[$gi][icon_link]?></a>
<? if ($write_href) { echo "<a href='{$write_href}&w=u&wr_id={$list[$gi][wr_id]}'><img src='$board_skin_path/img/icon_modify.gif' border=0 align=absmiddle></a> "; } ?>
</td>
<td style="padding-left:6" class="small"><?=$list[$gi][content]?></td>
<td style="padding-left:6" class="small"><?=$list[$gi][wr_1]?></td>
<? if ($is_good) { ?><td align="center"><?=$list[$gi][wr_good]?></td><? } ?>
<? if ($is_nogood) { ?><td align="center"><?=$list[$gi][wr_nogood]?></td><? } ?>
</tr>
<tr><td colspan=<?=$colspan?> height=1 bgcolor=#d3d3d3></td></tr>
<?
////////////////////////////////////////////////////////////////////////////////////
}
?>
<tr>
<? if ($is_category) { ?>
<td height="29" style="padding-left:12"><a href="<?=$list[$i][ca_name_href]?>"><font color=gray><?=$list[$i][ca_name]?></font></a>
<? if ($list[$i][wr_10]) { ?> <a href="<?=$list[$i][ca_name_href]?>&sfl=wr_10&stx=<?=$list[$i][wr_10]?>&nca=<?=$list[$i][wr_10]?>"><font color=gray><?=$list[$i][wr_10]?></font></a><? } ?> <?=$list[$i][wr_3]?>호</td>
<? } ?>
<? if ($is_checkbox) { ?><td align="center"><input type=checkbox name=chk_wr_id[] value="<?=$list[$i][wr_id]?>"></td><? } ?>
<td align=left style='word-break:break-all; padding:3 3 3 6'>
<?
echo $nobr_begin;
echo $list[$i][reply];
echo $list[$i][icon_reply];
if ($list[$i][is_notice])
echo "<font color='#2C8CB9'><strong>{$list[$i][subject]}</strong></font>";
else
echo "<b><font color=00000>{$list[$i][subject]}</font></b>";
//if ($list[$i][comment_cnt])
// echo " <a href=\"{$list[$i][comment_href]}\"><span style='font-size:7pt;'>{$list[$i][comment_cnt]}</span></a>";
// if ($list[$i]['link']['count']) { echo "[{$list[$i]['link']['count']}]"; }
// if ($list[$i]['file']['count']) { echo "<{$list[$i]['file']['count']}>"; }
//echo " " . $list[$i][icon_new];
//echo " " . $list[$i][icon_file];
//echo " " . $list[$i][icon_hot];
//echo " " . $list[$i][icon_secret];
echo $nobr_end;
?>
<a href='#' onClick="window.open('<?=$list[$i][wr_link1]?>', '', 'left=154, top=93, width=860, height=531, scrollbars=0')"><?=$list[$i][icon_link]?></a>
<? if ($write_href) { echo "<a href='{$write_href}&w=u&wr_id={$list[$i][wr_id]}'><img src='$board_skin_path/img/icon_modify.gif' border=0 align=absmiddle></a> "; } ?>
</td>
<td style="padding-left:6" class="small"><?=$list[$i][content]?></td>
<td style="padding-left:6" class="small"><?=$list[$i][wr_1]?></td>
<? if ($is_good) { ?><td align="center"><?=$list[$i][wr_good]?></td><? } ?>
<? if ($is_nogood) { ?><td align="center"><?=$list[$i][wr_nogood]?></td><? } ?>
</tr>
<tr><td colspan=<?=$colspan?> height=1 bgcolor=#d3d3d3></td></tr>
<?}?>
<? if (count($list) == 0) { echo "<tr><td colspan='$colspan' height=100 align=center>게시물이 없습니다.</td></tr>"; } ?>
<tr><td colspan=<?=$colspan?> bgcolor=#d3d3d3 height=1>
</table>
</form>
<!-- 페이지 -->
<table width="100%" cellspacing="0" cellpadding="0">
<tr>
<td width="100%" align="center" height=30 valign=bottom>
<? if ($prev_part_href) { echo "<a href='$prev_part_href'><img src='$board_skin_path/img/btn_search_prev.gif' width=50 height=20 border=0 align=absmiddle title='이전검색'></a>"; } ?>
<?
// 기본으로 넘어오는 페이지를 아래와 같이 변환하여 이미지로도 출력할 수 있습니다.
//echo $write_pages;
$write_pages = str_replace("처음", "<img src='$board_skin_path/img/begin.gif' border='0' align='absmiddle' title='처음'>", $write_pages);
$write_pages = str_replace("이전", "<img src='$board_skin_path/img/prev.gif' border='0' align='absmiddle' title='이전'>", $write_pages);
$write_pages = str_replace("다음", "<img src='$board_skin_path/img/next.gif' border='0' align='absmiddle' title='다음'>", $write_pages);
$write_pages = str_replace("맨끝", "<img src='$board_skin_path/img/end.gif' border='0' align='absmiddle' title='맨끝'>", $write_pages);
$write_pages = preg_replace("/<span>([0-9]*)<\/span>/", "<b><font style=\"font-family:돋움; font-size:9pt; color:#797979\">$1</font></b>", $write_pages);
$write_pages = preg_replace("/<b>([0-9]*)<\/b>/", "<b><font style=\"font-family:돋움; font-size:9pt; color:orange;\">$1</font></b>", $write_pages);
?>
<?=$write_pages?>
<? if ($next_part_href) { echo "<a href='$next_part_href'><img src='$board_skin_path/img/btn_search_next.gif' width=50 height=20 border=0 align=absmiddle title='다음검색'></a>"; } ?>
</td>
</tr>
</table>
<!-- 버튼 링크 -->
<table width=100% cellpadding=0 cellspacing=0>
<tr>
<td width="50%" height="40">
<? if ($list_href) { ?><a href="<?=$list_href?>"><img src="<?=$board_skin_path?>/img/btn_list.gif" border="0"></a><? } ?>
<? if ($write_href) { ?><a href="<?=$write_href?>"><img src="<?=$board_skin_path?>/img/btn_write.gif" border="0"></a><? } ?>
<? if ($is_checkbox) { ?>
<a href="javascript:select_delete();"><img src="<?=$board_skin_path?>/img/btn_select_delete.gif" border="0"></a>
<a href="javascript:select_copy('copy');"><img src="<?=$board_skin_path?>/img/btn_select_copy.gif" border="0"></a>
<a href="javascript:select_copy('move');"><img src="<?=$board_skin_path?>/img/btn_select_move.gif" border="0"></a>
<? } ?>
</td>
<td width="50%" align="right"> </td>
</tr>
</table>
</td></tr></table>
<script language="JavaScript">
if ("<?=$sca?>") document.fcategory.sca.value = "<?=$sca?>";
if ("<?=$nca?>") document.fcategory.nca.value = "<?=$nca?>";
if ("<?=$stx?>") {
document.fsearch.sfl.value = "<?=$sfl?>";
document.fsearch.sop.value = "<?=$sop?>";
}
</script>
<? if ($is_checkbox) { ?>
<script language="JavaScript">
function all_checked(sw)
{
var f = document.fboardlist;
for (var i=0; i<f.length; i++) {
if (f.elements[i].name == "chk_wr_id[]")
f.elements[i].checked = sw;
}
}
function check_confirm(str)
{
var f = document.fboardlist;
var chk_count = 0;
for (var i=0; i<f.length; i++) {
if (f.elements[i].name == "chk_wr_id[]" && f.elements[i].checked)
chk_count++;
}
if (!chk_count) {
alert(str + "할 게시물을 하나 이상 선택하세요.");
return false;
}
return true;
}
// 선택한 게시물 삭제
function select_delete()
{
var f = document.fboardlist;
str = "삭제";
if (!check_confirm(str))
return;
if (!confirm("선택한 게시물을 정말 "+str+" 하시겠습니까?\n\n한번 "+str+"한 자료는 복구할 수 없습니다"))
return;
f.action = "./delete_all.php";
f.submit();
}
// 선택한 게시물 복사 및 이동
function select_copy(sw)
{
var f = document.fboardlist;
if (sw == "copy")
str = "복사";
else
str = "이동";
if (!check_confirm(str))
return;
var sub_win = window.open("", "move", "left=50, top=50, width=396, height=550, scrollbars=1");
f.sw.value = sw;
f.target = "move";
f.action = "./move.php";
f.submit();
}
</script>
<? } ?>
<!-- 게시판 목록 끝 -->
별로 건드린 부분은 없지만 아래 <!--목록--> 부분에서
주석을 달아놨습니다.
그 부분의 바로 아래$numbersss와 $gi변수의 값을 수정하시면 될것같습니다.
만약 실행시켜보시고 안된다면 다시 말씀해 주세요
######################################################
<?
if (!defined("_GNUBOARD_")) exit; // 개별 페이지 접근 불가
include_once "$board_skin_path/skin.lib.php";
// 선택옵션으로 인해 셀합치기가 가변적으로 변함
$colspan = 5;
if ($is_category) $colspan++;
if ($is_checkbox) $colspan++;
if ($is_good) $colspan++;
if ($is_nogood) $colspan++;
if ($is_category) {
$nc_category_location = "./board.php?bo_table=$bo_table&sca=$sca&sfl=wr_10&stx=";
$nc_category_option = get_nc_category_option($bo_table, $sca);
}
// 제목이 두줄로 표시되는 경우 이 코드를 사용해 보세요.
// <nobr style='display:block; overflow:hidden; width:000px;'>제목</nobr>
?>
<!-- 게시판 목록 시작 -->
<table width="<?=$width?>" align=center cellpadding=0 cellspacing=0><tr><td>
<!-- 분류 셀렉트 박스, 게시물 몇건, 관리자화면 링크 -->
<table width="100%" cellspacing="0" cellpadding="0">
<tr height="25">
<? if ($is_category) { ?>
<form name="fcategory" method="get">
<td width="50%">
<select name=sca onchange="location='<?=$category_location?>'+this.value;">
<option value=''>전체</option>
<?=$category_option?>
</select>
<? if ($sca) { ?>
<select name=nca onchange="location='<?=$nc_category_location?>'+this.value+'&nca='+this.value;">
<option value=''>전체</option>
<?=$nc_category_option?>
</select>
<? } ?>
<? if ($admin_href) { ?><a href="<?=$admin_href?>" target="_blank"><img src="<?=$board_skin_path?>/img/admin_button.gif" title="관리자" width="63" height="22" border="0" align="absmiddle"></a><? } ?>
</td>
</form>
<? } ?>
<form name=fsearch method=get style="margin:0px;">
<input type=hidden name=bo_table value="<?=$bo_table?>">
<input type=hidden name=sca value="<?=$sca?>">
<td align="right">
<!--게시물 <?=number_format($total_count)?>건 --><a href='<?=$rss_href?>'></a>
<select name=sfl>
<option value='wr_subject'>명칭</option>
<option value='wr_content'>주소</option>
</select><input name=stx maxlength=15 size=10 itemname="검색어" required value="<?=$stx?>"><select name=sop>
<option value=and>and</option>
<option value=or>or</option>
</select>
<input type=image src="<?=$board_skin_path?>/img/search_btn.gif" border=0 align=absmiddle>
</td>
</form>
</tr>
<tr><td height=5></td></tr>
</table>
<?
if ($stx && $nca) {
$stx = "";
$sfl = "";
$sop = "";
}
?>
<!-- 제목 -->
<form name="fboardlist" method="post" style="margin:0px;">
<input type="hidden" name="bo_table" value="<?=$bo_table?>">
<input type="hidden" name="sfl" value="<?=$sfl?>">
<input type="hidden" name="stx" value="<?=$stx?>">
<input type="hidden" name="spt" value="<?=$spt?>">
<input type="hidden" name="page" value="<?=$page?>">
<input type="hidden" name="sw" value="">
<table width=100% cellpadding=0 cellspacing=0>
<tr><td colspan=<?=$colspan?> height=2 bgcolor=#000000></td></tr>
<tr>
<? if ($is_category) { ?><td width=145><img src='<?=$board_skin_path?>/img/title_m_name.gif' border=0 align=absmiddle></td><?}?>
<? if ($is_checkbox) { ?><td width=20 align="center"><INPUT onclick="if (this.checked) all_checked(true); else all_checked(false);" type=checkbox></td><? } ?>
<td><img src='<?=$board_skin_path?>/img/title_name.gif' border="0" align="absmiddle" /></td>
<td width=140><img src='<?=$board_skin_path?>/img/title_add.gif' border="0" align="absmiddle" /></td>
<td width=48><img src='<?=$board_skin_path?>/img/title_keeper.gif' border="0" align="absmiddle" /></td>
<? if ($is_good) { ?><td width=40><?=subject_sort_link('wr_good', $qstr2, 1)?>추천</a></td><?}?>
<? if ($is_nogood) { ?><td width=40><?=subject_sort_link('wr_nogood', $qstr2, 1)?>비추천</a></td><?}?>
</tr>
<tr><td colspan=<?=$colspan?> height=1 bgcolor=#d3d3d3></td>
</tr>
<!-- 목록 -->
<? for ($i=0; $i<count($list); $i++) { ?>
<?
//////////////////////////////////////////////////////// 추가된 부분.
$numbersss = "50";//추가될 라인번호
$gi = "1000";//출력될 번호
if ($numbersss == $list[$i][num]) {?>
<tr>
<? if ($is_category) { ?>
<td height="29" style="padding-left:12"><a href="<?=$list[$gi][ca_name_href]?>"><font color=gray><?=$list[$gi][ca_name]?></font></a>
<? if ($list[$gi][wr_10]) { ?> <a href="<?=$list[$gi][ca_name_href]?>&sfl=wr_10&stx=<?=$list[$gi][wr_10]?>&nca=<?=$list[$gi][wr_10]?>"><font color=gray><?=$list[$gi][wr_10]?></font></a><? } ?> <?=$list[$gi][wr_3]?>호</td>
<? } ?>
<? if ($is_checkbox) { ?><td align="center"><input type=checkbox name=chk_wr_id[] value="<?=$list[$gi][wr_id]?>"></td><? } ?>
<td align=left style='word-break:break-all; padding:3 3 3 6'>
<?
echo $nobr_begin;
echo $list[$gi][reply];
echo $list[$gi][icon_reply];
if ($list[$gi][is_notice])
echo "<font color='#2C8CB9'><strong>{$list[$gi][subject]}</strong></font>";
else
echo "<b><font color=00000>{$list[$gi][subject]}</font></b>";
//if ($list[$gi][comment_cnt])
// echo " <a href=\"{$list[$gi][comment_href]}\"><span style='font-size:7pt;'>{$list[$gi][comment_cnt]}</span></a>";
// if ($list[$gi]['link']['count']) { echo "[{$list[$gi]['link']['count']}]"; }
// if ($list[$gi]['file']['count']) { echo "<{$list[$gi]['file']['count']}>"; }
//echo " " . $list[$gi][icon_new];
//echo " " . $list[$gi][icon_file];
//echo " " . $list[$gi][icon_hot];
//echo " " . $list[$gi][icon_secret];
echo $nobr_end;
?>
<a href='#' onClick="window.open('<?=$list[$gi][wr_link1]?>', '', 'left=154, top=93, width=860, height=531, scrollbars=0')"><?=$list[$gi][icon_link]?></a>
<? if ($write_href) { echo "<a href='{$write_href}&w=u&wr_id={$list[$gi][wr_id]}'><img src='$board_skin_path/img/icon_modify.gif' border=0 align=absmiddle></a> "; } ?>
</td>
<td style="padding-left:6" class="small"><?=$list[$gi][content]?></td>
<td style="padding-left:6" class="small"><?=$list[$gi][wr_1]?></td>
<? if ($is_good) { ?><td align="center"><?=$list[$gi][wr_good]?></td><? } ?>
<? if ($is_nogood) { ?><td align="center"><?=$list[$gi][wr_nogood]?></td><? } ?>
</tr>
<tr><td colspan=<?=$colspan?> height=1 bgcolor=#d3d3d3></td></tr>
<?
////////////////////////////////////////////////////////////////////////////////////
}
?>
<tr>
<? if ($is_category) { ?>
<td height="29" style="padding-left:12"><a href="<?=$list[$i][ca_name_href]?>"><font color=gray><?=$list[$i][ca_name]?></font></a>
<? if ($list[$i][wr_10]) { ?> <a href="<?=$list[$i][ca_name_href]?>&sfl=wr_10&stx=<?=$list[$i][wr_10]?>&nca=<?=$list[$i][wr_10]?>"><font color=gray><?=$list[$i][wr_10]?></font></a><? } ?> <?=$list[$i][wr_3]?>호</td>
<? } ?>
<? if ($is_checkbox) { ?><td align="center"><input type=checkbox name=chk_wr_id[] value="<?=$list[$i][wr_id]?>"></td><? } ?>
<td align=left style='word-break:break-all; padding:3 3 3 6'>
<?
echo $nobr_begin;
echo $list[$i][reply];
echo $list[$i][icon_reply];
if ($list[$i][is_notice])
echo "<font color='#2C8CB9'><strong>{$list[$i][subject]}</strong></font>";
else
echo "<b><font color=00000>{$list[$i][subject]}</font></b>";
//if ($list[$i][comment_cnt])
// echo " <a href=\"{$list[$i][comment_href]}\"><span style='font-size:7pt;'>{$list[$i][comment_cnt]}</span></a>";
// if ($list[$i]['link']['count']) { echo "[{$list[$i]['link']['count']}]"; }
// if ($list[$i]['file']['count']) { echo "<{$list[$i]['file']['count']}>"; }
//echo " " . $list[$i][icon_new];
//echo " " . $list[$i][icon_file];
//echo " " . $list[$i][icon_hot];
//echo " " . $list[$i][icon_secret];
echo $nobr_end;
?>
<a href='#' onClick="window.open('<?=$list[$i][wr_link1]?>', '', 'left=154, top=93, width=860, height=531, scrollbars=0')"><?=$list[$i][icon_link]?></a>
<? if ($write_href) { echo "<a href='{$write_href}&w=u&wr_id={$list[$i][wr_id]}'><img src='$board_skin_path/img/icon_modify.gif' border=0 align=absmiddle></a> "; } ?>
</td>
<td style="padding-left:6" class="small"><?=$list[$i][content]?></td>
<td style="padding-left:6" class="small"><?=$list[$i][wr_1]?></td>
<? if ($is_good) { ?><td align="center"><?=$list[$i][wr_good]?></td><? } ?>
<? if ($is_nogood) { ?><td align="center"><?=$list[$i][wr_nogood]?></td><? } ?>
</tr>
<tr><td colspan=<?=$colspan?> height=1 bgcolor=#d3d3d3></td></tr>
<?}?>
<? if (count($list) == 0) { echo "<tr><td colspan='$colspan' height=100 align=center>게시물이 없습니다.</td></tr>"; } ?>
<tr><td colspan=<?=$colspan?> bgcolor=#d3d3d3 height=1>
</table>
</form>
<!-- 페이지 -->
<table width="100%" cellspacing="0" cellpadding="0">
<tr>
<td width="100%" align="center" height=30 valign=bottom>
<? if ($prev_part_href) { echo "<a href='$prev_part_href'><img src='$board_skin_path/img/btn_search_prev.gif' width=50 height=20 border=0 align=absmiddle title='이전검색'></a>"; } ?>
<?
// 기본으로 넘어오는 페이지를 아래와 같이 변환하여 이미지로도 출력할 수 있습니다.
//echo $write_pages;
$write_pages = str_replace("처음", "<img src='$board_skin_path/img/begin.gif' border='0' align='absmiddle' title='처음'>", $write_pages);
$write_pages = str_replace("이전", "<img src='$board_skin_path/img/prev.gif' border='0' align='absmiddle' title='이전'>", $write_pages);
$write_pages = str_replace("다음", "<img src='$board_skin_path/img/next.gif' border='0' align='absmiddle' title='다음'>", $write_pages);
$write_pages = str_replace("맨끝", "<img src='$board_skin_path/img/end.gif' border='0' align='absmiddle' title='맨끝'>", $write_pages);
$write_pages = preg_replace("/<span>([0-9]*)<\/span>/", "<b><font style=\"font-family:돋움; font-size:9pt; color:#797979\">$1</font></b>", $write_pages);
$write_pages = preg_replace("/<b>([0-9]*)<\/b>/", "<b><font style=\"font-family:돋움; font-size:9pt; color:orange;\">$1</font></b>", $write_pages);
?>
<?=$write_pages?>
<? if ($next_part_href) { echo "<a href='$next_part_href'><img src='$board_skin_path/img/btn_search_next.gif' width=50 height=20 border=0 align=absmiddle title='다음검색'></a>"; } ?>
</td>
</tr>
</table>
<!-- 버튼 링크 -->
<table width=100% cellpadding=0 cellspacing=0>
<tr>
<td width="50%" height="40">
<? if ($list_href) { ?><a href="<?=$list_href?>"><img src="<?=$board_skin_path?>/img/btn_list.gif" border="0"></a><? } ?>
<? if ($write_href) { ?><a href="<?=$write_href?>"><img src="<?=$board_skin_path?>/img/btn_write.gif" border="0"></a><? } ?>
<? if ($is_checkbox) { ?>
<a href="javascript:select_delete();"><img src="<?=$board_skin_path?>/img/btn_select_delete.gif" border="0"></a>
<a href="javascript:select_copy('copy');"><img src="<?=$board_skin_path?>/img/btn_select_copy.gif" border="0"></a>
<a href="javascript:select_copy('move');"><img src="<?=$board_skin_path?>/img/btn_select_move.gif" border="0"></a>
<? } ?>
</td>
<td width="50%" align="right"> </td>
</tr>
</table>
</td></tr></table>
<script language="JavaScript">
if ("<?=$sca?>") document.fcategory.sca.value = "<?=$sca?>";
if ("<?=$nca?>") document.fcategory.nca.value = "<?=$nca?>";
if ("<?=$stx?>") {
document.fsearch.sfl.value = "<?=$sfl?>";
document.fsearch.sop.value = "<?=$sop?>";
}
</script>
<? if ($is_checkbox) { ?>
<script language="JavaScript">
function all_checked(sw)
{
var f = document.fboardlist;
for (var i=0; i<f.length; i++) {
if (f.elements[i].name == "chk_wr_id[]")
f.elements[i].checked = sw;
}
}
function check_confirm(str)
{
var f = document.fboardlist;
var chk_count = 0;
for (var i=0; i<f.length; i++) {
if (f.elements[i].name == "chk_wr_id[]" && f.elements[i].checked)
chk_count++;
}
if (!chk_count) {
alert(str + "할 게시물을 하나 이상 선택하세요.");
return false;
}
return true;
}
// 선택한 게시물 삭제
function select_delete()
{
var f = document.fboardlist;
str = "삭제";
if (!check_confirm(str))
return;
if (!confirm("선택한 게시물을 정말 "+str+" 하시겠습니까?\n\n한번 "+str+"한 자료는 복구할 수 없습니다"))
return;
f.action = "./delete_all.php";
f.submit();
}
// 선택한 게시물 복사 및 이동
function select_copy(sw)
{
var f = document.fboardlist;
if (sw == "copy")
str = "복사";
else
str = "이동";
if (!check_confirm(str))
return;
var sub_win = window.open("", "move", "left=50, top=50, width=396, height=550, scrollbars=1");
f.sw.value = sw;
f.target = "move";
f.action = "./move.php";
f.submit();
}
</script>
<? } ?>
<!-- 게시판 목록 끝 -->