XenForo Documentation

website·Indexed 42 days ago

https://docs.xenforo.com

Official documentation for XenForo forum software, covering installation, upgrading from XenForo 1, user management, forum configuration, and template syntax. Includes guides on user groups, monetization via user upgrades, route filters, and API references for resource categories.

Tokens
116.8K
Snippets
500
Records
967
Agent score
71%

What's inside XenForo

  1. Overview of XenForo Progressive Web App (PWA) features

    XenForo uses PWA technology to automatically reconfigure the user interface for mobile devices. Key features include:

    • Responsive Design: Automatically adjusts layouts from multi-column to single-column and enlarges touch controls for small viewports.
    • Installability: Users can add the forum to their home screen as an app icon. On iOS 16.4+, users must use the 'Add to Home Screen' feature in Safari to enable push notifications.
    • Push Notifications: Integrates with device notification systems to alert users even when not browsing the forum.
    • App Badging: Displays a notification counter badge on the installed app icon.
    • Share Sheet Integration: Triggers the device's native system share sheet when sharing content.
  2. Overview of the XenForo Criteria system

    The Criteria system is used to test entities (such as users, pages, or posts) against conditions selected by an administrator or user. It is used natively in Trophies, User-group promotions, and Forum notices. Criteria types are implemented as children of the AbstractCriteria class. Out-of-the-box, XenForo provides 'User criteria' (about the user) and 'Page criteria' (about the user's current location and time).
  3. Overview of User Group Promotions

    User group promotions allow administrators to automatically add members to user groups, modify their user titles, change username styling, or adjust permissions based on defined criteria. This system can be used for membership segmentation (e.g., A/B testing), identifying users with birthdays, awarding badges for contributions, or styling usernames for new users. All controls are located in the Admin Control Panel at Groups & Permissions > User group promotions.
  4. Overview of XenForo user communication methods

    XenForo provides multiple tools for administrators to communicate with their user base, depending on the required visibility and urgency:

    • On-screen notices: Used for attention-grabbing announcements displayed directly on the page.
    • Help pages: Used for providing static documentation and guidance to users.
    • Direct contact: Tools for reaching out to individual users specifically.
    • Activity summary emails: Automated email digests that summarize user activity.
  5. Access user details via the ContentUser object

    The ContentUser object within FeaturedContent provides comprehensive information about the content creator. The available fields vary based on the requester's permissions and the verbosity of the API call. Key fields include:

    • Identity: user_id, username, user_title, and custom_title (prefer user_title).
    • Status: is_admin, is_moderator, is_super_admin, is_banned, is_discouraged, and is_staff.
    • Metrics: message_count, trophy_points, reaction_score, and vote_score.
    • Profile: about, location, website, signature, and avatar_urls (map of size types to URLs).
    • Permissions/State: can_ban, can_warn, is_followed, and is_ignored (only if visitor is not a guest).
  6. ProfilePostComment API schema reference

    The ProfilePostComment object represents a comment on a user's profile post. It contains the comment content, metadata about the author, and permission flags for the current viewer.
    {
      "profile_post_comment_id": "integer",
      "profile_post_id": "integer",
      "user_id": "integer",
      "comment_date": "integer",
      "message": "string",
      "message_state": "string",
      "warning_message": "string",
      "reaction_score": "integer",
      "username": "string",
      "message_parsed": "string", // HTML parsed version of the message
      "can_edit": "boolean",
      "can_soft_delete": "boolean",
      "can_hard_delete": "boolean",
      "can_react": "boolean",
      "can_view_attachments": "boolean",
      "is_reacted_to": "boolean", // True if the viewing user has reacted
      "visitor_reaction_id": "integer", // ID of the reaction used by the viewer
      "User": "object" // Detailed information about the user
    }
  7. Update a specific resource via REST API

    Update a specified resource by sending a POST request to the /resources/:id/ endpoint. A successful request returns a 200 OK response. The response includes headers indicating the API version used and information about the requesting user.
    POST /resources/{id}/
  8. Understand XenForo thread basics and structure

    Threads are the primary containers for forum content in XenForo. Every thread must be created within a specific forum, although moderators have the ability to move threads between forums. A thread consists of an initial post (which requires a title and body text) and subsequent replies (which consist of body text attributed to a user without a separate title).
  9. Understand and use criteria in XenForo

    Criteria in XenForo are used to determine if an item is visible or available, and to fine-tune search processes. They are commonly used when searching for users in the control panel or defining when Notices should be displayed.

    Search Behavior:

    • Text Fields: Searches are partial matches. For example, entering jo in a username box returns users like Jo, John, Joanne, Bjorn, and Marjory.
    • Numeric Fields: Use minimum and maximum value boxes. To specify no maximum, use -1.
    • Defaults: Fields left empty or set to their default value are ignored during the search.
    Example: To find users with at least one message:
    - Message count minimum: 1
    - Message count maximum: -1
  10. Retrieve information about a specific media item

    Use the GET /media/:id/ endpoint to retrieve detailed information about a specific media item. The :id parameter in the URL path must be replaced with the unique identifier of the media item you wish to query.
    GET /api/media/{id}/
  11. Understand XenForo API pagination response schema

    XenForo API paginated responses include a pagination object that provides metadata about the result set. This allows developers to track the current position, total record count, and the boundaries of the dataset.
    {
      "current_page": 0, // The current page number (integer)
      "last_page": 0,    // The last page number (integer)
      "per_page": 0,     // The number of items per page (integer)
      "shown": 0,        // The number of items returned in the current response (integer)
      "total": 0         // The total number of items across all pages (integer)
    }
  12. Understand response headers for forum API requests

    When requesting forum information, the API returns several XF-specific headers providing context about the API version and the requesting user:

    • XF-Latest-Api-Version: The most recent version of the API available.
    • XF-Used-Api-Version: The specific API version used to generate the current response.
    • XF-Request-User: The user ID of the user making the request.
    • XF-Request-User-Extras: A JSON-encoded string containing additional details about the request user. This header is only populated if the XF-Request-User header is non-zero.