RadarURL

조회 수 6829 추천 수 0 댓글 0
?

단축키

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=javascript:void(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
?

공부 게시판

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

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

    Date2003.08.18 By처누 Views941994
    read more
  2. EMR을 기반으로 DW를 구축한 병원의 CRM 활용 방안 연구 = The Study on a Plan to Activate Customer Relationship Management through Data Warehouse based on Electronic Medical Record of Hospitals

    Date2026.02.06 Category논문 ByJaeSoo Views10
    Read More
  3. 호스팅케이알(hosting.kr) 도메인 가격 2배 인상으로 인한 도메인 기관 이전

    Date2026.01.16 Category인터넷 ByJaeSoo Views0
    Read More
  4. 올바른 자위습관을 가져야 하는 이유

    Date2026.01.12 Category건강 ByJaeSoo Views51
    Read More
  5. 대한민국 결정사 직업 등급표

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    Date2025.12.09 Category건강 ByJaeSoo Views238
    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


숭실대 인공지능학과


숭실대 통신연구실


베너