Documentation

NewsRecentComments extends NewsLibrary

News : Get recent comments

Tags
copyright

CLOUDREXX CMS - CLOUDREXX AG

author

Thomas Däppen thomas.daeppen@comvation.com

author

ss4u ss4u.comvation@gmail.com

version
3.1.1
subpackage

coremodule_news

Table of Contents

Properties

$_objTemplate  : mixed
$_pageContent  : mixed
$arrSettings  : mixed
$newsMetaKeys  : mixed
$useThumbnails  : bool
Value of setting use_thumbnails
$arrTypeData  : array<string|int, mixed>
Localized data of available types
$errMsg  : array<string|int, mixed>
Status messages
$nestedSetRootId  : int
NestedSet root node ID
$objNestedSet  : DB_NestedSet|null
NestedSet object

Methods

__construct()  : mixed
Initialize the NestedSet of Categories
_buildNewsCategories()  : string
Generates the formated ul/li of categories Used in the template's
addTag()  : bool|int
Save new tag into database
checkForCommentFlooding()  : bool
Check if the current user has already written a comment within the definied timeout-time set by news_comments_timeout.
fetchSubmittedCommentData()  : array<string|int, mixed>
Fetch news comment data that has been submitted via POST and return it as array with three elements.
filterBodyTag()  : string
Gets only the body content and deleted all the other tags
findCmdById()  : string
Searches for cmds having the passed id and returns the cmd of the result set having the lowest length.
getApplicationUrl()  : string
Get URL pointing to an application page of this component
getCategoriesByNewsId()  : mixed
Get the categories by News ID
getCategoryLocale()  : array<string|int, mixed>
Getting the locale categories
getCategoryRelNews()  : mixed
Get the news ID list based on the category
getIdsOfCategorySubCategories()  : array<string|int, mixed>
Get subcategory-ID lsit
getLangData()  : array<string|int, mixed>
Get language data (title, text, teaser_text) from database
getMostFrequentTag()  : bool|array<string|int, mixed>
Retruns most Frequent(Searched|Viewed) tag details.
getMostUsedTag()  : bool|array<string|int, mixed>
Retruns most used tag details
getNewsArchiveList()  : string
Generates the formated ul/li of Archive list Used in the template's If there are any news with scheduled publishing $nextUpdateDate will contain the date when the next news changes its publishing state.
getNewsCategories()  : string
Generates the formated ul/li of categories Used in the template's
getNewsDetailsById()  : array<string|int, mixed>
Get news Details by id
getNewsFilterQuery()  : string
Get News Filter Condition Query
getNewsFromDbForSearch()  : ADORecordSet
getNewsGlobalPlaceholderNames()  : array<string|int, mixed>
Get all the News global placeholder names
getNewsLink()  : string
Get the News important/source link
getNewsRelCategories()  : array<string|int, mixed>
Get the news related category by ID
getNewsTags()  : bool|array<string|int, mixed>
Get the news IDs and tags using news id (and|or) tag
getRecentNewsComments()  : mixed
getSettings()  : mixed
Gets the category option menu string
getTags()  : bool|array<string|int, mixed>
Getting all the stored tags
getTypeMenu()  : mixed
getTypeNameById()  : string
Get name of a type
getTypesLangData()  : array<string|int, mixed>
Get types language data
hasCategories()  : mixed
incrementViewingCount()  : null
Increment the tags viewing count
insertLocales()  : bool
Insert new locales after create news from backend
manipulateTags()  : bool
Manipulating the submitted tags from the news Entry form.
parseCategoryList()  : mixed
Parse the category list
parseCommentsOfMessage()  : null
Lists all active comments of the news message specified by $messageId
parseImageBlock()  : mixed
Parse the Image Block for thumbnail and detail image
parseImageThumbnail()  : mixed
parseMessageCommentForm()  : null
Validates the submitted comment data and writes it to the databse if valid.
parseNewsCommentsCount()  : mixed
Parse the news comments count
parseNewsPlaceholders()  : string
Parse the news placeholders
parseNextAndPreviousLinks()  : null
Generate the next and previous news links from the current news
parseTagCloud()  : mixed
parseUserAccountData()  : mixed
Parses a user's account and profile data specified by $userId.
registerTagJsCode()  : mixed
Register the JS code for the given input field ID
showNewsTextOrRedirectLink()  : mixed
Show News Text content or Redirect link
storeMessageComment()  : array<string|int, mixed>
Validates the submitted comment data and writes it to the databse if valid.
submitLocales()  : bool
Insert new locales after submit news from frontend One copy for all languages
categoryExists()  : bool
Checks whether the passed category exists.
findPageById()  : bool
Find the Page based on the category id $cmdId
getAuthorMenu()  : string
Get Author dropdown options
getCategoriesData()  : array<string|int, mixed>
Get categories data
getCategoryFilterForSearchComponent()  : array<string|int, mixed>
Get category Ids from the published application pages of this component
getCategoryMenu()  : string
Generates the category menu.
getCategoryNestedSet()  : DB_NestedSet
Returns the category nested set
getCategoryNestedSetRootId()  : int
Returns the root ID of the category nested set
getCatIdsFromNestedSetArray()  : array<string|int, mixed>
Returns the category ids of a nested set array.
getEmptyCategoryIds()  : array<string|int, mixed>
Returns an array containing the ids of empty categories.
getIdOfLatestNewsArticle()  : int
Fetch ID of latest news article. If $categoryId is specified, then the ID of the latest news article of the category identified by ID $categoryId is returned.
getMonthlyNewsStats()  : array<string|int, mixed>
Returns the news monthly stats by the given filters If there are any news with scheduled publishing $nextUpdateDate will contain the date when the next news changes its publishing state.
getNestedSetCategories()  : array<string|int, mixed>
Returns an array containing the nested set information for the passed categories and their subcategories (ordered by their left id).
getParentCatId()  : int
Returns the parent category id of passed category.
getPublisherMenu()  : string
Get Publisher dropdown options
getRelatedNews()  : bool
Getting the realated News
getRelatedNewsIds()  : mixed
getSortedCategoryIdListIncludingSubcategories()  : array<string|int, mixed>
initTypesLangData()  : mixed
Fetch type localization and store them in a local member variable
manipulateCategories()  : bool
Manipulating the submitted categories from the news Entry form.
manipulateRelatedNews()  : bool
Manipulating the submitted related news from the news Entry form.
parseLink()  : mixed
parseNewsCategoryWidgetBlock()  : mixed
Parse element of category widget block
parseNewsTags()  : mixed
Parsing the News tags.
parseRelatedNews()  : mixed
Parsing related News
sortCategoryIdByPriorityId()  : array<string|int, mixed>
Prepend the array by the given values
sortNestedSetArray()  : array<string|int, mixed>
Sorts the given nested set array by the left id.
storeCategoriesLocales()  : bool
Saving categories locales
storeFeedLocales()  : bool
Saving feed settings locales
storeLocales()  : bool
Saving locales after edit news
storeTypesLocales()  : bool
Saving types locales

