Composr Tutorial: Advanced techniques for multi-site-networks

Written by Chris Graham
The linking of different installations, linked via a forum, into a 'multi-site-network' (an M.S.N.) is a feature in the software (maintenance status). This is an important feature for networks of websites which share a common community, but are segmented, for reasons such as:
  • Division of staff, either on a hierarchical basis or a basis of co-operation by a loose-knit alliance of websites
  • Strong division of content, perhaps for sub-branding or clarity
  • A balance between autonomy and co-operation between websites that wish to share a visitor-base


Shared forum and members

Image

Choose this option if you want to run each site' discussion forum from its own code and URL (optional only shows if applicable to your site)

Choose this option if you want to run each site' discussion forum from its own code and URL (optional only shows if applicable to your site)

(Click to enlarge)

All that needs to be done to create an M.S.N. is to install each Composr such that they all share a common forum driver and forum database. At its heart, this is all a M.S.N. is: Composr provides special features that allow this to work comfortably, but there is no specific 'M.S.N.' feature or setting in Composr, nor does Composr need such.

At the time of writing this note (2016), a more normal approach to sharing member databases is to leave it to Facebook, using the Facebook addon to handle log-ins. Usage of Facebook has obvious disadvantages, but also for most people the advantages far outweigh them. Facebook is de facto the world's standard identity service.

The site sharing the forum is the "central site", and all other sites are "satellite sites".

If you are using the Composr forum system (Conversr) as your forum, then it is possible to run Conversr from each site, without members even knowing (from a feature and visual point of view) that a multi-site-network is in action. All you need to do to achieve this is to:
  1. set the forum-base URL to that of the central Composr site
  2. enable the "Show forum within website" configuration option (Admin Zone > Setup > Configuration > Site options > Advanced) shown in the screen-shot
  3. enable the on_msn installation option
Note that if you do this, and you decide to move a site you are connecting to the M.S.N. with, then URLs may be broken for things such as photos, avatars and attachments – as these get uploaded locally and are stored on the forum using full URLs. In other words, they are not stored on the central site if they got uploaded from a member site, thus the other sites get a dependency on the member site's URL Scheme.

Important notes about Conversr M.S.N. sites:
  • Each site on the network must have the same setting for "Support content translations". If not, you'll find massive corruption happening.
  • Each site on the network must be running the same version of Composr.
  • Local (satellite) privileges and configuration settings are used, not ones from the central forum site: this is actually a feature, as it provides additional control, but it is important to keep in-mind from a security point of view.

Conversr may be administered from an M.S.N. site, although some very minor restrictions are put in place, such as prevention of editing rank and emoticon images.

Special note: upgrading

If you are upgrading to a new major release then you will need to upgrade all the sites together, starting with the central site.

Custom Profile Fields

As Custom Profile Fields are saved to the central site, the central site will need to have any Custom Profile Fields associated to modules that need to save data for them.

For example, if a site uses points, it'll store them in special CPFs. If the central site has had the points addon removed, then the CPF will no longer exist and sites will not be able to save. Therefore it is best to not remove any addons (especially points) from the central site if you intend to use those addons on some of your other sites.

Editing data on satellite sites

The following should only be configured on the central site:
  • Custom Comcode Tags
  • Usergroups
  • Emoticons

