RadarURL

조회 수 5120 추천 수 0 댓글 1
?

단축키

Prev이전 문서

Next다음 문서

크게 작게 위로 아래로 댓글로 가기 인쇄
?

단축키

Prev이전 문서

Next다음 문서

크게 작게 위로 아래로 댓글로 가기 인쇄
두 그룹으로 나눠진 각각의 홈페이지에서 사용하려고 그룹별 현재접속자 출력하는 방법을 찾다가 이것저것 꿰맞추고 이곳에서 주신 답을 가지고 구현한 겁니다. 구현이라기 보다는 짜맞추기에 가깝겠네요^^;
기쁜마음에 혹시 이런팁을 찾는분이 계실까해서 올려봅니다.

전체소스는 아니고, 각자 사용하는 접속자 출력소스를 보면 비슷한 부분들이 있을겁니다.
해당되는 부분만 참고하시면 쉽게 되리라 생각합니다.
=========================================================================================
// DB 연결
        $connect=dbConn();

// 멤버정보 구하기
        $member=member_info();
        if(!$page&&!$status) $status=1;

// 그룹데이타 읽어오기;;
        $group_data=mysql_fetch_array(mysql_query("select * from $group_table where no='$member[group_no]'"));

// 검색어 처리;;
        if($keyword) {
                if(!$status) $s_que=" where user_id = '$keyword' or name = '$keyword' ";
        }


// 로그인 회원의 수
        $temp2=mysql_fetch_array(mysql_query("select count(*) from $member_table where group_no=3 $s_que"));
        $total_member=$temp2[0];

// 전체회원수
        $temp=mysql_fetch_array(mysql_query("select count(*) from $member_table where group_no=3"));
        $total_member=$temp[0];

        if($status) {
                $_str = trim(zReadFile("$zero_path/data/now_member_connect.php"));
                if($_str) {
                        $_str = str_replace("<?/*","",$_str);
                        $_str = str_replace("*/?>","",$_str);
                        $_connector = explode(":",$_str);
                        
                        $total = count($_connector);
                }
        } else $total=$total_member;
// 페이지 계산
        $page_num=100;
        $total_page=(int)(($total-1)/$page_num)+1; // 전체 페이지 구함

        if(!$page) $page=1;
        if($page>$total_page) $page=1; // 페이지가 전체 페이지보다 크면 페이지 번호 바꿈

        $start_num=($page-1)*$page_num; // 페이지 수에 따른 출력시 첫번째가 될 글의 번호 구함

// 데이타 뽑아오는 부분

// 오프라인 멤버
        if(!$status) {
                $que="select * from $member_table $s_que order by no desc limit $start_num,$page_num";
                $result=mysql_query($que) or Error(mysql_error());
// 온라인 멤버
        } else {
                $endnum = $start_num + $page_num;
                if($endnum>$total) $endnum=$total;
                unset($s_que);
                for($i=$start_num;$i<$endnum;$i++) {
                        $member_no = substr($_connector[$i],12);
                      if($s_que) $s_que .= " or no = '$member_no' "; else $s_que = " where (no = '$member_no' ";
                }
         $que = "select * from $member_table $s_que) and (group_no=3) ";  
                $result=mysql_query($que) or Error(mysql_error());

        }


// 화면에 출력
echo"<link rel=StyleSheet HREF=zumanji_style.css type=text/css>
<script language='javascript'>
window.setTimeout('window.location.reload()',50000); //10초마다 리플리쉬 시킨다 1000이 1초가 된다.
</script>


<div align=right>";
echo"전체회원수 : $total_member 분<br>";
                
// 접속 멤버가 많을 경우 표 안에서 스크롤바를 만들기 위해 상단 div레이어를 이용함.
        $loop_number=$total-($page-1)*$page_num;
        while($data=mysql_fetch_array($result)) {
                $name=stripslashes($data[name]);
      
// 특정이름 안보이게
        if($name == "홍길동")
                    continue;
// 끝

                $user_id=stripslashes($data[user_id]);

// 특정ID 안보이게
        if($user_id == "abcde")
                    continue;
// 끝

              echo"<img src=img/ho.gif border=0><a href=.javascriptvoid(window.open('../view_info.php?member_no=$data[no]','view_info','width=400,height=510,toolbar=no,scrollbars=yes')) onfocus=blur()> $name</a> 님<br>";


                $loop_number--;
        }

====================================================================
특정인을 출력에서 제외할때는, 사용하는 접속자 출력 소스에 보면 $user_id=stripslashes($data[user_id]); 이런식의 부분이 있을겁니다. 그 아래에   if($user_id == "abcde")  continue; 를 추가하면 abcde라는 아이디는 제외가 됩니다.
이것은 여러개의 아이디를 추가해서 사용해도 가능하구요.
아이디가 아닌 이름을 제외할때는 name의 홍길동이라는 부분을 추가하시면 되겠구요.