Properties

$useThumbnails

Value of setting use_thumbnails

public static bool $useThumbnails

$arrTypeData

Localized data of available types

protected array<string|int, mixed> $arrTypeData = array()

$errMsg

Status messages

protected array<string|int, mixed> $errMsg = array()

$nestedSetRootId

NestedSet root node ID

protected int $nestedSetRootId = 0
Tags
access

protected

$objNestedSet

NestedSet object

protected DB_NestedSet|null $objNestedSet = null
Tags
access

protected

Methods

__construct()

Initialize the NestedSet of Categories

public __construct(mixed $pageContent) : mixed
Parameters
$pageContent : mixed

_buildNewsCategories()

Generates the formated ul/li of categories Used in the template's

public _buildNewsCategories(Sigma $template, int $catId, array<string|int, mixed> $categoriesLang[, int $langId = null ][, int $categoryId = 0 ]) : string
Parameters
$template : Sigma

Template object to be parsed

$catId : int

Category id

$categoriesLang : array<string|int, mixed>

Category locale

$langId : int = null

Language id

$categoryId : int = 0

ID of category to highlight

Return values
string

Formated ul/li of categories

addTag()

Save new tag into database

public addTag(string $tag) : bool|int
Parameters
$tag : string

Tag name to insert

Tags
global

