[질문] 스킨자료실 출석체크 게임 페이징 처리 방법 > 그누4 질문답변

그누4 질문답변

그누보드4 관련 질문은 QA 로 이전됩니다. QA 그누보드4 바로가기
기존 게시물은 열람만 가능합니다.

[질문] 스킨자료실 출석체크 게임 페이징 처리 방법 정보

[질문] 스킨자료실 출석체크 게임 페이징 처리 방법

본문

 

http://sir.co.kr/bbs/board.php?bo_table=g4_skin&wr_id=96660&page=2

위 스킨을 적용했는데,

두치라는 분의 댓글을 보니까 페이징 처리를 하셨더라구요.

http://www.da5.co.kr/gweb/bbs/attendance.php

페이징 처리 하는 방법 좀 알려주시면 감사드리겠습니다.

아래는 전체 소스 입니다.

--------------------------------------------------------
<?
include_once("./_common.php");
include_once("$g4[path]/_head.php");

$game_point = 10; // 게임포인트 설정
$game_besu1 = 10; // 퍼펙트 게임포인트 배수 설정
$game_besu2 = 3; // ±1 게임포인트 배수 설정
$game_besu3 = 1; // ±3 게임포인트 배수 설정
$game_range1 = 1; // ±1 게임 점수 설정
$game_range2 = 3; // ±3 게임 점수 설정
$game_minus = 30; // ±30 게임 감점점수 설정

// 게임 평균
function mb_average($mb_id,$agelevel)
{
 global $g4;

 $sql = "select count(po_id) as cnt from $g4[point_table] where mb_id='$mb_id' and po_rel_table = '@attendance' and SUBSTRING(po_rel_action,1,1) = '$agelevel' ";
 $row = sql_fetch($sql);
 $game_average = $row[cnt];

 return $game_average;
}
//로그인 테이블기준 로그인 여부 체크
function mb_loginchk($mb_id)
{
 global $g4;

 if ($mb_id) {
  $sql = "select mb_id from $g4[login_table] where mb_id='$mb_id'";
  $mb = sql_fetch($sql);
 
  if($mb[mb_id])
   $message = "접속중";
  else
   $message = "";
  return $message;
 }
}

//게임점수
function mb_gamechk($mb_id)
{
 global $g4;
 $tmp = array();
 if ($mb_id) {
  $sql = "select po_point, SUBSTRING(po_rel_action,1,1) as agelevel from $g4[point_table] where mb_id='$mb_id' and SUBSTRING(po_datetime,1,10) = '$g4[time_ymd]' and po_rel_table = '@attendance' ";
  $po = sql_fetch($sql);

  if($po[po_point])
   $tmp[point] = "$po[po_point]";
  else
   $tmp[point] = "";

  if($po[agelevel])
   $tmp[agelevel] = "$po[agelevel]";
  else
   $tmp[agelevel] = "";

  return $tmp;
 }
}

// 총 인원 수
$sql = " select count(*) as cnt from $g4[member_table] where mb_today_login like '$g4[time_ymd]%' and mb_id != '$config[cf_admin]' order by mb_today_login";
$cnt = sql_fetch($sql);

?>
<script language="javascript" src="<?=$g4[path]?>/js/sideview.js"></script>
<script LANGUAGE="Javascript">
function Title() {document.title="STOP ON 1o0 By  Nolan Gendron"; window.setTimeout("Title1();",1);}
function Title1() {document.title="STOP ON 10o By Nolan Gendron"; window.setTimeout("Title();",1);}
    counter=0;
function Counter1() {
    window.status="Counter: " + counter;
    document.game.number.value=counter;
    counter++;
    Time=window.setTimeout("Counter1();",1);
    if (counter==201) {
        counter=0;
    }
}

function Results() {
    window.clearTimeout(Time);
 document.game.number.value=counter;
 document.game.submit();
}
</script>
<style type="text/css">
<!--
#attendance_font td{
 color: #FFFFFF;
 }
