Composr Supplementary: Setting Timed Content for Composr on a cPanel host

Written by Steve Jarvis, Sponsored by Arvixe hosting

Potentially Outdated Tutorial

This supplementary tutorial might be outdated as it was written for a previous version of Composr CMS (version 10).


Being able to set up timed content on your Composr website is possibly something you will want to do at some point during your website's lifespan. This might be so you can schedule content to go live while you are away, or in the case of a news site you may have an embargo on news until a specific time.

These instructions should work for most cPanel hosting.

The first task is you need to do is known as "setting up a Cron job" (to tie in the Composr system scheduler). To do this you will need to log in to your webhosting cPanel.

Once you have logged into cPanel scroll down to the advanced section which is the second last section in the standard cPanel on many hosting plans. Click on the "Cron Jobs" option which will take you to a screen which will have a section which looks like this:
Image

Setting Cron in cPanel

Setting Cron in cPanel

To set up the Cron job you need to fill in all of the options. Depending on how regularly you will want to post scheduled content will determine what settings you use in this section. You can set Cron to run as often as you like from once every minute to once a month. In most cases once every 5 minutes will be more than adequate. To set this you need to input */5 in the minute box which is every 5 minutes. If this was */7 it would run every 7 minutes. You also need to fill in the hour, day month and weekday options. As you want it to run every hour, every day, every month and every weekday you need to put "*" in each of these boxes.

If you want the Cron to run very minute put "*" in all of the boxes or choose the every 1 minute option in the common settings.

Image

Adding the Cronjob

Adding the Cronjob

(Click to enlarge)

The last part of this section of the tutorial is filling in the command box. In this box you need to tell Cron to call the file which will tell Composr to check for scheduled content. In Composr the file is cron_bridge.php and it is located in the data directory. So the command line will look something like this:

Code (Bash)

php /home/ACCOUNTNAME/public_html/data/cron_bridge.php
 

The php is telling Cron it is calling a php file and the second part is the path to the file within your hosting. You can find the first part by looking at the stats section of your cPanel home screen which will tell you your home directory. The next part public_html is where your root directory of your webhosting files will be and the data/cron_bridge.php is the path of the file within your hosting. If you have not installed your Composr website on the root of your hosting you will need to add the directory of the website into the command line too.

For example if your website is installed into a WEB directory then the command line would be:

Code (Bash)

php /home/ACCOUNTNAME/public_html/WEB/data/cron_bridge.php
 

Once you have filled this in you can click the "Add new Cron job" button.

This will now instruct Cron to call the file at the designated time. I have noticed this can sometimes take an hour or two to kick in so be patient.

Once this is up and running you should see options to schedule a post within the advanced section of when you add a new news post, for example. Once this appears you will know your Cron is running correctly. The option will look like this:
Image

Setting content publication time

Setting content publication time

You will also need to make sure you have the website time settings correct otherwise the article may not appear at the correct time.

Feedback

Please rate this tutorial:

Have a suggestion? Report an issue on the tracker.