전체페이지뷰 수
어제페이지 뷰 수
오늘페이지뷰 수 와
총게시판수 를 방문자현황처럼 나타나게하려고합니다.
그런데,실력이 모자라다보니, 구현소스를 알 수가 없어 문의드립니다.
아시는 분 계시면 부탁드립니다.
항상 즐거운 날 되세요^^
어제페이지 뷰 수
오늘페이지뷰 수 와
총게시판수 를 방문자현황처럼 나타나게하려고합니다.
그런데,실력이 모자라다보니, 구현소스를 알 수가 없어 문의드립니다.
아시는 분 계시면 부탁드립니다.
항상 즐거운 날 되세요^^
댓글 5개
그런 기능이 필요하면 페이지를 열때 별도로 페이지 뷰수 누계를 기록하는 기능을 넣으면 출력시 쿼리도 줄일 수 있고 출력방법도 간단하게 되겠지만 어려울테니
기본 상태에서 가능한 방법으로 합계를 내는 코드를 만들어드리겠습니다
(게시판 마다 게시물수가 몇만개씩으로 쌓여가면 별로 좋은 방법이 아닙니다)
접속자마다 이런 처리를 해야하니 더욱 그렇습니다
$totalcnt=0;
$result = sql_query("select bo_table from $g4[board_table]");
for ($i=0; $row=sql_fetch_array($result); $i++) {
$table= $g4[write_prefix].$row[bo_table];
$tmp=sql_fetch("select sum(wr_hit) as cnt from $table");
$totalcnt+=$tmp[cnt];
}
echo "게시판수 : ".$i;
echo " 조회수 : ".$totalcnt;
그런데 전체 조회수 합계가 무슨 의미가 있는지 모르겠네요
기본 상태에서 가능한 방법으로 합계를 내는 코드를 만들어드리겠습니다
(게시판 마다 게시물수가 몇만개씩으로 쌓여가면 별로 좋은 방법이 아닙니다)
접속자마다 이런 처리를 해야하니 더욱 그렇습니다
$totalcnt=0;
$result = sql_query("select bo_table from $g4[board_table]");
for ($i=0; $row=sql_fetch_array($result); $i++) {
$table= $g4[write_prefix].$row[bo_table];
$tmp=sql_fetch("select sum(wr_hit) as cnt from $table");
$totalcnt+=$tmp[cnt];
}
echo "게시판수 : ".$i;
echo " 조회수 : ".$totalcnt;
그런데 전체 조회수 합계가 무슨 의미가 있는지 모르겠네요
이런식으로 사이트 현황의 항목에 집어 넣으려고합니다.
<tr>
<td style="padding-left:15;" colspan="3" span class="bu" height="22"></span> <a href="#">어제가입자 :
</a> <font color="#666666" style="font-size:9pt;">
<?
$row = sql_fetch(" select count(*) as cnt from $g4[member_table] where left(mb_datetime,10) = '".date("Y-m-d", time()-86400)."' ");
echo "$row[cnt]명";
?>
</font></td>
</tr>
<tr>
<td style="padding-left:15;" colspan="3" span class="bu" height="22"></span> <a href="#">전체회원수 :
</a><font color="#666666" style="font-size:9pt;">
<?
$row = sql_fetch(" select count(*) as cnt from $g4[member_table] ");
echo "$row[cnt]명<br>";
?></td></tr>
<tr>
<td style="padding-left:15;" colspan="3" span class="bu" height="22"></span> <a href="#">전체방문자 :
<?=number_format($visit[4])?>명
</a></td>
</tr>
좀 무리겠지요?^.^
<tr>
<td style="padding-left:15;" colspan="3" span class="bu" height="22"></span> <a href="#">어제가입자 :
</a> <font color="#666666" style="font-size:9pt;">
<?
$row = sql_fetch(" select count(*) as cnt from $g4[member_table] where left(mb_datetime,10) = '".date("Y-m-d", time()-86400)."' ");
echo "$row[cnt]명";
?>
</font></td>
</tr>
<tr>
<td style="padding-left:15;" colspan="3" span class="bu" height="22"></span> <a href="#">전체회원수 :
</a><font color="#666666" style="font-size:9pt;">
<?
$row = sql_fetch(" select count(*) as cnt from $g4[member_table] ");
echo "$row[cnt]명<br>";
?></td></tr>
<tr>
<td style="padding-left:15;" colspan="3" span class="bu" height="22"></span> <a href="#">전체방문자 :
<?=number_format($visit[4])?>명
</a></td>
</tr>
좀 무리겠지요?^.^
게시글 목록
| 번호 | 제목 |
|---|---|
| 284508 | |
| 284499 | |
| 284492 | |
| 284490 | |
| 284484 | |
| 284481 | |
| 284478 | |
| 284476 | |
| 284474 | |
| 284472 | |
| 284470 | |
| 284458 | |
| 284457 | |
| 284454 | |
| 284453 | |
| 284447 | |
| 284446 | |
| 284444 | |
| 284441 | |
| 284440 |
댓글 작성
댓글을 작성하시려면 로그인이 필요합니다.
로그인하기