Knowledgebase : PHP Templating Reference > PHP Templating API
   

Introduction

Within our PHP templates, our system works in a way where specific variables are available to the templates based on the page they are on. These variables are created by the system before template code is being run.

For instance:

/members/index.php

On the index page, there's a variable called $sets available which lists the newest sets.

/members/category.php?id=10

On this page, if this is a non-model category, the $sets variable will list the sets available on this page, based on which category this is, and which order the system is set to show these sets.

/members/gallery.php?id=1&type=vids

On this page, for instance, you'll have a variable named $media that shows content that is associated with this set.

This works well within our standard templates, since our standard templates are coded in order to show information that is available on that specific page.

The Problem

The problem comes into play if you wish to fetch content on a specific page that is NOT part of the normal page's variables.

For example, if you want to embed the newest movie on your home page. In this case, $media is not available on the index page, so embedded the movie file becomes a lot harder from a design perspective, often involving either direct database queries (NOT ADVISED) or AJAX calls in order to show the information.

As another example, say you wish to show the newest sets on your blog page. In this case, $sets is not available on your blog page so showing the newest sets becomes a lot harder from a design perspective. Just like the above example, getting around this limitation involves either direct database queries or AJAX calls in order to show that element of the page.

The Solution

In order to get around this, we have provided version 1.0 of our PHP Template API so that specific information about scenes and sets can be fetched on ANY template page.

Examples

Let's take first example up above. If you want to get media and file information about a specific scene on your front page, you can do;
$media = $api->getContent(["id" => $id]);
By making this call the $media element becomes available to your templates, and you can code any page to embed movies without much trouble.

In our second example, this is also easily fixed in our template API:
$sets = $api->getSets();
Now that this information is made available, you should be able to show newest sets, or specific sets anywhere.

API Calls

Here are a list of API calls currently available. Please click on each of these for more detail on what these do, and how to implement them in your templates.

The getCategories() function gets a list of categories that are present in the system.

The getComments() function gets a list of comments that are present in the system.

The getContent() function returns a list of content files (videos and movies) that are affiliated with a specific set id.

The getDVDs() function gets a list of DVDs that are present in the system.

The getModels() function gets a list of models that are present in the system.

The getNews() function gets a list of news entries that are present in the system.

The getSets() function gets a list of sets that are present in the system.

The getVodAreas() function gets a list of areas that are present in the system which are VOD areas.


Description:

The getCategories() function gets a list of categories that are present in the system. Based on the arguments that are passed to it will determine which and how many categories are returned.

Sample Usage:

$categoryobj = $api->getCategories();

$categoryobj = $api->getCategories(["id" => 1]);

$categoryobj = $api->getCategories([
"parentid" => 1,
"subsiteid" => 1,
"has_sets" => 1,
"sort" => "date",
"sort_reverse" => "1",
"countonly" => 0,
]);

echo "\nNumber of categories returned: " . $categoryobj->categorycount;
echo "\nNumber of categories total: " . $categoryobj->categorytotal;
echo "\nNumber of pages: " . $categoryobj->numpages;
echo "\nCategories:\n";
print_r($categoryobj->categories);

Returning Attributes:

This function call will return a StdObject object with the following attributes:

categories:

This is a multi-dimensional array that returns any categories that match search criteria.

categorycount:

The number of categories within the categories attribute.

Arguments:

parentid:

If set, only show categories that have a specific category id as its parent category. This is useful, for instance, to only retrieve categories that are children of the "Tags" category.

By default, the system does not filter by category id if this value is not specified.

subsiteid:

If specified, limit categories that have sets belonging to a specified all-access subsite id. If this value is category to 0, show categories from all sites. Must be used in conjunction with the has_sets attribute.

By default, the system will detect if the current area belongs to an all-access subsite, and use that value.

Note: If you specify a non-zero value for subsiteid, all-access must be available within this system. Otherwise, an Exception will be triggered.

has_sets:

If set to 1, only retrieve categories that have active sets assigned to these categories.

By default, the system fetches all categories regardless of which sets are assigned to them.

sort:

Specify sorting order of categories.

Valid values are: id and title.

By default, the system will sort by id.

sort_reverse:

