게시판 조회수가 안올라 갑니다. 정보
그누보드 게시판 조회수가 안올라 갑니다.본문
http://www.sir.co.kr/?doc=bbs/gnuboard.php&bo_table=skin3&sselect=wr_subject&stext=%C0%DA%B7%E1%BD%C7&soperator=1&page=1&wr_id=518
위 자료실 스킨을 좀 바꿨는데 조회수가 안올라가네요
위 기존스킨으로 하면 조회수가 잘 올라가는데
아래는 소스를 바꾼 gblist.skin.php 게시판 소스입니다.
===========================================================================================
<?
$image_width = 150; // 이미지 폭
$image_height = 120; // 이미지 높이
?>
<table width='<?=$width?>' align=center>
<tr>
<td>
<!-- 최상단 카테고리-->
<table width=100% border=0 cellpadding=0 cellspacing=0>
<tr height=25><td width=100% valign=bottom>
<span class=skin_date>
<?
if ($is_category) {
echo " <input type=hidden name=ca_id>";
echo get_category_list("$cfg[write_table_prefix]$bo_table",$category_location);
} else echo " <b>TOTAL</b> : $total_count <b>ARTICLES</b> : $page / $total_page<br>";
?>
</span>
</td><td width=190>
<table width=190 align=right border=0 cellpadding=0 cellspacing=0>
<tr>
<!--검색폼 시작-->
<form name=fsearch method=get action='<?="./"?>'>
<input type=hidden name=doc value='<?=$doc?>'>
<input type=hidden name=bo_table value='<?=$bo_table?>'>
<input type=hidden name=select value=1>
<input type=hidden name=sselect value='wr_subject|wr_content'>
<td align=right><input type=text name=stext size=18 class=skin_input required itemname='검색어' <? if ($stext) echo "value='$stext' "; else echo "value='검색어 입력' "; ?> onFocus=this.value='<?=$stext?>'>
<input type=image src='<?="$board_skin/search.gif"?>' border=0 alt='검색' align=absmiddle>
<? if ($admin_href) { echo "<a href='$admin_href'><img src='$board_skin/admin.gif' border=0 align=absmiddle></a>"; } ?></td></form>
<!-- 검색폼 끝-->
</tr></table>
</td></tr>
</table>
<!-- 최상단 카테고리, 총 몇건?? 끝##########-->
<table width='100%' cellpadding=0 cellspacing=0 border=0>
<tr><td height=2 bgcolor=#FF9900></td></tr>
<tr height=4><td colspan=8 background=<?=$board_skin?>/sha.gif></td></tr>
</table>
<table width=100% border=0 cellpadding=3 cellspacing=0>
<form name=frmgblist method='post' action='./?doc=bbs/gbdeleteall.php'>
<input type=hidden name=bo_table value='<?=$bo_table?>'>
<input type=hidden name=sselect value='<?=$sselect?>'>
<input type=hidden name=stext value='<?=$stext?>'>
<input type=hidden name=section value='<?=$section?>'>
<input type=hidden name=page value='<?=$page?>'>
<input type=hidden name=sw value=''>
<?
// 번호에 이미지를 사용할 경우는 아래의 주석을 제거하고 $list[$i][num]의 내용을 수정후 사용하세요.
// if (!is_int($list[$i][num])) { $list[$i][num] = "<img src='$board_skin/img/arrow.gif'>"; }
?>
<? for ($i=0; $i<count($list); $i++) { ?>
<? if (!file_exists($list[$i][file_image2])) { $list[$i][file_image2] = "$board_skin/noimage.gif"; } ?>
<tr width=100% height=5><td colspan=5></td></tr>
<tr width=100% class=list<?=($i%1)?>>
<td align=left valign=top width='<?=$image_width?>' height=200><a href='<?=$list[$i][href]?>'><img src='<?=$list[$i][file_image2]?>' width='<?=$image_width?>' height='<?=$image_height?>' border=1 alt='<?=$list[$i][wr_subject]?>' style='border-color:#555555;'></a></td>
<td colspan=4 height=100% align=right valign=top>
<table width=100% height=100% border=0 cellpadding=0 cellspacing=0>
<tr height=20>
<td colspan=3 valign=top>
<table width=100% border=0 cellpadding=0 cellspacing=0>
<tr>
<td>
<b><?=$list[$i][num]?>.</b> <b><a href='<?=$list[$i][href]?>'><?=$list[$i][subject]?></a></b>
<?=$list[$i][icon_new]?><?=$list[$i][icon_hot]?><?=$list[$i][icon_battle]?><?=$list[$i][icon_secret]?>
</td>
<td width=20>
<? if ($is_checkdelete) { ?><input type=checkbox name=chk_wr_id[] value='<?=$list[$i][wr_id]?>'><? } ?>
</td>
</tr>
</table>
</td>
</tr>
<tr height=10><td width=43%> <span class=skin_cmt><b>- 분류 : </b><? if ($is_category) { ?><?=$list[$i][ca_name]?><? } ?></span></td>
<td width=23%><span class=skin_cmt><b>- 조회수 : </b><?=$list[$i][wr_hit]?></span></td>
<td width=34%><span class=skin_cmt><b>- 추천수 : </b><?=$list[$i][wr_good]?></span></td>
</tr>
<tr height=10><td> <span class=skin_cmt><b>- 등록자 : </b><?=$list[$i][name]?></span></td>
<td></td>
<td><span class=skin_cmt><b>- 등록일자 : </b><?=$list[$i][datetime]?></span</td>
</tr>
<tr height=10><td colspan=3><span class=skin_cmt>
<?if ($link[$i][link1]) {?> <b>- 링크1 : </b><a href='<?=$link[$i][link_href1]?>' target='blank'><?=set_http(get_text(cut_str($link[$i][link1], 40)))?></a> <b>Hit : </b><?=$list[$i][wr_link1_hit]?><br><?}?>
<?if ($link[$i][link2]) {?> <b>- 링크2 : </b><a href='<?=$link[$i][link_href2]?>' target='blank'><?=set_http(get_text(cut_str($link[$i][link2], 40)))?></a> <b>Hit : </b><?=$list[$i][wr_link2_hit]?><br><?}?>
<?
$ss_name = "ss_view_{$bo_table}_{$list[$i][wr_id]}";
session_register($ss_name);
$$ss_name = $HTTP_SESSION_VARS[$ss_name] = TRUE;
?>
<?if ($file[$i][source1]) {?><a href='<?=$file[$i][file_href1]?>'>- 파일1 : <?=$file[$i][source1]?>
<?=$file[$i][size1]?></a> 다운로드 : <?=$list[$i][wr_file1_download]?><br><?}?>
<?if ($file[$i][source2]) {?><a href='<?=$file[$i][file_href2]?>'>- 파일2 : <?=$file[$i][source2]?>
<?=$file[$i][size2]?></a> 다운로드 : <?=$list[$i][wr_file2_download]?><?}?>
</span>
</td>
</tr>
<tr><td colspan=3 valign=bottom>
<table border=0 cellpadding=0 cellspacing=0>
<tr><td width=10></td>
<td><?=cut_str($list[$i][content],300,"...");?></td>
</tr>
</table>
</td>
</tr>
</table>
</td>
</tr>
<tr height=10><td colspan=5></td></tr>
<tr>
<td colspan=5 height=1 background='./<?=$board_skin?>/dot_line.gif'></td>
</tr>
<? } ?>
<? if (count($list) == 0) { echo "<tr><td colspan=8 align=center height=100 class='content contentbg'>자료가 없습니다.</td></tr>"; } ?>
</form>
</table>
<table width='100%' cellpadding=0 cellspacing=0 border=0>
<tr><td height=2 bgcolor=#FF9900></td></tr>
<tr><td><img src=<?=$board_skin?>/skin_shadow.gif></td></tr>
</table>
<table width=100% cellpadding=0 cellspacing=0 border=0>
<tr height=30>
<!-- 하단 각종 버튼 (글쓰기, 전체선택, 선택해제, 선택삭제..)-->
<td>
<? if ($list_href) { echo "<a href='$list_href'><img src='./$board_skin/img/list.gif' border=0 alt=목록></a>"; } ?>
<? if ($write_href) { echo "<a href='$write_href'><img src='./$board_skin/write.gif' border=0 alt=글쓰기></a>"; } ?>
<? if ($is_checkdelete) { ?>
<a href='javascript:all_checked(true);'><img src='./<?=$board_skin ?>/img/allchk.gif' border=0 alt='전체선택'></a>
<a href='javascript:all_checked(false);'><img src='./<?=$board_skin ?>/img/allunchk.gif' border=0 alt='선택해제'></a>
<a href='javascript:all_delete();'><img src='./<?=$board_skin ?>/img/allchkdel.gif' border=0 alt='글삭제'></a>
<a href="javascript:all_move('copy');"><img src='<?="$board_skin/img/copy.gif"?>' border=0 alt='선택복사' align=absmiddle></a>
<a href="javascript:all_move('move');"><img src='<?="$board_skin/img/move.gif"?>' border=0 alt='선택이동' align=absmiddle></a>
<script language='javascript'>
function all_checked(sw)
{
var f = document.frmgblist;
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.frmgblist;
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 all_delete()
{
var f = document.frmgblist;
str = "삭제";
if (!check_confirm(str)) {
return;
}
if (!confirm("선택한 게시물을 정말 "+str+" 하시겠습니까?\n\n한번 "+str+"한 자료는 복구할 수 없습니다")) {
return;
}
f.action = "./?doc=bbs/gbdeleteall.php";
f.submit();
}
// 선택한 게시물 복사 및 이동
function all_move(sw)
{
var f = document.frmgblist;
if (sw == 'copy') {
str = '복사';
} else {
str = '이동';
}
if (!check_confirm(str)) {
return;
}
var sub_win = window.open('', 'gbmoveall', 'left=50, top=50, width=396, height=550, scrollbars=1');
f.sw.value = sw;
f.target = "gbmoveall";
f.action = "./?doc=bbs/gbmoveall.php";
f.submit();
}
</script>
<? } ?>
</td width=100>
<!-- 하단 각종 버튼 (글쓰기, 전체선택, 선택해제, 선택삭제..) 끝#######-->
<td align=right>
<? if ($prev_section_href) { echo "<a href='$prev_section_href'>이전검색</a>"; } ?>
<?=$write_pages?>
<? if ($next_section_href) { echo "<a href='$next_section_href'>다음검색</a>"; } ?>
</td>
</tr>
</table>
</td></tr></table>
================================================================
위 자료실 스킨을 좀 바꿨는데 조회수가 안올라가네요
위 기존스킨으로 하면 조회수가 잘 올라가는데
아래는 소스를 바꾼 gblist.skin.php 게시판 소스입니다.
===========================================================================================
<?
$image_width = 150; // 이미지 폭
$image_height = 120; // 이미지 높이
?>
<table width='<?=$width?>' align=center>
<tr>
<td>
<!-- 최상단 카테고리-->
<table width=100% border=0 cellpadding=0 cellspacing=0>
<tr height=25><td width=100% valign=bottom>
<span class=skin_date>
<?
if ($is_category) {
echo " <input type=hidden name=ca_id>";
echo get_category_list("$cfg[write_table_prefix]$bo_table",$category_location);
} else echo " <b>TOTAL</b> : $total_count <b>ARTICLES</b> : $page / $total_page<br>";
?>
</span>
</td><td width=190>
<table width=190 align=right border=0 cellpadding=0 cellspacing=0>
<tr>
<!--검색폼 시작-->
<form name=fsearch method=get action='<?="./"?>'>
<input type=hidden name=doc value='<?=$doc?>'>
<input type=hidden name=bo_table value='<?=$bo_table?>'>
<input type=hidden name=select value=1>
<input type=hidden name=sselect value='wr_subject|wr_content'>
<td align=right><input type=text name=stext size=18 class=skin_input required itemname='검색어' <? if ($stext) echo "value='$stext' "; else echo "value='검색어 입력' "; ?> onFocus=this.value='<?=$stext?>'>
<input type=image src='<?="$board_skin/search.gif"?>' border=0 alt='검색' align=absmiddle>
<? if ($admin_href) { echo "<a href='$admin_href'><img src='$board_skin/admin.gif' border=0 align=absmiddle></a>"; } ?></td></form>
<!-- 검색폼 끝-->
</tr></table>
</td></tr>
</table>
<!-- 최상단 카테고리, 총 몇건?? 끝##########-->
<table width='100%' cellpadding=0 cellspacing=0 border=0>
<tr><td height=2 bgcolor=#FF9900></td></tr>
<tr height=4><td colspan=8 background=<?=$board_skin?>/sha.gif></td></tr>
</table>
<table width=100% border=0 cellpadding=3 cellspacing=0>
<form name=frmgblist method='post' action='./?doc=bbs/gbdeleteall.php'>
<input type=hidden name=bo_table value='<?=$bo_table?>'>
<input type=hidden name=sselect value='<?=$sselect?>'>
<input type=hidden name=stext value='<?=$stext?>'>
<input type=hidden name=section value='<?=$section?>'>
<input type=hidden name=page value='<?=$page?>'>
<input type=hidden name=sw value=''>
<?
// 번호에 이미지를 사용할 경우는 아래의 주석을 제거하고 $list[$i][num]의 내용을 수정후 사용하세요.
// if (!is_int($list[$i][num])) { $list[$i][num] = "<img src='$board_skin/img/arrow.gif'>"; }
?>
<? for ($i=0; $i<count($list); $i++) { ?>
<? if (!file_exists($list[$i][file_image2])) { $list[$i][file_image2] = "$board_skin/noimage.gif"; } ?>
<tr width=100% height=5><td colspan=5></td></tr>
<tr width=100% class=list<?=($i%1)?>>
<td align=left valign=top width='<?=$image_width?>' height=200><a href='<?=$list[$i][href]?>'><img src='<?=$list[$i][file_image2]?>' width='<?=$image_width?>' height='<?=$image_height?>' border=1 alt='<?=$list[$i][wr_subject]?>' style='border-color:#555555;'></a></td>
<td colspan=4 height=100% align=right valign=top>
<table width=100% height=100% border=0 cellpadding=0 cellspacing=0>
<tr height=20>
<td colspan=3 valign=top>
<table width=100% border=0 cellpadding=0 cellspacing=0>
<tr>
<td>
<b><?=$list[$i][num]?>.</b> <b><a href='<?=$list[$i][href]?>'><?=$list[$i][subject]?></a></b>
<?=$list[$i][icon_new]?><?=$list[$i][icon_hot]?><?=$list[$i][icon_battle]?><?=$list[$i][icon_secret]?>
</td>
<td width=20>
<? if ($is_checkdelete) { ?><input type=checkbox name=chk_wr_id[] value='<?=$list[$i][wr_id]?>'><? } ?>
</td>
</tr>
</table>
</td>
</tr>
<tr height=10><td width=43%> <span class=skin_cmt><b>- 분류 : </b><? if ($is_category) { ?><?=$list[$i][ca_name]?><? } ?></span></td>
<td width=23%><span class=skin_cmt><b>- 조회수 : </b><?=$list[$i][wr_hit]?></span></td>
<td width=34%><span class=skin_cmt><b>- 추천수 : </b><?=$list[$i][wr_good]?></span></td>
</tr>
<tr height=10><td> <span class=skin_cmt><b>- 등록자 : </b><?=$list[$i][name]?></span></td>
<td></td>
<td><span class=skin_cmt><b>- 등록일자 : </b><?=$list[$i][datetime]?></span</td>
</tr>
<tr height=10><td colspan=3><span class=skin_cmt>
<?if ($link[$i][link1]) {?> <b>- 링크1 : </b><a href='<?=$link[$i][link_href1]?>' target='blank'><?=set_http(get_text(cut_str($link[$i][link1], 40)))?></a> <b>Hit : </b><?=$list[$i][wr_link1_hit]?><br><?}?>
<?if ($link[$i][link2]) {?> <b>- 링크2 : </b><a href='<?=$link[$i][link_href2]?>' target='blank'><?=set_http(get_text(cut_str($link[$i][link2], 40)))?></a> <b>Hit : </b><?=$list[$i][wr_link2_hit]?><br><?}?>
<?
$ss_name = "ss_view_{$bo_table}_{$list[$i][wr_id]}";
session_register($ss_name);
$$ss_name = $HTTP_SESSION_VARS[$ss_name] = TRUE;
?>
<?if ($file[$i][source1]) {?><a href='<?=$file[$i][file_href1]?>'>- 파일1 : <?=$file[$i][source1]?>
<?=$file[$i][size1]?></a> 다운로드 : <?=$list[$i][wr_file1_download]?><br><?}?>
<?if ($file[$i][source2]) {?><a href='<?=$file[$i][file_href2]?>'>- 파일2 : <?=$file[$i][source2]?>
<?=$file[$i][size2]?></a> 다운로드 : <?=$list[$i][wr_file2_download]?><?}?>
</span>
</td>
</tr>
<tr><td colspan=3 valign=bottom>
<table border=0 cellpadding=0 cellspacing=0>
<tr><td width=10></td>
<td><?=cut_str($list[$i][content],300,"...");?></td>
</tr>
</table>
</td>
</tr>
</table>
</td>
</tr>
<tr height=10><td colspan=5></td></tr>
<tr>
<td colspan=5 height=1 background='./<?=$board_skin?>/dot_line.gif'></td>
</tr>
<? } ?>
<? if (count($list) == 0) { echo "<tr><td colspan=8 align=center height=100 class='content contentbg'>자료가 없습니다.</td></tr>"; } ?>
</form>
</table>
<table width='100%' cellpadding=0 cellspacing=0 border=0>
<tr><td height=2 bgcolor=#FF9900></td></tr>
<tr><td><img src=<?=$board_skin?>/skin_shadow.gif></td></tr>
</table>
<table width=100% cellpadding=0 cellspacing=0 border=0>
<tr height=30>
<!-- 하단 각종 버튼 (글쓰기, 전체선택, 선택해제, 선택삭제..)-->
<td>
<? if ($list_href) { echo "<a href='$list_href'><img src='./$board_skin/img/list.gif' border=0 alt=목록></a>"; } ?>
<? if ($write_href) { echo "<a href='$write_href'><img src='./$board_skin/write.gif' border=0 alt=글쓰기></a>"; } ?>
<? if ($is_checkdelete) { ?>
<a href='javascript:all_checked(true);'><img src='./<?=$board_skin ?>/img/allchk.gif' border=0 alt='전체선택'></a>
<a href='javascript:all_checked(false);'><img src='./<?=$board_skin ?>/img/allunchk.gif' border=0 alt='선택해제'></a>
<a href='javascript:all_delete();'><img src='./<?=$board_skin ?>/img/allchkdel.gif' border=0 alt='글삭제'></a>
<a href="javascript:all_move('copy');"><img src='<?="$board_skin/img/copy.gif"?>' border=0 alt='선택복사' align=absmiddle></a>
<a href="javascript:all_move('move');"><img src='<?="$board_skin/img/move.gif"?>' border=0 alt='선택이동' align=absmiddle></a>
<script language='javascript'>
function all_checked(sw)
{
var f = document.frmgblist;
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.frmgblist;
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 all_delete()
{
var f = document.frmgblist;
str = "삭제";
if (!check_confirm(str)) {
return;
}
if (!confirm("선택한 게시물을 정말 "+str+" 하시겠습니까?\n\n한번 "+str+"한 자료는 복구할 수 없습니다")) {
return;
}
f.action = "./?doc=bbs/gbdeleteall.php";
f.submit();
}
// 선택한 게시물 복사 및 이동
function all_move(sw)
{
var f = document.frmgblist;
if (sw == 'copy') {
str = '복사';
} else {
str = '이동';
}
if (!check_confirm(str)) {
return;
}
var sub_win = window.open('', 'gbmoveall', 'left=50, top=50, width=396, height=550, scrollbars=1');
f.sw.value = sw;
f.target = "gbmoveall";
f.action = "./?doc=bbs/gbmoveall.php";
f.submit();
}
</script>
<? } ?>
</td width=100>
<!-- 하단 각종 버튼 (글쓰기, 전체선택, 선택해제, 선택삭제..) 끝#######-->
<td align=right>
<? if ($prev_section_href) { echo "<a href='$prev_section_href'>이전검색</a>"; } ?>
<?=$write_pages?>
<? if ($next_section_href) { echo "<a href='$next_section_href'>다음검색</a>"; } ?>
</td>
</tr>
</table>
</td></tr></table>
================================================================
댓글 전체