Hey everybody,

We got several requests these days regarding the messages that are automatically displayed in the chat. Some of you probably already know how to edit or disable the messages but we thought we should write a more comprehensive article about it.

This feature was added in Build 1505 of AVChat 3 to give the website owner the ability to add info messages, text ads with links or any other announcements in the text chat.

In detail

The file which stores the messages is rotate_messages.php located in the AVChat 3 installation folder. It is called by AVChat 3 every rotatingMessageTime seconds (option in avc_settings.xml) and it sends to it a GET variable named count which stores the number of times it was called by that user.

The file comes by default with several messages. These can all be replaced and more can be added.

To replace the messages, open rotate_messages.php with a text editor and replace the text between the quotes, without affecting the PHP code.

Here’s the default file with the text that you should edit highlighted:

The default rotate_messages.php

If you’ve edited the 6 default messages and you want to add more here’s what you need to do:

  1. duplicate the last case (case 0, lines 29-31 above) and replace 0 with 6 like this:
    case 6:
    echo "<font color='#999999' face='Tahoma' size='11' ><b>A new message.</b></font>";
  2. On line 13 change the number 6 with 7 like this:
    switch ($count%7) {

As you can see, you can customize these messages using some HTML tags for color, font, size, etc. The supported list of HTML tags that can be used can be found here.

If you are an experienced web developer you can create your own rotate_messages.php file with messages being pulled out of a database, more complex logic, ads, etc. and point AVChat 3 to use it through the rotatingMessageUrl option located in avc_settings.xml.

 Other notes:

  • rotatingMessageUrl in avc_settings.xml contains the path to rotating_messages.php
  • To disable the feature open avc_settings.xml file with a text editor and set rotatingMessageTime to 0 (<value>0</value>)
  • To increase the time between calls to rotate_messages.ph open avc_settings.xml file with a text editor and set rotatingMessageTime to 120 (<value>120</value>) which means 2 minutes between calls.

Should you have any other question please contact tech support from your private client area. Tech support is here to assist you with your rotating messages troubles :).

Leave a Reply

Your email address will not be published. Required fields are marked *