Support: Integrating AVChat 2, AVChat 3 or AVConference with your web site users database

Prerequisites:

  • AVChat 2, AVChat 3 or AVConference installed on your web site
  • medium asp or php programming experience

Introduction

This is not a step by step guide because user management systems (log in & log out mechanisms) are different from a web site to another.

Integrating AVChat or AVConference with your users database means that the users of your web site will have to login only once on your web site and have same username on the web site and in the chat. Furthermore if your web site allows for several user levels (like free,premium,gold,etc...) you can impose restrictions one some user levels in order to force them to upgrade to a paid plan.

A little bit of information

When a user visits your web site and reaches the HMTL page with AVChat or AVConference software embedded in it, the HTML file containing the flash .swf file are downloaded on the users computer and displayed in their browser.

Once the swf file is completely downloaded and the browser displays it, the swf file calls the asp/php configuration file on the web server. The config file executes, and, in turn, returns a string containing all the variable/value pairs within it back to the swf file.

The swf file then reads this string and uses all those variables to limit features, to use as username/gender, to connect, etc... . All the variables accepted and used by the .swf file are listed and explained in the asp/php configuration files.

If we were to talk about it in a timely manner, the integration will take place when the asp/php configuration file executes on the web server.

Deep in the problem

Once a person is logged in on your web site, the user management system will remember (using a Cookie, or a Session Variable) the persons username, real name, email, gender and other details, and will display these details in certain places throughout the web site. Once the user logs out, the user management system "forgets" him (it deletes the Cookie or Session Variable).

You need to look trough the existing code and analyze how the existing management system remembers the person logged in. Either COOKIES or SESSIONS are used. If you have never learned about these before, this is a good time to do it! :) Once you find out how, you need to use those Cookie/Session Variables inside the avc_settings.php or avc_settings.asp file and populate the variables in it with the values inside the Cookie/Session Variable.

Cookies are little bits of information that are stored by your browser and sent with every call to the web site. Session Variables are little bits of information that are stored by the webserver for each visitor of your website.

Username and gender are automatically recognized

When the asp/php config file is executed, it should check for existing Cookies or Session Variables, detecting the username and gender, and should populate the username and gender variables with the detected values.

The variable for the username inside the asp/php configuration file is $username.

The variable for the gender inside the asp/php configuration file is $gender.

If both variables above are populated and the $changegender and $changeusername variables are also set to 0 (meaning changing the username and gender is disabled) the user wil not see the Log In Screen when logging in the video chat.

Different settings for different user groups

If your web site allows for different levels of membership (free,premium, gold, etc...) you can force restrictions on some of them.

AVChat 2 and AVConference both allow for unlimited levels of membership. On your web site they might be known as "premium", "free", "gold", "silver", etc... but AVChat and AVConfernce have nothing to do with these names as the .swf file obeys to whatever values the php/asp configuration file outputs.

When the configuration file is executed, it should check for existing Cookies or Session Variables, detecting the user's level, and should populate the variables inside the asp/php configuration accordingly. The values of these variables are used by the swf file to know what restrictions to apply.

Every variable in the php/asp configuration file can be populated according to the level of the user.

Here are a few ideas of what you can do:

  • allow "gold" users to send higher quality video and audio by pointing the value of $bandwidthurl to a .xml file with better quality settings
  • limit the amount of time "free" users can see video by specifying a value for the $freeVideoTime variable
  • allow "gold" users to see more web cams at a time by modifying the value of $maxcams when the logged in user is detected as "gold"
  • drop "gold" users in selected rooms, while "free" users gather only in the lobby by modifying the value of $dropInRoom according to the level of the user

Further notes

  • You might want to block the user from changing the username and gender detected by the php/asp config file in the login screen of the AVChat user interface. For this set the value of $changeuser and $changegender to 0.
  • When you set $changeuser and $changegender to 0 in the asp/php config file, AVChat and AVConference will skip the login screen of the user/admin interfaces and jump directly to the chat area.
  • You can test the integration by logging in, loading the asp/php configuration file directly in the browser, and checking the variable/value pairs it returns. This way you can also check for any syntax errors that might have slipped in while editing the config file.
  • We also provide integration services for a certain fee. More details on the AVChat purchase page.
  • If you are in need of a good text editor we recommend Notepad2
  • A good introduction on PHP (including Session and Cookie variables) can be found here:
    http://www.w3schools.com/php/default.asp
  • A good introduction on ASP (including Session and Cookie variables) can be found here:
    http://www.w3schools.com/asp/default.asp

Go top · Go back to articles list