This is so as to:
  1. Ensure consistency between sites
  2. Make sure that any uploads are uploaded to the central site rather than a satellite site (as satellite sites don't have disk write access to the central site)

Custom fields

Custom fields on forum content are not supported across networks. If you set them up they'll only be viewable for the particular site that content is added/edited on, and not show up on other sites.

Comment forums

Composr allows configuration of what forums are used to store portal-generated comments, and support tickets. On an M.S.N. it is important to declare a different forum for each site on the network, in order to prevent conflict.

Themes

The theme management screen (Admin Zone > Style > Themes) will help you understand this – it is difficult to describe in words.

Composr supports a sophisticated theme detection system, whereby Composr themes can be automatically detected based on a priority system:
  1. (whatever a zone might be forcibly set to)
  2. from the "forum-theme-name-to-Composr-theme" mapping of the member chosen forum-themes, if the logged in member has made a choice. In other words, if a member Bob selects a forum theme named ForumFoo, then the Composr theme would be whatever the map says that ForumFoo's Composr equivalent is (e.g. ComposrFoo)
  3. from the "forum-theme-name-to-Composr-theme" mapping of the forum-theme titled after the name of your website name. In other words, if the forum contains a theme titled "My Site" and your website happens to be called "My Site", then Composr theme would be whatever the map says that MySite's Composr equivalent is (e.g. MySiteTheme)
  4. the Composr default theme

This system is complicated to understand and configure, and is optional, but it is useful for some websites. If you do not wish to use this system, simply manually select which themes to use for each zone, by editing the zone.

Basically, Composr has a file, themes/map.ini, that contains entries that link forum-theme-codes to Composr-theme-codes. Note that the forum-theme-code is not the same as the forum-theme-title: the relationship between these vary between forums, but most forums define both a humanely readable title and a code-name.

The netlink system

Image

Configuring the network link URL to point to the central network site

Configuring the network link URL to point to the central network site

(Click to enlarge)

Image

Editing the netlink definition file

Editing the netlink definition file

(Click to enlarge)

Image

The netlink block

The netlink block

(Click to enlarge)

The netlink is a simple but useful feature of multi-site-networks. It provides the navigation aid to move between sites on the network, via a simple drop-down list placed on to your panel via the side_network block.

The links available are edited on the central site at:
Admin Zone > Structure > Partner sites

The netlink system can be configured (from the Admin Zone Configuration module) so that all sites on the network point to a shared netlink definition file. The config option allows you to set the URL to the netlink of one of the network sites (usually the central site).

News

You may share news by placing it on the central network site, and using the RSS blocks (set to use the central site's feed) to link to it on the other network sites.

Banners

To share banners across your network, simply add all banners to the central site, and place the URL to the central site's http://yourbaseurl/banner.php script as the only banner in the banner rotation for all the other M.S.N. sites. You may add additional banners to M.S.N. sites if you want to mix central banners with individual rotations.

The staff system

Image

Configuring the staff system

Configuring the staff system

(Click to enlarge)

Image

Managing staff

Managing staff

(Click to enlarge)

As permissions are set separately on each M.S.N. site (except for forum access permissions), it is possible to assign different staff access to key functions on different sites by usergroup. However, assigning staff is more than a permissive issue, it is also a presentation issue: for the staff module to work, there needs to be some way for Composr to actually list staff other than merely by usergroup permission. This is done via the 'staff filter' feature, available under security/usergroup configuration.

The staff filter works by storing 'staff on' lists under all member profiles that would be staff if the filter was off. These are comma-separated lists of site-names the member is staff-on, and are stored as a hidden Composr Custom Profile Field.

Domain structuring

You can make it so you have a single Composr site that runs across different subdomains. You can also make it so that zones appear to be structured hierarchically.

This is an advanced feature that is not fully supported by the developers. It requires some fairly low level web server configuration to work (i.e. it won't work on many shared webhosts).

The procedure is as follows:
  1. It is strongly recommended, for simplicity and user-friendliness, that you operate Composr from the root of your domain name, e.g. having http://example.com as your base URL.
    1. For multiple sub(domain) names, each representing a different zone…
      Set up multiple website profiles in IIS manager / virtual hosts in the Apache configuration file. These profiles must all point to the Composr installation directory (not the zone you're linking the subdomain to).
    2. For complex hierarchies:
      Set up virtual directories in IIS manager / directory sections in the Apache configuration file. These virtual directories must all point to the Composr installation directory (not the zone you're linking the subdomain to).
  2. Composr is now set up to receive requests on the various domain names / paths that you have configured. Extra information needs adding to the Composr _config.php, to tell Composr how to map these individual source locations, into zone accesses.
    Let's pretend we've added a new subdomain 'forum.mydomain.com' (for the forum zone), and a new virtual directory under our normal website entry, under example/path; we'll point this to the xyz (i.e. we'll map to a zone unrelated to the subdomain name or virtual directory path). You would add this to _config.php

    Code (PHP)

    $SITE_INFO['ZONE_MAPPING_forum'] = array('forum.mydomain.com','');
    $SITE_INFO['ZONE_MAPPING_xyz'] = array('mydomain.com','example/path');
     

    As of Composr 10, you can do this setup in the normal zone management screen. It does save to _config.php though.
  3. Now Composr links point to the proper complex URLs, and the complex URLs are properly recognised as zones.

    Please note it is essential to configure your cookie domain to be encompassing of all the subdomains you use. In the above example you would need .mydomain.com to be set as the cookie domain. You cannot use a blank cookie domain.

Many sites, one install

Composr used to have a method for running many sites under one Composr install (referred to as 'Demonstratr'). As of version 11, this is legacy functionality and has been pulled due to the significant maintenance needs and security implications of running demonstratr. You can check the Composr addon archive if you wish to implement your own demonstratr-like system at your own risk, or if you wish to bring back the maintenance of Composr's demonstratr functionality.


See also


Feedback

Please rate this tutorial:

Have a suggestion? Report an issue on the tracker.