• 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

Deadlock...

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

Post a reply
13 posts • Page 1 of 1

Postby guttastyle » Sun Mar 04, 2012 9:26 pm

Hello again, I'm using a free open source "User Management System" called "Deadlock-1.01-Stable" and i was wondering how can i integrate PFC with this so that each of my members can login the chat room using their username and password they made when registering to the site via deadlock

Thanks in advance.
guttastyle
Member
 
Posts: 24
Joined: Sat Mar 03, 2012 5:37 pm
Top

Postby xgamer224 » Mon Mar 05, 2012 2:56 am

Hmm.... Good question. To do this, you would have to use this "plugin"
www.phpfreechat.net/forum/viewtopic.php?id=4678
You would have to go in to your deadlock website user list (located in one of the MySQL tables) you must decrypt all the passwords. Then remove the sha1 encryption on the pfc login interface then you would have to insert all of the unencrypted usernames and passwords from your deadlock website to the pfc login MySQL table....
Sounds fun right?
I would have to know what website template you are using for your deadlock website to assist you any further....
xgamer224
Member
 
Posts: 13
Joined: Sun Mar 04, 2012 7:01 am
Location: Austin Texas
Top

Postby guttastyle » Mon Mar 05, 2012 4:58 pm

Hello xgamer224 thanks for the reply, I am only now setting up my website and i have not yet integrated "deadlock" with my website design, but its simple HTML pages I'm using. I do not have any members yet as i am still working on integrating PFC and Deadlock then integrating the 2 with my design for the website.

I would like when logged in to deadlock user management system and you enter the chat u enter with the registered name you have, just like how when logged into this forum and you enter the demo chat, you enter with the name you registered to the forum with.

when not logged in you enter as guest because guest is what i have my params set to instead of prompting for a name.

Hope i have made it clear on what i am trying to achieve here and that someone can enlighten me on how to go about doing it.

Thanks in Advance.
guttastyle
Member
 
Posts: 24
Joined: Sat Mar 03, 2012 5:37 pm
Top

Postby OldWolf » Mon Mar 05, 2012 10:25 pm

I'm afraid xgamer224 is a bit off here... there's no need to go through all that work or use the other plugin. There's a much simpler way:

All you actually need to do is add deadlock to the top of your chat page, and find out what function returns the username of the current person. Set $params['nick'] to that username, and $params['frozen_nick'] to true. Let me know if you get stuck.
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 guttastyle » Tue Mar 06, 2012 1:20 am

Hello again, I'm not sure what you mean by add deadlock to the top of page ?

But the function to get the username in deadlock is "${username}"

can you explain in a little more detail or type the exact params for the nick and frozen nick so i can add them and see if it works ?
guttastyle
Member
 
Posts: 24
Joined: Sat Mar 03, 2012 5:37 pm
Top

Postby OldWolf » Wed Mar 07, 2012 7:39 am

$params['nick'] = ${username};
$params['frozen_nick'] = true;

But it wont work without deadlock being invoked somehow
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 guttastyle » Wed Mar 07, 2012 8:03 pm

Hello again OldWolf i set the params like you said then i rehash and got this error below


Error: 'chat.js.tpl.php' could not be found, please check your themepath '' and your theme 'default' are correct

//

I then rehash again and refresh the page and i got this error below

phpFreeChat cannot be initialized, please correct these errors:

'nick' parameter must be a charatere string

//

Can you further assist me on where you think the problem is at ?
guttastyle
Member
 
Posts: 24
Joined: Sat Mar 03, 2012 5:37 pm
Top

Postby guttastyle » Wed Mar 07, 2012 8:43 pm

hello again , trying to explain it a little more,

I installed deadlock in the main "public_html" folder the index is redirected to "/user/login.php"

For example when you go to "www.yourdomain.com" it redirects to "www.yourdomain.com/user/login.html"

Now inside the "user" folder located in the "public_html" folder are the .PHP files which i guess calls the Get command values for the login, Files named such as

"register, login, account, edit_account," etc...

Then there's another folder that came with deadlock inside the "public_html" folder called "templates"

Now inside this "templates" folder are HTML files to go with the PHP files inside the"user" folder.
Files named such as

"user_panel_login, user_panel_register, account_information, edit_account," etc......

In these HTML files is where the function returns the username of the current person after a successful login

For example in the "account_information.html" page inside the "templates" folder has line of text like saying "Welcome ${username} your account information is below. which actually shows up in the account.php page in your browser after a successful login.

I uploaded PFC into the main "public_html" folder and it did not work, so what i did after is uploaded another copy of PFC to the "templates" folder and got the same errors again.

