Archives FluxBB.fr

Les archives de FluxBB.fr

Vous n'êtes pas identifié(e).

#1 29-04-2011 09:54:22

baltar
Membre

phpfreechat intégration

Bonjour,

Comme le nom d'indique je cherche à intégrer ce tchat sur mon forum car il est super simpas au terme partique et aussi design que l'ont peut adapter. Il y as de la docs sur leurs site, j'ai suivie les indications mais je n'est pas réussi à l'intégrer....

<?php

  require_once "src/phpfreechat.class.php"; // adjust to your own path
  $params["serverid"] = md5(__FILE__);
  $params["nick"]     = "guest"; // it can be useful to take nicks from a database
  $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>
    </head>

    <body>
      <?php $chat->printChat(); ?>
    </body>
  </html>

J'ai bien mis ça dans main.pl mais rien ne marque,quand j'affiche le forum sa me met la ligne "<?php $chat->printChat(); ?>" et rien de plus. Du cou je n'est pas testé cette doc: http://www.phpfreechat.net/faq#how-to-c … hpfreechat

Avez-vous une idée sur la question?
Cordialement,
Baltar

Dernière modification par baltar (29-04-2011 09:55:09)

Hors ligne

#2 29-04-2011 22:57:14

Doubrovski
Membre

Re : phpfreechat intégration

Hors ligne

#3 30-04-2011 09:35:32

baltar
Membre

Re : phpfreechat intégration

Bonjour,

Merci pour ta réponse

J'ai fait comme sur l'astuce,mais sa me donne toujours ça:

Sans-titre_20110430-0934.png

Hors ligne

#4 30-04-2011 11:39:57

adaur
Membre

Re : phpfreechat intégration

phpfreechat a écrit :

How to connect PunBB nicknames to phpfreechat ?

You have to put this piece of code at beginning of your chat script:

  session_start();
  if (!isset($_SESSION['punbb_to_pfc_nickname']))
  {
    define('PUN_ROOT', dirname(__FILE__).'/forum/'); // adjust this path to your forum installation root
    require PUN_ROOT.'include/common.php';
    $userdata = array();
    check_cookie($userdata);
    if ($userdata['username'] == 'Guest')
      $userdata['username'] .= rand(1,1000); // generate a random guest username
    $_SESSION['punbb_to_pfc_nickname'] = $userdata['username'];
  }

Then you can write the classic phpfreechat parameter list using “$_SESSION['punbb_to_pfc_nickname']” as the phpfreechat nickname. For example:

  require_once "src/phpfreechat.class.php";
  $params["serverid"]          = md5(__FILE__);
  $params["title"]             = "phpFreeChat connected to the PunBB forum";
  $params["channels"]          = array("General","PunBB support");
  $params["language"]          = "en_US";
  $params["nick"]              = $_SESSION['punbb_to_pfc_nickname'];
  $chat = new phpFreeChat($params);

Tout cela me paraît étrange. Essaye plutôt comme ceci:

phpfreechat a écrit :

How to connect PunBB nicknames to phpfreechat ?

You have to put this piece of code at beginning of your chat script:

  session_start();
  if (!isset($_SESSION['punbb_to_pfc_nickname']))
  {
    define('PUN_ROOT', dirname(__FILE__).'/forum/'); // adjust this path to your forum installation root
    require PUN_ROOT.'include/common.php';
    if ($pun_user['username'] == 'Guest')
      $pun_user['username'] .= rand(1,1000); // generate a random guest username
    $_SESSION['punbb_to_pfc_nickname'] = $pun_user['username'];
  }

Then you can write the classic phpfreechat parameter list using “$_SESSION['punbb_to_pfc_nickname']” as the phpfreechat nickname. For example:

  require_once "src/phpfreechat.class.php";
  $params["serverid"]          = md5(__FILE__);
  $params["title"]             = "phpFreeChat connected to the PunBB forum";
  $params["channels"]          = array("General","PunBB support");
  $params["language"]          = "fr_FR";
  $params["nick"]              = $_SESSION['punbb_to_pfc_nickname'];
  $chat = new phpFreeChat($params);


"As code is more often read than written it's really important to write clean code." - Franz
Twitter: @adaurfr
Mon fork de FluxBB: FeatherBB

Hors ligne

Pied de page des forums