Absolut Engine PHP Cross Reference Web Portal Systems

Source: /docs/admin-classarticles.php.html - 162 lines - 16660 bytes - Summary - Text - Print

   1  <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
   2      "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
   3  <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
   4  
   5  <head>
   6  <meta http-equiv="content-type" content="text/html; charset=iso-8859-1" />
   7  <meta name="licence" content="GNU General Public Licence" />
   8  <meta name="robots" content="all" />
   9  <title>Documentation: class CArticles extends CEngine
  10  </title>
  11  <style type="text/css">@import "styles.css";</style>
  12  </head>
  13  
  14  <body><h1>class CArticles extends CEngine
  15  </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()
  16  </h2><h3>absolutengine
  17  </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)
  18  </h2><p class="text">Retrieve articles from database<br />
  19  function accepts two styles of parameters due to backward compatibility<br />
  20  OLD STYLE (v1.70) is deprecated, use only new style with $settings array<br />
  21  "articlenumber"=>int number of articles to list<br />
  22  "offset"=>int offset to show articles from<br />
  23  "fromdate"=>string articles to be shown from date (date format in settings.php)<br />
  24  "todate"=>string articles to be shown up to date (date format as in settings.php)<br />
  25  "authorID"=>string articles written by author ID (comma delimited list for multiple values)<br />
  26  "sectionID"=>string articles in section ID (comma delimited list for multiple values)<br />
  27  "priority"=>boolean 0,1<br />
  28  "status"=>boolean 0,1<br />
  29  "articleID"=>int ID of article to be displayed<br />
  30  "order"=>string use MySQL format ("adate DESC, atime DESC, priority DESC" etc.)<br />
  31  EXCLUSION: !X = !4 - will exclude author/section with ID 4 if used in authorID or sectionID<br />
  32  <br />
  33  This will list latest 10 articles with priority 1<br />
  34  <code><br />
  35  <?<br />
  36  $settings=array(<br />
  37  "articlenumber"=>10,<br />
  38  "priority"=>1<br />
  39  );<br />
  40  $aepublic->GetArchive($settings);<br />
  41  .<br />
  42  .<br />
  43  .<br />
  44  ?><br />
  45  </code><br />
  46  This will list 10 articles starting from 5th result from January 1st 2004 to January 31st 2004 in section 5 and 14<br />
  47  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 />
  48  <code><br />
  49  <?<br />
  50  $settings=array(<br />
  51  "articlenumber"=>10,<br />
  52  "offset"=>5,<br />
  53  "fromdate"=>"01.01.2004",<br />
  54  "todate"=>"31.01.2004",<br />
  55  "sectionID"=>"5,14"<br />
  56  );<br />
  57  $aepublic->GetArchive($settings);<br />
  58  .<br />
  59  .<br />
  60  .<br />
  61  ?><br />
  62  </code><br />
  63  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 />
  64  Result is sorted by from the oldest to the newest articles<br />
  65  <code><br />
  66  <?<br />
  67  $settings=array(<br />
  68  "articlenumber"=>50,<br />
  69  "authorID"=>"2,10",<br />
  70  "sectionID"=>"5,8,!7",<br />
  71  "order"=>"adate ASC, atime ASC"<br />
  72  );<br />
  73  $aepublic->GetArchive($settings);<br />
  74  .<br />
  75  .<br />
  76  .<br />
  77  ?><br />
  78  </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()
  79  </h2><p class="text">Retrieve article content</p><p><a href="#TOC-MAIN">^ Top</a></p><a name="GetArticleAuthor"></a><h2>   GetArticleAuthor($authorID=0)
  80  </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()
  81  </h2><p class="deprecated">DEPRECATED: from v1.71
  82  </p><p class="text">Print beginning of article<br />
  83  Beginning will not be supported in future</p><p class="see">SEE: <a href="#GetArticleSummary">GetArticleSummary()<br />
  84  GetArticleText()</a></p><p><a href="#TOC-MAIN">^ Top</a></p><a name="GetArticleDate"></a><h2>   GetArticleDate()
  85  </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)
  86  </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()
  87  </h2><p class="text">Return filename of article</p><p><a href="#TOC-MAIN">^ Top</a></p><a name="GetArticleFiles"></a><h2>   GetArticleFiles()
  88  </h2><p class="deprecated">DEPRECATED: from v1.71 DO NOT USE! This function is obsolete and will be deleted in next version
  89  </p><p class="text">Retrieve file set / DEPRECATED<br />
  90  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()
  91  </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)
  92  </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)
  93  </h2><p class="deprecated">DEPRECATED: from v1.71 DO NOT USE! This function is obsolete and will be deleted in next version
  94  </p><p class="text">Retrieve image set / DEPRECATED<br />
  95  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()
  96  </h2><p class="deprecated">DEPRECATED: from v1.71 DO NOT USE! This function is obsolete and will be deleted in next version
  97  </p><p class="text">Print section name<br />
  98  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)
  99  </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)
 100  </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()
 101  </h2><p class="text">Print summary for article (e.g. first few sentences of the text)<br />
 102  Use instead of GetArticleBeginning()<br />
 103  Function searches first 180 characters of text of the article for a dot.<br />
 104  If found it then creates summary text (few sentences) until that position<br />
 105  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()
 106  </h2><p class="text">Print text of article</p><p><a href="#TOC-MAIN">^ Top</a></p><a name="GetArticleTime"></a><h2>   GetArticleTime()
 107  </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()
 108  </h2><p class="text">Print title of article</p><p><a href="#TOC-MAIN">^ Top</a></p><a name="GetAuthorEmail"></a><h2>   GetAuthorEmail()
 109  </h2><p class="text">Print email of author</p><p><a href="#TOC-MAIN">^ Top</a></p><a name="GetAuthorID"></a><h2>   GetAuthorID()
 110  </h2><p class="text">Return ID of author</p><p><a href="#TOC-MAIN">^ Top</a></p><a name="GetAuthorInfo"></a><h2>   GetAuthorInfo()
 111  </h2><p class="text">Print extended information about author</p><p><a href="#TOC-MAIN">^ Top</a></p><a name="GetAuthorName"></a><h2>   GetAuthorName()
 112  </h2><p class="text">Print name of author</p><p><a href="#TOC-MAIN">^ Top</a></p><a name="GetFileName"></a><h2>   GetFileName()
 113  </h2><p class="text">Return filename</p><p><a href="#TOC-MAIN">^ Top</a></p><a name="GetFileSetDescription"></a><h2>   GetFileSetDescription()
 114  </h2><p class="text">Return fileset description</p><p><a href="#TOC-MAIN">^ Top</a></p><a name="GetImageDescription"></a><h2>   GetImageDescription()
 115  </h2><p class="text">Return image description</p><p><a href="#TOC-MAIN">^ Top</a></p><a name="GetImageName"></a><h2>   GetImageName()
 116  </h2><p class="text">Return imagename</p><p><a href="#TOC-MAIN">^ Top</a></p><a name="GetImageSetDescription"></a><h2>   GetImageSetDescription()
 117  </h2><p class="text">Return imageset description</p><p><a href="#TOC-MAIN">^ Top</a></p><a name="GetImageThumbnail"></a><h2>   GetImageThumbnail()
 118  </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)
 119  </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()
 120  </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)
 121  </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()
 122  </h2><p class="deprecated">DEPRECATED: from v1.71 DO NOT USE! This function is obsolete and will be deleted in next version
 123  </p><p class="text">Get related article / DEPRECATED<br />
 124  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)
 125  </h2><p class="text">Retrieves section</p><p><a href="#TOC-MAIN">^ Top</a></p><a name="GetSectionArticleID"></a><h2>   GetSectionArticleID()
 126  </h2><p class="text">Return articleID describing section</p><p><a href="#TOC-MAIN">^ Top</a></p><a name="GetSectionFilename"></a><h2>   GetSectionFilename()
 127  </h2><p class="text">Return filename of section</p><p><a href="#TOC-MAIN">^ Top</a></p><a name="GetSectionID"></a><h2>   GetSectionID()
 128  </h2><p class="text">Return section ID</p><p><a href="#TOC-MAIN">^ Top</a></p><a name="GetSectionName"></a><h2>   GetSectionName()
 129  </h2><p class="text">Print section name</p><p><a href="#TOC-MAIN">^ Top</a></p><a name="GetSectionPriority"></a><h2>   GetSectionPriority()
 130  </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)
 131  </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="")
 132  </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 />
 133  boolean $order - 0 order by priority, 1 order alphabetically<br />
 134  boolean $override - override current section filtering 0 do nothing, 1 override and show<br />
 135  string $attribute - ID or class attribute</p><p><a href="#TOC-MAIN">^ Top</a></p><a name="ReplaceFileTags"></a><h2>   ReplaceFileTags($replace=0)
 136  </h2><p class="deprecated">DEPRECATED: from v1.71 DO NOT USE! This function is obsolete and will be deleted in next version
 137  </p><p class="text">Replace file tags / DEPRECATED<br />
 138  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)
 139  </h2><p class="deprecated">DEPRECATED: from v1.71 DO NOT USE! This function is obsolete and will be deleted in next version
 140  </p><p class="text">Replace image tags / DEPRECATED<br />
 141  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)
 142  </h2><p class="text">Search articles in database<br />
 143  function accepts two styles of parameters due to backward compatibility<br />
 144  OLD STYLE (v1.70) is deprecated, use only new style with $settings array<br />
 145  "query"=>string text to find<br />
 146  "searchin"=>string where the search should be made: title,beginning,text (comma delimited list for multiple values)<br />
 147  "style"=>string should the search be fulltext (fulltext) or just free match (anypart)<br />
 148  "articlenumber"=>int number of articles to list<br />
 149  "offset"=>int offset to show articles from<br />
 150  "fromdate"=>string articles to be shown from date (date format in settings.php)<br />
 151  "todate"=>string articles to be shown up to date (date format as in settings.php)<br />
 152  "authorID"=>string articles written by author ID (comma delimited list for multiple values)<br />
 153  "sectionID"=>string articles in section ID (comma delimited list for multiple values)<br />
 154  "priority"=>boolean 0,1<br />
 155  "status"=>boolean 0,1<br />
 156  "articleID"=>int ID of article to be displayed<br />
 157  "order"=>string use MySQL format ("adate DESC, atime DESC, priority DESC" etc.)<br />
 158  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)
 159  </h2><p class="text">If syndication module is active, test whether article is syndicated on the current<br />
 160  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)
 161  </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>
 162  </html>

title

Description

title

Description

title

Description

title

title

Body