Class: Zenpage
Source Location: /zp-extensions/zenpage/zenpage-class.php
Class Zenpage
Method Summary
static
string
|
getOffset() |
Gets the LIMIT and OFFSET for the query that gets the news articles |
int |
getArticle() |
Returns an article from the album based on the index passed. |
array |
getCombiNews() |
Gets news articles and images of a gallery to show them together on the news section |
string |
getNewsIndexURL() |
Returns the full path of the news index page (news page 1) or if the "news on zp index" option is set a link to the gallery index. |
array |
getPages() |
Gets all pages or published ones. |
string |
__toString() |
"Magic" function to return a string identifying the object when it is treated as a string |
Methods
static string getOffset(
int
$articles_per_page, [bool
$ignorepagination = false]
)
|
|
Gets the LIMIT and OFFSET for the query that gets the news articles
Parameters:
int |
$articles_per_page: |
The number of articles to get |
bool |
$ignorepagination: |
If pagination should be ingored so always with the first is started (false is default) |
array getAllArticleDates(
[bool
$yearsonly = false], [string
$order = 'desc']
)
|
|
Retrieves a list of all unique years & months
Parameters:
bool |
$yearsonly: |
If set to true only the years' count is returned (Default false) |
string |
$order: |
'desc' (default) or 'asc' for descending or ascending |
array getAllCategories(
[bool
$visible = true], [string
$sorttype = NULL], [bool
$sortdirection = NULL]
)
|
|
Gets all categories
Parameters:
bool |
$visible: |
TRUE for published and unprotected |
string |
$sorttype: |
NULL for the standard order as sorted on the backend, "title", "id", "popular", "random" |
bool |
$sortdirection: |
TRUE for ascending or FALSE for descending order |
int getArticle(
int
$index, [
$published = NULL], [
$sortorder = NULL], [
$sortdirection = NULL], [
$sticky = true]
)
|
|
Returns an article from the album based on the index passed.
Parameters:
int |
$index: |
|
|
$published: |
|
|
$sortorder: |
|
|
$sortdirection: |
|
|
$sticky: |
|
array getArticles(
[int
$articles_per_page = 0], [string
$published = NULL], [boolean
$ignorepagination = false], [string
$sortorder = NULL], [bool
$sortdirection = NULL], [bool
$sticky = NULL], [
$category = NULL]
)
|
|
Gets all news articles titlelink.
NOTE: Since this function only returns titlelinks for use with the object model it does not exclude articles that are password protected via a category
Parameters:
int |
$articles_per_page: |
The number of articles to get |
string |
$published: |
"published" for an published articles, "unpublished" for an unpublised articles, "published-unpublished" for published articles only from an unpublished category, "sticky" for sticky articles (published or not!) for admin page use only, "all" for all articles |
boolean |
$ignorepagination: |
Since also used for the news loop this function automatically paginates the results if the "page" GET variable is set. To avoid this behaviour if using it directly to get articles set this TRUE (default FALSE) |
string |
$sortorder: |
"date" (default), "title", "id, "popular", "mostrated", "toprated", "random" This parameter is not used for date archives |
bool |
$sortdirection: |
TRUE for ascending, FALSE for descending. Note: This parameter is not used for date archives |
bool |
$sticky: |
set to true to place "sticky" articles at the front of the list. |
|
$category: |
|
array getCategory(
int
$id
)
|
|
Gets a category titlelink by id
Parameters:
int |
$id: |
id of the category |
string getCategoryLink(
string
$catname
)
|
|
Gets the category link of a category
Parameters:
string |
$catname: |
the title of the category |
API Tags:
Deprecated: | since version 1.4.6 |
array getCombiNews(
[int
$articles_per_page = ''], [string
$mode = ''], [string
$published = NULL], [string
$sortorder = NULL], [bool
$sticky = true], [
$sortdirection = 'desc'], string
$direction
)
|
|
Gets news articles and images of a gallery to show them together on the news section
NOTE: This function does not exclude articles that are password protected via a category
Parameters:
int |
$articles_per_page: |
The number of articles to get |
string |
$mode: |
"latestimages-thumbnail" "latestimages-thumbnail-customcrop" "latestimages-sizedimage" "latestalbums-thumbnail" "latestalbums-thumbnail-customcrop" "latestalbums-sizedimage" "latestimagesbyalbum-thumbnail" "latestimagesbyalbum-thumbnail-customcrop" "latestimagesbyalbum-sizedimage" "latestupdatedalbums-thumbnail" (for RSS and getLatestNews() used only) "latestupdatedalbums-thumbnail-customcrop" (for RSS and getLatestNews() used only) "latestupdatedalbums-sizedimage" (for RSS and getLatestNews() used only) NOTE: The "latestupdatedalbums" variants do NOT support pagination as required on the news loop! |
string |
$published: |
"published" for published articles, "unpublished" for un-published articles, "all" for all articles |
string |
$sortorder: |
id, date or mtime, only for latestimages-... modes |
bool |
$sticky: |
set to true to place "sticky" articles at the front of the list. |
string |
$direction: |
"desc" or "asc" |
|
$sortdirection: |
|
API Tags:
Deprecated: | since version 1.4.6 |
Access: | protected |
string getNewsArchivePath(
$date, [
$page = NULL]
)
|
|
Returns partial path of news date archive
Parameters:
API Tags:
Deprecated: | since version 1.4.6 |
string getNewsCategoryPath(
$category, [
$page = NULL]
)
|
|
Returns partial path of news category
Parameters:
API Tags:
Deprecated: | since version 1.4.6 |
string getNewsIndexURL(
)
|
|
Returns the full path of the news index page (news page 1) or if the "news on zp index" option is set a link to the gallery index.
string getNewsTitlePath(
$title
)
|
|
Returns partial path of news article title
Parameters:
API Tags:
Deprecated: | since version 1.4.6 |
array getPages(
[bool
$published = NULL], [bool
$toplevel = false], [int
$number = NULL], [string
$sorttype = NULL], [string
$sortdirection = NULL]
)
|
|
Gets all pages or published ones.
NOTE: Since this function only returns titlelinks for use with the object model it does not exclude pages that are password protected
Parameters:
bool |
$published: |
TRUE for published or FALSE for all pages including un-published |
bool |
$toplevel: |
TRUE for only the toplevel pages |
int |
$number: |
number of pages to get (NULL by default for all) |
string |
$sorttype: |
NULL for the standard order as sorted on the backend, "title", "date", "id", "popular", "mostrated", "toprated", "random" |
string |
$sortdirection: |
false for ascenting, true for descending |
void getSortDirection(
[
$what = 'news']
)
|
|
Parameters:
void getSortType(
[
$what = 'news']
)
|
|
Parameters:
Returns the articles count
API Tags:
Deprecated: | since version 1.4.6 |
void setSortDirection(
$value, [
$what = 'news']
)
|
|
Parameters:
void setSortSticky(
$value
)
|
|
Parameters:
void setSortType(
$value, [
$what = 'news']
)
|
|
Parameters:
void visibleCategory(
$cat
)
|
|
Parameters:
"Magic" function to return a string identifying the object when it is treated as a string
API Tags:
|
|