class CArticles extends CEngine

^ INDEX

Table of contents

CArticles
GetArchive
GetArticle
GetArticleAuthor
GetArticleBeginning
GetArticleDate
GetArticleFileSet
GetArticleFilename
GetArticleFiles
GetArticleID
GetArticleImageSet
GetArticleImages
GetArticleSection
GetArticleSections
GetArticleStats
GetArticleSummary
GetArticleText
GetArticleTime
GetArticleTitle
GetAuthorEmail
GetAuthorID
GetAuthorInfo
GetAuthorName
GetFileName
GetFileSetDescription
GetImageDescription
GetImageName
GetImageSetDescription
GetImageThumbnail
GetParentSection
GetParentSectionID
GetRelatedArchive
GetRelatedArticle
GetSection
GetSectionArticleID
GetSectionFilename
GetSectionID
GetSectionName
GetSectionPriority
GetTopSection
LoopThroughSectionList
ReplaceFileTags
ReplaceImageTags
SearchArchive
TestSyndication
UpdateArticleStats

^ Top

CArticles()

absolutengine

Article class for handling all article-related functions

^ Top

GetArchive($settings=10,$adate=0,$sectionID="all",$authorID="all",$priority="all",$articleID=0)

Retrieve articles from database
function accepts two styles of parameters due to backward compatibility
OLD STYLE (v1.70) is deprecated, use only new style with $settings array
"articlenumber"=>int number of articles to list
"offset"=>int offset to show articles from
"fromdate"=>string articles to be shown from date (date format in settings.php)
"todate"=>string articles to be shown up to date (date format as in settings.php)
"authorID"=>string articles written by author ID (comma delimited list for multiple values)
"sectionID"=>string articles in section ID (comma delimited list for multiple values)
"priority"=>boolean 0,1
"status"=>boolean 0,1
"articleID"=>int ID of article to be displayed
"order"=>string use MySQL format ("adate DESC, atime DESC, priority DESC" etc.)
EXCLUSION: !X = !4 - will exclude author/section with ID 4 if used in authorID or sectionID

This will list latest 10 articles with priority 1

$settings=array(
"articlenumber"=>10,
"priority"=>1
);
$aepublic->GetArchive($settings);
.
.
.
?>

This will list 10 articles starting from 5th result from January 1st 2004 to January 31st 2004 in section 5 and 14
Please note that date format matches date format in settings.php, for the example below it is "DD.MM.YYYY" - you always need to match date format as set in settings.php!

$settings=array(
"articlenumber"=>10,
"offset"=>5,
"fromdate"=>"01.01.2004",
"todate"=>"31.01.2004",
"sectionID"=>"5,14"
);
$aepublic->GetArchive($settings);
.
.
.
?>

This will list latest 50 articles written by authors with ID 2 and 10 and put under section ID 5 and 8, but NOT section ID 7
Result is sorted by from the oldest to the newest articles

$settings=array(
"articlenumber"=>50,
"authorID"=>"2,10",
"sectionID"=>"5,8,!7",
"order"=>"adate ASC, atime ASC"
);
$aepublic->GetArchive($settings);
.
.
.
?>

array $settings array of parameters, see below:

^ Top

GetArticle()

Retrieve article content

^ Top

GetArticleAuthor($authorID=0)

Retrieve information about author

int $authorID ID of author

^ Top

GetArticleBeginning()

DEPRECATED: from v1.71

Print beginning of article
Beginning will not be supported in future

SEE: GetArticleSummary()
GetArticleText()

^ Top

GetArticleDate()

Print date of publishing of article

^ Top

GetArticleFileSet($filesetID=0)

Retrieve file set

int filesetID ID of file set

^ Top

GetArticleFilename()

Return filename of article

^ Top

GetArticleFiles()

DEPRECATED: from v1.71 DO NOT USE! This function is obsolete and will be deleted in next version

Retrieve file set / DEPRECATED
Function has been replaced by GetArticleFileSet()

SEE: GetArticleFileSet()

^ Top

GetArticleID()

Return ID of article

^ Top

GetArticleImageSet($imagesetID=0)

Retrieve image set

int imagesetID ID of image set

^ Top

GetArticleImages($before="",$after="",$number=10,$link=0,$imagenumber=0)

DEPRECATED: from v1.71 DO NOT USE! This function is obsolete and will be deleted in next version

Retrieve image set / DEPRECATED
Function has been replaced by GetArticleImageSet()

SEE: GetArticleImageSet()

^ Top

GetArticleSection()

DEPRECATED: from v1.71 DO NOT USE! This function is obsolete and will be deleted in next version

