• 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

Two chat windows different sizes

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

Post a reply
5 posts • Page 1 of 1

Postby chughes » Tue Mar 10, 2009 5:39 am

I have searched the forum and have not been able to find an answer to this.

I am trying to setup two different web pages with the same chat room. Basically the first page has a medium sized chat window for guests to login with a height of about 400px. The second page will be used to display the live chat on a very large screen and needs to be about 1024x768 so that it takes up the whole display. I can get one or the other to work by changing $param["height"], but everytime I /rehash it overwrites the previous value. Is there a way to dynamically adjust the height of the chat window or have two seperate windows of different size.

I tried using a static server id and created two seperate index.php files, but that didn't work because the /rehash.

See code below:

<?php

require_once dirname(__FILE__)."/src/phpfreechat.class.php";
$params = array();
$params["height"] = "628px";
$params["shownotice"] = 1;
$params["time_format"] = 'H:i';
$params["title"] = " ";
$params['max_msg'] = 35;
$params["startwithsound"] = false;
$params["display_ping"] = false;
$params["display_pfc_logo"] = false;
$params["displaytabimage"] = false;
$params["timeout"] = 60000;
$params["isadmin"] = false;
$params["admins"] = array("admin" => "password");
$params["displaytabclosebutton"] = false;
$params["isadmin"] = false; // do not use it on production servers
$params["serverid"] = md5("2l23j5ha8sd9f87f"); // calculate a unique id for this chat
$params["channels"] = array('chat');
$params['time_offset'] = 60*60*15; // offset in seconds
$params["showsmileys"] = false;
//$params["debug"] = true;
$chat = new phpFreeChat( $params );

?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html>
<head>
<meta http-equiv="content-type" content="text/html; charset=utf-8" />
<title>phpFreeChat- Sources Index</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 class="header">
<h1>phpFreeChat - Sources Index</h1>
<img alt="logo bulle" src="style/bulle.gif" class="logo2" />
</div>-->

<div class="content">
<?php $chat->printChat(); ?>
<?php if (isset($params["isadmin"]) && $params["isadmin"]) { ?>
<p style="color:red;font-weight:bold;">Warning: because of "isadmin" parameter, everybody is admin. Please modify this script before using it on production servers !</p>
<?php } ?>
</div>
</body></html>

Any help would be greatly appreciated,
Thanks!
chughes
New member
 
Posts: 3
Joined: Tue Mar 10, 2009 4:43 am
Top

Postby OldWolf » Fri Mar 13, 2009 5:42 am

Give http://www.phpfreechat.net/parameters#dyn_params a try, see if that's what you're looking for. This will allow each chat to have it's own parameter.
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 chughes » Wed Apr 01, 2009 4:02 am

I tried taking your advice and added this to the code in my original post.

$params["dyn_params"] = array("height");
$params["height"] = "638px";

Both php files are identical except for the "height" value. It appears that this value is still being cached though. When I open the second php file with the smaller height value it uses the value from the first file. I have tried this with other variables like "title" as well with the same problem.

Any Suggestions?

Thanks,
Carl
chughes
New member
 
Posts: 3
Joined: Tue Mar 10, 2009 4:43 am
Top

Postby OldWolf » Wed Apr 01, 2009 4:08 am

Did you rehash after the change?
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 chughes » Tue Apr 07, 2009 12:44 am

I have tried to rehash several times. It seems like the value for 'height' and 'title' are still being cached somehow. If I open file1.php and then file2.php they both use the values from file1.php for 'height' and 'title'.

Using /rehash after opening file2.php does not even seem to update these values. I have to go in and manually delete the cache in /data/private/cache to reset things. The 'height' and 'title' values then default to whichever php file I open first after deleting the cache.

This weird behaviour only seems to be a problem with dyn_params. The regular params seem to function properly.

Below is the exact code being used in each file.

Thanks for your help and patience.

-------------------------------------------------------------------------------

file1.php

<?php

require_once dirname(__FILE__)."/src/phpfreechat.class.php";
$params = array();
$params["height"] = "238px";
$params["shownotice"] = 1;
$params["time_format"] = 'H:i';
$params["title"] = "Small Chat";
$params["dyn_params"] = array("height","title");
$params['max_msg'] = 35;
$params["startwithsound"] = false;
$params["display_ping"] = false;
$params["display_pfc_logo"] = false;
$params["displaytabimage"] = false;
$params["timeout"] = 60000;
$params["isadmin"] = false;
$params["displaytabclosebutton"] = false;
$params["isadmin"] = false; // do not use it on production servers ;)
$params["serverid"] = md5("chat2009"); // calculate a unique id for this chat
$params["channels"] = array('chat');
$params['time_offset'] = 60*60*15; // offset in seconds
$params["showsmileys"] = false;
//$params["debug"] = true;
$chat = new phpFreeChat( $params );
$chat->printChat();
if (isset($params["isadmin"]) && $params["isadmin"]) { }?>

---------------------------------------------------------------------------
file 2.php

<?php

require_once dirname(__FILE__)."/src/phpfreechat.class.php";
$params = array();
$params["height"] = "638px";
$params["shownotice"] = 1;
$params["time_format"] = 'H:i';
$params["title"] = "Big Chat";
$params["dyn_params"] = array("height","title");
$params['max_msg'] = 35;
$params["startwithsound"] = false;
$params["display_ping"] = false;
$params["display_pfc_logo"] = false;
$params["displaytabimage"] = false;
$params["timeout"] = 60000;
$params["isadmin"] = false;
$params["displaytabclosebutton"] = false;
$params["isadmin"] = false; // do not use it on production servers ;)
$params["serverid"] = md5("chat2009"); // calculate a unique id for this chat
$params["channels"] = array('chat');
$params['time_offset'] = 60*60*15; // offset in seconds
$params["showsmileys"] = false;
//$params["debug"] = true;
$chat = new phpFreeChat( $params );
$chat->printChat();
if (isset($params["isadmin"]) && $params["isadmin"]) { }?>
chughes
New member
 
Posts: 3
Joined: Tue Mar 10, 2009 4:43 am
Top


Post a reply
5 posts • Page 1 of 1

Return to General Support (v1.x)

Who is online

Users browsing this forum: No registered users and 11 guests

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