1
mouacy
Need help coding XOOPS SESSION
  • 2007/3/1 21:59

  • mouacy

  • Not too shy to talk

  • Posts: 138

  • Since: 2002/11/2


Here is the complete code for the file.

Quote:

<?php
$xoopsOption['pagetype'] = "user";
include "../mainfile.php";
include "../header.php";

if (empty($xoopsModuleConfig['anonpost']) && !is_object($xoopsUser)) {
redirect_header("../index.php", 0, _NOPERM);
exit();
}

$user_name = $xoopsUser->getVar("uname");

//phpfreechat script begins
require_once dirname(__FILE__)."/src/phpfreechat.class.php";
$params = array();
$params["nick"] = $user_name;
$params["serverid"] = $_SESSION['chat_serverid'];
$chat = new phpFreeChat( $params );
$chat->printJavascript();
$chat->printStyle();
$chat->printChat();

//include XOOPS footer
include "../footer.php";
?>


I need to replace the
Quote:

$params["serverid"] = $_SESSION['chat_serverid'];

to make it uses the XOOPS default session.

How?

2
zyspec
Re: Need help coding XOOPS SESSION
  • 2007/3/1 22:29

  • zyspec

  • Module Developer

  • Posts: 1095

  • Since: 2004/9/21


mouacy - I haven't tried this code but I believe it should be changed to something like this:
<?php
global $xoopsConfig;
$xoopsOption['pagetype'] = "user";
include 
"../mainfile.php";
include 
"../header.php";

if (empty(
$xoopsModuleConfig['anonpost']) && !is_object($xoopsUser)) {
        
redirect_header("../index.php"0_NOPERM);
        exit();
}

$user_name $xoopsUser->getVar("uname");

//phpfreechat script begins
require_once dirname(__FILE__)."/src/phpfreechat.class.php";
$params = array();
$params["nick"] = $user_name;
$params["serverid"] = $xoopsConfig['session_name'];
$chat = new phpFreeChat$params );
$chat->printJavascript();
$chat->printStyle();
$chat->printChat();

//include XOOPS footer
include "../footer.php";
?>


I included the 'global $xoopsConfig' (line 2) and changed your $params["serverid"] equate to use the XOOPS session_name. I think this will do what you want.

3
manfraid
Re: Need help coding XOOPS SESSION
  • 2007/4/19 12:59

  • manfraid

  • Just popping in

  • Posts: 1

  • Since: 2007/4/19


Hello,


I would like to know if the coding of your module is finished because this one strongly interests me

PS: sorry for my English I have to use an automatic translator:)

4
marin
Re: Need help coding XOOPS SESSION
  • 2010/12/12 11:14

  • marin

  • Just popping in

  • Posts: 19

  • Since: 2003/1/29


hello, i try also to include phpfreechat in my website but i don't know witch file edit...
i try to integrate the code in a block but it's doesn't works.

5
marin
Re: Need help coding XOOPS SESSION
  • 2010/12/20 19:45

  • marin

  • Just popping in

  • Posts: 19

  • Since: 2003/1/29


up

Login

Who's Online

184 user(s) are online (96 user(s) are browsing Support Forums)


Members: 0


Guests: 184


more...

Donat-O-Meter

Stats
Goal: $100.00
Due Date: Mar 31
Gross Amount: $0.00
Net Balance: $0.00
Left to go: $100.00
Make donations with PayPal!

Latest GitHub Commits