• Forum
  • Doc
  • Screenshots
  • Download
  • Donate
  • Contributors
  • Contact
  • Follow @phpfreechat
  • DEMO
  • Board index ‹ Version 1.x branch ‹ General Support (v1.x)
  • Change font size
  • FAQ
  • Register
  • Login

dyn_params usage

Moderators: OldWolf, re*s.t.a.r.s.*2

Post a reply
8 posts • Page 1 of 1

Postby feloescoto » Mon Feb 25, 2008 12:38 am

Hello, first of all, congratulations, this chat looks very powerful and simple to use, I have been trying it for a few days now, but I am having some problems with the nicks, once someone logs in with one nickname, s/he remains logged in with that nick

I saw that there is a setting 'dyn_params' to bypass the cache, but it does not seem to be working properly. I am using 'get' to establish the users nick and other params (I know is not very secure, but I will work on that later on :-) )

This is what I have:

require_once dirname(__FILE__)."/src/phpfreechat.class.php";
$params["serverid"] = md5(__FILE__); // calculate a unique id for this chat

$params["title"] = $_GET['title'];
$params["nick"] = $_GET['user'];
$params["channels"] = array($_GET['channel']);
$params["connect_at_startup"] = true;
$params["height"] = "200px";
$params["dyn_params"] = array("server_script_url", "nick");
$chat = new phpFreeChat($params);

This is what it tells me that it is using:

Array ( [serverid] => 8ae4bfda1af9a4c53156ba94f7c736ac [title] => General Chat [nick] => felipe [channels] => Array ( [0] => General Chats ) [connect_at_startup] => 1 [height] => 200px [dyn_params] => Array ( [0] => server_script_url [1] => nick ) )

Is there something I am missing here?
I have seen other posts in this board and the recommendation is to use this param, but I have not seen any report of whether or not it has worked for them.

Thanks for any help that you can give me.

Regards,
Felipe
feloescoto
New member
 
Posts: 4
Joined: Mon Feb 25, 2008 12:04 am
Top

Postby OldWolf » Mon Feb 25, 2008 1:14 am

I would seriously recomend you use POST instead of GET... get throws all sorts of odd problems into the mix because of the AJAX.

If you REALLY want to use GET, I recomend you hard code the URL params at a minimum.

Also, nick is by default dynamic.
Signature:
Read before Posting: Forum Rules
Note: I am unable to offer support through PM/e-mail at this time.
OldWolf
Site Admin
 
Posts: 1918
Joined: Sun Sep 23, 2007 5:48 am
Top

Postby feloescoto » Mon Feb 25, 2008 4:32 am

Hello and thanks for your reply.

I will try a bigger integration to avoid get and post completely.

I just tried again after a couple of ours out of the chats, and it loaded the names correctly.
I will do some more tests with more users and see how it goes.

Thanks a lot.
feloescoto
New member
 
Posts: 4
Joined: Mon Feb 25, 2008 12:04 am
Top

Postby OldWolf » Mon Feb 25, 2008 11:23 am

Personally, I find that either classes or sessions work best for passing usernames (depending on how complex your user management is).

I use the phpbb 3.0 session classes (ha, combination :P) for management on one website. Works well without messing with the get post odds and ends.

For a short cut, the global $_SESSION is really the easiest way to go by far, and since you have to have cookies for this chat to work, it's no less compatable to browsers than the chat itself. :)
Signature:
Read before Posting: Forum Rules
Note: I am unable to offer support through PM/e-mail at this time.
OldWolf
Site Admin
 
Posts: 1918
Joined: Sun Sep 23, 2007 5:48 am
Top

Postby feloescoto » Mon Feb 25, 2008 4:17 pm

Hi, thanks for the recommendation, I will try it as soon as I am able to load the chat.

I am now trying to include the index file, something like this:

include('chatrooms/index.php');

That way I can pass parameters internally without exposing them, but when the chat is loading it gives me this message:

alt=""
style="float:left;margin:0;"/>
Chat loading ...
Please wait

And it never loads.

I will keep on making tests and see if I can find out what is going on.

Regards,
Felipe
feloescoto
New member
 
Posts: 4
Joined: Mon Feb 25, 2008 12:04 am
Top

Postby OldWolf » Mon Feb 25, 2008 10:27 pm

That first bit is odd... the chat loading issue is pretty common.

Could you link me please?
Signature:
Read before Posting: Forum Rules
Note: I am unable to offer support through PM/e-mail at this time.
OldWolf
Site Admin
 
Posts: 1918
Joined: Sun Sep 23, 2007 5:48 am
Top

Postby feloescoto » Mon Feb 25, 2008 11:19 pm

Sure:

http://silveravatar.com/chatme

And directly to the install:

http://silveravatar.com/chatters/rooms.php
(This loads fine)

There you will see the params that I am using.

I am basically using this
include('chatters/rooms.php');

with this:

<?php

require_once dirname(__FILE__)."/src/phpfreechat.class.php";
$params["serverid"] = md5(__FILE__); // calculate a unique id for this chat

$params["title"] = "mis titulos";
$params["nick"] = "felipe";
$params["channels"] = array("canales");
$params["connect_at_startup"] = true;
$params["height"] = "200px";

$chat = new phpFreeChat($params);
$chat->printJavascript();

$chat->printChat();
print_r($params);


?>

I have not done much more, but any feedback that you can give be will be appreciated.


Regards,
Felipe
Last edited by feloescoto on Mon Feb 25, 2008 11:47 pm, edited 1 time in total.
feloescoto
New member
 
Posts: 4
Joined: Mon Feb 25, 2008 12:04 am
Top

Postby OldWolf » Tue Feb 26, 2008 2:13 am

Ok, I'll try to return to this later tonight. I need to look up some notes I jotted down before. :)
Signature:
Read before Posting: Forum Rules
Note: I am unable to offer support through PM/e-mail at this time.
OldWolf
Site Admin
 
Posts: 1918
Joined: Sun Sep 23, 2007 5:48 am
Top


Post a reply
8 posts • Page 1 of 1

Return to General Support (v1.x)

Who is online

Users browsing this forum: No registered users and 7 guests

  • Board index
  • The team • Delete all board cookies • All times are UTC + 1 hour
Powered by phpBB® Forum Software © phpBB Group
Sign in
Wrong credentials
Sign up I forgot my password
.
jeu-gratuit.net | more partners
Fork me on GitHub