그룹별로 특정 그룹만 출력을 하고 싶을때는 알맞은 위치에 group_no=그룹넘버 만 추가하면 됩니다.(위 소스에서 group_no 이 들어간 부분 // 로그인회원수 //전체회원수 //온라인멤버 뽑는 부분)

원본 소스는 여기서 받은건데...어느분건지 잊어버렸네요. (__)
엉성한 부분이 있으면 지적바랍니다.

출처 : http://www.nzeo.com/bbs/zboard.php?id=cgi_tip&page=1&sn1=&divpage=1&sn=off&ss=on&sc=off&keyword=그룹&select_arrange=headnum&desc=asc&no=5805
?
  • profile
    JaeSoo 2006.01.28 05:25
    위와 같이 하니까.. 특정 그룹인원의 현재 접속자 출력이 잘 안되더라.. 삽질하다가 다음처럼 하니까 되더라..

    $que = "select * from $member_table $s_que) and (group_no=3) ";
    요 부분을
    if($s_que) $s_que .= " or group_no=12 and no = '$member_no' "; else $s_que = " where group_no=12 and no = '$member_no' ";
    요렇게 바꿔주니 잘 되는거 같다..

공부 게시판

공부에 도움되는 글을 올려주세요.

  1. [공지] 공부 게시판 입니다.

    Date2003.08.18 By처누 Views935959
    read more
  2. 대한민국 결정사 직업 등급표

    Date2026.01.09 Category연애 ByJaeSoo Views3
    Read More
  3. 알아두면 유용한 향수 향 종류 모음

    Date2026.01.09 Category생활 ByJaeSoo Views3
    Read More
  4. 로그인 구글 드라이브 안 쓰고 시놀로지 드라이브 쓰는 이유, 설정 방법 & 활용팁

    Date2026.01.08 Category업무 ByJaeSoo Views4
    Read More
  5. SMB 다중 채널 관리

    Date2026.01.08 Category네트워크 ByJaeSoo Views2
    Read More
  6. Synology NAS SMB 3.0 Multichannel 이용하기

    Date2026.01.08 Category네트워크 ByJaeSoo Views1
    Read More
  7. 어떻게 SSH를 통해 root 권한으로 DSM/SRM에 로그인할 수 있습니까?

    Date2026.01.08 Category네트워크 ByJaeSoo Views1
    Read More
  8. 시놀로지 나스 SMB 3.0 멀티채널 구성하는법

    Date2026.01.08 Category네트워크 ByJaeSoo Views2
    Read More
  9. RWA(Real-World Assets): 실물자산 토큰화 이해

    Date2026.01.05 Category경제 ByJaeSoo Views2
    Read More
  10. 그루밍성범죄와 가스라이팅 차이점, 처벌 수위 알아보기

    Date2025.12.23 Category생활 ByJaeSoo Views57
    Read More
  11. 전문의가 추천하는 자위 횟수

    Date2025.12.23 Category건강 ByJaeSoo Views64
    Read More
  12. 일상에 쉽게 적용할 수 있는 수면 관리 앱 5가지

    Date2025.12.18 Category모바일 ByJaeSoo Views103
    Read More
  13. 매일 밤에 머리 감으면 일어나는 일ㅣ탈모 전문가가 알려주는 충격적인 진실ㅣ김주용 원장 1편ㅣ닥터딩요

    Date2025.12.11 Category건강 ByJaeSoo Views98
    Read More
  14. 다친 손가락에 끼우는 실리콘 손가락

    Date2025.12.11 Category건강 ByJaeSoo Views97
    Read More
  15. 성적 취향에 대하여...

    Date2025.12.09 Category연애 ByJaeSoo Views211
    Read More
  16. fwb(Friends with Benefits)에 대해

    Date2025.12.09 Category연애 ByJaeSoo Views174
    Read More
  17. 자위가 잠자는 데 도움이됩니까? 알아봅시다!

    Date2025.12.09 Category건강 ByJaeSoo Views165
    Read More
  18. 야동 실태보고서

    Date2025.12.09 Category건강 ByJaeSoo Views160
    Read More
  19. 불면증 해결을 위한 자위 활용

    Date2025.12.09 Category건강 ByJaeSoo Views219
    Read More
  20. 변호사가 보아온 상간남들의 공통점

    Date2025.11.25 Category연애 ByJaeSoo Views263
    Read More
  21. 윈도우11 비밀번호 분실시 설정 변경방법 (Windows10 포함)

    Date2025.11.06 Category윈도우즈 ByJaeSoo Views328
    Read More
Board Pagination Prev 1 2 3 4 5 6 7 8 9 10 ... 127 Next
/ 127


즐겨찾기 (가족)

JAESOO's HOMEPAGE


YOUNGAE's HOMEPAGE


장여은 홈페이지


장여희 홈페이지


장여원 홈페이지


즐겨찾기 (업무)

알리카페 홀릭

숭실대 컴퓨터 통신연구실 (서창진)

말레이시아 KL Sentral 한국인 GuestHouse


즐겨찾기 (취미)

어드민아이디

유에코 사랑회

아스가르드 좋은사람/나쁜사람

JServer.kr

제이서버 메타블로그

재수 티스토리


즐겨찾기 (강의, 커뮤니티)

재수 강의 홈페이지


한소리


VTMODE.COM


숭실대 인공지능학과


숭실대 통신연구실


베너