Print section name
Function has been replaced by GetSectionName()

SEE: GetSectionName()

^ Top

GetArticleSections($articleID=0)

Retrieve sections for the article

int $articleID ID of article

^ Top

GetArticleStats($articleID=0)

Print article stats/number of views

^ Top

GetArticleSummary()

Print summary for article (e.g. first few sentences of the text)
Use instead of GetArticleBeginning()
Function searches first 180 characters of text of the article for a dot.
If found it then creates summary text (few sentences) until that position
If not found, it takes first 300 characters of text as a summary

TO-DO:@todo: Allow for changing the length of summary as well as symbol that is being searched for

^ Top

GetArticleText()

Print text of article

^ Top

GetArticleTime()

Print time of publishing of article

^ Top

GetArticleTitle()

Print title of article

^ Top

GetAuthorEmail()

Print email of author

^ Top

GetAuthorID()

Return ID of author

^ Top

GetAuthorInfo()

Print extended information about author

^ Top

GetAuthorName()

Print name of author

^ Top

GetFileName()

Return filename

^ Top

GetFileSetDescription()

Return fileset description

^ Top

GetImageDescription()

Return image description

^ Top

GetImageName()

Return imagename

^ Top

GetImageSetDescription()

Return imageset description

^ Top

GetImageThumbnail()

Return thumbnail name for image

^ Top

GetParentSection($sectionID=0)

Retrieve parent section for the section

int $sectionID ID of section

^ Top

GetParentSectionID()

Return parent sectionID of section

^ Top

GetRelatedArchive($articleID)

Retrieve related articles for article $articleID

^ Top

GetRelatedArticle()

DEPRECATED: from v1.71 DO NOT USE! This function is obsolete and will be deleted in next version

Get related article / DEPRECATED
Function has been replaced by GetArticle()

SEE: GetArticle()

^ Top

GetSection($settings)

Retrieves section

^ Top

GetSectionArticleID()

Return articleID describing section

^ Top

GetSectionFilename()

Return filename of section

^ Top

GetSectionID()

Return section ID

^ Top

GetSectionName()

Print section name

^ Top

GetSectionPriority()

Return priority of section

^ Top

GetTopSection($sectionID=0)

^ Top

LoopThroughSectionList($parentsectionID,$type=0,$order=0,$override=0,$attribute="")

Loop through the sections and generate a section list

int $type type of section list to be displayed - 0 public list, 1 links using UL, 2 dropdown menu using  , 3 checkboxes below each other;
boolean $order - 0 order by priority, 1 order alphabetically
boolean $override - override current section filtering 0 do nothing, 1 override and show
string $attribute - ID or class attribute

^ Top

ReplaceFileTags($replace=0)

DEPRECATED: from v1.71 DO NOT USE! This function is obsolete and will be deleted in next version

Replace file tags / DEPRECATED
Function does not have replacement for now - SORRY

TO-DO:Possibly some sophisticated image replacing in future

^ Top

ReplaceImageTags($replace=0,$link=1)

DEPRECATED: from v1.71 DO NOT USE! This function is obsolete and will be deleted in next version

Replace image tags / DEPRECATED
Function does not have replacement for now - SORRY

TO-DO:Possibly some sophisticated image replacing in future

^ Top

SearchArchive($settings,$articlenumber=10,$adate=0)

Search articles in database
function accepts two styles of parameters due to backward compatibility
OLD STYLE (v1.70) is deprecated, use only new style with $settings array
"query"=>string text to find
"searchin"=>string where the search should be made: title,beginning,text (comma delimited list for multiple values)
"style"=>string should the search be fulltext (fulltext) or just free match (anypart)
"articlenumber"=>int number of articles to list
"offset"=>int offset to show articles from
"fromdate"=>string articles to be shown from date (date format in settings.php)
"todate"=>string articles to be shown up to date (date format as in settings.php)
"authorID"=>string articles written by author ID (comma delimited list for multiple values)
"sectionID"=>string articles in section ID (comma delimited list for multiple values)
"priority"=>boolean 0,1
"status"=>boolean 0,1
"articleID"=>int ID of article to be displayed
"order"=>string use MySQL format ("adate DESC, atime DESC, priority DESC" etc.)
EXCLUSION: !X = !4 - will exclude author/section with ID 4 if used in authorID or sectionID

array $settings array of parameters, see below:

^ Top

TestSyndication($articleID)

If syndication module is active, test whether article is syndicated on the current
website, if yes continue with displaying in related articles, otherwise skip

^ Top

UpdateArticleStats($articleID=0)

Update number of views for article

int $articleID

^ Top