object $objDatabase

Return values
bool|int

Retrun inserted Tag id or retrun false if failed to insert

checkForCommentFlooding()

Check if the current user has already written a comment within the definied timeout-time set by news_comments_timeout.

public checkForCommentFlooding(mixed $newsMessageId) : bool
Parameters
$newsMessageId : mixed
Tags
global

object

Return values
bool

TRUE, if the user hast just written a comment before.

fetchSubmittedCommentData()

Fetch news comment data that has been submitted via POST and return it as array with three elements.

public fetchSubmittedCommentData() : array<string|int, mixed>

Where the first element is the name of the poster (if poster is anonymous), the second is the title of the comment and the third is the comment message by it self.

Return values
array<string|int, mixed>

filterBodyTag()

Gets only the body content and deleted all the other tags

public filterBodyTag(string $fullContent) : string
Parameters
$fullContent : string

HTML-Content with more than BODY

Return values
string

$content HTML-Content between BODY-Tag

findCmdById()

Searches for cmds having the passed id and returns the cmd of the result set having the lowest length.

public findCmdById(string $cmdName, array<string|int, mixed> $cmdIds[, string $cmdSeparator = ',' ][, string $module = 'News' ][, int $lang = FRONTEND_LANG_ID ]) : string
Parameters
$cmdName : string
$cmdIds : array<string|int, mixed>
$cmdSeparator : string = ','
$module : string = 'News'
$lang : int = FRONTEND_LANG_ID
Tags
access

public

Return values
string

$cmd

getApplicationUrl()

Get URL pointing to an application page of this component

public getApplicationUrl(array<string|int, mixed> $searchData) : string
Parameters
$searchData : array<string|int, mixed>

Array of search data

Return values
string

URL pointing to an application page of this component / other page in content manager / external link

getCategoriesByNewsId()

Get the categories by News ID

public getCategoriesByNewsId(int $newsId[, mixed $selectHidden = array() ]) : mixed
Parameters
$newsId : int
$selectHidden : mixed = array()
Tags
global

object $objDatabase

Return values
mixed

boolean|array

getCategoryLocale()

Getting the locale categories

public getCategoryLocale([mixed $categoryIds = null ][, mixed $langIds = null ]) : array<string|int, mixed>
Parameters
$categoryIds : mixed = null
$langIds : mixed = null
Tags
global

object $objDatabase

Return values
array<string|int, mixed>

getCategoryRelNews()

Get the news ID list based on the category

public getCategoryRelNews(int $categoryId) : mixed
Parameters
$categoryId : int
Tags
global

object $objDatabase

Return values
mixed

boolean|array

getIdsOfCategorySubCategories()

Get subcategory-ID lsit

public getIdsOfCategorySubCategories(int $catId) : array<string|int, mixed>
Parameters
$catId : int

ID of category to fetch IDs of subcategories from

Return values
array<string|int, mixed>

All IDs of categories that are a child (direct and indirect) of the category identified by $catId. $catId itself is also being returned.

getLangData()

Get language data (title, text, teaser_text) from database

public getLangData(int $id) : array<string|int, mixed>
Parameters
$id : int
Tags
global

ADONewConnection

Return values
array<string|int, mixed>

getMostFrequentTag()

Retruns most Frequent(Searched|Viewed) tag details.

public getMostFrequentTag() : bool|array<string|int, mixed>
Tags
global

object $objDatabase

Return values
bool|array<string|int, mixed>

