Simple Machines Community Forum

Customizing SMF => Bridges and Integrations => Topic started by: smitch6 on November 17, 2011, 08:17:46 AM

Title: AVchat
Post by: smitch6 on November 17, 2011, 08:17:46 AM
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 :~
Title: Re: AVchat
Post by: Andre N on November 17, 2011, 11:21:44 AM
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 :)
Title: Re: AVchat
Post by: smitch6 on November 17, 2011, 11:25:50 AM
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
Title: Re: AVchat
Post by: smitch6 on November 17, 2011, 11:30:46 AM
would it be helpful if i sent you any files that you'd like to see ?
Title: Re: AVchat
Post by: smitch6 on November 17, 2011, 11:43:21 AM
here is the avc file

there are already some login text on here
Title: Re: AVchat
Post by: Andre N on November 17, 2011, 11:58:04 AM
Upload this AND the API file to the exact same directory where that avc_settings.php file is located and try it out
Title: Re: AVchat
Post by: smitch6 on November 17, 2011, 12:00:54 PM
ok :)
have i got to edit the avc file at all?

thanks steve
Title: Re: AVchat
Post by: Andre N on November 17, 2011, 12:04:20 PM
Not if it works when you upload those 2 files :D
Title: Re: AVchat
Post by: smitch6 on November 17, 2011, 12:15:19 PM
don't think it's working the chat is just stuck on 'loading'
this is the chat christianstogether.co.uk/avchat
Title: Re: AVchat
Post by: Andre N on November 17, 2011, 12:21:58 PM
Try this one
Title: Re: AVchat
Post by: smitch6 on November 17, 2011, 12:25:31 PM
nope still not working :( sorry
Title: Re: AVchat
Post by: Andre N on November 17, 2011, 12:31:26 PM
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
Title: Re: AVchat
Post by: smitch6 on November 17, 2011, 12:36:26 PM
nope no joy sorry
Title: Re: AVchat
Post by: smitch6 on November 17, 2011, 12:43:23 PM
ignore the last comment :)
i didn't delete the } at the end

removed them and i'm now logged in as 'test user'

:)
Title: Re: AVchat
Post by: Andre N on November 17, 2011, 01:10:12 PM
Ok, can you try this one out? :)
Title: Re: AVchat
Post by: smitch6 on November 17, 2011, 01:14:30 PM
nope not working :(
sorry

did you want log-in details? so save going back and forth?
Title: Re: AVchat
Post by: Andre N on November 18, 2011, 04:56:50 PM
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.

:)
Title: Re: AVchat
Post by: smitch6 on November 18, 2011, 05:02:54 PM
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 :)
Title: Re: AVchat
Post by: blogger419 on May 30, 2015, 11:13:16 PM
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.