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

MySQL & website Integration ?

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

Post a reply
20 posts • Page 1 of 2 • 1, 2

MySQL & website Integration ?

Postby elfaus » Tue Nov 06, 2012 7:07 pm

Hi there,

i've tried to integrate this new release to my website using mysql after read the documentation but it seems not up to date about the 2.x :s
i would like integrate him using my users table like that :
id => int, pseudo => varchar, password => varchar

ID from each users are stored into a SESSION, that the only var which stored about an user

and this structure

index => going to look for a module.php which integrate a view file (default.php or chat.php or something else) into a chat folder.
in this folder there are a js folder with the phpfreechat.js and the jquery.js

and last, i've a functions folder with everything else.

I now where put the .html file with <div id="mychat"><a href=""></a></div>
I now where put the phpfreechat.js and the jquery.js

but where can i put other files ?
elfaus
New member
 
Posts: 4
Joined: Tue Nov 06, 2012 7:00 pm
Top

Re: MySQL & website Integration ?

Postby phpfreechat » Thu Nov 08, 2012 6:32 pm

Did you look at this documentation ?
https://github.com/kerphi/phpfreechat#pfcbeforeauth

You need to add a phpfreechat hook to connect the chat auth system to your mysql auth system.
phpfreechat
Site Admin
 
Posts: 2657
Joined: Tue Feb 07, 2006 3:35 pm
Location: France
Top

Re: MySQL & website Integration ?

Postby elfaus » Thu Nov 08, 2012 9:18 pm

what are :
$app, $req, $res ?
elfaus
New member
 
Posts: 4
Joined: Tue Nov 06, 2012 7:00 pm
Top

Re: MySQL & website Integration ?

Postby phpfreechat » Thu Nov 08, 2012 10:38 pm

app is a slim framework application instance.
req : http://docs.slimframework.com/pages/request-overview/
res : http://docs.slimframework.com/pages/response-overview/

I think you don't need it to return your login from the $_SESSION array
phpfreechat
Site Admin
 
Posts: 2657
Joined: Tue Feb 07, 2006 3:35 pm
Location: France
Top

Re: MySQL & website Integration ?

Postby elfaus » Fri Nov 09, 2012 1:03 pm

I've do something like that :

Code: Select all
$GLOBALS['pfc_hooks']['pfc.before.auth'][5] = function ($app, $req, $res) {
    return function ($hr) use ($app, $req, $res) {
   
        if (isset($_SESSION['id'])) {
            $query = $db->prepare("THE QUERY");
            $query->bindParam(':id',$_SESSION['id'],PDO::PARAM_INT);
            $query->execute();
            $data = $query->fetch(PDO::FETCH_OBJ);
            $hr->login = $data->pseudo;
        } else {
            $hr->login = 'Anon'.rand(1,1000);
        }
        return $hr->login;
    };
};


Does it correct ?

How can I add color on users depend of rights ?
And how can I add macro ? I don't view any files to do that :s
elfaus
New member
 
Posts: 4
Joined: Tue Nov 06, 2012 7:00 pm
Top

Re: MySQL & website Integration ?

Postby phpfreechat » Fri Nov 09, 2012 1:53 pm

Yes it seems to be correct. Does it work ?

Concerning the colors depending on the user's rôle, the feature is not yet implemented. Don't hesitate to vote for the user role feature cause it is needed to have things depending on the role.

Last thing is about "macro", please could you explain what is a macro ?
phpfreechat
Site Admin
 
Posts: 2657
Joined: Tue Feb 07, 2006 3:35 pm
Location: France
Top

Re: MySQL & website Integration ?

Postby elfaus » Fri Nov 09, 2012 2:52 pm

Yes it works :)

about color, can i keep some modification on the code to make it possible for the moment ?
currently each group has a color information store in my DB and i use it to keep the good color to an user depending his role

http://momcards.fr/chat.html

about macro, on my current chat which i've dev, i've those function

/clear => flush every messages
/system [msg] => add an announce on the top of chat
/ban [user] => ban a user on the chat
/unban [user] => unban a user who's ban

what about smiley too ?
elfaus
New member
 
Posts: 4
Joined: Tue Nov 06, 2012 7:00 pm
Top

Re: MySQL & website Integration ?

Postby phpfreechat » Fri Nov 09, 2012 6:37 pm

Ok so what you call "macro" is a chat command. This is also features which are not implemented yet.

To know the currently implemented features, have a look to this page: https://github.com/kerphi/phpfreechat#features

The code is opensource so if you have skills, you can patch the code to add your own features, don't hesitate to fork the github repository.