array( 'id' => //Tag id 'tag' => //Tag Value 'maxViewedCount' => //Maximum count of the tag viewed | searched ) | FALSE on query fails

getMostUsedTag()

Retruns most used tag details

public getMostUsedTag() : bool|array<string|int, mixed>
Tags
global

object $objDatabase

Return values
bool|array<string|int, mixed>

array( 'id' => //Tag id 'tag' => //Tag Value 'maxUsedCount' => //Maximum count of the tag used ) | FALSE on query fails

getNewsArchiveList()

Generates the formated ul/li of Archive list Used in the template's If there are any news with scheduled publishing $nextUpdateDate will contain the date when the next news changes its publishing state.

public getNewsArchiveList([int $langId = null ][, DateTime &$nextUpdateDate = null ]) : string

If there are are no news with scheduled publishing $nextUpdateDate will be null.

Parameters
$langId : int = null

Language id

$nextUpdateDate : DateTime = null

(reference) DateTime of the next change

Return values
string

Formated ul/li of Archive list

getNewsCategories()

Generates the formated ul/li of categories Used in the template's

public getNewsCategories([Sigma $template = null ][, int $langId = null ][, int $categoryId = 0 ][, mixed $rootCategoryId = 0 ]) : string
Parameters
$template : Sigma = null

Template object to be parsed

$langId : int = null

Language id

$categoryId : int = 0

ID of category to highlight

$rootCategoryId : mixed = 0
Return values
string

Formated ul/li of categories

getNewsDetailsById()

Get news Details by id

public getNewsDetailsById(int $id) : array<string|int, mixed>
Parameters
$id : int
Tags
global

object $objDatabase

Return values
array<string|int, mixed>

getNewsFilterQuery()

Get News Filter Condition Query

public getNewsFilterQuery(string $tableAlias, array<string|int, mixed> $filters, string $filterCategory) : string
Parameters
$tableAlias : string
$filters : array<string|int, mixed>
$filterCategory : string

category filter

Return values
string

sql query

getNewsFromDbForSearch()

public getNewsFromDbForSearch(Search $search[, bool $fetchAssociationData = false ]) : ADORecordSet
Parameters
$search : Search
$fetchAssociationData : bool = false

Set to true to fetch a comma-separated ID-list of associated categories and one of associated tags.

Return values
ADORecordSet

News articles matching the seach query

getNewsGlobalPlaceholderNames()

Get all the News global placeholder names

public getNewsGlobalPlaceholderNames() : array<string|int, mixed>
Return values
array<string|int, mixed>

Get the News important/source link

public getNewsLink(string $linkSource) : string
Parameters
$linkSource : string
Return values
string

getNewsRelCategories()

Get the news related category by ID

public getNewsRelCategories(int $newsId) : array<string|int, mixed>
Parameters
$newsId : int
Tags
global

object $objDatabase

Return values
array<string|int, mixed>

getNewsTags()

Get the news IDs and tags using news id (and|or) tag

public getNewsTags([int $newsId = null ][, array<string|int, mixed> $tags = array() ]) : bool|array<string|int, mixed>
Parameters
$newsId : int = null

News id to get the corresponding related tags

$tags : array<string|int, mixed> = array()

Tag string to search the corresponding tags

Tags
global

object $objDatabase

Return values
bool|array<string|int, mixed>

Array List of News Related tags

getRecentNewsComments()

public getRecentNewsComments([mixed $langId = 0 ]) : mixed
Parameters
$langId : mixed = 0
Tags
todo

This does not respect scheduled publishing!

getSettings()

Gets the category option menu string

public getSettings() : mixed
Tags
global

ADONewConnection

getTags()

Getting all the stored tags

public getTags([int $id = null ][, int $tag = null ]) : bool|array<string|int, mixed>
Parameters
$id : int = null

Tag id

$tag : int = null

Tag name

Tags
global

object $objDatabase

Return values
bool|array<string|int, mixed>

Array list of tag and its id as key array('id' => //Id of the tag 'tag' => //Tag value)

getTypeMenu()

public getTypeMenu([mixed $selectedOption = '' ]) : mixed
Parameters
$selectedOption : mixed = ''

getTypeNameById()

Get name of a type

public getTypeNameById(int $id) : string
Parameters
$id : int

ID of type to get name from

Return values
string

Name of type identified by $id. If type identified by $id is unknown, then an empty string is returned.

getTypesLangData()

Get types language data

public getTypesLangData() : array<string|int, mixed>
Tags
global

ADONewConnection

Return values
array<string|int, mixed>

incrementViewingCount()

Increment the tags viewing count

public incrementViewingCount([array<string|int, mixed> $tagIds = array() ]) : null
Parameters
$tagIds : array<string|int, mixed> = array()

tag ids

Tags
global

object $objDatabase

Return values
null

insertLocales()

Insert new locales after create news from backend

public insertLocales(int $newsId, array<string|int, mixed> $newLangData) : bool
Parameters
$newsId : int
$newLangData : array<string|int, mixed>
Tags
global

ADONewConnection

Return values
bool

manipulateTags()

Manipulating the submitted tags from the news Entry form.

public manipulateTags([array<string|int, mixed> $tags = array() ][, int $newsId = null ]) : bool

i) Adding the new tag if the tag is not availbale already. ii) Update the relationship of the news in the corresponding table iii) Delete the removed tags ids from the news relation table