the params i have set are as follows below

<?php
require_once dirname(__FILE__)."/src/phpfreechat.class.php";
$params = array();
$params["channels"] = array("The Lobby");
$params["title"] = "1FM Radio";
$params['nick'] = ${username}; // setup the intitial nickname
$params["frozen_nick"] = true; // do not allow to change the nickname
$params['admins'] = array('name1' => 'password1', 'name2' => 'password2');
$params["serverid"] = md5(__FILE__); // calculate a unique id for this chat
$params["debug"] = false;
$chat = new phpFreeChat( $params );

?>


Inside the html content where the chat should appear i have this

<div class="content">
<?php $chat->printChat(); ?>
</div>

And it is saved as a PHP file,

Hope this enlightens you that u can help me resolve this

Thanks in Advance
Last edited by guttastyle on Wed Mar 07, 2012 8:46 pm, edited 1 time in total.
guttastyle
Member
 
Posts: 24
Joined: Sat Mar 03, 2012 5:37 pm
Top

Postby guttastyle » Thu Mar 08, 2012 9:44 am

Hello again, i was playing around with the parameters you gave me and made these changes

instead of this:

$params['nick'] = ${username}; // setup the intitial nickname

i put this:

$params['nick'] = '${username}'; // setup the intitial nickname

and the errors were gone but i entered the room as ${username} instead of the name i was logged in as on deadlock.

I then decided to experiment a little more i added the same ${username} to the bottom of the chat page to see if it showed my username but it didn't, It showed up the same way as ${username} , I think i missing a PHP file that should be inside the user folder.

when i log into deadlock it goes to the account.php page found in the user folder which actually gets the ${username} from the account_information.html found inside the templates folder.

I then selected all the coding in my chat page which is a PHP file and opened the account_information.html page and deleted what was there and pasted the code from the chat page. After refreshing i got the error which i knew i would have get because the chat does not show inside an html page but the ${username} part i placed at the bottom of the page was now showing my logged in name but the chat was not showing.


I'm a Beginner with PHP but in my experiments i narrowed it down to this, I need to get some part of the code inside the account.php file inside the user folder to add to my chat page, or is there anyway to get the ${username} to show up inside a PHP page instead of the HTML page ?
if the chat used to show in HTML the integration would have worked perfectly but unfortunately it doesn't and it seems like the 2 languages are racist or something, lol

PFC wont show inside HTML pages and the ${username} wont show up inside PHP pages. I'm stuck and really hoping someone can help me sort this out .
guttastyle
Member
 
Posts: 24
Joined: Sat Mar 03, 2012 5:37 pm
Top

Postby OldWolf » Thu Mar 08, 2012 5:49 pm

I think you had everything right the first time, but you need to somehow call deadlock on the pfc index.php page. I don't know how you do that, you'll have to check with the deadlock folks. You can't call the username variable unless deadlock has somehow been initiated on that page.
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 guttastyle » Wed Mar 14, 2012 7:43 am

Hello, I know This Is A Dumb Question And Might Not Even Get A Response But Here Goes.........
Isn't There Any Way To Get PFC To Show In An "Index.html" Page Instead Of The "Index,php" Page ?
guttastyle
Member
 
Posts: 24
Joined: Sat Mar 03, 2012 5:37 pm
Top

Postby OldWolf » Sun Mar 18, 2012 7:39 pm

Not easily... but my return question is why do you want that? Any html file could just be renamed to .php and it will parse 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 guttastyle » Sun Jul 08, 2012 10:18 pm

hello again can someone please take a look at my code again and see what I'm doing wrong :(


Code: Select all
<?php
// this will integrate the wordpress database
require_once dirname(__FILE__)."/src/phpfreechat.class.php";
require_once('../db_config.php');
$params = array();
$params["serverid"] = md5(__FILE__); // calculate a unique id for this chat
$params["channels"] = array("The Lobby");
$params["title"] = "1FM Radio";
$params["nick"] = "${username}";  // setup the intitial nickname
$params["frozen_nick"]    = false;     // do not allow to change the nickname
$params['admins'] = array('_gutta__' => 'ghutt44', 'user' => 'password');
$params["debug"] = false;
$chat = new phpFreeChat( $params );

?>

When i call the chat from my browser it prompts for a user name eve though I'm logged in on my Deadlock PHP User Management System
Last edited by guttastyle on Sun Jul 08, 2012 10:21 pm, edited 1 time in total.
guttastyle
Member
 
Posts: 24
Joined: Sat Mar 03, 2012 5:37 pm
Top


Post a reply
13 posts • Page 1 of 1

Return to General Support (v1.x)

Who is online

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