G4와 phpfeechat 챗트 연동하기 정보
G4와 phpfeechat 챗트 연동하기
본문
우선 도움을 주신 헐랭이님께 감사드립니다...^^
아래 링크의 헐랭이님 팁을 활용했습니다
http://www.sir.co.kr/bbs/board.php?bo_table=g4_tiptech&wr_id=7842
phpfeechat 챗트를 사용하기 위해서는
우선 소스 파일을 구해야겠죠?
아래링크에서 최신 버전을 다운받으세요.
http://www.phpfreechat.net/download.en.html
참고로 위 소스의 라이센스는 여기에서 확인하세요..
http://www.phpfreechat.net/license.en.html
파일을 다운 받으셨다면 파일의 압축을 해제하여
그누보드 설치폴더에 업로드한 다음
도메인명/phpfreechat-1.0-final/ 으로 불러오시면
phpfreechat-1.0-final 폴더내의 index.php 파일이 실행되면서
채팅창이 열리게 되는데 좌측에 메뉴들을 이용해 보시면
비록 영문이지만 설치하는 방법이 잘 설명이 되어있습니다 .
우선 General 항목의 Demos 로 들어가셔서 실행되는 모습들을 잘 살펴 보세요...
살펴 보시고 감을 잡으셨으면 이제부터
G4와 phpfeechat 챗트를 연동하기 위하여 아래의 소스를
적당한 이름으로 phpfreechat-1.0-final 내에 저장하시고
도메인명/phpfreechat-1.0-final/파일명 으로 불러오시면 G4와 연동이 됩니다..
아래는 G4 연동채팅소스 입니다.
<?php
include_once("./_common.php"); // common.php 파일의 경로를 맞춰주세요.
require_once dirname(__FILE__)."/src/phpfreechat.class.php";
$params["serverid"] = md5(__FILE__); // calculate a unique id for this chat
$params["language"] = "ko_KR";
$params["isadmin"] = true; // just for debug ;)
if ($member['mb_id']) {
$oneline = $member['mb_name'];
$params["nick"] = $oneline; // setup the intitial nickname
} else {
alert('회원 전용 채팅 입니다.\n\n로그인 후 이용해주세요.', $url='javascript:window.close();');
exit;
//$params["nick"] = "guest".rand(1,999); // setup the intitial nickname
}
$chat = new phpFreeChat( $params );
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html>
<head>
<meta http-equiv="content-type" content="text/html; charset=utf-8" />
<title>phpFreeChat demo</title>
<link rel="stylesheet" title="classic" type="text/css" href="style/generic.css" />
<link rel="stylesheet" title="classic" type="text/css" href="style/header.css" />
<link rel="stylesheet" title="classic" type="text/css" href="style/footer.css" />
<link rel="stylesheet" title="classic" type="text/css" href="style/menu.css" />
<link rel="stylesheet" title="classic" type="text/css" href="style/content.css" />
</head>
<body>
<div>
<?php $chat->printChat(); ?>
</div>
</body>
</html>
추가 옵션들은 데모에서 살펴보신것을 참고로해서
다양하게 활용하시면 됩니다...^^
그럼 .....잘 사용하세요...^^
2
댓글 6개

EUC-KR 버전에서 사용하실 분들은
아래의 소스를 이용하세요...^^
<?php
include_once("./_common.php"); // common.php 파일의 경로를 맞춰주세요.
require_once dirname(__FILE__)."/src/phpfreechat.class.php";
$params["serverid"] = md5(__FILE__); // calculate a unique id for this chat
$params["language"] = "ko_KR";
$params["isadmin"] = true; // just for debug ;)
if ($member['mb_id']) {
$oneline = $member['mb_name'];
$oneline2 = iconv("EUC-KR", "UTF-8", $oneline);
$params["nick"] = $oneline2; // setup the intitial nickname
} else {
alert('회원 전용 채팅 입니다.\n\n로그인 후 이용해주세요.', $url='javascript:window.close();');
exit;
//$params["nick"] = "guest".rand(1,999); // setup the intitial nickname
}
$chat = new phpFreeChat( $params );
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html>
<head>
<meta http-equiv="content-type" content="text/html; charset=utf-8" />
<title>phpFreeChat demo</title>
<link rel="stylesheet" title="classic" type="text/css" href="style/generic.css" />
<link rel="stylesheet" title="classic" type="text/css" href="style/header.css" />
<link rel="stylesheet" title="classic" type="text/css" href="style/footer.css" />
<link rel="stylesheet" title="classic" type="text/css" href="style/menu.css" />
<link rel="stylesheet" title="classic" type="text/css" href="style/content.css" />
</head>
<body>
<div>
<?php $chat->printChat(); ?>
</div>
</body>
</html>

한번 테스트 해보아 겟네요^^*

접속자 리스트에서 상대방의 닉네임을 클릭 .... " 개인메세지 " 클릭 ....^^
위와 같이 하시면 상대방 닉네임으로 채팅방이 추가가 됩니다...^^

phpfreechat.com에서 create account도 안되고 다운로드를 받을 수가 없네요ㅠㅠㅠ
어찌해야 하나요ㅠㅠㅠ
급한데...