If this is category to 1, reverse the sorting order as specified within "sort"

countonly:

If specified, only return the number of categories that fit the search criteria.

Description:

The getComments() function gets a list of comments that are present in the system. Based on the arguments that are passed to it will determine which and how many comments are returned.

Sample Usage:

$commentobj = $api->getComments("contenttype" => "set");

$commentobj = $api->getComments(["id" => 1, "contenttype" => "set]);

$commentobj = $api->getComments([
"contenttype" => "set",
"sort" => "id",
"sort_reverse" => 1,
"countonly" => 0,
]);

echo "\nNumber of comments returned: " . $commentobj->commentcount;
echo "\nComments:\n";
print_r($commentobj->models);

Returning Attributes:

This function call will return a StdObject object with the following attributes:

comments:

This is a multi-dimensional array that returns any comments that match search criteria.

commentcount:

The number of comments returned.

Arguments:

contenttype:

This specifies the type of comment that is being fetched. This field is required.

Valid values for this field are: set, news, model, dvd, custompages, store

id:

This filters the results by model id. If set, this will only return a set of the specified model id, if it is available for release and is present on the current site.

sort:

Specify sorting order of comments.

Valid values are: id

By default, the system will sort by id.

Note: Future sorting options will be available in a future API release.

sort_reverse:

If this is set to 1, reverse the sorting order as specified within "sort"

countonly:

If specified, only return the number of areas that fit the search criteria.


Description:

The getContent() function returns a list of content files (videos and movies) that are affiliated with a specific set id.

Sample Usage:

$cobj = $api->getContent(["id" => 1]);

echo "\nContent Belonging to Set Id 1:\n";
print_r($cobj->content);

Returning Attributes:

This function call will return a StdObject object with the following attribute:

content:

This is a multi-dimensional array that returns content information that belongs to the scene.

The output has a multi-level structure, as follows:

Level 1: Top level keys include the type of content that this belongs to, as determined by Types under Media Types. For instance, if this is photo content, may see a key called "highres". If this is video content, you may see a top level key called "vids".

Level 2: Underneath the first level, you will see a key that denotes the base naming for a piece of content in the system.

Examples:
- If a photo is within /members/content/upload/foldername/photos/1.jpg, the key name here would be "1"
- If a photo is within /members/content/upload/foldername/photos/photo0001.jpg, the key name here would be "photo0001"
- If a photo is within /members/content/upload/foldername/photos/IMG_4065.jpg, the key name here would be "img_0465"

The reason the system sets it up this way is so the system can group photos and medias of different types. This way, it's aware that the same piece of "content" comes in different sizes or configurations (480p, 1080p for videos, and 1024 / 1600 / 2000 for photos).

Level 3: Underneath here, you will see a key that is:
[name:type] for content that belongs to media types
AND
[thumb|watermark:type|cname] for watermark types.

Within this array you'll see all of the information available for that piece of content. This includes information such as path, filesize, and width / height.

Example print_r output of $cobj->content may look like so:
Array
(
    [highres] => Array
        (
            [img_0465] => Array
                (
                    [jpg:highres] => Array
                        (
                            [name] => jpg
                            [type] => highres
                            [filesize] => 5179688
                            [mtime] => 1505009899
                            [width] => 3024
                            [height] => 4032
                            [retina] => 0
                            [id] => 1
                            [file] => /photos/IMG_0465.jpg
                            [show] => 1
                            [date] => 09/09/2017
                            [fullpath] => /photos/IMG_0465.jpg
                        )

                    [thumb:highres:Thumbs] => Array
                        (
                            [name] => thumb
                            [cname] => Thumbs
                            [width] => 185
                            [height] => 230
                            [sourcetype] => highres
                            [type] => 
                            [filesize] => 139865
                            [mtime] => 1505009971
                            [retina] => 1
                            [id] => 1
                            [file] => /thumbs/img_0465.jpg
                            [show] => 1
                            [date] => 09/09/2017
                            [fullpath] => /thumbs/img_0465.jpg
                        )

                    [watermark:highres:1024] => Array
                        (
                            [name] => watermark
                            [cname] => 1024
                            [width] => 768
                            [height] => 1024
                            [sourcetype] => highres
                            [type] => 
                            [filesize] => 458891
                            [mtime] => 1505009973
                            [retina] => 0
                            [id] => 1
                            [file] => /1024watermarked/img_0465.jpg
                            [show] => 1
                            [date] => 09/09/2017
                            [fullpath] => /1024watermarked/img_0465.jpg
                        )

                    [watermark:highres:1280] => Array
                        (
                            [name] => watermark
                            [cname] => 1280
                            [width] => 960
                            [height] => 1280
                            [sourcetype] => highres
                            [type] => 
                            [filesize] => 707668
                            [mtime] => 1505009975
                            [retina] => 0
                            [id] => 1
                            [file] => /1280watermarked/img_0465.jpg
                            [show] => 1
                            [date] => 09/09/2017
                            [fullpath] => /1280watermarked/img_0465.jpg
                        )

                    [watermark:highres:1600] => Array
                        (
                            [name] => watermark
                            [cname] => 1600
                            [width] => 1200
                            [height] => 1600
                            [sourcetype] => highres
                            [type] => 
                            [filesize] => 1079880
                            [mtime] => 1505009978
                            [retina] => 0
                            [id] => 1
                            [file] => /1600watermarked/img_0465.jpg
                            [show] => 1
                            [date] => 09/09/2017
                            [fullpath] => /1600watermarked/img_0465.jpg
                        )

                    [watermark:highres:Full Size] => Array
                        (
                            [name] => watermark
                            [cname] => Full Size
                            [width] => 3024
                            [height] => 4032
                            [sourcetype] => highres
                            [type] => 
                            [filesize] => 5584083
                            [mtime] => 1505009981
                            [retina] => 0
                            [id] => 1
                            [file] => /fullwatermarked/img_0465.jpg
                            [show] => 1
                            [date] => 09/09/2017
                            [fullpath] => /fullwatermarked/img_0465.jpg
                        )

                )

            [img_0474] => Array
                (
                    [jpg:highres] => Array
                        (
                            [name] => jpg
                            [type] => highres
                            [filesize] => 1442462
                            [mtime] => 1505009897
                            [width] => 4032
                            [height] => 3024
                            [retina] => 0
                            [id] => 2
                            [file] => /photos/IMG_0474.jpg
                            [show] => 1
                            [date] => 09/09/2017
                            [fullpath] => /photos/IMG_0474.jpg
                        )

                    [thumb:highres:Thumbs] => Array
                        (
                            [name] => thumb
                            [cname] => Thumbs
                            [width] => 185
                            [height] => 230
                            [sourcetype] => highres
                            [type] => 
                            [filesize] => 56506
                            [mtime] => 1505009972
                            [retina] => 1
                            [id] => 2
                            [file] => /thumbs/img_0474.jpg
                            [show] => 1
                            [date] => 09/09/2017
                            [fullpath] => /thumbs/img_0474.jpg
                        )

                    [watermark:highres:1024] => Array
                        (
                            [name] => watermark
                            [cname] => 1024
                            [width] => 1024
                            [height] => 768
                            [sourcetype] => highres
                            [type] => 
                            [filesize] => 141213
                            [mtime] => 1505009974
                            [retina] => 0
                            [id] => 2
                            [file] => /1024watermarked/img_0474.jpg
                            [show] => 1
                            [date] => 09/09/2017
                            [fullpath] => /1024watermarked/img_0474.jpg
                        )

                    [watermark:highres:1280] => Array
                        (
                            [name] => watermark
                            [cname] => 1280
                            [width] => 1280
                            [height] => 960
                            [sourcetype] => highres
                            [type] => 
                            [filesize] => 211564
                            [mtime] => 1505009976
                            [retina] => 0
                            [id] => 2
                            [file] => /1280watermarked/img_0474.jpg
                            [show] => 1
                            [date] => 09/09/2017
                            [fullpath] => /1280watermarked/img_0474.jpg
                        )

                    [watermark:highres:1600] => Array
                        (
                            [name] => watermark
                            [cname] => 1600
                            [width] => 1600
                            [height] => 1200
                            [sourcetype] => highres
                            [type] => 
                            [filesize] => 319861
                            [mtime] => 1505009979
                            [retina] => 0
                            [id] => 2
                            [file] => /1600watermarked/img_0474.jpg
                            [show] => 1
                            [date] => 09/09/2017
                            [fullpath] => /1600watermarked/img_0474.jpg
                        )

                    [watermark:highres:Full Size] => Array
                        (
                            [name] => watermark
                            [cname] => Full Size
                            [width] => 4032
                            [height] => 3024
                            [sourcetype] => highres
                            [type] => 
                            [filesize] => 1540239
                            [mtime] => 1505009984
                            [retina] => 0
                            [id] => 2
                            [file] => /fullwatermarked/img_0474.jpg
                            [show] => 1
                            [date] => 09/09/2017
                            [fullpath] => /fullwatermarked/img_0474.jpg
                        )

                )

        )

)

Arguments:

id:

This retrieves content that belongs to the specified set id.

Note: This is a required attribute.


Description:

The getDVDs() function gets a list of DVDs that are present in the system. Based on the arguments that are passed to it will determine which and how many DVDs are returned.

Sample Usage:

$dvdobj = $api->getDVDs();

$dvdobj = $api->getDVDs(["id" => 1]);

$dvdobj = $api->getDVDs([
"page" => 1,
"id" => 1,
"numperpage" => 20,
"studioid" => 1,
"startwith" => "A",
"sort" => "date",
"sort_reverse" => "1",
"subsiteid" => 1,
]);

echo "\nNumber of DVDs returned: " . $dvdobj->dvdcount;
echo "\nNumber of DVDs total: " . $dvdobj->dvdtotal;
echo "\nNumber of pages: " . $dvdobj->numpages;
echo "\nDVDs:\n";
print_r($dvdobj->dvds);

Returning Attributes:

This function call will return a StdObject object with the following attributes:

dvds:

This is a multi-dimensional array that returns any DVDs that match search criteria.

dvdcount:

The number of sets within the dvds attribute.

numpages:

A total number of pages that are available. For instance, if dvdtotal = 400 and the system has a numperpage value of 20, this value will be 20.

dvdtotal:

A total number of DVDs that are available, regardless of pagination.

Arguments:

page:

This paginates the DVD list. This way, if you specify "page" => 2, it will show a different list of DVDs than if you specify "page" => 1.

This is useful if the page you're calling this function on is paginated and you want to show different updates on page 2 of your page than page 1.

By default, the system sets this value to 1 if not specified when passing along to the system.

id:

This filters the results by DVD id. If set, this will only return a set of the specified DVD id, if it is available for release and is present on the current site.

numperpage:

If specified, determines the maximum number of results to show.

By default, the system looks at the value of "DVDs per page" under Plugins -> DVDs -> Configure.

studioid:

If specified, only return DVDs that belong to the specified Studio Id.

By default, the returns all DVDs regardless of what Studio Id they are affiliated with.

startwith:

If specified, only show DVDs that begin with the specified letter.

By default, the system does not filter results by letter.

sort:

Specify sorting order of sets.

Valid values are: name, date, rating, random.

By default, the system will sort by date.

Note: Doing a database sort by random creates a temporary table within mysql, and may result in reduced performance. Only choose this sorting option when absolutely necessary.

sort_reverse:

If this is set to 1, reverse the sorting order as specified within "sort"

subsiteid:

If specified, limit DVDs belonging to a specified all-access subsite id. If this value is set to 0, show sets from all sites.

By default, the system will detect if the current area belongs to an all-access subsite, and use that value.

Note: If you specify a non-zero value for subsiteid, all-access must be available within this system. Otherwise, an Exception will be triggered.


Description:

The getModels() function gets a list of models that are present in the system. Based on the arguments that are passed to it will determine which and how many models are returned.

Sample Usage:

$modelobj = $api->getModels();

$modelobj = $api->getModels(["id" => 1]);

$modelobj = $api->getModels([
"page" => 1,
"id" => 1,
"numperpage" => 20,
"gender" => "F",
"startwith" => "A",
"sort" => "date",
"sort_reverse" => "1",
"subsiteid" => 1,
"extrafield_filter" => [
"4" => "Search String",
"5" => "Search",
],

]);

echo "\nNumber of models returned: " . $modelobj->modelcount;
echo "\nNumber of models total: " . $modelobj->modeltotal;
echo "\nNumber of pages: " . $modelobj->numpages;
echo "\nModels:\n";
print_r($modelobj->models);

Returning Attributes:

This function call will return a StdObject object with the following attributes:

models:

This is a multi-dimensional array that returns any models that match search criteria.

modelcount:

The number of sets within the models attribute.

numpages:

A total number of pages that are available. For instance, if modeltotal = 400 and the system has a numperpage value of 20, this value will be 20.

modeltotal:

A total number of models that are available, regardless of pagination.

Arguments:

page:

This paginates the model list. This way, if you specify "page" => 2, it will show a different list of models than if you specify "page" => 1.

This is useful if the page you're calling this function on is paginated and you want to show different updates on page 2 of your page than page 1.

By default, the system sets this value to 1 if not specified when passing along to the system.

id:

This filters the results by model id. If set, this will only return a set of the specified model id, if it is available for release and is present on the current site.

numperpage:

If specified, determines the maximum number of results to show.

By default, the system looks at the value of "Models per page" under Plugins -> Models -> Configure.

gender:

If specified, only return models that belong to the specified gender.

By default, the system attempts to see if the existing site is set to limit results on the models page to a specified gender, if set. Generally, this is a setting that is specified within all-access site setups.

startwith:

If specified, only show models that begin with the specified letter.

By default, the system does not filter results by letter.

sort:

Specify sorting order of sets.

Valid values are: id,name, date, rating, gender, random.

By default, the system will sort by date.

Note: Doing a database sort by random creates a temporary table within mysql, and may result in reduced performance. Only choose this sorting option when absolutely necessary.

sort_reverse:

If this is set to 1, reverse the sorting order as specified within "sort"

subsiteid:

If specified, limit models belonging to a specified all-access subsite id. If this value is set to 0, show sets from all sites.

By default, the system will detect if the current area belongs to an all-access subsite, and use that value.

Note: If you specify a non-zero value for subsiteid, all-access must be available within this system. Otherwise, an Exception will be triggered.

extrafield_filter:

If specified, limit models based on extra field search criteria.

In order to do a search with this, you'll need to pass an associative array, where:

- The key specifies the Extra Field Id of the item you're searching. You can find this ID in /cms_admin/plugins/extrafields/extrafields.php

- The value of the array is an exact match of the string that you're searching.

Examples:

"extrafield_filter" => [
  "4" => "Female",
],

"extrafield_filter" => [
"4" => "Male",
"6" => "Scorpio",
],

Description:

The getNews() function gets a list of news entries that are present in the system. Based on the arguments that are passed to it will determine which and how many news entries are returned.

Sample Usage:

$newsobj = $api->getNews();

$newsobj = $api->getNews(["id" => 1]);

$newsobj = $api->getNews([
"page" => 1,
"id" => 1,
"numperpage" => 20,
"subsiteid" => 1,
"sort" => "date",
"sort_reverse" => "1",
"newerthan" => "2000-01-01",
"olderthan" => "2010-01-01",
"tag_filter" => ["one", "two", "three"],
"tag_exclude" => ["four", "five", "six"],
"areatype" => "members",
]);

echo "\nNumber of news entries returned: " . $newsobj->newscount;
echo "\nNumber of news entries total: " . $newsobj->newstotal;
echo "\nNumber of pages: " . $newsobj->numpages;
echo "\nNews:\n";
print_r($newsobj->news);

Returning Attributes:

This function call will return a StdObject object with the following attributes:

news:

This is a multi-dimensional array that returns any news entries that match search criteria.

newscount:

The number of news entries within the news attribute.

numpages:

A total number of pages that are available. For instance, if settotal = 400 and the system has a numperpage value of 20, this value will be 20.

newstotal:

A total number of sets that are available, regardless of pagination.

Arguments:

page:

This paginates the news entries. This way, if you specify "page" => 2, it will show a different list of news entries than if you specify "page" => 1.

This is useful if the page you're calling this function on is paginated and you want to show different entries on page 2 of your page than page 1.

By default, the system sets this value to 1 if not specified when passing along to the system.

id:

This filters the results by news id. If set, this will only return a news entry of the specified id, if it is available for release and is present on the current site.

numperpage:

If specified, determines the maximum number of results to show.

By default, the system looks at the value of "Number of entries per page" in Plugins -> News -> Configure in your admin panel.

subsiteid:

If specified, limit news entries belonging to a specified all-access subsite ids. If this value is set to 0, show news entries from all sites.

By default, the system will detect if the current area belongs to an all-access subsite, and use that value.

Note: If you specify a non-zero value for subsiteid, all-access must be available within this system. Otherwise, an Exception will be triggered.

sort:

Specify sorting order of news entries.

Valid values are: title, date, random.

By default, the system will sort by date.

Note: Doing a database sort by random creates a temporary table within mysql, and may result in reduced performance. Only choose this sorting option when absolutely necessary.

sort_reverse:

If this is set to 1, reverse the sorting order as specified within "sort"

newerthan:

If this value is set, only show news entries that are newer than the specified date.

olderthan:

If this value is set, only show news entries that are older than the specified date.

tag_filter:

If set, only show sets that belong to the specified categories.

By default, the system looks at the value of "Use Categories" in "Index.php Config Options" on the Global Settings page in your admin panel.

Example values:

"tag_filter" => ["one,two"]
"tag_filter" => [["one,two"]];
"tag_filter" => [["one", "two"]];

Fetch news entries that belong to either tags labelled "one" or "two"

"tag_filter" => [["one"],["two"]];
"tag_filter" => "one,two";
"tag_filter" => ["one", "two"];

Fetch sets that belong to both tags labelled "one" and "two"

"tag_filter" => = [["one", "two"],["three", "four"]];

Fetch sets that belong either tags "one", or "two" AND ALSO belong to either tags "three" or "four".

tag_exclude:

If set, do not show sets that belong to the specified categories.

"tag_exclude" => "five,six"

This will exclude any news entries that belong to either tag "five" or "six".

areatype:

If specified, filter news entries based on whether or not they should be displayed based on the specific area type.

Valid values: members, public, mobile

By default, the system will try to determine what area type the end-user is currently in, and filter entries by that value. For example, if the user is on a desktop devices, it will only show blog entries that are set to show on desktop devices.

Description:

The getSets() function gets a list of sets that are present in the system. Based on the arguments that are passed to it will determine which and how many sets are returned.

Sample Usage:

$setobj = $api->getSets();

$setobj = $api->getSets(["id" => 1]);

$setobj = $api->getSets([
"page" => 1,
"id" => 1,
"tourid" => 1,
"numperpage" => 20,
"subsiteid" => 1,
"sort" => "date",
"sort_reverse" => "1",
"newerthan" => "2000-01-01",
"olderthan" => "2010-01-01",
"orderby" => "",
"category_filter" => [4,5,6],
"category_exclude" => "1,2,3",
"model_filter" => [4,5,6],
"model_exclude" => "1,2,3",
"dvd_filter" => [4,5,6],
"dvd_exclude" => "1,2,3",
]);

echo "\nNumber of sets returned: " . $setobj->setcount;
echo "\nNumber of sets total: " . $setobj->settotal;
echo "\nNumber of pages: " . $setobj->numpages;
echo "\nSets:\n";
print_r($setobj->sets);

Returning Attributes:

This function call will return a StdObject object with the following attributes:

sets:

This is a multi-dimensional array that returns any sets that match search criteria.

setcount:

The number of sets within the sets attribute.

numpages:

A total number of pages that are available. For instance, if settotal = 400 and the system has a numperpage value of 20, this value will be 20.

settotal:

A total number of sets that are available, regardless of pagination.

Arguments:

page:

This paginates the updates. This way, if you specify "page" => 2, it will show a different list of updates than if you specify "page" => 1.

This is useful if the page you're calling this function on is paginated and you want to show different updates on page 2 of your page than page 1.

By default, the system sets this value to 1 if not specified when passing along to the system.

id:

This filters the results by set id. If set, this will only return a set of the specified set id, if it is available for release and is present on the current site.

tourid:

If specified, filter sets by those that belong to the specified tour id.

By default, the system detects which tourid (if any) the current area is on and filters by that result.

numperpage:

If specified, determines the maximum number of results to show.

By default, the system looks at the value of "Number of sets per page" in "Index.php Config Options" on the Global Settings page in your admin panel.

subsiteid:

If specified, limit sets belonging to a specified all-access subsite id. If this value is set to 0, show sets from all sites.

By default, the system will detect if the current area belongs to an all-access subsite, and use that value.

Note: If you specify a non-zero value for subsiteid, all-access must be available within this system. Otherwise, an Exception will be triggered.

sort:

Specify sorting order of sets.

Valid values are: title, date, rating, random.

By default, the system will sort by date.

Note: Doing a database sort by random creates a temporary table within mysql, and may result in reduced performance. Only choose this sorting option when absolutely necessary.

sort_reverse:

If this is set to 1, reverse the sorting order as specified within "sort"

newerthan:

If this value is set, only show sets that are newer than the specified date.

olderthan:

If this value is set, only show sets that are older than the specified date.

category_filter:

If set, only show sets that belong to the specified categories.

By default, the system looks at the value of "Use Categories" in "Index.php Config Options" on the Global Settings page in your admin panel.

Example values:

"category_filter" => ["4,5"]
"category_filter" => [["4,5"]];
"category_filter" => [[4,5]];

Fetch sets that belong to either category ids 4 or 5.

"category_filter" => [[4],[5]];
"category_filter" => "4,5";
"category_filter" => [4,5];

Fetch sets that belong to both category id 4 and category id 5.

"category_filter" => = [[4,5],[6,7]];

Fetch sets that belong either category ids 4 and 5 AND ALSO belong to either categories 6 and 7.

category_exclude:

If set, do not show sets that belong to the specified categories.

By default, the system looks at the value of "Don't use Categories" in "Index.php Config Options" on the Global Settings page in your admin panel.


model_filter:

If set, only show sets that belong to the specified Models.

Example values:

"model_filter" => ["4,5"]
"model_filter" => [["4,5"]];
"model_filter" => [[4,5]];

Fetch sets that belong to either Model ids 4 or 5.

"model_filter" => [[4],[5]];
"model_filter" => "4,5";
"model_filter" => [4,5];

Fetch sets that belong to both Model id 4 and Model id 5.

"model_filter" => = [[4,5],[6,7]];

Fetch sets that belong either Model ids 4 and 5 AND ALSO belong to either Model Ids 6 and 7.

model_exclude:

If set, do not show sets that belong to the specified Models.


dvd_filter:

If set, only show sets that belong to the specified DVDs.

Example values:

"dvd_filter" => ["4,5"]
"dvd_filter" => [["4,5"]];
"dvd_filter" => [[4,5]];

Fetch sets that belong to either DVD ids 4 or 5.

"dvd_filter" => [[4],[5]];
"dvd_filter" => "4,5";
"dvd_filter" => [4,5];

Fetch sets that belong to both DVD id 4 and DVD id 5.

"dvd_filter" => = [[4,5],[6,7]];

Fetch sets that belong either DVD ids 4 and 5 AND ALSO belong to either DVD Ids 6 and 7.

dvd_exclude:

If set, do not show sets that belong to the specified DVDs.

Description:

The getVodAreas() function gets a list of areas that are present in the system which are VOD areas. Based on the arguments that are passed to it will determine which and how many areas are returned.

Sample Usage:

$areaobj = $api->getVodAreas();

$areaobj = $api->getVodAreas(["id" => 1]);

$areaobj = $api->getVodAreas([
"id" => 1,
"countonly" => 0,
]);

echo "\nNumber of areas returned: " . $areaobj->areacount;
echo "\nAreas:\n";
print_r($areaobj->area);

Returning Attributes:

This function call will return a StdObject object with the following attributes:

areas:

This is a multi-dimensional array that returns any areas that match search criteria.

areacount:

The number of areas returned.

Arguments:

id:

This filters the results by set id. If set, this will only return areas that have these specific sets.

examples:
"id" => "4,5"
"id" => [4,5]

This will show all VOD areas that either have set id 4 OR set id 5.

countonly:

If specified, only return the number of areas that fit the search criteria.