Parameters
$tags : array<string|int, mixed> = array()

Array of submitted tags

$newsId : int = null

News id for manipulation

Tags
global

object $objDatabase

Return values
bool

true when tags stored, false otherwise

parseCategoryList()

Parse the category list

public parseCategoryList(object $objTpl, array<string|int, mixed> $newsCategories[, mixed $templatePrefix = '' ]) : mixed
Parameters
$objTpl : object

Template object \Cx\Core\Html\Sigma

$newsCategories : array<string|int, mixed>

News categories array by its news message id

$templatePrefix : mixed = ''

parseCommentsOfMessage()

Lists all active comments of the news message specified by $messageId

public parseCommentsOfMessage(object $objTpl, int $messageId, int $newsCommentActive[, mixed $templatePrefix = '' ]) : null
Parameters
$objTpl : object

Template object \Cx\Core\Html\Sigma

$messageId : int

News message-ID

$newsCommentActive : int

Status of news comment activation

$templatePrefix : mixed = ''
Return values
null

parseImageBlock()

Parse the Image Block for thumbnail and detail image

public static parseImageBlock(object $objTpl, string $imagePath, string $altText, string $newsUrl, string $block[, mixed $templatePrefix = '' ]) : mixed
Parameters
$objTpl : object

Template object \Cx\Core\Html\Sigma

$imagePath : string

Image path(Thumbnail/Detail Image)

$altText : string

News title

$newsUrl : string

News url

$block : string

Block name

$templatePrefix : mixed = ''

parseImageThumbnail()

public static parseImageThumbnail(mixed $imageSource, mixed $thumbnailSource, mixed $altText, mixed $newsUrl) : mixed
Parameters
$imageSource : mixed
$thumbnailSource : mixed
$altText : mixed
$newsUrl : mixed

parseMessageCommentForm()

Validates the submitted comment data and writes it to the databse if valid.

public parseMessageCommentForm(object $objTpl, int $newsMessageId, string $newsMessageTitle, int $newsCommentActive[, mixed $templatePrefix = '' ]) : null

Additionally, a notification is send out to the administration about the comment by e-mail (only if the corresponding configuration option is set to do so).

Parameters
$objTpl : object

Template object \Cx\Core\Html\Sigma

$newsMessageId : int

News message ID for which the comment shall be stored

$newsMessageTitle : string

Title of the news message for which the comment shall be stored. The title will be used in the notification e-mail

$newsCommentActive : int

Status of news comment activation

$templatePrefix : mixed = ''
Return values
null

parseNewsCommentsCount()

Parse the news comments count

public parseNewsCommentsCount(object $objTpl, int $newsid, int $newsCommentActive[, mixed $templatePrefix = '' ]) : mixed
Parameters
$objTpl : object

Template object \Cx\Core\Html\Sigma

$newsid : int

News message ID

$newsCommentActive : int

News comment active

$templatePrefix : mixed = ''

parseNewsPlaceholders()

Parse the news placeholders

public parseNewsPlaceholders(object $objTpl, array<string|int, mixed> $objResult, string $newsUrl[, mixed $templatePrefix = '' ][, mixed $selectedCategories = array() ]) : string
Parameters
$objTpl : object

Template object \Cx\Core\Html\Sigma

$objResult : array<string|int, mixed>

Result Array

$newsUrl : string

News Url

$templatePrefix : mixed = ''
$selectedCategories : mixed = array()
Return values
string

Generate the next and previous news links from the current news

public parseNextAndPreviousLinks(Sigma $objTpl[, mixed $selectedCategories = array() ]) : null
Parameters
$objTpl : Sigma

template object

$selectedCategories : mixed = array()
Return values
null

parseTagCloud()

public parseTagCloud(mixed $template, mixed $langId) : mixed
Parameters
$template : mixed
$langId : mixed

