This is an update to the instructions that were originally created for vBulletin 3.

These instructions will setup trial access to your forum such that new users must purchase a subscription within X days or they will lose their access. At the end of X days they will still be in the Registered Users usergroup which will qualify them for the promotion (demotion) into the "Expired Trial" usergroup.

Note that we are using the default Registered Users usergroup as the trial usergroup since that is where new registrations go. Then we are demoting back to an "Expired Trial" usergroup at the end of X days.


Create a new usergroup for expired trials
Create the new group in your:

Admin CP > Usergroups > Add New Usergroup

When setting the permissions on the Add New Usergroup page, set all permissions to No except for the Can View Forum permission. This way the expired trial can still access the Paid Subscriptions page so they can purchase subscriber access after their trial has expired. In the meantime they won't be able to access anything else.

You may wish to set specific forum permissions for this group:

Admin CP > Channel Management > Channel Permissions
Create a promotion (demotion) to expire the trials after X days
Go to your:

Admin CP > Usergroups > Promotions > Add New Promotion

Use these settings, where X is the number of days after which trial accounts are expired:
  • Usergroup - Registered Users
  • Reputation Comparison Type - Greater or Equal to
  • Reputation Level - 0
  • Days Registered - X
  • Posts - 0
  • Promotion Strategy - Join Date
  • Promotion Type - Primary Usergroup
  • Move User to Usergroup - the group you created for expired trials

Create a new group for Paid Subscribers
Go to your:

Admin CP > Usergroups > Add New Usergroup

Set this group's permissions as appropriate for members who've taken out a Paid Subscription.

You may wish to set specific forum permissions for this group:

Admin CP > Forums & Moderators > Forum Permissions
Create a subscription for subscribers to purchase

Go to your:

Admin CP > Paid Subscriptions > Add New Subscription

Configure the subscription so it changes a user's primary group to the new group you created for subscribed users. Set whatever prices and lengths you want.
Inform active trials of how long they have left
You may wish to have an indicator on your site that tells a user how long they have left on their Trial Membership. The following code will give the Trial Member the date they joined and how many days they have left on their Trial Membership. If the user is then moved to the Expired Trial usergroup you created earlier, they will receive a message telling them that their Trial has expired.

Rather than editing a template, I've chosen to use the Ad module within Site Builder to show these messages. This allows easier customisation using the module GUI rather than adding various conditional statements to the code.

To add the messages, activate Site Builder and click on Edit Page. Then, drag an Ad Module to your page (I've chosen just below the Page Title module:

Trial4.jpg


Next, edit the module and create your first Ad. This will be for current Trial Members using the code below changing X for the number of days trial you setup in the Promotion previously:


Code:
{vb:set daysleft, {vb:number {vb:math (({vb:raw user.joindate} + ([COLOR=#FF0000][B]X[/B][/COLOR] * 86400) - {vb:raw timenow}) / 86400)}}}  
             <div align="center" style="color: red; background-color: white; border: 1px solid black; padding:2px">                 <br />                 You joined on {vb:date {vb:raw user.joindate}} so your trial access expires in {vb:var daysleft} days.  You can subscribe <a href="settings/subscriptions">here</a>.                 <br />             </div>
Ensure you check the box for 'User belongs to usergroup' and select the Registered Users usergroup from the dropdown:


Trial2.jpg


Now create a second Ad - this will contain the message for those whose Trial has expired:

Code:
<div align="left" style="color: red; background-color: white; border: 1px solid black; padding:2px">Your trial has expired. Please subscribe <a href="settings/subscriptions">here</a>.</div>
This time, make sure the 'User belongs to usergroup' dropdown is set to your new Expired Users usergroup that you created earlier:


Trial3.jpg


Save the Ads, Module configuration and then save the page.


Additional Information

Both subscription expirations and promotions are handled by scheduled tasks:

Admin CP > Scheduled Tasks > Scheduled Task Manager > User Promotions and Subscriptions

By default, promotions run every hour while subscription expirations run once a day. So an expired trial can take up to one hour to change over, and an expired subscription can take up to one day. If you are testing your setup, then you can manually run these tasks using the Run Now button to see that the appropriate changes are being made.

If a user's subscription expires then they will be dropped back to the expired group, either directly or by way of the Registered Users group and the demotion, depending on which group they were in when they purchased the subscription. This process can take time because of the tasks mentioned above.