• Forum
  • Doc
  • Screenshots
  • Download
  • Donate
  • Contributors
  • Contact
  • Follow @phpfreechat
  • DEMO
  • Board index ‹ Version 1.x branch ‹ phpBB, Simple Machines Forum (SMF), and Forum Software (v1.x)
  • Change font size
  • FAQ
  • Register
  • Login

Problems with integrating SMF

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

Post a reply
11 posts • Page 1 of 1

Postby Jaminb2030 » Tue Apr 07, 2009 5:43 pm

I used this topic
http://www.phpfreechat.net/forum/viewto ... 8369#p8369

but that chat donst so much as show up and that topic hasnt had a post in a long time here is my index.php

<?php

/////////////////////////////////////////////////////////////////////////////////

require(dirname(__FILE__) . 'http://forums.aohelp.info/SSI.php');

$user_info = ssi_welcome('array');

/////////////////////////////////////////////////////////////////////////////////

if (!$user_info['is_guest'])
{
require_once dirname(__FILE__)."http://forums.aohelp.info/chat2/src/phpfreechat.class.php";

/////////////////////////////////////////////////////////////////////////////////

$params = array();
$params["serverid"] = md5("Ao Help Chat"); // calculate a unique id for this chat
$params["nick"] = $user_info['is_guest'] ? "AoHelp-G" . rand(1, 1000) : $user_info['name'];
$params["title"] = "Ao Help Chat";
$params["language"] = "en_US";
$params["theme"] = "zilveer";
$params["shownotice"] = 0;
$params["display_ping"] = false;
$params["channels"] = array("Common room");
$params["time_offset"] = 2 * 3600;
$params["admins"] = array("" => "");
$params["frozen_nick"] = true;
$params["max_displayed_lines"] = 150;

if ($user_info["id"] == 1)
$params["isadmin"] = true;

/////////////////////////////////////////////////////////////////////////////////

$params["container_type"] = "mysql";
$params["container_cfg_mysql_host"] = "localhost"; // default value is "localhost"
$params["container_cfg_mysql_port"] = 3306; // default value is 3306
$params["container_cfg_mysql_database"] = "aohelp_forums"; // default value is "phpfreechat"
$params["container_cfg_mysql_table"] = "chat"; // default value is "phpfreechat"
$params["container_cfg_mysql_username"] = "jaminb2030"; // default value is "root"
$params["container_cfg_mysql_password"] = "password"; // default value is ""

/////////////////////////////////////////////////////////////////////////////////

$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>MySite Chat</title>
<?php
if (!$user_info['is_guest'])
{
$chat->printJavascript();
$chat->printStyle();
}
?>
</head>

<body>
<?php
if ($user_info['is_guest'])
{
// Not registered user
}
else
{
$chat->printChat();
}
?>
</body>
</html>

Image

Iv changed all my db and login info with fake ones, the chat address is http://forums.aohelp.info/chat2/index.php

I also want to be able to set me and other ppl as admin but didnt understand how the $params["admins"] = array("" => "");
command worked...

thanks to anyone that can help :)
Last edited by Jaminb2030 on Thu Apr 09, 2009 3:32 am, edited 1 time in total.
Jaminb2030
New member
 
Posts: 6
Joined: Tue Apr 07, 2009 5:32 pm
Top

Postby OldWolf » Tue Apr 07, 2009 8:36 pm

This line is how you set an admin if you're using an integrated system, forget about that other one (it's for stand alone installs):
if ($user_info["id"] == 1774)
$params["isadmin"] = true;

Just find your id, and change that number to it. You can add more like so:
if ($user_info["id"] == 1774 || $user_info["id"] == 1234 || $user_info["id"] = 5678)
$params["isadmin"] = true;
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 Jaminb2030 » Wed Apr 08, 2009 1:52 am

so the id is the number i get when i open that chat (guest1234) thus
if ($user_info["id"] == 1234)
$params["isadmin"] = true;

does that number change if the cookies deleted?

dam i was hoping to get this working with ppls names
Jaminb2030
New member
 
Posts: 6
Joined: Tue Apr 07, 2009 5:32 pm
Top

Postby OldWolf » Wed Apr 08, 2009 9:26 am

No no, you need the user's id number from SMF... I don't know the easiest way to go about that, but I can tell you if you look at your SQL table for the users, and find your username, the ID will be next to it.

I'm willing to bet that you can change "id" to whatever the username field is called and use user names instead.
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 Jaminb2030 » Wed Apr 08, 2009 3:44 pm

how can that work if im noy connect to smf at all im useing the defalt settings for the chat so i dont have the db on my site for the chat so how would that work with the admin
my smf id is 1 so ur saying
if ($user_info["id"] == 1)
$params["isadmin"] = true;
i just dont see how that can work its not even so much as connected to my db
Jaminb2030
New member
 
Posts: 6
Joined: Tue Apr 07, 2009 5:32 pm
Top

Postby OldWolf » Wed Apr 08, 2009 9:43 pm

If you're using the SMF integration (which is the forum you posted in, so taht's what I assumed) it uses the data SMF provides about users.

If you're totally unintegrated (you shouldn't be posting in this forum then), you would use the admins parameter, in the form of array("name" => "password", "name2" => "password2")
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 Jaminb2030 » Thu Apr 09, 2009 3:27 am

ok and thats what i was trying to do up there get the smf integrated chat working but when i go to the chat page i get a white screen no chat at all so can u see any problems
and what is this parameter for
$params["container_cfg_mysql_table"] = "chat";

sorry i just want to get it working..
Last edited by Jaminb2030 on Thu Apr 09, 2009 3:35 am, edited 1 time in total.
Jaminb2030
New member
 
Posts: 6
Joined: Tue Apr 07, 2009 5:32 pm
Top

Postby OldWolf » Thu Apr 09, 2009 9:07 am

That parameter is naming the sql table you wish to store the chat files in.

As far as your chat goes, I went to it and was able to get it to pop up just fine.
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 Jaminb2030 » Thu Apr 09, 2009 5:00 pm

(i knew i should have changed it back) Yea i changed index back to default so my other admins and see that chat i plan on implementing sorry ill change it to the code above
Jaminb2030
New member
 
Posts: 6
Joined: Tue Apr 07, 2009 5:32 pm
Top

Postby Jaminb2030 » Thu Apr 09, 2009 5:08 pm

ok changed it back and got the same err also if i do leave it like
$params["container_cfg_mysql_table"] = "chat";
will it create the table chat with the fields it needs or do i have to do that manually?
Last edited by Jaminb2030 on Thu Apr 09, 2009 5:09 pm, edited 1 time in total.
Jaminb2030
New member
 
Posts: 6
Joined: Tue Apr 07, 2009 5:32 pm
Top

Postby OldWolf » Fri Apr 10, 2009 8:06 am

To answer your question, to be perfectly honest I'm really not sure, but I believe so. I've never used the mysql personally.

As far as your page, I think you've made a copy paste mistake of some kind... there's no way that what you posted above is contained in that file. Double check the contents of that file.
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
11 posts • Page 1 of 1

Return to phpBB, Simple Machines Forum (SMF), and Forum Software (v1.x)

Who is online

Users browsing this forum: No registered users and 5 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