parseUserAccountData()

Parses a user's account and profile data specified by $userId.

public static parseUserAccountData(mixed $objTpl, mixed $userId, mixed $userTitle, mixed $blockName) : mixed

If the \Cx\Core\Html\Sigma template block specified by $blockName exists, then the user's data will be parsed inside this block. Otherwise, it will try to parse a template variable by the same name. For instance, if $blockName is set to news_publisher, it will first try to parse the template block news_publisher, if unable it will parse the template variable NEWS_PUBLISHER.

Parameters
$objTpl : mixed
$userId : mixed
$userTitle : mixed
$blockName : mixed

registerTagJsCode()

Register the JS code for the given input field ID

public registerTagJsCode([type $newsTagId = 'newsTags' ]) : mixed
Parameters
$newsTagId : type = 'newsTags'

HMTL ID attribute Value of the input field

Show News Text content or Redirect link

public showNewsTextOrRedirectLink(object $objTpl, string $text, string $redirect[, mixed $templatePrefix = '' ]) : mixed
Parameters
$objTpl : object

Template object \Cx\Core\Html\Sigma

$text : string

Text news content

$redirect : string

News redirect link

$templatePrefix : mixed = ''

storeMessageComment()

Validates the submitted comment data and writes it to the databse if valid.

public storeMessageComment(mixed $newsMessageId, mixed $newsMessageTitle, mixed $name, mixed $title, mixed $message) : array<string|int, mixed>

Additionally, a notification is send out to the administration about the comment by e-mail (only if the corresponding configuration option is set to do so).

Parameters
$newsMessageId : mixed
$newsMessageTitle : mixed
$name : mixed
$title : mixed
$message : mixed
Tags
global

ADONewConnection

global

array

global

array

global

array

Return values
array<string|int, mixed>

Returns an array of two elements. The first is either TRUE on success or FALSE on failure. The second element contains an error message on failure.

submitLocales()

Insert new locales after submit news from frontend One copy for all languages

public submitLocales(int $newsId, string $title, string $text, string $teaser_text) : bool
Parameters
$newsId : int
$title : string
$text : string
$teaser_text : string
Tags
global

ADONewConnection

Return values
bool

categoryExists()

Checks whether the passed category exists.

protected categoryExists(int $category) : bool
Parameters
$category : int
Tags
access

protected

Return values
bool

findPageById()

Find the Page based on the category id $cmdId

protected findPageById(string $cmdName, array<string|int, mixed> $cmdId[, string $cmdSeparator = ',' ][, string $module = 'News' ][, int $lang = FRONTEND_LANG_ID ]) : bool
Parameters
$cmdName : string
$cmdId : array<string|int, mixed>
$cmdSeparator : string = ','
$module : string = 'News'
$lang : int = FRONTEND_LANG_ID
Return values
bool

getAuthorMenu()

Get Author dropdown options

protected getAuthorMenu([int $selectedOption = '' ][, array<string|int, mixed> $categoryId = array() ]) : string
Parameters
$selectedOption : int = ''
$categoryId : array<string|int, mixed> = array()
Return values
string

options string

getCategoriesData()

Get categories data

protected getCategoriesData() : array<string|int, mixed>
Return values
array<string|int, mixed>

getCategoryFilterForSearchComponent()

Get category Ids from the published application pages of this component

protected getCategoryFilterForSearchComponent(Search $search) : array<string|int, mixed>
Parameters
$search : Search
Tags
throws
NewsLibraryException

In case no application page of this component is published

Return values
array<string|int, mixed>

List of published category IDs. An empty array is returned, in case an application page is published that has no category restriction set through its CMD.

getCategoryMenu()

Generates the category menu.

protected getCategoryMenu(mixed $categories[, array<string|int, mixed> $selectedCategory = array() ][, array<string|int, mixed> $hiddenCategories = array() ][, bool $highlightOnlyCategoriesWithEntries = false ][, bool $showLevel = true ][, mixed $includeHidden = true ]) : string
Parameters
$categories : mixed
$selectedCategory : array<string|int, mixed> = array()

selected category

$hiddenCategories : array<string|int, mixed> = array()

the categories which shouldn't be shown as option