You can also vote for the features you whould like to be implemented in the next release: https://phpfreechat.uservoice.com/

Finaly you can also contribute with a donation, it will help the futurs developments: http://www.phpfreechat.net/donate
phpfreechat
Site Admin
 
Posts: 2657
Joined: Tue Feb 07, 2006 3:35 pm
Location: France
Top

Re: MySQL & website Integration ?

Postby rick001 » Thu Dec 20, 2012 1:59 pm

I just want a simple integration into my site. I though i would achieve this using an <iframe> but there are some complexities that arises out of it. The most important being the chat wont work in IE if loaded using an <iframe> so was wondering what would be the most effective way to integrate this into my existing site?
rick001
Member
 
Posts: 35
Joined: Sun Oct 16, 2011 1:28 pm
Top

Re: MySQL & website Integration ?

Postby phpfreechat » Thu Dec 20, 2012 10:34 pm

I don't understand why do you integrate the chat with an iframe ? thanks to the phpfreechat jquery plugin you can easily integrate wherever you want in your website.
phpfreechat
Site Admin
 
Posts: 2657
Joined: Tue Feb 07, 2006 3:35 pm
Location: France
Top

Re: MySQL & website Integration ?

Postby rick001 » Wed Dec 26, 2012 3:46 am

Wanted to try iframes coz when i use jquery the chat works fine for almost every browser in there other than IE so wanted to see if an iframe would help but well its the same thing. when the is integrated into the site then IE has trouble with it. however if i load just the example chat or a chat which is not integrated into another page then it works fine even in IE
rick001
Member
 
Posts: 35
Joined: Sun Oct 16, 2011 1:28 pm
Top

Re: MySQL & website Integration ?

Postby phpfreechat » Fri Dec 28, 2012 9:52 am

Could you show me an example with a classic integration on your web site (without iframe integration) that do not work with IE ?
And please use the phpfreechat-2.0.5-debug.zip so that I'll see which lines of code are problematic.
phpfreechat
Site Admin
 
Posts: 2657
Joined: Tue Feb 07, 2006 3:35 pm
Location: France
Top

Re: MySQL & website Integration ?

Postby rick001 » Fri Dec 28, 2012 11:46 am

ok i tried to use the debug chat and integrate it into a page. Now the chat wont even load. I dont see what i am doing wrong, because i already did integrate the other one and it works just fine even now in all browser other than IE. here are the links.

http://www.techbreeze.in/test/phpfreechat-2.0.5/examples/default this is just to check that the debug chat was installed properly and is working.

http://www.techbreeze.in/test this the page where i did the integration the chat wont load in here

http://www.techbreeze.in/chat this the page where i did the integration of the normal version of the chat, which works in almost all browser other than IE
rick001
Member
 
Posts: 35
Joined: Sun Oct 16, 2011 1:28 pm
Top

Re: MySQL & website Integration ?

Postby phpfreechat » Sat Dec 29, 2012 1:41 pm

In http://www.techbreeze.in/test you included the wrong files:
Code: Select all
<script src="http://www.techbreeze.in/test/phpfreechat-2.0.5/client/lib/jquery-1.8.2.min.js" type="text/javascript"></script>
<link rel="stylesheet" type="text/css" href="http://www.techbreeze.in/test/phpfreechat-2.0.5/client/themes/default/jquery.phpfreechat.min.css" />
<script src="http://www.techbreeze.in/test/phpfreechat-2.0.5/client/jquery.phpfreechat.min.js" type="text/javascript"></script>


It should be:
Code: Select all
<script src="http://www.techbreeze.in/test/phpfreechat-2.0.5/client/lib/jquery-1.8.2.min.js" type="text/javascript"></script>
<link rel="stylesheet" type="text/css" href="http://www.techbreeze.in/test/phpfreechat-2.0.5/client/themes/default/jquery.phpfreechat.css" />
<script src="http://www.techbreeze.in/test/phpfreechat-2.0.5/client/jquery.phpfreechat.js" type="text/javascript"></script>
phpfreechat
Site Admin
 
Posts: 2657
Joined: Tue Feb 07, 2006 3:35 pm
Location: France
Top

Re: MySQL & website Integration ?

Postby rick001 » Sat Dec 29, 2012 7:07 pm

OK i have corrected that, but the problem with IE still persists. Please check
rick001
Member
 
Posts: 35
Joined: Sun Oct 16, 2011 1:28 pm
Top

Next

Post a reply
20 posts • Page 1 of 2 • 1, 2

Return to General Support (v2.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