Simple Ajax Chat Pro (SAC Pro) chat forms can be public, private, require login, or “read only”. When displayed in read-only mode, the chat box is visible to all visitors but sending messages is limited to logged-in users. Perhaps like watching people eat in a restaurant by staring through the window, read-only mode lets your visitors read chat messages without actually participating.
Enable read-only mode
To set the default (global) option, visit the SAC Pro settings ▸ General ▸ “Display Mode”.
To enable read-only for a specific form, add the read_only
attribute to the [sacpro]
shortcode:
[sacpro form_id="123" read_only="true"]
The read_only
attribute accepts either true
or false
.
More attributes to customize your chat forms can be found in the SAC Pro shortcode reference.
Customize the read-only message
When read-only mode is enabled and a non-logged user visits the form, a message is displayed that says, “Log in to join this chat!”. You can change this message to say whatever you want.
To set the default (global) option, visit the SAC Pro settings ▸ General ▸ “Display Mode Message”.
To set the read-only message for a specific form, add the read_only_message
attribute to the [sacpro]
shortcode:
[sacpro form_id="123" read_only="true" read_only_message="Welcome visitor, please log in to participate in this chat."]
You can change the value of the read_only_message
attribute with any text or markup.
More attributes to customize your chat forms can be found in the SAC Pro shortcode reference.
Include basic markup
For the setting “Display Mode Message” and the shortcode attribute read_only_message
, you can use %%login_url%%
to display the URL of your site’s Login Page. To make it a link (instead of just plain text), add the following code:
{a href='%%login_url%%'}Log in{/a}
When that code is output on the front end, the curly brackets {
}
will be replaced by angle brackets <
>
. You can use this technique to include other HTML tags as needed. Read important note below.
href='%%login_url%%'
in the read-only message. If we were to include double quotes or curly quotes, the shortcode syntax would be incorrect and things would not work correctly.