Location: PHPKode > projects > Absolut Engine > absolut/documentation/admin-classarticles.php.html
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
    "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">

<head>
<meta http-equiv="content-type" content="text/html; charset=iso-8859-1" />
<meta name="licence" content="GNU General Public Licence" />
<meta name="robots" content="all" />
<title>Documentation: class CArticles extends CEngine
</title>
<style type="text/css">@import "styles.css";</style>
</head>

<body><h1>class CArticles extends CEngine
</h1><a href="index.html">^ INDEX</a><br /><a name="TOC-MAIN"></a><h1>Table of contents</h1><a href="#CArticles">CArticles</a><br /><a href="#GetArchive">GetArchive</a><br /><a href="#GetArticle">GetArticle</a><br /><a href="#GetArticleAuthor">GetArticleAuthor</a><br /><a href="#GetArticleBeginning">GetArticleBeginning</a><br /><a href="#GetArticleDate">GetArticleDate</a><br /><a href="#GetArticleFileSet">GetArticleFileSet</a><br /><a href="#GetArticleFilename">GetArticleFilename</a><br /><a href="#GetArticleFiles">GetArticleFiles</a><br /><a href="#GetArticleID">GetArticleID</a><br /><a href="#GetArticleImageSet">GetArticleImageSet</a><br /><a href="#GetArticleImages">GetArticleImages</a><br /><a href="#GetArticleSection">GetArticleSection</a><br /><a href="#GetArticleSections">GetArticleSections</a><br /><a href="#GetArticleStats">GetArticleStats</a><br /><a href="#GetArticleSummary">GetArticleSummary</a><br /><a href="#GetArticleText">GetArticleText</a><br /><a href="#GetArticleTime">GetArticleTime</a><br /><a href="#GetArticleTitle">GetArticleTitle</a><br /><a href="#GetAuthorEmail">GetAuthorEmail</a><br /><a href="#GetAuthorID">GetAuthorID</a><br /><a href="#GetAuthorInfo">GetAuthorInfo</a><br /><a href="#GetAuthorName">GetAuthorName</a><br /><a href="#GetFileName">GetFileName</a><br /><a href="#GetFileSetDescription">GetFileSetDescription</a><br /><a href="#GetImageDescription">GetImageDescription</a><br /><a href="#GetImageName">GetImageName</a><br /><a href="#GetImageSetDescription">GetImageSetDescription</a><br /><a href="#GetImageThumbnail">GetImageThumbnail</a><br /><a href="#GetParentSection">GetParentSection</a><br /><a href="#GetParentSectionID">GetParentSectionID</a><br /><a href="#GetRelatedArchive">GetRelatedArchive</a><br /><a href="#GetRelatedArticle">GetRelatedArticle</a><br /><a href="#GetSection">GetSection</a><br /><a href="#GetSectionArticleID">GetSectionArticleID</a><br /><a href="#GetSectionFilename">GetSectionFilename</a><br /><a href="#GetSectionID">GetSectionID</a><br /><a href="#GetSectionName">GetSectionName</a><br /><a href="#GetSectionPriority">GetSectionPriority</a><br /><a href="#GetTopSection">GetTopSection</a><br /><a href="#LoopThroughSectionList">LoopThroughSectionList</a><br /><a href="#ReplaceFileTags">ReplaceFileTags</a><br /><a href="#ReplaceImageTags">ReplaceImageTags</a><br /><a href="#SearchArchive">SearchArchive</a><br /><a href="#TestSyndication">TestSyndication</a><br /><a href="#UpdateArticleStats">UpdateArticleStats</a><br /><p class="text"></p><p><a href="#TOC-MAIN">^ Top</a></p><a name="CArticles"></a><h2>   CArticles()
</h2><h3>absolutengine
</h3><p class="text">Article class for handling all article-related functions</p><p><a href="#TOC-MAIN">^ Top</a></p><a name="GetArchive"></a><h2>   GetArchive($settings=10,$adate=0,$sectionID="all",$authorID="all",$priority="all",$articleID=0)
</h2><p class="text">Retrieve articles from database<br />
function accepts two styles of parameters due to backward compatibility<br />
OLD STYLE (v1.70) is deprecated, use only new style with $settings array<br />
"articlenumber"=>int number of articles to list<br />
"offset"=>int offset to show articles from<br />
"fromdate"=>string articles to be shown from date (date format in settings.php)<br />
"todate"=>string articles to be shown up to date (date format as in settings.php)<br />
"authorID"=>string articles written by author ID (comma delimited list for multiple values)<br />
"sectionID"=>string articles in section ID (comma delimited list for multiple values)<br />
"priority"=>boolean 0,1<br />
"status"=>boolean 0,1<br />
"articleID"=>int ID of article to be displayed<br />
"order"=>string use MySQL format ("adate DESC, atime DESC, priority DESC" etc.)<br />
EXCLUSION: !X = !4 - will exclude author/section with ID 4 if used in authorID or sectionID<br />
<br />
This will list latest 10 articles with priority 1<br />
<code><br />
<?<br />
$settings=array(<br />
"articlenumber"=>10,<br />
"priority"=>1<br />
);<br />
$aepublic->GetArchive($settings);<br />
.<br />
.<br />
.<br />
?><br />
</code><br />
This will list 10 articles starting from 5th result from January 1st 2004 to January 31st 2004 in section 5 and 14<br />
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!<br />
<code><br />
<?<br />
$settings=array(<br />
"articlenumber"=>10,<br />
"offset"=>5,<br />
"fromdate"=>"01.01.2004",<br />
"todate"=>"31.01.2004",<br />
"sectionID"=>"5,14"<br />
);<br />
$aepublic->GetArchive($settings);<br />
.<br />
.<br />
.<br />
?><br />
</code><br />
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<br />
Result is sorted by from the oldest to the newest articles<br />
<code><br />
<?<br />
$settings=array(<br />
"articlenumber"=>50,<br />
"authorID"=>"2,10",<br />
"sectionID"=>"5,8,!7",<br />
"order"=>"adate ASC, atime ASC"<br />
);<br />
$aepublic->GetArchive($settings);<br />
.<br />
.<br />
.<br />
?><br />
</code></p><p class="param">array $settings array of parameters, see below:</p><p><a href="#TOC-MAIN">^ Top</a></p><a name="GetArticle"></a><h2>   GetArticle()
</h2><p class="text">Retrieve article content</p><p><a href="#TOC-MAIN">^ Top</a></p><a name="GetArticleAuthor"></a><h2>   GetArticleAuthor($authorID=0)
</h2><p class="text">Retrieve information about author</p><p class="param">int $authorID ID of author</p><p><a href="#TOC-MAIN">^ Top</a></p><a name="GetArticleBeginning"></a><h2>   GetArticleBeginning()
</h2><p class="deprecated">DEPRECATED: from v1.71
</p><p class="text">Print beginning of article<br />
Beginning will not be supported in future</p><p class="see">SEE: <a href="#GetArticleSummary">GetArticleSummary()<br />
GetArticleText()</a></p><p><a href="#TOC-MAIN">^ Top</a></p><a name="GetArticleDate"></a><h2>   GetArticleDate()
</h2><p class="text">Print date of publishing of article</p><p><a href="#TOC-MAIN">^ Top</a></p><a name="GetArticleFileSet"></a><h2>   GetArticleFileSet($filesetID=0)
</h2><p class="text">Retrieve file set</p><p class="param">int filesetID ID of file set</p><p><a href="#TOC-MAIN">^ Top</a></p><a name="GetArticleFilename"></a><h2>   GetArticleFilename()
</h2><p class="text">Return filename of article</p><p><a href="#TOC-MAIN">^ Top</a></p><a name="GetArticleFiles"></a><h2>   GetArticleFiles()
</h2><p class="deprecated">DEPRECATED: from v1.71 DO NOT USE! This function is obsolete and will be deleted in next version
</p><p class="text">Retrieve file set / DEPRECATED<br />
Function has been replaced by GetArticleFileSet()</p><p class="see">SEE: <a href="#GetArticleFileSet">GetArticleFileSet()</a></p><p><a href="#TOC-MAIN">^ Top</a></p><a name="GetArticleID"></a><h2>   GetArticleID()
</h2><p class="text">Return ID of article</p><p><a href="#TOC-MAIN">^ Top</a></p><a name="GetArticleImageSet"></a><h2>   GetArticleImageSet($imagesetID=0)
</h2><p class="text">Retrieve image set</p><p class="param">int imagesetID ID of image set</p><p><a href="#TOC-MAIN">^ Top</a></p><a name="GetArticleImages"></a><h2>   GetArticleImages($before="",$after="",$number=10,$link=0,$imagenumber=0)
</h2><p class="deprecated">DEPRECATED: from v1.71 DO NOT USE! This function is obsolete and will be deleted in next version
</p><p class="text">Retrieve image set / DEPRECATED<br />
Function has been replaced by GetArticleImageSet()</p><p class="see">SEE: <a href="#GetArticleImageSet">GetArticleImageSet()</a></p><p><a href="#TOC-MAIN">^ Top</a></p><a name="GetArticleSection"></a><h2>   GetArticleSection()
</h2><p class="deprecated">DEPRECATED: from v1.71 DO NOT USE! This function is obsolete and will be deleted in next version
</p><p class="text">Print section name<br />
Function has been replaced by GetSectionName()</p><p class="see">SEE: <a href="#GetSectionName">GetSectionName()</a></p><p><a href="#TOC-MAIN">^ Top</a></p><a name="GetArticleSections"></a><h2>   GetArticleSections($articleID=0)
</h2><p class="text">Retrieve sections for the article</p><p class="param">int $articleID ID of article</p><p><a href="#TOC-MAIN">^ Top</a></p><a name="GetArticleStats"></a><h2>   GetArticleStats($articleID=0)
</h2><p class="text">Print article stats/number of views</p><p><a href="#TOC-MAIN">^ Top</a></p><a name="GetArticleSummary"></a><h2>   GetArticleSummary()
</h2><p class="text">Print summary for article (e.g. first few sentences of the text)<br />
Use instead of GetArticleBeginning()<br />
Function searches first 180 characters of text of the article for a dot.<br />
If found it then creates summary text (few sentences) until that position<br />
If not found, it takes first 300 characters of text as a summary</p><p class="todo">TO-DO:@todo: Allow for changing the length of summary as well as symbol that is being searched for</p><p><a href="#TOC-MAIN">^ Top</a></p><a name="GetArticleText"></a><h2>   GetArticleText()
</h2><p class="text">Print text of article</p><p><a href="#TOC-MAIN">^ Top</a></p><a name="GetArticleTime"></a><h2>   GetArticleTime()
</h2><p class="text">Print time of publishing of article</p><p><a href="#TOC-MAIN">^ Top</a></p><a name="GetArticleTitle"></a><h2>   GetArticleTitle()
</h2><p class="text">Print title of article</p><p><a href="#TOC-MAIN">^ Top</a></p><a name="GetAuthorEmail"></a><h2>   GetAuthorEmail()
</h2><p class="text">Print email of author</p><p><a href="#TOC-MAIN">^ Top</a></p><a name="GetAuthorID"></a><h2>   GetAuthorID()
</h2><p class="text">Return ID of author</p><p><a href="#TOC-MAIN">^ Top</a></p><a name="GetAuthorInfo"></a><h2>   GetAuthorInfo()
</h2><p class="text">Print extended information about author</p><p><a href="#TOC-MAIN">^ Top</a></p><a name="GetAuthorName"></a><h2>   GetAuthorName()
</h2><p class="text">Print name of author</p><p><a href="#TOC-MAIN">^ Top</a></p><a name="GetFileName"></a><h2>   GetFileName()
</h2><p class="text">Return filename</p><p><a href="#TOC-MAIN">^ Top</a></p><a name="GetFileSetDescription"></a><h2>   GetFileSetDescription()
</h2><p class="text">Return fileset description</p><p><a href="#TOC-MAIN">^ Top</a></p><a name="GetImageDescription"></a><h2>   GetImageDescription()
</h2><p class="text">Return image description</p><p><a href="#TOC-MAIN">^ Top</a></p><a name="GetImageName"></a><h2>   GetImageName()
</h2><p class="text">Return imagename</p><p><a href="#TOC-MAIN">^ Top</a></p><a name="GetImageSetDescription"></a><h2>   GetImageSetDescription()
</h2><p class="text">Return imageset description</p><p><a href="#TOC-MAIN">^ Top</a></p><a name="GetImageThumbnail"></a><h2>   GetImageThumbnail()
</h2><p class="text">Return thumbnail name for image</p><p><a href="#TOC-MAIN">^ Top</a></p><a name="GetParentSection"></a><h2>   GetParentSection($sectionID=0)
</h2><p class="text">Retrieve parent section for the section</p><p class="param">int $sectionID ID of section</p><p><a href="#TOC-MAIN">^ Top</a></p><a name="GetParentSectionID"></a><h2>   GetParentSectionID()
</h2><p class="text">Return parent sectionID of section</p><p><a href="#TOC-MAIN">^ Top</a></p><a name="GetRelatedArchive"></a><h2>   GetRelatedArchive($articleID)
</h2><p class="text">Retrieve related articles for article $articleID</p><p><a href="#TOC-MAIN">^ Top</a></p><a name="GetRelatedArticle"></a><h2>   GetRelatedArticle()
</h2><p class="deprecated">DEPRECATED: from v1.71 DO NOT USE! This function is obsolete and will be deleted in next version
</p><p class="text">Get related article / DEPRECATED<br />
Function has been replaced by GetArticle()</p><p class="see">SEE: <a href="#GetArticle">GetArticle()</a></p><p><a href="#TOC-MAIN">^ Top</a></p><a name="GetSection"></a><h2>   GetSection($settings)
</h2><p class="text">Retrieves section</p><p><a href="#TOC-MAIN">^ Top</a></p><a name="GetSectionArticleID"></a><h2>   GetSectionArticleID()
</h2><p class="text">Return articleID describing section</p><p><a href="#TOC-MAIN">^ Top</a></p><a name="GetSectionFilename"></a><h2>   GetSectionFilename()
</h2><p class="text">Return filename of section</p><p><a href="#TOC-MAIN">^ Top</a></p><a name="GetSectionID"></a><h2>   GetSectionID()
</h2><p class="text">Return section ID</p><p><a href="#TOC-MAIN">^ Top</a></p><a name="GetSectionName"></a><h2>   GetSectionName()
</h2><p class="text">Print section name</p><p><a href="#TOC-MAIN">^ Top</a></p><a name="GetSectionPriority"></a><h2>   GetSectionPriority()
</h2><p class="text">Return priority of section</p><p><a href="#TOC-MAIN">^ Top</a></p><a name="GetTopSection"></a><h2>   GetTopSection($sectionID=0)
</h2><p class="text"></p><p><a href="#TOC-MAIN">^ Top</a></p><a name="LoopThroughSectionList"></a><h2>   LoopThroughSectionList($parentsectionID,$type=0,$order=0,$override=0,$attribute="")
</h2><p class="text">Loop through the sections and generate a section list</p><p class="param">int $type type of section list to be displayed - 0 public list, 1 links using UL, 2 dropdown menu using &nbsp, 3 checkboxes below each other;<br />
boolean $order - 0 order by priority, 1 order alphabetically<br />
boolean $override - override current section filtering 0 do nothing, 1 override and show<br />
string $attribute - ID or class attribute</p><p><a href="#TOC-MAIN">^ Top</a></p><a name="ReplaceFileTags"></a><h2>   ReplaceFileTags($replace=0)
</h2><p class="deprecated">DEPRECATED: from v1.71 DO NOT USE! This function is obsolete and will be deleted in next version
</p><p class="text">Replace file tags / DEPRECATED<br />
Function does not have replacement for now - SORRY</p><p class="todo">TO-DO:Possibly some sophisticated image replacing in future</p><p><a href="#TOC-MAIN">^ Top</a></p><a name="ReplaceImageTags"></a><h2>   ReplaceImageTags($replace=0,$link=1)
</h2><p class="deprecated">DEPRECATED: from v1.71 DO NOT USE! This function is obsolete and will be deleted in next version
</p><p class="text">Replace image tags / DEPRECATED<br />
Function does not have replacement for now - SORRY</p><p class="todo">TO-DO:Possibly some sophisticated image replacing in future</p><p><a href="#TOC-MAIN">^ Top</a></p><a name="SearchArchive"></a><h2>   SearchArchive($settings,$articlenumber=10,$adate=0)
</h2><p class="text">Search articles in database<br />
function accepts two styles of parameters due to backward compatibility<br />
OLD STYLE (v1.70) is deprecated, use only new style with $settings array<br />
"query"=>string text to find<br />
"searchin"=>string where the search should be made: title,beginning,text (comma delimited list for multiple values)<br />
"style"=>string should the search be fulltext (fulltext) or just free match (anypart)<br />
"articlenumber"=>int number of articles to list<br />
"offset"=>int offset to show articles from<br />
"fromdate"=>string articles to be shown from date (date format in settings.php)<br />
"todate"=>string articles to be shown up to date (date format as in settings.php)<br />
"authorID"=>string articles written by author ID (comma delimited list for multiple values)<br />
"sectionID"=>string articles in section ID (comma delimited list for multiple values)<br />
"priority"=>boolean 0,1<br />
"status"=>boolean 0,1<br />
"articleID"=>int ID of article to be displayed<br />
"order"=>string use MySQL format ("adate DESC, atime DESC, priority DESC" etc.)<br />
EXCLUSION: !X = !4 - will exclude author/section with ID 4 if used in authorID or sectionID</p><p class="param">array $settings array of parameters, see below:</p><p><a href="#TOC-MAIN">^ Top</a></p><a name="TestSyndication"></a><h2>   TestSyndication($articleID)
</h2><p class="text">If syndication module is active, test whether article is syndicated on the current<br />
website, if yes continue with displaying in related articles, otherwise skip</p><p><a href="#TOC-MAIN">^ Top</a></p><a name="UpdateArticleStats"></a><h2>   UpdateArticleStats($articleID=0)
</h2><p class="text">Update number of views for article</p><p class="param">int $articleID</p><p><a href="#TOC-MAIN">^ Top</a></p></body>
</html>
Return current item: Absolut Engine