$highlightOnlyCategoriesWithEntries : bool = false

only categories which have entries

$showLevel : bool = true

Whether or not to visualy show the hierarchy as indent

$includeHidden : mixed = true
Tags
access

protected

Return values
string

$options html options

getCategoryNestedSet()

Returns the category nested set

protected getCategoryNestedSet() : DB_NestedSet
Return values
DB_NestedSet

Nested set instance

getCategoryNestedSetRootId()

Returns the root ID of the category nested set

protected getCategoryNestedSetRootId() : int
Return values
int

Root ID of the category nested set

getCatIdsFromNestedSetArray()

Returns the category ids of a nested set array.

protected getCatIdsFromNestedSetArray(array<string|int, mixed> $nestedSet) : array<string|int, mixed>
Parameters
$nestedSet : array<string|int, mixed>
Tags
access

protected

Return values
array<string|int, mixed>

$categories

getEmptyCategoryIds()

Returns an array containing the ids of empty categories.

protected getEmptyCategoryIds() : array<string|int, mixed>
Tags
access

protected

global

object $objDatabase ADONewConnection

Return values
array<string|int, mixed>

$arrEmptyCategoryIds ids of categories without entries

getIdOfLatestNewsArticle()

Fetch ID of latest news article. If $categoryId is specified, then the ID of the latest news article of the category identified by ID $categoryId is returned.

protected getIdOfLatestNewsArticle([int $categoryId = 0 ]) : int
Parameters
$categoryId : int = 0

ID of category to fetch the latest news article from

Tags
throws
NewsLibraryException

In case no latest news article was found

Return values
int

ID of latest news article

getMonthlyNewsStats()

Returns the news monthly stats by the given filters If there are any news with scheduled publishing $nextUpdateDate will contain the date when the next news changes its publishing state.

protected getMonthlyNewsStats(array<string|int, mixed> $categories[, int $langId = null ][, DateTime &$nextUpdateDate = null ]) : array<string|int, mixed>

If there are are no news with scheduled publishing $nextUpdateDate will be null.

Parameters
$categories : array<string|int, mixed>

category filter

$langId : int = null

Language id

$nextUpdateDate : DateTime = null

(reference) DateTime of the next change

Tags
access

protected

Return values
array<string|int, mixed>

$monthlyStats Monthly status array

getNestedSetCategories()

Returns an array containing the nested set information for the passed categories and their subcategories (ordered by their left id).

protected getNestedSetCategories(mixed $categories) : array<string|int, mixed>
Parameters
$categories : mixed
Tags
access

protected

Return values
array<string|int, mixed>

nested set information

getParentCatId()

Returns the parent category id of passed category.

protected getParentCatId(int $category) : int
Parameters
$category : int
Tags
access

protected

Return values
int

or boolean $cmd

getPublisherMenu()

Get Publisher dropdown options

protected getPublisherMenu([int $selectedOption = '' ][, array<string|int, mixed> $categoryId = array() ]) : string
Parameters
$selectedOption : int = ''
$categoryId : array<string|int, mixed> = array()
Return values
string

options string

getRelatedNews()

Getting the realated News

protected getRelatedNews([type $newsId = 0 ][, mixed $additionalRelatedNewsIds = array() ][, mixed $withArticleData = true ]) : bool
Parameters
$newsId : type = 0
$additionalRelatedNewsIds : mixed = array()
$withArticleData : mixed = true
Return values
bool

getRelatedNewsIds()

protected getRelatedNewsIds(mixed $newsId) : mixed
Parameters
$newsId : mixed

getSortedCategoryIdListIncludingSubcategories()

protected getSortedCategoryIdListIncludingSubcategories(array<string|int, mixed> $categoryIds) : array<string|int, mixed>
Parameters
$categoryIds : array<string|int, mixed>

List of IDs of categories to fetch and sort including their subcategories.

Return values
array<string|int, mixed>

Sorted list of category IDs

initTypesLangData()

Fetch type localization and store them in a local member variable

protected initTypesLangData() : mixed

manipulateCategories()

Manipulating the submitted categories from the news Entry form.

protected manipulateCategories([type $categoryIds = array() ][, type $newsId = null ]) : bool