.tt1 { font-family: verdana,돋음; font-size: 10px; color: #555555; line-height: 170%; }
.test11 { background-color:#222222; border:0px; }
-->
</style>
<table align=center cellpadding="0" cellspacing="0" width="100%">
<tr>
 <td height=30 align=right valign=bottom>Total <strong><?=$cnt[cnt]?></strong> 명 </td>
</tr>
<tr>
 <td height=5 align=right valign=bottom></td>
</tr>
</table>
<table width="720" border="0" align="center" cellpadding="0" cellspacing="0" background="<?=$g4[path]?>/img/att_base.png" class="tt1">
  <tr>
    <td width="160" height="170"></td>
    <td width="270">
<span class="tt1"><br>
Start 클릭하고 숫자가 100이 되는 순간 Stop 클릭!<br>
[1] 100점에 정확히 맞힐 경우 : <?=number_format($game_point * $game_besu1);?>포인트<br>
[2] ±1점에 맞힐 경우 : <?=number_format($game_point * $game_besu2);?>포인트<br>
[3] ±3점에 맞힐 경우 : <?=number_format($game_point * $game_besu3);?>포인트<br>
(감점 : ±30점 초과해 맞힐 경우 : -<?=number_format($game_point * $game_besu3);?>포인트)</span></td>
    <td width="95" valign="top">
   
    <form name="game" action="attendance_update.php" method="post">
    <table width="100" border="0" cellspacing="0" cellpadding="0">
      <tr>
        <td height="35"></td>
      </tr>
      <tr>
        <td align="center" height="50">
          <input type="hidden" name="point" VALUE="<?=$game_point;?>">
          <input type="hidden" name="besu1" VALUE="<?=$game_besu1;?>">
          <input type="hidden" name="besu2" VALUE="<?=$game_besu2;?>">
          <input type="hidden" name="besu3" VALUE="<?=$game_besu3;?>">
          <input type="hidden" name="range1" VALUE="<?=$game_range1;?>">
          <input type="hidden" name="range2" VALUE="<?=$game_range2;?>">
          <input type="hidden" name="minus" VALUE="<?=$game_minus;?>">
          <input class="test11" type="text" name="number" VALUE="0" onFocus="this.blur();" style="font-size: 40;font-family:arial black;width:100;color:white">
         
        </td>
      </tr>
      <tr>
        <td height="30" align="center">
        <img id="Start" src="<?=$g4[path]?>/img/_start.png" border=0 onClick="Counter1(); counter=0;" style="cursor:hand;"> <input type=image id="Stop" src="<?=$g4[path]?>/img/_stop.png" border=0 onClick="Results(); counter=0;">
        </td>
      </tr>
      <tr>
        <td height="45"></td>
      </tr>
    </table>
    </form>
   
    </td>
    <td width="100" valign="top"><table width="45" border="0" align="right" cellpadding="0" cellspacing="0">
      <tr>
        <td height="69"> </td>
      </tr>
      <tr>
        <td height="20" align="right"><?=mb_average($member[mb_id],"a");?></td>
      </tr>
      <tr>
        <td height="20" align="right"><?=mb_average($member[mb_id],"b");?></td>
      </tr>
      <tr>
        <td height="20" align="right"><?=mb_average($member[mb_id],"c");?></td>
      </tr>
      <tr>
        <td height="20" align="right"><?=mb_average($member[mb_id],"e");?></td>
      </tr>
    </table></td>
    <td width="25"></td>
  </tr>
</table>
<br />
<table width=100% align=center cellpadding="0" cellspacing="0">
<tr height=25 align=center id="attendance_font">
 <td width="40" background="<?=$g4[path]?>/img/count_bg.gif"><div style="margin-left:5px;">순서</div></td>
    <td width="7"><img src="<?=$g4[path]?>/img/count_bg._shodow.gif" width="7" /></td>
 <td width="80" background="<?=$g4[path]?>/img/board_image_bg.gif">로그인시간</td>
 <td width="30" background="<?=$g4[path]?>/img/board_image_bg.gif">레벨</td>
 <td width="100" background="<?=$g4[path]?>/img/board_image_bg.gif">닉네임</td>
 <td width="" background="<?=$g4[path]?>/img/board_image_bg.gif">접속여부</td>
 <td width="30" background="<?=$g4[path]?>/img/board_image_bg.gif">오늘</td>
    <td width="70" background="<?=$g4[path]?>/img/board_image_bg.gif">겜포인트</td>
    <td width="35" background="<?=$g4[path]?>/img/board_image_bg.gif">금</td>
    <td width="35" background="<?=$g4[path]?>/img/board_image_bg.gif">은</td>
    <td width="35" background="<?=$g4[path]?>/img/board_image_bg.gif">동</td>
    <td width="35" background="<?=$g4[path]?>/img/board_image_bg.gif">-</td>
    <td width="9"><img src="<?=$g4[path]?>/img/point_bg_shodow.gif" alt="" width="9" /></td>
 <td width="80" background="<?=$g4[path]?>/img/point_image.gif">총포인트</td>
</tr>
<tr>
 <td height="6" colspan="14" background="<?=$g4[path]?>/img/board_shodow.gif"></td>
</tr>
<?
$sql = " select mb_id, mb_name, mb_nick, mb_level, mb_email, mb_homepage, mb_today_login, mb_point
    from $g4[member_table]
     where SUBSTRING(mb_today_login,1,10) = '$g4[time_ymd]'
     and mb_level < '10'
    order by mb_today_login ";
$result = sql_query($sql);

for ($i=1; $row=sql_fetch_array($result); $i++)
{
 // 자신이라면 체크
 if ($row[mb_id] == $member[mb_id])
  $bgcolor = "#FFFFFF";

 $mb_nick = get_sideview($row[mb_id], $row[mb_nick], $row[mb_email], $row[mb_homepage]);
// 본명사용시 사용 $mb_name = get_sideview($row[mb_id], $row[mb_name], $row[mb_email], $row[mb_homepage]);
 $mb_loginchk = mb_loginchk($row[mb_id]);
 $mb_gamechk = mb_gamechk($row[mb_id]);
?>

    <tr bgcolor='<?=$bgcolor?>' onmouseout=this.bgColor='<?=$bgcolor?>' onmouseover=this.bgColor='#f1f1f1'>
        <td align="center" height=25><div style="margin-left:5px;"><?=$i?></div></td>
     <td width="7"></td>
        <td align="center"><?=substr($row[mb_today_login],11,8)?></td>
     <td align="center"><?=$row[mb_level];?></td>
  <td align="center"><?=$mb_nick ?></td>
  <td align="center"><?=$mb_loginchk?></td>
  <td align="center"><img src="<?=$g4[path]?>/img/ico_medal_<?=$mb_gamechk[agelevel];?>.png"></td>
        <td align="right"><div style="margin-right:15px;"><?=$mb_gamechk[point]?>P</div></td>
        <td align="right"><div style="margin-right:10px;"><?=mb_average($row[mb_id],"a");?></div></td>
        <td align="right"><div style="margin-right:10px;"><?=mb_average($row[mb_id],"b");?></div></td>
        <td align="right"><div style="margin-right:10px;"><?=mb_average($row[mb_id],"c");?></div></td>
        <td align="right"><div style="margin-right:10px;"><?=mb_average($row[mb_id],"e");?></div></td>
     <td width="9"></td>
        <td align="right"><div style="margin-right:15px;"><?=number_format($row[mb_point])?>P</div></td>
    </tr>
    <tr><td colspan=14 height=1 bgcolor='#E0E0E0'></td></tr>
<? } ?>
</table>

<?
include_once("$g4[path]/_tail.php");
?>

댓글 전체

전체 66,554 |RSS
그누4 질문답변 내용 검색

회원로그인

(주)에스아이알소프트 / 대표:홍석명 / (06211) 서울특별시 강남구 역삼동 707-34 한신인터밸리24 서관 1402호 / E-Mail: admin@sir.kr
사업자등록번호: 217-81-36347 / 통신판매업신고번호:2014-서울강남-02098호 / 개인정보보호책임자:김민섭(minsup@sir.kr)
© SIRSOFT