Plugin Forum Posts User — guide and overview
Plugin purpose
The Forum Posts User plugin is designed to display forum messages posted by a user in two formats:
- a standalone page with a list of the authorized user’s own posts;
- a dedicated tab in the user profile with a list of the user’s forum posts, available to other users according to access permissions.
The plugin extends the forums module and the users module by adding a personalized view of forum activity.
General plugin logic
The plugin works in conjunction with the forums module and uses forum posts and topics data. It performs the following tasks:
- retrieving posts of a specific user;
- checking access permissions for forum sections;
- pagination handling;
- truncating post content;
- integration into the site interface via menus and profile tabs.
The plugin’s operation fully depends on the presence of the forums module and an active user.
Server-side operation (without code)
General principles
- The plugin is loaded globally and includes language files.
- It uses the standard Cotonti templating system.
- All data is retrieved directly from forum database tables.
- Access permissions for forum sections are checked for every request.
Main scenarios
- Viewing own posts
- The user must be authorized.
- The current user identifier is used.
- The total number of posts is calculated.
- Pagination is generated.
- Posts are sorted by update date, from newest to oldest.
- Post content is stripped of markup and truncated to a configured length.
- Viewing user posts in a profile
- The user identifier from the profile is used.
- The existence of the user is verified.
- Access to forum sections is checked for each post.
- Profile tab switching is supported.
- Paginated output is supported.
Integration into the site interface
Authorized user menu
- A menu item “My forum posts” appears.
- The item is displayed only if:
- the plugin is active;
- the user is authorized.
- The link leads to a separate page with the user’s posts list.
User profile
- A separate tab appears in the user profile.
- The tab title includes:
- a label;
- the user’s post count.
- The tab is available if forum read permissions are granted.
- The tab is activated using the standard tab switching mechanism.
Plugin operation for administrators
The administrator has the following capabilities:
- enable or disable the plugin via the extensions panel;
- configure the number of posts per page;
- configure the length of displayed post text;
- automatic integration of the plugin into user profiles without manual template modifications;
- use of standard forum access permissions without additional configuration.
The plugin does not introduce new permission types and relies entirely on the existing Cotonti authorization system.
Plugin operation for users
Authorized user
- Sees the “My forum posts” menu item.
- Can view all of their own posts regardless of the currently opened profile.
- Receives:
- a list of posts;
- topic titles;
- post dates;
- truncated post text;
- a direct link to the specific post in the topic.
- Can navigate through pages when the number of posts is large.
Viewing another user’s profile
- Can open the tab with the user’s forum posts.
- Sees only posts from forum sections they have access to.
- Can use pagination.
- Sees the current total number of the user’s posts.
Access control handling
- Read permissions for the corresponding forum section are checked for each post.
- Posts from restricted sections are not displayed.
- If the user does not exist, the tab is disabled.
- If the forums module is not active, the plugin functionality is not used.
Templates and layout
- Separate templates are used:
- for the user’s own posts page;
- for the profile tab.
- Responsive layout is supported.
- Standard interface classes are used.
- Posts are displayed as a list.
- Breadcrumb navigation is supported on the standalone page.
Localization
- The plugin uses language files.
- All titles and labels are rendered through the localization system.
- Multilingual support is available.
Summary
The Forum Posts User plugin provides a structured and secure way to display user forum activity, integrated into both the site menu and user profiles. It operates using standard Cotonti mechanisms, preserves the access control model, and does not require additional logic from administrators or users.