i) Update the relationship of the news in the corresponding table ii) Delete the removed categories ids from the news relation table

Parameters
$categoryIds : type = array()

Array of submitted category Ids

$newsId : type = null

News id for manipulation

Tags
global

object $objDatabase

global

array $_ARRAYLANG

Return values
bool

manipulateRelatedNews()

Manipulating the submitted related news from the news Entry form.

protected manipulateRelatedNews([type $relatedNewsIds = array() ][, type $newsId = null ]) : bool

i) Update the relationship of the news in the corresponding table ii) Delete the removed related news ids from the news relation table

Parameters
$relatedNewsIds : type = array()

Array of submitted related_news Ids

$newsId : type = null

News id for manipulation

Return values
bool

Returns TRUE

protected static parseLink(mixed $href, mixed $title, mixed $innerHtml[, mixed $target = null ]) : mixed
Parameters
$href : mixed
$title : mixed
$innerHtml : mixed
$target : mixed = null

parseNewsCategoryWidgetBlock()

Parse element of category widget block

protected parseNewsCategoryWidgetBlock(Sigma $template, string $block, array<string|int, mixed> $category, int $categoryId) : mixed

The element identified by $block will be parsed in template $template. All other elements (blocks) in the template will be hidden.

Parameters
$template : Sigma

Template object to parse

$block : string

Name of block to parse

$category : array<string|int, mixed>

Category data as array

$categoryId : int

ID of category to highlight

parseNewsTags()

Parsing the News tags.

protected parseNewsTags(Sigma $objTpl[, int $newsId = null ][, string $block = 'news_tag_list' ][, bool $setMetaKeys = false ][, string $templatePrefix = '' ][, bool $parseContent = true ]) : mixed
Parameters
$objTpl : Sigma

Template object

$newsId : int = null

News id

$block : string = 'news_tag_list'

Name of the block to parse the news tags

$setMetaKeys : bool = false

Set the tags as $this->newsMetaKeys when it is true

$templatePrefix : string = ''

Prefix for the blocks and variables to parse

$parseContent : bool = true

Whether to parse content or only set variables

Tags
global

type $_ARRAYLANG

parseRelatedNews()

Parsing related News

protected parseRelatedNews(Sigma $objTpl[, Interger $newsId = null ][, mixed $selectedCategories = array() ]) : mixed
Parameters
$objTpl : Sigma

Template Object

$newsId : Interger = null

News Id

$selectedCategories : mixed = array()
Tags
global

type $_ARRAYLANG

sortCategoryIdByPriorityId()

Prepend the array by the given values

protected static sortCategoryIdByPriorityId([array<string|int, mixed> $categoryIds = array() ][, array<string|int, mixed> $priorityIds = array() ]) : array<string|int, mixed>
Parameters
$categoryIds : array<string|int, mixed> = array()
$priorityIds : array<string|int, mixed> = array()
Return values
array<string|int, mixed>

sortNestedSetArray()

Sorts the given nested set array by the left id.

protected sortNestedSetArray(array<string|int, mixed> $array) : array<string|int, mixed>
Parameters
$array : array<string|int, mixed>
Tags
access

protected

Return values
array<string|int, mixed>

$array

storeCategoriesLocales()

Saving categories locales

protected storeCategoriesLocales(array<string|int, mixed> $newLangData) : bool
Parameters
$newLangData : array<string|int, mixed>
Tags
global

ADONewConnection

Return values
bool

storeFeedLocales()

Saving feed settings locales

protected storeFeedLocales(mixed $settingsName, array<string|int, mixed> $newLangData) : bool
Parameters
$settingsName : mixed
$newLangData : array<string|int, mixed>
Tags
global

ADONewConnection

Return values
bool

storeLocales()

Saving locales after edit news

protected storeLocales(int $newsId, array<string|int, mixed> $newLangData) : bool
Parameters
$newsId : int
$newLangData : array<string|int, mixed>
Tags
global

ADONewConnection

Return values
bool

storeTypesLocales()

Saving types locales

protected storeTypesLocales(array<string|int, mixed> $newLangData) : bool
Parameters
$newLangData : array<string|int, mixed>
Tags
global

ADONewConnection

Return values
bool

        
On this page

Search results