[member.php]관리자님이 배포하신 현재접속자 코드[수정] > 그누3 팁자료실

그누3 팁자료실

[member.php]관리자님이 배포하신 현재접속자 코드[수정] 정보

그누호환 [member.php]관리자님이 배포하신 현재접속자 코드[수정]

본문

<?
if (!defined("_GNUBOARD_")) exit; // 개별 페이지 접근 불가

define("_DOCTYPE_", "DESIGN");

$html_title = "접속회원";

$mod = 6; // 6명이 출력되면 한줄 아래로 출력
?>

<table width=100% cellpadding=1 cellspacing=1>
 &nbsp; &nbsp; &nbsp; <tr><td height=1 background='./<?=$cfg[bbs_dir]?>/line.gif'></td></tr>
 &nbsp; &nbsp; &nbsp; <tr><td class='subject subjectbg ht arial' align=center>현재 접속자</td></tr>
 &nbsp; &nbsp; &nbsp; <tr><td height=1 background='./<?=$cfg[bbs_dir]?>/line.gif'></td></tr>
 &nbsp; &nbsp; &nbsp; <tr>
 &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <td>
 &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <table width=100% cellpadding=0 cellspacing=0><tr><td>
 &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <?
&nbsp; include "./$cfg[bbs_dir]/gblayer.php";
 &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; $guest_count = 0;
 &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; $sql = " select a.mb_id, b.mb_name, b.mb_icon, b.mb_email, b.mb_homepage, b.mb_open, a.lo_ip
 &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;from $cfg[table_login] a left join $cfg[table_member] b on (a.mb_id = b.mb_id)
 &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; order by a.mb_id desc, a.lo_ip ";
 &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; $result = sql_query($sql);
 &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; for ($i=0; $row=mysql_fetch_array($result); $i++) {
 &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; if ($row[mb_id]) {
 &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; $tmp_name = gblayer($row[mb_id], cut_str($row[mb_name],12), $row[mb_email], $row[mb_homepage], $row[mb_open]);
echo "<table width=85% align=left><tr>";
echo "<td height=20><font color=777777>".(($rows)+$i+1).".</font> $tmp_name</td>";
&nbsp; &nbsp;echo "</tr></table>";
&nbsp; &nbsp;if ($i && $i%$mod==0) {
echo "</td></tr><tr><td>";
}
 &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; }
 &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; mysql_free_result($result);
 &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; ?>
 &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; </table>
 &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; </td>
 &nbsp; &nbsp; &nbsp; </tr>
 &nbsp; &nbsp; &nbsp; </table>


많은 테스트를 해보지 못해서 즉 접속자가 많이 접속을 해야 되는데...
테스트 해보시고 글올려주세요...
추천
2

댓글 전체

허~~~~님이 저를 성가시게 하는게 아니라 제가 님을 성가시게하고
좋은팁을 올렸는데 올바르게 사용하지 못하는 제가 미안합니다.
해결했습니다.....
올리신 내용중 하나가 빠졌군요...

올리신 팁....
---------------------------------------------------------------------------------------------------
<?
if (!defined("_GNUBOARD_")) exit; // 개별 페이지 접근 불가

define("_DOCTYPE_", "DESIGN");

$html_title = "접속회원";

$mod = 6; // 6명이 출력되면 한줄 아래로 출력
?>

<table width=100% cellpadding=1 cellspacing=1>
    <tr><td height=1 background='./<?=$cfg[bbs_dir]?>/line.gif'></td></tr>
    <tr><td class='subject subjectbg ht arial' align=center>현재 접속자</td></tr>
    <tr><td height=1 background='./<?=$cfg[bbs_dir]?>/line.gif'></td></tr>
    <tr>
        <td>
            <table width=100% cellpadding=0 cellspacing=0><tr><td>
            <?
include "./$cfg[bbs_dir]/gblayer.php";
            $guest_count = 0;
            $sql = " select a.mb_id, b.mb_name, b.mb_icon, b.mb_email, b.mb_homepage, b.mb_open, a.lo_ip
                      from $cfg[table_login] a left join $cfg[table_member] b on (a.mb_id = b.mb_id)
                      order by a.mb_id desc, a.lo_ip ";
            $result = sql_query($sql);
            for ($i=0; $row=mysql_fetch_array($result); $i++) {
                if ($row[mb_id]) {
                    $tmp_name = gblayer($row[mb_id], cut_str($row[mb_name],12), $row[mb_email], $row[mb_homepage], $row[mb_open]);
echo "<table width=85% align=left><tr>";
echo "<td height=20><font color=777777>".(($rows)+$i+1).".</font> $tmp_name</td>";
 echo "</tr></table>";
 if ($i && $i%$mod==0) {
echo "</td></tr><tr><td>";
}
            }
            }  <--------------------------------------------------------------요거이 빠졌습니다.
            mysql_free_result($result);
            ?>
            </table>
        </td>
    </tr>
    </table>
-------------------------------------------------------------------------------------------

무지한 저를 용서하세요....
님의 관심에 몸둘바를 모르겠습니다.
감사합니다.
괜시리 팁을 올려가지구 님을 더욱 성가시게 하고 있는듯하군뇨

echo "<table width=85% align=left><tr>";
echo "<td height=20><font color=777777>".(($rows)+$i+1).".</font> $tmp_name</td>";
  echo "</tr></table>";
위의 내용을

echo "<font color=777777>".(($rows)+$i+1).".</font>{$tmp_name} &nbsp;&nbsp;&nbsp;";

이렇게 해보시지요
박갑성님 자꾸 귀찮게 하는군요
님이 올리신 소스를 그대로 적용후 member.php라하고 gnu폴더에 올리고 호출하면...
http://도메인/gnu/?doc=member.php

_DOCTYPE_ 오류 : NONE , STYLE , DESIGN 중 하나를 사용하세요.
Parse error: parse error in /home/도메인/gnu/member.php on line 39

님이 올리신 소스는 요렇게 뜨는군요...
위에 된다구 하는건 세로로 한명씩 주~욱 회원 명단이 나오고 밑에 비회원 **명...이렇게 나옵니다.
어케해야되죠?
아마도 sir에서는 아래 처럼 하는시는 듯하군요...

<?
if (!defined("_GNUBOARD_")) exit; // 개별 페이지 접근 불가

define("_DOCTYPE_", "DESIGN");

$html_title = "접속회원";

?>

<table width=100% cellpadding=1 cellspacing=1>
      <tr><td height=1 background='./<?=$cfg[bbs_dir]?>/line.gif'></td></tr>
      <tr><td class='subject subjectbg ht arial' align=center>현재 접속자</td></tr>
      <tr><td height=1 background='./<?=$cfg[bbs_dir]?>/line.gif'></td></tr>
      <tr>
          <td>
              <table width=100% cellpadding=0 cellspacing=0><tr><td>
              <?
  include "./$cfg[bbs_dir]/gblayer.php";
              $guest_count = 0;
              $sql = " select a.mb_id, b.mb_name, b.mb_icon, b.mb_email, b.mb_homepage, b.mb_open, a.lo_ip
                        from $cfg[table_login] a left join $cfg[table_member] b on (a.mb_id = b.mb_id)
                        order by a.mb_id desc, a.lo_ip ";
              $result = sql_query($sql);
              for ($i=0; $row=mysql_fetch_array($result); $i++) {
                  if ($row[mb_id]) {
                      $tmp_name = gblayer($row[mb_id], cut_str($row[mb_name],12), $row[mb_email], $row[mb_homepage], $row[mb_open]);
 echo "$tmp_name &nbsp;&nbsp;";
              }
              mysql_free_result($result);
              ?>
              </table>
          </td>
      </tr>
      </table>
얼마전 좌측하단에 나타나던 접속회원표시는 됩니다.
요거는.....

<?
if (!defined("_GNUBOARD_")) exit; // 개별 페이지 접근 불가

define("_DOCTYPE_", "DESIGN");

$html_title = "접속회원";

?>

<table width=100% cellpadding=1 cellspacing=1>
      <tr><td height=1 background='./<?=$cfg[bbs_dir]?>/line.gif'></td></tr>
      <tr><td class='subject subjectbg ht arial' align=center>현재 접속자</td></tr>
      <tr><td height=1 background='./<?=$cfg[bbs_dir]?>/line.gif'></td></tr>
      <tr>
          <td>
              <table width=100% cellpadding=0 cellspacing=0><tr><td>
  <?
              include "./$cfg[bbs_dir]/gblayer.php";
              $guest_count = 0;
              $sql = " select a.mb_id, b.mb_name, b.mb_icon, b.mb_email, b.mb_homepage, b.mb_open, a.lo_ip
                          from $cfg[table_login] a left join $cfg[table_member] b on (a.mb_id = b.mb_id)
                        order by a.mb_id desc, a.lo_ip ";
              $result = sql_query($sql);
              for ($i=0; $row=mysql_fetch_array($result); $i++) {
                  if ($row[mb_id]) {
                      $tmp_name = gblayer($row[mb_id], cut_str($row[mb_name],12), $row[mb_email], $row[mb_homepage], $row[mb_open]);
                      echo "<tr><td align=center height=20>$tmp_name</td></tr>";
                  } else {
                      $guest_count++;
                  }
              }
              mysql_free_result($result);
              echo "<tr><td align=center height=20>비회원 {$guest_count}명</td></tr>";
              if ($i==0) {
                  echo "<tr><td align=center>없음</td></tr>";
              }
              ?>
           
              </table>
          </td>
      </tr>
      </table>

그런데 님이 올리신팁을 사용하면 안됩니다.
전체 1,026
그누3 팁자료실 내용 검색

회원로그인

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