Ektron CMS400.Net Reference

>>Managing User Communities > MessageBoard Server Control

MessageBoard Server Control

The Message Board server control allows a user to submit comments on a Web page about a

Comments are presented in a “wall” type format, where the newest one appears at the top, and older comments are pushed down as new ones arrive. See example below.

Other users can reply to comments. Replying to Message Board comments facilitates community building by allowing members to share information and, thereby, feel they have a personal stake in the discussion.

Comments are posted to the Message Board immediately unless the board is moderated. See Also: Moderating a Message Board

This section also contains the following topics.

Authorization to Comment and Reply to a Message Board

Moderating a Message Board

Replying to Message Board Comments

Message Board Notifications

Filtering Spam

MessageBoard Server Control Properties

Authorization to Comment and Reply to a Message Board

If Message Board Associated with

These users can add comments or replies

User

the logged-in user

his colleagues

users assigned to Message Board Admin role See Also: Defining Roles

Administrators group member

Group

group members

users assigned to Community Group Admin role See Also: Defining Roles

Administrators group member

Content item

anyone who can view the content

For example, if a content item is set to private, a user must have at least Read-Only permission for the folder containing the content.

Moderating a Message Board

A Message Board can be moderated, which means that comments and replies must be approved by an authorized user before they appear. Those users can either approve or delete the comment/reply. To learn which users are authorized to moderate, see Users Who Can Moderate Message Board .

You can force all message boards associated with a MessageBoard control to moderate comments/replies. To do this, set the Moderate property to True. On the other hand, you can allow the Message Board owners to decide if it will be moderated. To do this, set the control’s Moderate property to False. Then, users and community group administrators can set this property in their user or group profile.

Users determine whether their Message Board is moderated by checking their profile’s Moderate check box (see below).

Community group members determine if the group's Message Board is moderated by editing the Group Profile's Group MessageBoard Moderation check box.

Note: If a Group administrator submits a comment to a moderated Group Message Board, it is automatically approved.

This topic is explained more fully through these subtopics.

Users Who Can Moderate Message Board

User

Can perform these actions on a comment/reply

Who submitted comment

view

delete

Individual or group member who owns Message Board to which comment/reply was added

view

approve pending comments/replies

delete

community group administrator

assigned Message Board Admin role

view

approve pending comments/replies

delete

If Message Board assigned to a content item, administrators or users with Message Board Admin role

view

approve pending comments/replies

delete

Comments' Appearance on Moderated Message Board

If a comment is submitted to a moderated Message Board, users who can see it notice a green dot border, as shown below. The user who submitted the comment sees an hour glass icon () until it’s approved. At any time, he can delete the comment using the delete button ().

Approving Comments on a Moderated Message Board

There are two ways to approve comments for a moderated message board:

Approving Comments from the Message Board Server Control

Approving Comments from the Ektron CMS400.NET Workarea

Approving Comments from the Message Board Server Control

On a moderated message board, approval activity appears on the Approve tab (circled below).

To approve a single Message Board comment, an authorized user clicks approval ().

To delete a single comment, he clicks delete ().

An authorized user any can approve several or all comments at once. To select several comments, place a check next to each, then click Approve (circled below).

To select all comments, click Select: All then Approve.

Approving Comments from the Ektron CMS400.NET Workarea

1. Navigate to Settings > Community Management > Message Board.

2. A list of all unapproved comments appears. You can restrict the list using the dropdown shown below.

3. Place a check next to comments you want to approve.

To select all comments, check the box next to Messages in the header row, as shown below.

4. Click Approve ().

Deleting Message Board Comments

There are two ways to delete comments for a moderated message board:

Deleting Comments from Message Board Server Control

Deleting Unapproved Comments from Workarea(unapproved comments only)

Deleting Comments from Message Board Server Control

To delete unapproved comments from the Message Board Server Control, follow these steps.

1. Find the comment.

2. Click Delete in the lower right corner.

Deleting Unapproved Comments from Workarea

To delete unapproved comments from the Workarea, follow these steps.

1. Navigate to Settings > Community Management > Message Board.

2. A list of all unapproved comments appears. You can restrict the list using the dropdown shown below.

3. Select the comments that you want to delete. To select all comments, check the box next to Messages in the header row, as shown below.

4. Click Delete ().

Replying to Message Board Comments

Users can reply to comments on a user’s, community group’s, or content item’s Message Board. For community groups, the group must be public and not restricted; otherwise, only group members can reply.

Note: To learn which users are eligible to reply to Message Board comments, see Authorization to Comment and Reply to a Message Board

Note: If you are in a load-balanced environment, the same reply may appear several times. If this problem occurs, stop the Ektron notification service on all but one of the servers in the cluster.

