Hi running the new 2.0.1 version of smf
i'm installing avchat onto my site and am looking to intergrate the 2
so users register on the forum and once they have they can log-in straight into the chat
has anyone done this or have any ideas pls
here's the avchat site http://avchat.net
they do show a bit of info about it in the docs but it isn't very clear :~
It looks like it would be simple enough to do, to auto-login the SMF user into chat, but the software isn't free so I can't download it and see.
Here's what I'm guessing you should do:
1. Download the API and put it on your server. Download it here http://www.simplemachines.org/community/index.php?topic=453008.0
2. In your avc_settings.php file, at the very top, include the API
require_once('smf_2_api.php'); // make sure path is correct
3. Next, below the include, you need to gather the information needed.
global $user_info;
if (isset($user_info['id'])) {
$user_data = smfapi_getUserData($user_info['id']);
if (!empty($user_data)) {
$config['username'] = $user_data['member_name'];
$config['gender'] = (!$user_data['gender'] ? 'male' : $user_data['gender']);
$config['changegender'] = 0;
$config['changeuser'] = 0;
}
}
Now, hopefully, if the user is logged into SMF, those variables will be set and they will be logged into chat as well. Try and see :)
Hi Andre
Thanks for the reply
is it hard to do?
i'm fairly new at this type of thing so am always a bit warey of doing things like this :)
thanks steve
would it be helpful if i sent you any files that you'd like to see ?
here is the avc file
there are already some login text on here
Upload this AND the API file to the exact same directory where that avc_settings.php file is located and try it out
ok :)
have i got to edit the avc file at all?
thanks steve
Not if it works when you upload those 2 files :D
don't think it's working the chat is just stuck on 'loading'
this is the chat christianstogether.co.uk/avchat
Try this one
nope still not working :( sorry
No worries :)
Replace the contents of integrate.php with this:
<?php
$avconfig['username'] = 'test_user';
$avconfig['gender'] = 'male';
$avconfig['changegender'] = 0;
$avconfig['changeuser'] = 0;
and see if it logs you in as 'test_user' or not
nope no joy sorry
ignore the last comment :)
i didn't delete the } at the end
removed them and i'm now logged in as 'test user'
:)
Ok, can you try this one out? :)
nope not working :(
sorry
did you want log-in details? so save going back and forth?
For anyone else wanting to do this:
These files did the trick. Upload them to the same folder as avc_settings.php. They'll be included automatically
Open them up first, they are commented pretty good. Make sure the paths are correct. Set the user groups that will be able to admin.
As a security precaution you should delete index.html and admin.html (this index.php will cover both securely). Also, in avc_settings.php you can set all the admin permissions to 0
That way if someone browses to yourchat/admin.swf they won't have admin permissions in your chat room. The permissions are restored in integration.php. You can set the level for moderators, admins get everything.
:)
I'll vouch for Andre He's been a real help sorting this out and it really does work :)
well done mate and thanks again :)
Anyone have an update for this? I can't get this to work with 2.0.9 I just get stuck on the loading settings page.
Here is the latest avc settings file.