P

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>



추가 옵션들은 데모에서 살펴보신것을 참고로해서

다양하게 활용하시면 됩니다...^^



그럼 .....잘 사용하세요...^^

|

댓글 6개

위의 채팅소스는 모두 기본적으로 UTF-8 로 되어있습니다...^^

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>
그누 채팅연동을 찾고 있었는데...감사합니다.
한번 테스트 해보아 겟네요^^*
두사람만이 대화를 하려면 어떻게 하면 되는 건가요? 감사합니다
귓속말 기능을 이용하시면 됩니다..^^
접속자 리스트에서 상대방의 닉네임을 클릭 .... " 개인메세지 " 클릭 ....^^

위와 같이 하시면 상대방 닉네임으로 채팅방이 추가가 됩니다...^^
그누연동 채팅이 필요해서 download 받으러 갔는데...
phpfreechat.com에서 create account도 안되고 다운로드를 받을 수가 없네요ㅠㅠㅠ
어찌해야 하나요ㅠㅠㅠ
급한데...
안되네요..
댓글을 작성하시려면 로그인이 필요합니다. 로그인

그누4 팁자료실

그누보드4와 관련된 팁을 여러분들과 함께 공유하세요. 나누면 즐거움이 커집니다.

+
제목 글쓴이 날짜 조회
18년 전 조회 2,715
18년 전 조회 3,939
18년 전 조회 3,041
18년 전 조회 3,176
18년 전 조회 3,244
18년 전 조회 4,769
18년 전 조회 4,920
18년 전 조회 7,735
18년 전 조회 2,813
18년 전 조회 5,539
18년 전 조회 7,914
18년 전 조회 4,398
18년 전 조회 7,004
18년 전 조회 3,426
18년 전 조회 4,366
18년 전 조회 2,629
18년 전 조회 3,327
18년 전 조회 3,405
18년 전 조회 6,422
18년 전 조회 2,939
🐛 버그신고