To add a reply, click Reply () in a comment’s lower right corner (circled below).

Next, a dialog box displays the original comment and a Reply field.

When the reply is submitted, a Replies link appears below the comment. The number of replies appears next to the link.

Click the link to view comments. They are arranged from oldest at top to newest at bottom.

Like comments, if the message board is moderated, replies must be approved before everyone can see them. See Also: Moderating a Message Board

Deleting a Reply

To remove a reply, click Delete ().

Note: To learn which users are eligible to delete Message Board comments, see Users Who Can Moderate Message Board

Message Board Notifications

You can send email notifications to Message Board owners and community group members whenever someone posts a comment to a board. If a comment is posted to a community group’s Message Board, all group members are notified.

Important: Users' profiles must include a valid email address to receive email notifications.

Enabling Message Board Notifications

You can turn this feature on or off in the <site root>/Web.config file. By default, the feature is turned off. To turn it on, open the Web.config file and set the following key’s value to True.

<add key="ek_EnableMessageBoardEmail" value= "False"/>

Note: Message Board notifications are sent from the same email address as the invite system.

Once activated, this feature applies to all user and community group message boards.

Filtering Spam

Ektron CMS400.NET lets you filter spam from your message boards. Ektron defines spam filtering as setting the following limits.

Limitation

To set, select this value in MessageBoard server control’s SpamControlType property

User cannot post the same comment to a board more than once per day

SameUserSameMessageSameDay

User cannot post another comment for a period of time, specified in the SpamTimeSpan property.

SameUserTimeDelay

User cannot post the same comment for a period of time, specified in the SpamTimeSpan property.

SameMessageTimeDelay

You can also define custom spam filters. See Creating a Custom Spam Filter.

Spam Filter Usage Examples

The table below provides examples of setting up the control to filter spam.

As a developer I want to...

So I set the SpamControlType property to...

And I set the SpamTimeSpan property to …

Prevent a user from posting the same comment more than once a day

SameUserSameMessageSameDay

 

Prevent a user from posting any other comment for 30 minutes

SameUserTimeDelay

1800

Prevent a user from posting identical comments for 2 hours

SameMessageTimeDelay

7200

Use my own spam filter code

Custom and add the code to the code behind page of the template containing the MessageBoard server control.

 

Creating a Custom Spam Filter

You can create your own spam filter in the codebehind of the page that hosts the Message Board. To do this, set the SpamControlType property to Custom, call the CustomSpamMethod in the page load event, and point it to your custom spam filter method. Your method’s signature must include the following parameters:

long objectId - the numeric ID of the object defined in the object type

Ektron.Cms.Common.EkEnumeration.MessageBoardObjectType objectType - the type of object with which the Message Board is associated. See Also:

long userId - The numeric ID of a user. For example, you want to block a user with the ID 18 from posting to the board.

string messageText - a string of text you want to block

int interval - the amount of time, in seconds, to block posting on the Message Board. For example, if you want to block a user from posting for 30 minutes, set this property to 900.

Below is a C# example that blocks the text Hello World.

using System;
using System.Data;
using System.Configuration;
using System.Collections;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;
public partial class WebformCB : System.Web.UI.Page
        {
protected void Page_Load(object sender, EventArgs e)
            {
                this.MessageBoard1.CustomSpamMethod(SpamControl);
            }
private bool SpamControl(long objectId, Ektron.Cms.Common.EkEnumeration.MessageBoardObjectType objectType, long userId, string messageText, int interval)
            {
if (messageText == "Hello World")
                {
return true;
                }
return false;
            }
        }

MessageBoard Server Control Properties

The MessageBoard server control properties are described in this table.

Note: On a PageBuilder page, you can insert a Message Board using the Message Board widget. See Also: MessageBoard

Note: The following table only lists Ektron-specific properties. It does not describe native .NET properties such as font, height, width and border style. For documentation of these properties, see Visual Studio help.

Property

Description

Data Type

Authenticated

Indicates if you are logged in to the CMS Explorer and can use it to browse to Content, Collections, etc. See Also: Using CMS Explorer to Browse Your Ektron CMS400.NET Site

String

CacheInterval

Sets the amount of time the server control’s data is cached. The default is 0 (zero). This is the amount of time, in seconds, a control’s data is cached. For example, if you want to cache the data for five minutes, set this property to 300 (three hundred).

See Also: Caching with Server Controls

Double

CommentBoxLocation

Defines the location of the comment box. By default, bottom is selected. Choices are:

Bottom = comment box appears below the comments

Top = comment box appears above the comments

Data Type: EkEnumeration.MessageBoardCommentBoxLocation

 

DefaultObjectID

