News:

SMF 2.1.6 has been released! Take it for a spin! Read more.

Main Menu

AVchat

Started by smitch6, November 17, 2011, 08:17:46 AM

Previous topic - Next topic

smitch6

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 :~
Friendly, reliable web hosting at affordable prices
www.normanboatforum.co.uk l www.PatTesterSuffolk.co.uk

Andre N

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 :)
"Every generation of humans believed it had all the answers it needed, except for a few mysteries they assumed would be solved at any moment. And they all believed their ancestors were simplistic and deluded. What are the odds that you are the first generation of humans who will understand reality?"

smitch6

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
Friendly, reliable web hosting at affordable prices
www.normanboatforum.co.uk l www.PatTesterSuffolk.co.uk

smitch6

would it be helpful if i sent you any files that you'd like to see ?
Friendly, reliable web hosting at affordable prices
www.normanboatforum.co.uk l www.PatTesterSuffolk.co.uk

smitch6

here is the avc file

there are already some login text on here
Friendly, reliable web hosting at affordable prices
www.normanboatforum.co.uk l www.PatTesterSuffolk.co.uk

Andre N

Upload this AND the API file to the exact same directory where that avc_settings.php file is located and try it out
"Every generation of humans believed it had all the answers it needed, except for a few mysteries they assumed would be solved at any moment. And they all believed their ancestors were simplistic and deluded. What are the odds that you are the first generation of humans who will understand reality?"

smitch6

ok :)
have i got to edit the avc file at all?

thanks steve
Friendly, reliable web hosting at affordable prices
www.normanboatforum.co.uk l www.PatTesterSuffolk.co.uk

Andre N

Not if it works when you upload those 2 files :D
"Every generation of humans believed it had all the answers it needed, except for a few mysteries they assumed would be solved at any moment. And they all believed their ancestors were simplistic and deluded. What are the odds that you are the first generation of humans who will understand reality?"

smitch6

don't think it's working the chat is just stuck on 'loading'
this is the chat christianstogether.co.uk/avchat
Friendly, reliable web hosting at affordable prices
www.normanboatforum.co.uk l www.PatTesterSuffolk.co.uk

Andre N

"Every generation of humans believed it had all the answers it needed, except for a few mysteries they assumed would be solved at any moment. And they all believed their ancestors were simplistic and deluded. What are the odds that you are the first generation of humans who will understand reality?"

smitch6

nope still not working :( sorry
Friendly, reliable web hosting at affordable prices
www.normanboatforum.co.uk l www.PatTesterSuffolk.co.uk

Andre N

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
"Every generation of humans believed it had all the answers it needed, except for a few mysteries they assumed would be solved at any moment. And they all believed their ancestors were simplistic and deluded. What are the odds that you are the first generation of humans who will understand reality?"

smitch6

Friendly, reliable web hosting at affordable prices
www.normanboatforum.co.uk l www.PatTesterSuffolk.co.uk

smitch6

ignore the last comment :)
i didn't delete the } at the end

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

:)
Friendly, reliable web hosting at affordable prices
www.normanboatforum.co.uk l www.PatTesterSuffolk.co.uk

Andre N

Ok, can you try this one out? :)
"Every generation of humans believed it had all the answers it needed, except for a few mysteries they assumed would be solved at any moment. And they all believed their ancestors were simplistic and deluded. What are the odds that you are the first generation of humans who will understand reality?"

smitch6

nope not working :(
sorry

did you want log-in details? so save going back and forth?
Friendly, reliable web hosting at affordable prices
www.normanboatforum.co.uk l www.PatTesterSuffolk.co.uk

Andre N

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.

:)
"Every generation of humans believed it had all the answers it needed, except for a few mysteries they assumed would be solved at any moment. And they all believed their ancestors were simplistic and deluded. What are the odds that you are the first generation of humans who will understand reality?"

smitch6

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 :)
Friendly, reliable web hosting at affordable prices
www.normanboatforum.co.uk l www.PatTesterSuffolk.co.uk

blogger419

#18
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.

Advertisement: