Series Details

With Preachit 4.1 it is now possible to access the Preachit core engine and get access to Preachit series details from other extensions in Joomla. Here we show you how to hook into the series api and list the various functions you can call.

 

Plugging in

 

To plug into the Preachit series api you will first need to load the relevant php file into your script. Here is the call you need:

 

require_once(JPATH_SITE.DIRECTORY_SEPARATOR.'components/com_preachit/helpers/info-builder.php');

Once you've loaded in the file you then need to activate the Preachit series class:

 

$series = new PreachitSeries($series, $config);

In this call the $series value can either be the id for the Preachit series you want to use or the full database object for the Preachit series. The $config value needs to be an array. At the moment we only use 3 keys in this array. First, the 'runplugin' key. This can be set to true or false depending on whether you want plugins to be run on the description field for the series The other two keys allow you to set the height and width of the different players. They are 'videowidth', 'videoheight'.

 

Function list

 

Below is a list of calls that can be made and the details they will return:

 

$series->item

Returns the database object for the series

 

$series->id

Returns the id for the series

 

$series->name($menuid = 0)

Returns the name of the series with a link. If the menuid is set to greater than 0 then this will be set as the menuid in the link.

 

$series->nameonly()

Returns the name of the series with no link.

 

$series->url($menuid = 0)

Returns the link for the series. If the menuid is set to greater than 0 then this will be set as the menuid in the link.

 

$series->daterange()

Returns the date range of messages connected to the series.

 

$series->datestart()

Returns the date of the first message in the series.

 

$series->dateend()

Returns the date of the last message in the series.

 

$series->count()

Returns the number of sermons linked to this series.

 

$series->image($size, $bd = null, $menuid = 0)

Returns an image for this series. The size can be set to 'sm', 'med', 'lrg', 'ori'. Set $fb to 'fb' if you want the function to return the original url for the image. Set $fb to 'url' if you want the function to return the url for the resized image. If $fb is not set then the function will return the image as a complete html image tag wrapped in a link to the relevant details so that you just need to insert it in your page. If the menuid is set to greater than 0 then this will be set as the menuid in the link.

 

$series->description()

Returns the description of the series.

 

$series->edit()

Returns the edit link for the series.

 

$series->videoplayer()

Returns the video player object. This contains two entries. Under the key ->code you will find the html for the player. Under the key ->script you will find the url for a javascript file to load if needed.

 

$series->access()

Returns the access group set for the series.

 

$series->download()

Returns the link to download the whole series of messages in a zip file.

 

$series->seriesStudies()

Returns the $message object for all of the messages in the series in an array.

 

$series->ministryname($link = 0, $menuid = 0)

Returns the ministry name. If the $link setting is set to 2 then this will only return the ministry name. If it is set to 1 or left then the return will include the ministry name and a link to the series page. If the menuid is set to greater than 0 then this will be set as the menuid in the link.

 

$series->extrafields()

Returns the array for any extra fields that have been set up through the extra fields area of the Preachit administrator. The array format puts the alias for each extra field as the key in the array.

Cron Job Starts