The default object ID for this control to use when there is no matching dynamic parameter value passed.

Long

DisplayXslt

Determines how information is displayed on the page. Enter the path to the XSL file. It can be relative or absolute.

Warning! If you specify an external file, it is strongly recommended that you do not store this file in your site's Workarea folder. If you store this file in the Workarea folder, the file will be lost when you upgrade.

Warning! If you enter a valid EkML file at the MarkupLanguage property, the DisplayXslt property value is ignored.

String

 

DoInitFill

By default, Fill occurs during the Page_Init event. Set to false if you want to postpone the fill-action until later. In this case, FIll is automatically called during the Page Render event.

You might do this if you need to set or change a property on the control in codebehind and have it render with your changes shown.

Boolean

DynamicObjectParameter

Gets or sets the QueryString parameter to read a object ID dynamically. To use the default object ID, leave blank.

String

EnablePaging

This property, in conjunction with the MaxResults property, lets site visitors view an unlimited number of document items while controlling the amount of screen space. To accomplish this, the display is limited to the number set in the MaxResults property.

If you set this property to true, and the number of items exceeds the MaxResults number, navigation aids appear below the last item.

Boolean

Hide

Used to hide output of the control in design time and run time.

True = Hide control

False = Display control

Boolean

Language

Set a language for viewing the server control. This property shows results in design-time (in Visual Studio) and at run-time (in a browser).

Integer

MarkupLanguage

Identify the template markup file that controls the display of the server control. For example, mymarkup.ekml. If the *.ekml file is located in the same folder as the Web form containing the server control, just enter its name. Otherwise, the path to the file can be relative or absolute. See Also: Controlling Output with Ektron Markup Language

String

MaxResults

The maximum number of items to fetch. 0 (zero) = unlimited.

Integer

Moderate

Set to True to force moderation of the Message Board. If set to false, moderation is controlled by the user or community group with which the Message Board is associated. See Also: Moderating a Message Board

Boolean

ObjectType

The type of object to which the Message Board is assigned. Choices are:

Content - a content item

User - an individual

CommunityGroup - a community group

Data Type: EkEnumeration.MessageBoardObjectType

 

ProfileParamName

The parameter name to pass in the QueryString to the TemplateUserProfile page, if you want it to be anything other than id.

For example, you may prefer userid, because it is more descriptive, as shown in the following example.

String

ShowMaxCharacter

The maximum number of characters to display in the comment.

If the number of characters in a comment exceeds this, a... more >> link appears. Users click the link to see the full text.

Integer

SpamControlType

Assigns a spam filter to the Message Board. Ektron CMS400.NET provides three spam filters, and the ability to define your own.

Note: Note: Spam control is turned off by default.

Filter choices are:

SameUserMessageDay - a user cannot post the same comment to a board more than once per day

SameUserTimeDelay - prevents user from posting another comment for period of time, specified in the SpamTimeSpan property.

SameMessageTimeDelay - prevents user from posting an identical comment for a period of time, specified in the SpamTimeSpan property.

Custom - Message Board uses your custom spam filter code. See Creating a Custom Spam Filter

See Also: Filtering Spam

Data Type: EkEnumeration.MessageBoardSpamControlType

 

SpamTimeSpan

The number of seconds for which the SameUserTimeDelay or SameMessageTimeDelay spam filters delay a user from posting a second time.

See Also: Filtering Spam

Integer

Stylesheet

Specify the path to a style sheet for use with the server control. The location can be relative or absolute. Leave blank to use the default style sheet.

Warning! If you enter a valid EkML file at the MarkupLanguage property, the Stylesheet property is ignored.

String

SuppressWrapperTags

Suppresses the output of the span/div tags around the control. The default is False.

True - Suppress wrap tags.

False - Allow wrap tags.

Boolean

TemplateUserProfile

The URL path to a page that contains a UserProfile server control. The path can be relative or absolute.

If you enter a path, a user can click any user’s name or avatar from the Message Board server control and be forwarded to his profile page. See illustration below.

Note that user templates can be defined in the Ektron CMS400.NET Workarea > Settings > Community Management > Templates screen.

However, if you assign a template in this field, this setting takes precedence over the setting on the Workarea Template screen.

String

WrapTag

Allows a developer to specify a server control’s tag.

The default is Span.

Span—The <span> tag is used to designate an inline portion of an HTML document as a span element.

Div—The <div> tag is used when you want to apply attributes to a block of code.

Custom—Allows you to use a custom tag.

String


Visit the Ektron Dev Center at http://dev.ektron.com 1-866 - 4 - EKTRON

Ektron CMS400.NET Reference Version 8.02 SP1 Rev 1

Ektron Documentation,© 2011 Ektron, Inc.