아래 전체 게시글 관리 소스를 봐주세요
본문
아래 전체 게시글 관리 소스를 봐주세요
전에 다른 사이트에서 잘사용하고 잇던건데 새로운 사이트에서 사용하자니까 않됩니다.
혹시 어디 문제있는건지 부탁합니다.
감사 합니다
<?php
$sub_menu = "900300";
include_once('./_common.php');
auth_check($auth[$sub_menu], 'r');
$sql_common = " from {$g5['board_new_table']} a, {$g5['board_table']} b, {$g5['group_table']} c
where a.bo_table = b.bo_table and b.gr_id = c.gr_id and b.bo_use_search = '1' ";
if ($gr_id){
$sql_common .= " and b.gr_id = '$gr_id' ";
$qstr .= "&gr_id=$gr_id";
}
if ($bo_table){
$sql_common .= " and a.bo_table = '$bo_table' "; //여기가 추가된 부분
$qstr .= "&bo_table=$bo_table";
}
if ($view == "w"){
$sql_common .= " and a.wr_id = a.wr_parent ";
$qstr .= "&view=$view";
}
else if ($view == "c") {
$sql_common .= " and a.wr_id <> a.wr_parent ";
$qstr .= "&view=$view";
}
if ($mb_id) {
$sql_common .= " and a.mb_id = '$mb_id' ";
$qstr .= "&mb_id=$mb_id";
//출석 체크
if($member['mb_id']) chulcheck($member[mb_id]);
}
if (!$sst) {
$sst = "a.bn_id";
$sod = "desc";
}
if($sst) {
$qstr .= "&sst=$sst";
$qstr .= "&sod=$sod";
}
$sql_order = " order by $sst $sod";
$sql = " select count(*) as cnt $sql_common ";
$row = sql_fetch($sql);
$total_count = $row[cnt];
if ($pgview) {
$rows = $pgview;
$qstr .= "&pgview=$pgview";
} else {
$rows = $config[cf_new_rows];
}
$total_page = ceil($total_count / $rows); // 전체 페이지 계산
if (!$page) $page = 1; // 페이지가 없으면 첫 페이지 (1 페이지)
$from_record = ($page - 1) * $rows; // 시작 열을 구함
$group_select = "<select name=gr_id id=gr_id onchange='select_change();'><option value=''>전체그룹";
$sql = " select gr_id, gr_subject from {$g5['group_table']} order by gr_id ";
$result = sql_query($sql);
for ($i=0; $row=sql_fetch_array($result); $i++)
{
$selected = ($gr_id == $row['gr_id']) ? "selected=selected" : "";
$group_select .= "<option $selected value='$row[gr_id]'>$row[gr_subject]";
}
$group_select .= "</select>";
$board_select = "<select name=bo_table id=bo_table onchange='select_change();'><option value=''>전체게시판";
if($gr_id)
$sql_extra = "where gr_id = '$gr_id'";
$sql = " select bo_table, bo_subject from {$g5['board_table']} $sql_extra order by bo_table";
$result = sql_query($sql);
for ($i=0; $row=sql_fetch_array($result); $i++)
{
$selected = ($bo_table == $row['bo_table']) ? "selected=selected" : "";
$board_select .= "<option $selected value='$row[bo_table]'>$row[bo_subject]";
}
$board_select .= "</select>";
$list = array();
$sql = " select a.*, b.bo_subject, c.gr_subject, c.gr_id
$sql_common
$sql_order
limit $from_record, $rows ";
$result = sql_query($sql);
for ($i=0; $row=sql_fetch_array($result); $i++)
{
$tmp_write_table = $g5['write_prefix'] . $row[bo_table];
if ($row[wr_id] == $row[wr_parent]) // 원글
{
$comment = "";
$comment_link = "";
$row2 = sql_fetch(" select * from $tmp_write_table where wr_id = '$row[wr_id]' ");
$list[$i] = $row2;
$name = get_sideview($row2[mb_id], cut_str($row2[wr_name], $config[cf_cut_name]), $row2[wr_email], $row2[wr_homepage]);
// 당일인 경우 시간으로 표시함
$datetime = $row2[wr_datetime];
}
else // 코멘트
{
$comment = "<font color='#FF0000'>[코]</font> ";
$comment_link = "#c_{$row[wr_id]}";
//$row2 = sql_fetch(" select * from $tmp_write_table where wr_id = '$row[wr_parent]' ");
$row2 = sql_fetch(" select * from $tmp_write_table where wr_id = '$row[wr_id]' ");
$row3 = sql_fetch(" select mb_id, wr_name, wr_email, wr_homepage, wr_datetime from $tmp_write_table where wr_id = '$row[wr_id]' ");
$list[$i] = $row2;
$list[$i][mb_id] = $row3[mb_id];
$list[$i][wr_name] = $row3[wr_name];
$list[$i][wr_email] = $row3[wr_email];
$list[$i][wr_homepage] = $row3[wr_homepage];
$name = get_sideview($row3[mb_id], cut_str($row3[wr_name], $config[cf_cut_name]), $row3[wr_email], $row3[wr_homepage]);
$datetime = $row3[wr_datetime];
$row2[wr_subject] = $row2[wr_content];
}
$list[$i][gr_id] = $row[gr_id];
$list[$i][bo_table] = $row[bo_table];
$list[$i][name] = $name;
$list[$i][comment] = $comment;
$list[$i][href] = "../bbs/board.php?bo_table=$row[bo_table]&wr_id=$row2[wr_id]{$comment_link}";
$list[$i][datetime] = $datetime;
$list[$i][gr_subject] = $row[gr_subject];
$list[$i][bo_subject] = $row[bo_subject];
$list[$i][wr_subject] = $row2[wr_subject];
}
$html_title = '전체 게시판 HIT 관리';
$g5['title'] = $html_title;
include_once('./admin.head.php');
?>
<!-- 분류 시작 -->
<form name="fnew" id="fnew" class="local_sch01 local_sch" method="get">
<?=$group_select?>
<?=$board_select?>
<label for="view" class="sound_only">전체게시물,원글,코멘트중에 선택하세요</label>
<select name='view' id='view' onchange="select_change()">
<option value=''>전체게시물
<option value='w'>원글만
<option value='c'>코멘트만
</select>
<label for="pgview" class="sound_only">출력개수를 선택하세요</label>
<select name='pgview' id='pgview' onchange="select_change()">
<option value=''>출력개수
<option value='1'>1개
<option value='15'>15개
<option value='30'>30개
<option value='50'>50개
<option value='100'>100개
<option value='150'>150개
<option value='200'>200개
<option value='300'>300개
<option value='500'>500개
</select>
<label for="mb_id"><b>회원아이디 : </b></label>
<input type=text id='mb_id' name='mb_id' value='<?=$mb_id?>' class="required frm_input">
<input type="submit" value="검색" class="btn_submit">
</form>
<!-- 분류 끝 -->
<form name="fboardlist" id="fboardlist" action="./new_hit_list_update.php" onsubmit="return fboardlist_submit(this);" method="post">
<input type=hidden name='gr_id' value='<?php echo $gr_id; ?>' />
<input type=hidden name='bo_table' value='<?php echo $bo_table; ?>' />
<input type=hidden name='view' value='<?php echo $view; ?>' />
<input type=hidden name='mb_id' value='<?php echo $mb_id; ?>' />
<input type=hidden name='pgview' value='<?php echo $pgview; ?>' />
<input type=hidden name='page' value='<?php echo $page; ?>' />
<input type=hidden name='sst' value='<?php echo $sst; ?>' />
<input type=hidden name='sod' value='<?php echo $sod; ?>' />
<div class="tbl_head01 tbl_wrap">
<table>
<caption><?php echo $g5['title']; ?> 목록</caption>
<colgroup>
<col width="30px" />
<col width="150px" />
<col width="150px" />
<col width="" />
<col width="120px" />
<col width="120px" />
<col width="150px" />
<col width="120px" />
</colgroup>
<thead>
<tr>
<th scope="col">
<label for="chkall" class="sound_only">전체선택</label>
<input type="checkbox" name="chkall" value="1" id="chkall" onclick="check_all(this.form)">
</th>
<th scope="col"><?=subject_sort_link("gr_id",$qstr)?>그룹</a></th>
<th scope="col"><?=subject_sort_link("bo_table",$qstr)?>게시판</a></th>
<th scope="col"><?=subject_sort_link("bo_subject",$qstr)?>제목</a></th>
<th scope="col"><?=subject_sort_link("mb_id",$qstr)?>이름</a></th>
<th scope="col"><?=subject_sort_link("mb_id",$qstr)?>작성자</a></th>
<th scope="col"><?=subject_sort_link("bn_datetime",$qstr)?>일시</a></th>
<!--<th scope="col">추천</th>-->
<th scope="col">조회</th>
</tr>
</thead>
<tbody>
<?php
for ($i=0; $i<count($list); $i++)
{
$gr_subject = cut_str($list[$i][gr_subject], 20);
$bo_subject = cut_str($list[$i][bo_subject], 20);
$wr_subject = get_text(cut_str($list[$i][wr_subject], 80));
$datetime3 = substr($list[$i][wr_datetime],10,10);
$bg = 'bg'.($i%2);
$random = 0;
if($list[$i][wr_hit] >= 1000){
$random=rand(3,8);
} else if($list[$i][wr_hit] >= 300){
$random=rand(20,45);
} else {
$random=rand(30,90);
}
?>
<tr class="<?php echo $bg; ?>">
<td class="td_chk">
<label for="chk_<?php echo $i; ?>" class="sound_only"><?php echo $list[$i][wr_id] ?>번글 선택</label>
<input class='chk' type="checkbox" name="chk[]" value="<?php echo $i; ?>">
<input type=hidden name=set_table[<?=$i?>] value='<?=$list[$i]['bo_table']?>'>
<input type=hidden name=set_id[<?=$i?>] value='<?=$list[$i]['wr_id']?>'>
</td>
<td><a href='./new_hit_list.php?gr_id=<?=$list[$i][gr_id]?>'><?=$gr_subject?></a></td>
<td><a href='<?=G5_BBS_URL ?>/board.php?bo_table=<?=$list[$i][bo_table]?>'><?=$bo_subject?></a></td>
<td><a href='<?=$list[$i][href]?>'><div style="padding:6px; width:100%; text-align:left;"><?=$list[$i][comment]?><?=$wr_subject?></div></a></td>
<td style="text-align:left;"><?=$list[$i][name]?></td>
<td><input type=text size=12 name=set_cb_mb_id[<?=$i?>] value="<?=$list[$i][mb_id]; ?>" class="frm_input"></td>
<td align='center'>
<label for="chk_date<?php echo $i; ?>" class="sound_only"><?php echo $list[$i][wr_id] ?>번글 날짜변경 사용</label>
<input type=text size=16 name=set_date[<?=$i?>] value='<?=$list[$i][datetime]?>' class="frm_input set_date">
</td>
<!--<td align='center'><input type=text size=3 name=set_good[<?=$i?>] value='<?=$list[$i][wr_good]?>' class="frm_input"></td>-->
<td style="text-align:left;">
<input type=text size=3 name=set_hit[<?=$i?>] value='<?php echo ((int)$list[$i][wr_hit]+$random) ?>' class="frm_input" maxlength="5" style="width:50px;">
<span title='현제 hit' > / <?=$list[$i][wr_hit]?></span>
</td>
</tr>
<?php }
if ($i == 0)
echo '<tr><td colspan="8" class="empty_table">자료가 없습니다.</td></tr>';
?>
</tbody>
</table>
</div>
<div class="btn_list01 btn_list"><input type="submit" name="act_button" value="선택수정" onclick="document.pressed=this.value" class="btn_01 btn"></div>
</form>
<?php echo get_paging(G5_IS_MOBILE ? $config['cf_mobile_pages'] : $config['cf_write_pages'], $page, $total_page, $_SERVER['PHP_SELF'].'?'.$qstr.'&page='); ?>
<script language="JavaScript">
function fboardlist_submit(f)
{
if (!is_checked("chk[]")) {
alert(document.pressed+" 하실 항목을 하나 이상 선택하세요.");
return false;
}
return true;
}
function select_change()
{
var f = document.fnew;
document.fnew.submit();
}
// document.getElementById("gr_id").value = "<?=$gr_id?>";
// document.getElementById("bo_table").value = "<?=$bo_table?>";
document.getElementById("pgview").value = "<?=$pgview?>";
document.getElementById("view").value = "<?=$view?>";
</script>
<script type="text/javascript">
/* Korean initialisation for the jQuery calendar extension. */
/* Written by DaeKwon Kang (*** 개인정보보호를 위한 이메일주소 노출방지 ***). */
jQuery(function($){
$.datepicker.regional['ko'] = {
closeText: '닫기',
prevText: '이전달',
nextText: '다음달',
currentText: '오늘',
monthNames: ['1월(JAN)','2월(FEB)','3월(MAR)','4월(APR)','5월(MAY)','6월(JUN)',
'7월(JUL)','8월(AUG)','9월(SEP)','10월(OCT)','11월(NOV)','12월(DEC)'],
monthNamesShort: ['1월','2월','3월','4월','5월','6월',
'7월','8월','9월','10월','11월','12월'],
dayNames: ['일','월','화','수','목','금','토'],
dayNamesShort: ['일','월','화','수','목','금','토'],
dayNamesMin: ['일','월','화','수','목','금','토'],
weekHeader: 'Wk',
dateFormat: 'yymmdd',
firstDay: 0,
isRTL: false,
showMonthAfterYear: true,
yearSuffix: ''};
$.datepicker.setDefaults($.datepicker.regional['ko']);
$('.set_date').datetimepicker({
showOn: 'none',
// buttonImage: '/img/calendar.gif',
buttonImageOnly: true,
buttonText: "달력",
changeMonth: true,
changeYear: true,
showButtonPanel: true,
dateFormat: 'yy-mm-dd',
timeFormat: 'HH:mm:ss',
controlType: 'select',
oneLine: true,
yearRange: 'c-99:c+99'
});
$('.set_date').on('click focus',function(){
$(this).datetimepicker('show');
});
});
</script>
<?php
include_once ('./admin.tail.php');
?>