PDA

View Full Version : simple scrips



amber19
11-10-2008, 07:10 AM
hi, i instaled php free chat from simple scrips and when i go yo the site it is a blank page . in file manager the files are all there but how can i get it working. ty amber

Falcon1986
11-10-2008, 07:59 AM
Did you read the documentation (http://www.phpfreechat.net/quickstart)?

pghcollectibles
11-10-2008, 07:59 AM
could you provide a link for us?

amber19
11-10-2008, 09:02 AM
ok i just had to refresh , i have it now i just have to find out how to apply changes and rehash. these are 3rd.party scrips and hm does not offer suport ty amber

pghcollectibles
11-10-2008, 11:06 AM
we are not hm, just users like you. we try to help out with all sorts of coding issues (all scripts are 3rd party) hm doesnt write these codes. at least not most of them

wschutz
04-04-2010, 07:06 AM
There seems to be a catch-22 with phpFreeChat. According to the documentation, I need to /rehash to have a new index.php take effect. But the default index.php doesn't define any admin accounts:


require_once dirname(__FILE__)."/src/phpfreechat.class.php";
$params = array();
$params["title"] = "Quick chat";
$params["nick"] = "guest".rand(1,1000); // setup the intitial nickname
$params["isadmin"] = false; // do not use it on production servers ;)
$params["serverid"] = md5(__FILE__); // calculate a unique id for this chat
//$params["debug"] = true;
$chat = new phpFreeChat( $params );

In testing on my own system, I was able to get around this by restarting Apache, but I can't seem to get tech support to understand why I want to restart apache (I'm not sure if its a global or local apache either).

Any thoughts?

shadmego
04-04-2010, 07:57 AM
I believe the Apache is a global copy and there is no amount of pleading that will cause the techs to restart apache unless the server has to be restarted, or they themselves make changes to the server environment.

I haven't read the documentation, but are you sure there is no other way around getting this set up other than having to restart apache?

shadmego
04-04-2010, 08:00 AM
How about this piece of code?



In special cases, you cannot access the chat to run the ”/rehash” command. An alternative is to manually delete the “data/private/cache/” directory content.

wschutz
04-05-2010, 04:53 AM
shadmego - worked perfectly ... I guess I missed that in the doc, many thanks.

wschutz
04-06-2010, 06:24 AM
So does anyone have phpFreeChat running on HM? It works fine, except that I can't seem to change the Nick thats being used. The first Nick after a refresh is the one thats used by everyone, even with the default settings in index.php. My script is:


require_once dirname(__FILE__)."/src/phpfreechat.class.php";
$params = array();
$params["title"] = "Welcome to the SHP Cafe - A Place to Chat";
//$params["nick"] = "";
$params["nick"] = iconv("ISO-8859-1", "UTF-8", $_GET["userid"]);
$params["serverid"] = md5(__FILE__); // calculate a unique id for this chat
//$params["channels"] = array("Main Street", "Local EMS Issues");
$params["channels"] = array("Main Street");
//$params["debug"] = true;
$params["height"] = "270px";
$params["frozen_nick"] = true;
$params['admins'] = array('wschutz' => 'admin', 'wayne' => 'admin');
$params['theme'] = "shp";
$params['dyn_params'] = array('nick');

$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>SHP Cafe</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="content">
<?php $chat->printChat(); ?>
</div>

</body></html>

shadmego
04-06-2010, 07:38 AM
From what I understand, you are not supposed to be using $_GET. They want you to use $_SESSION instead:



Why doesn't my code that includes $_GET/$_POST work?

$_GET and $_POST do NOT work well with this chat. It is recommended that you use $_SESSION, by setting whatever get/post values you will need into the session on a page BEFORE the chat page, then redirect to the chat page (by default, the chat page would be index.php).

wschutz
04-08-2010, 05:55 AM
Yes, using $_SESSION did the trick. It was a little fun since I am calling index.php from a perl script, but I used Perl's PHP:Session package and it works fine now. Thanks .