Home « Server software «
Documentation: articles/articles.php
Class Articles - The database abstraction layer for articles
The several versions of article content are now saved for history, and may be restored at any time.How to lock an article?
An article can be locked to prevent modification. This feature only concerns regular members of the community, as associates and editors are always allowed to add, change of remove any page.How to manage options for articles?
The options field is a convenient place to save attributes for any article without extending the database schema. As articles are commonly used to anchor some pages, their options can be also checked through thehas_option()
member function of the Anchor
interface. Check shared/anchor.php for more information.This means that some options are used within the context of one article (eg,
no_links
),
while others can be used with related items as well.Specific options to be processed by advanced overlays are not described hereafter. One example of this is the optional keyword '
home_with_results
' for the rendering of polls.
Please check documentation pages for any overlay you use, like overlays/poll.php.You can combine any of following keywords in the field for options, with the separator (spaces, tabs, commas) of your choice:
*
files_by_title
- When viewing articles, order attached files by alphabetical order instead of using edition time information.
This option may prove useful to structure a list of files.
For example, on a page describing a complex project, you would like to offer an introduction to the project ('1.introduction.doc
'),
then a report on initial issue ('2.the issue.ppt
'), and a business case for the solution ('3.profit_and_loss.xls
').
By adjusting file names and titles as shown, and by setting the option files_by_title
, you would achieve a nice and logical thing.*
formatted
- The YACS rendering engine is disabled, since the description contains formatting tags.
Use this option if you copy the source of a HTML or of a XHTML page, and paste it into an article at your server.
Note that this keyword is also accepted if it is formatted as a YACS code ('[formatted]'
)
at the very beginning of the description field.*
hardcoded
- The YACS rendering engine is disabled, except that new lines are changed to (X)HTML breaks.
Use this option if you copy some raw text file (including a mail message) and make a page out of it.
Note that this keyword is also accepted if it is formatted as a YACS code ('[hardcoded]'
)
at the very beginning of the description field.*
links_by_title
- When wiewing articles, order attached links by alphabetical order instead of using edition time information.
This options works like files_by_title
, except that it applies to link.
Use it to create nice and ordered bookmarks.*
no_comments
- New comments cannot be posted on this page.*
no_files
- New files cannot be attached to this page.*
no_links
- New links cannot be posted to this article.*
skin_<xxxx>
- Select one skin explicitly.
Use this option to apply a specific skin to a page.
This setting is the most straightforward way of introducing some skin to web surfers.*
variant_<xxxx>
- Select one skin variant explicitly.
Usually only the variant 'articles
' is used throughout articles.
This can be changed to 'xxxx
' by using the option variant_<xxxx>
.
Then the underlying skin may adapt to this code by looking at $context['skin_variant']
.
Basically, use variants to change the rendering of individual articles of your site, if the skin allows it.Also, a specific option is available to handle the article at the front page:
*
none
- Don't mention this published article at the site front page.
Use this option to avoid that special pages add noise to the front page.
For example, while building the on-line manual of YACS this option has been set to intermediate pages,
that are only featuring lists of following pages.How to order articles and to manage sticky pages?
Usually articles are ranked by edition date, with the most recent page coming first. You can change this 'natural' order by modifying the value of the rank field.What is the result obtained, depending on the value set?
* 10000 - This is the default value. All articles created by YACS are ranked equally.
* Less than 10000 - Useful to create sticky and ordered pages. Sticky, since these pages will always come first. Ordered, since the lower rank values come before higher rank values. Pages that have the same rank value are ordered by dates, with the newest item coming first. This lets you arrange precisely the order of sticky pages.
* More than 10000 - To reject pages at the end of lists.
This script is a reference file of this system.
Voir aussi:
Licence: GNU Lesser General Public License
Auteurs:
- Bernard Paques bernard.paques@bigfoot.com
- Florent
Testeurs:
- Mark
Reste à faire:
- add a field for trailer text
- add a field for extra text
- place in bin on deletion
delete() - Delete one article
function delete($id)
- $id - the id of the article to delete
- returns an error message, if any
delete_for_anchor() - Delete all articles for a given anchor
function delete_for_anchor($anchor)
- $anchor - string the anchor to check (e.g., 'section:123')
- returns void
delete_for_nick_name() - Delete articles by nick name
function delete_for_nick_name($nick_name)
- $nick_name - the nick name of the article(s) to delete
- returns an error message, if any
get() - Get one article by id, nick name or by handle
function &get($id, $variant=NULL)
- $id - int the id of the article
- $variant=NULL - string 'overlay' to only look into overlay ids
- returns the resulting $item array, with at least keys: 'id', 'title', 'description', etc.
get_newest_for_anchor() - Get the newest article for one anchor
function &get_newest_for_anchor($anchor, $without_sticky=FALSE)
- $anchor - int the id of the anchor
- $without_sticky=FALSE - boolean FALSE to include sticky pages, TRUE otherwise
- returns the resulting $item array, with at least keys: 'id', 'title', 'description', etc.
Only articles matching following criteria are returned:
- article is visible (active='Y')
- article is restricted (active='R'), but surfer is a logged user
- article is protected (active='N'), but surfer is an associate
- article has been officially published
- an expiry date has not been defined, or is not yet passed
- (if 2nd parameter is TRUE) article is not sticky (rank >= 10000)
Voir aussi:
get_next_url() - Get url of next article
function get_next_url(&$item, $anchor, $order='date', $capability='?')
- &$item - array the current item
- $anchor - string reference to the current anchor (e.g., 'section:123')
- $order='date' - string the order, either 'date' or 'title' or 'rank'
- $capability='?' - string surfer actual capability ('?', 'M', or 'A')
- returns an array ($url, $title)
Voir aussi:
get_options() - Get articles as options of a <SELECT> field
function &get_options()
- returns the HTML to insert in the page
- related section is visible (active='Y')
- related section is restricted (active='R'), but the surfer is an authenticated member
- article is visible (active='Y')
- article is restricted (active='R'), but surfer is a logged user
- article is protected (active='N'), but surfer is an associate, and we are not feeding someone
- article has been officially published
- an expiry date has not been defined, or is not yet passed
Voir aussi:
get_previous_url() - Get url of previous article
function get_previous_url(&$item, $anchor, $order='date', $capability='?')
- &$item - array the current item
- $anchor - string reference to the anchor (e.g., 'section:123')
- $order='date' - string the order, either 'date' or 'title'
- $capability='?' - string surfer actual capability ('?', 'M', or 'A')
- returns an array($url, $title)
Voir aussi:
get_url() - Get the url to view an article
function get_url($id, $action='view')
- $id - int the id of the article to view
- $action='view' - string the expected action ('view', 'print', 'edit', 'delete', ...)
- returns an anchor to the viewing script
articles/view.php?id=512
'),
which may be not processed correctly by search engines.
If the parameter 'with_friendly_urls
' has been set to 'Y
' in the configuration panel,
this function will return an URL parsable by search engines (e.g. 'articles/view.php/512
').Voir aussi:
increment_hits() - Set the hits counter - errors are not reported, if any
function increment_hits($id)
- $id - the id of the article to update
list_by_date() - List most recent articles
function &list_by_date($offset=0, $count=10, $variant='full', $since=NULL)
- $offset=0 - int the offset from the start of the list; usually, 0 or 1
- $count=10 - int the number of items to display
- $variant='full' - string the list variant, if any
- $since=NULL - string stamp of the minimum publication date to be considered
- returns NULL on error, else an ordered array with $url => ($prefix, $label, $suffix, $icon)
To build a simple box of the newest articles in your main index page, just use:
include_once 'articles/articles.php';
$items = Articles::list_by_date(0, 10);
$context['text'] .= Skin::build_list($items, 'decorated');
You can also display the newest article separately, using
Articles::get_newest()
In this case, skip the very first article in the list by using
Articles::list_by_date(1, 10)
Only articles matching following criteria are returned:
- related section is visible (active='Y')
- related section is restricted (active='R'), but the surfer is an authenticated member,
- article is visible (active='Y')
- article is restricted (active='R'), but the surfer is an authenticated member,
- article is protected (active='N'), but surfer is an associate, and we are not feeding someone
- article has been officially published
- an expiry date has not been defined, or is not yet passed
- related section is regularly displayed at the front page
Voir aussi:
list_by_date_for_anchor() - List most recent publications for one anchor
function &list_by_date_for_anchor($anchor, $offset=0, $count=10, $variant='no_anchor', $capability='?')
- $anchor - mixed, either a string the target anchor, or an array of anchors
- $offset=0 - int the offset from the start of the list; usually, 0 or 1
- $count=10 - int the number of items to display
- $variant='no_anchor' - string the list variant, if any
- $capability='?' - string actual surfer capability ('?', 'M', or 'A') -- used to impersonate the actual surfer, as in services/blog.php for example
- returns NULL on error, else an ordered array with $url => ($prefix, $label, $suffix, $icon)
Example:
include_once 'articles/articles.php';
$items = Articles::list_by_date_for_anchor('section:12');
$context['text'] .= Skin::build_list($items, 'decorated');
Use the variant 'boxes' to fetch articles within boxes. This is the standard way of displaying navigation, gadgets and extra boxes in yacs.
// load the navigation boxes, if any
include_once $context['path_to_root'].'sections/sections.php';
$anchor = Sections::lookup('navigation_boxes');
include_once $context['path_to_root'].'articles/articles.php';
if($items = Articles::list_by_date_for_anchor($anchor, 0, 5, 'boxes')) {
foreach($items as $title => $content)
echo "<p></p>\n".Skin::build_box($title, $content, 'navigation')."\n";
}
Only articles matching following criteria are returned:
- article is visible (active='Y')
- article is restricted (active='R'), but the surfer is an authenticated member,
- article is protected (active='N'), but surfer is an associate, and we are not feeding someone
- surfer is anonymous or the variant is 'boxes', and article has been officially published
- logged surfers are restricted to their own articles, plus published articles
- an expiry date has not been defined, or is not yet passed
Voir aussi:
list_by_date_for_author() - List most recent articles for one author
function &list_by_date_for_author($author_id, $offset=0, $count=10, $variant='no_author')
- $author_id - int the id of the author of the article
- $offset=0 - int the offset from the start of the list; usually, 0 or 1
- $count=10 - int the number of items to display
- $variant='no_author' - string the list variant, if any
- returns NULL on error, else an ordered array with $url => ($prefix, $label, $suffix, $icon)
Example:
include_once 'articles/articles.php';
$items = Articles::list_by_date_for_author(12, 0, 10);
$context['text'] .= Skin::build_list($items, 'decorated');
Only articles matching following criteria are returned:
- related section is visible (active='Y')
- article is visible (active='Y')
- article is restricted (active='R'), but surfer is a logged user
- article is not visible (active='N'), but surfer is an associate
- article has been officially published, or the surfer is a logged user
- an expiry date has not been defined, or is not yet passed
Voir aussi:
list_by_edition_date() - List most recent updates
function &list_by_edition_date($offset=0, $count=10, $variant='full', $since=NULL)
- $offset=0 - int the offset from the start of the list; usually, 0 or 1
- $count=10 - int the number of items to display
- $variant='full' - string the list variant, if any
- $since=NULL - string stamp of the minimum publication date to be considered
- returns NULL on error, else an ordered array with $url => ($prefix, $label, $suffix, $icon)
Only articles matching following criteria are returned:
- related section is visible (active='Y')
- related section is restricted (active='R'), but the surfer is an authenticated member,
- article is visible (active='Y')
- article is restricted (active='R'), but the surfer is an authenticated member,
- article is protected (active='N'), but surfer is an associate, and we are not feeding someone
- article has been officially published
- an expiry date has not been defined, or is not yet passed
- related section is regularly displayed at the front page
Voir aussi:
list_by_edition_date_for_anchor() - List most recent updates for one anchor
function &list_by_edition_date_for_anchor($anchor, $offset=0, $count=10, $variant='no_anchor', $capability='?')
- $anchor - mixed, either a string the target anchor, or an array of anchors
- $offset=0 - int the offset from the start of the list; usually, 0 or 1
- $count=10 - int the number of items to display
- $variant='no_anchor' - string the list variant, if any
- $capability='?' - string to impersonate the actual user through services/blog.php
- returns NULL on error, else an ordered array with $url => ($prefix, $label, $suffix, $icon)
Using edition dates enables updated articles to appear at the top of list in sections.
Only articles matching following criteria are returned:
- article is visible (active='Y')
- article is restricted (active='R'), but the surfer is an authenticated member,
- article is protected (active='N'), but surfer is an associate, and we are not feeding someone
- surfer is anonymous or the variant is 'boxes', and article has been officially published
- logged surfers are restricted to their own articles, plus published articles
- an expiry date has not been defined, or is not yet passed
Voir aussi:
- sections/feed.php
- sections/layout_sections.php
- sections/layout_sections_as_inline.php
- sections/layout_sections_as_yahoo.php
- sections/print.php
- sections/view.php
- services/blog.php
list_by_expiry_date() - List dead articles
function &list_by_expiry_date($offset=0, $count=10, $variant='full')
- $offset=0 - int the offset from the start of the list; usually, 0 or 1
- $count=10 - int the number of items to display
- $variant='full' - string the list variant, if any
- returns NULL on error, else an ordered array with $url => ($prefix, $label, $suffix, $icon)
Only articles matching following criteria are returned:
- related section is visible (active='Y')
- article is visible (active='Y')
- article is restricted (active='R'), but surfer is a logged user
- article is protected (active='N'), but surfer is an associate
- an expiry date has been set and the article is dead
Most recent dead pages come first, which is exactly what's expected for the review page.
Voir aussi:
list_by_future_date() - List articles that have been published in the future
function &list_by_future_date($offset=0, $count=10, $variant='full')
- $offset=0 - int the offset from the start of the list; usually, 0 or 1
- $count=10 - int the number of items to display
- $variant='full' - string the list variant, if any
- returns NULL on error, else an ordered array with $url => ($prefix, $label, $suffix, $icon)
- related section is visible (active='Y')
- article is visible (active='Y')
- article is restricted (active='R'), but surfer is a logged user
- article has been officially published, but in the future
- an expiry date has not been defined, or is not yet passed
Hidden articles, and articles in hidden sections, are not listed at all.
Voir aussi:
list_by_hits() - List most read articles
function &list_by_hits($offset=0, $count=10, $variant='hits')
- $offset=0 - int the offset from the start of the list; usually, 0 or 1
- $count=10 - int the number of items to display
- $variant='hits' - string the list variant, if any
- returns NULL on error, else an ordered array with $url => ($prefix, $label, $suffix, $icon)
include_once 'articles/articles.php';
$items = Articles::list_by_hits(0, COMPACT_LIST_SIZE);
$context['text'] .= Skin::build_list($items, 'compact');
You can also display the most read article separately, using Articles::get_most_read() In this case, skip the very first article in the list by using Articles::list_by_hits(1, 10)
Only articles matching following criteria are returned:
- related section is visible (active='Y')
- article is visible (active='Y')
- article is restricted (active='R'), but surfer is a logged user
- article is not visible (active='N'), but surfer is an associate
- article has been officially published
- an expiry date has not been defined, or is not yet passed
- articles have been edited within the last 4 months
Voir aussi:
list_by_hits_for_anchor() - List most read articles for one anchor
function &list_by_hits_for_anchor($anchor, $offset=0, $count=10, $variant='no_anchor', $capability='?')
- $anchor - mixed, either a string the target anchor, or an array of anchors
- $offset=0 - int the offset from the start of the list; usually, 0 or 1
- $count=10 - int the number of items to display
- $variant='no_anchor' - string the list variant, if any
- $capability='?' - string to impersonate the actual user through services/blog.php
- returns NULL on error, else an ordered array with $url => ($prefix, $label, $suffix, $icon)
- article is visible (active='Y')
- article is restricted (active='R'), but the surfer is an authenticated member,
- article is protected (active='N'), but surfer is an associate, and we are not feeding someone
- surfer is anonymous or the variant is 'boxes', and article has been officially published
- logged surfers are restricted to their own articles, plus published articles
- an expiry date has not been defined, or is not yet passed
Voir aussi:
list_by_hits_for_author() - List most read articles for one author
function &list_by_hits_for_author($author_id, $offset=0, $count=10, $variant='no_author')
- $author_id - int the id of the author of the article
- $offset=0 - int the offset from the start of the list; usually, 0 or 1
- $count=10 - int the number of items to display
- $variant='no_author' - string the list variant, if any
- returns NULL on error, else an ordered array with $url => ($prefix, $label, $suffix, $icon)
include_once 'articles/articles.php';
$items = Articles::list_by_hits_for_author(12, 0, 10);
$context['text'] .= Skin::build_list($items, 'compact');
Only articles matching following criteria are returned:
- related section is visible (active='Y')
- article is visible (active='Y')
- article is restricted (active='R'), but surfer is a logged user
- article is not visible (active='N'), but surfer is an associate
- article has been officially published, or the surfer is a logged user
- an expiry date has not been defined, or is not yet passed
Voir aussi:
list_by_oldest_date() - List oldest articles
function &list_by_oldest_date($offset=0, $count=10, $variant='full')
- $offset=0 - int the offset from the start of the list; usually, 0 or 1
- $count=10 - int the number of items to display
- $variant='full' - string the list variant, if any
- returns NULL on error, else an ordered array with $url => ($prefix, $label, $suffix, $icon)
This function never lists inactive articles. It is aiming to provide a simple list of the articles for the review page.
Only articles matching following criteria are returned:
- related section is visible (active='Y')
- article is visible (active='Y')
- article is restricted (active='R'), but surfer is a logged user
- article has been officially published, or the surfer is a logged user
- an expiry date has not been defined, or is not yet passed
Namely, hiddent articles, or articles attached to hidden sections, are not listed at all.
Voir aussi:
list_by_title_for_anchor() - List articles by title for one anchor
function &list_by_title_for_anchor($anchor, $offset=0, $count=10, $variant='no_anchor', $capability='?')
- $anchor - string the target anchor
- $offset=0 - int the offset from the start of the list; usually, 0 or 1
- $count=10 - int the number of items to display
- $variant='no_anchor' - string the list variant, if any
- $capability='?' - string to impersonate the actual user through services/blog.php
- returns NULL on error, else an ordered array with $url => ($prefix, $label, $suffix, $icon)
Example:
include_once 'articles/articles.php';
$items = Articles::list_by_title_for_anchor('section:12');
$context['text'] .= Skin::build_list($items, 'decorated');
Use the variant 'boxes' to fetch articles within boxes. This is the standard way of displaying navigation and extra boxes in yacs.
// load the navigation boxes, if any
include_once $context['path_to_root'].'sections/sections.php';
$anchor = Sections::lookup('navigation_boxes');
include_once $context['path_to_root'].'articles/articles.php';
if($items = Articles::list_by_title_for_anchor($anchor, 0, 5, 'boxes')) {
foreach($items as $title => $content)
echo "<p></p>\n".Skin::build_box($title, $content, 'navigation')."\n";
}
Only articles matching following criteria are returned:
- article is visible (active='Y')
- article is restricted (active='R'), but the surfer is an authenticated member,
- article is protected (active='N'), but surfer is an associate, and we are not feeding someone
- surfer is anonymous or the variant is 'boxes', and article has been officially published
- logged surfers are restricted to their own articles, plus published articles
- an expiry date has not been defined, or is not yet passed
Voir aussi:
list_randomly() - List some articles randomly
function &list_randomly($count=10, $variant='full')
- $count=10 - int the number of items to display
- $variant='full' - string the list variant, if any
- returns NULL on error, else an ordered array with $url => ($prefix, $label, $suffix, $icon)
include_once 'articles/articles.php';
$items = Articles::list_randomly(10);
$context['text'] .= Skin::build_list($items, 'decorated');
Only articles matching following criteria are returned:
- related section is visible (active='Y')
- related section is restricted (active='R'), but the surfer is an authenticated member
- article is visible (active='Y')
- article is restricted (active='R'), but surfer is a logged user
- article is protected (active='N'), but surfer is an associate, and we are not feeding someone
- article has been officially published
- an expiry date has not been defined, or is not yet passed
- related section is listed in the main panel of the front page
- article is allowed to be displayed at the site front page (home_panel != 'none')
Voir aussi:
list_selected() - List selected articles
function &list_selected(&$result, $variant='compact', $capability='?')
- &$result - resource result of database query
- $variant='compact' - string 'full', etc or object, i.e., an instance of Layout_Interface
- $capability='?' - string '?' or 'A', to support editors and to impersonate associates, where applicable
- returns NULL on error, else an ordered array with $key => ($prefix, $label, $suffix, $type, $icon)
- 'boxes' - a special variant to build boxes on index pages
- 'compact' - to build short lists in boxes and sidebars (this is the default)
- 'contents' - an array of $url => array($time, $label, $author, $section, $icon, $introduction, $content, $trackback) for feeds and search
- 'daily' - for blogs
- 'digest' - for newsletters
- 'feeds' - an array of $url => array($time, $label, $author, $section, $icon, $introduction, $content, $trackback) for feeds and search
- 'full' - include anchor information
- 'news' - to build a list of news or of featured pages
Voir aussi:
list_unpublished() - List unpublished articles
function &list_unpublished($offset=0, $count=10, $variant='full')
- $offset=0 - int the offset from the start of the list; usually, 0 or 1
- $count=10 - int the number of items to display
- $variant='full' - string the list variant, if any
- returns NULL on error, else an ordered array with $url => ($prefix, $label, $suffix, $icon)
Example:
include_once 'articles/articles.php';
$items = Articles::list_unpublished();
$context['text'] .= Skin::build_list($items, 'decorated');
Only articles matching following criteria are returned:
- related section is visible (active='Y')
- article is visible (active='Y')
- article is restricted (active='R'), but surfer is a logged user
- article is not visible (active='N'), but surfer is an associate
- article has not been officially published (publish_date field is empty)
- an expiry date has not been defined, or is not yet passed
Articles are ordered by decreasing modification date, which is the expected behaviour for the review page.
Voir aussi:
list_unread() - List articles that are not read
function &list_unread($offset=0, $count=10, $variant='full')
- $offset=0 - int the offset from the start of the list; usually, 0 or 1
- $count=10 - int the number of items to display
- $variant='full' - string the list variant, if any
- returns NULL on error, else an ordered array with $url => ($prefix, $label, $suffix, $icon)
- related section is visible (active='Y')
- article is visible (active='Y')
- article is restricted (active='R'), but surfer is a logged user
- article has been officially published
- an expiry date has not been defined, or is not yet passed
Hidden articles, and articles in hidden sections, are not listed at all.
lookup() - Get the id of one article knowing its nick name
function lookup($nick_name)
- $nick_name - string the nick name looked for
- returns string either 'article:<id>', or NULL
post() - Post a new article
function post(&$fields, $capability='?')
- &$fields - array an array of fields
- $capability='?' - string to support editors and remote updates (eg, through XML-RPC)
- returns the id of the new article, or FALSE on error
$context['error']
.Voir aussi:
put() - Put an updated article in the database
function put(&$fields, $capability='?')
- &$fields - array an array of fields
- $capability='?' - string to support editors and remote updates (eg, through XML-RPC)
- returns string either a null string, or some text describing an error to be inserted into the html response
Voir aussi:
rate() - Rate a page
function rate($id, $rating)
- $id - int the id of the article to rate
- $rating - int the rate
search() - Search for some keywords in all articles
function &search($pattern, $offset=0, $count=10, $variant='full')
- $pattern - the search string
- $offset=0 - int the offset from the start of the list; usually, 0 or 1
- $count=10 - int the number of items to display
- $variant='full' - string the list variant, if any
- returns NULL on error, else an ordered array with $url => ($prefix, $label, $suffix, $icon)
- related section is visible (active='Y')
- article is visible (active='Y')
- article is restricted (active='R'), but the surfer is an authenticated member,
- article is restricted (active='N'), but surfer is an associate
- article has been officially published, or the surfer is a logged user
- an expiry date has not been defined, or is not yet passed
Voir aussi:
search_in_section() - Search for some keywords articles anchored to one precise section
function &search_in_section($section_id, $pattern, $offset=0, $count=10, $variant='full')
- $section_id - the id of the section to look in
- $pattern - the search string
- $offset=0 - int the offset from the start of the list; usually, 0 or 1
- $count=10 - int the number of items to display
- $variant='full' - string the list variant, if any
- returns NULL on error, else an ordered array with $url => ($prefix, $label, $suffix, $icon)
- article is visible (active='Y')
- article is restricted (active='R'), but the surfer is an authenticated member,
- article is restricted (active='N'), but surfer is an associate
- article has been officially published, or the surfer is a logged user
- an expiry date has not been defined, or is not yet passed
Voir aussi:
setup() - Create tables for articles
function setup()
stamp() - Stamp an article
function stamp($id, $publication=NULL, $expiry=NULL, $publisher=NULL)
- $id - int the id of the item to publish
- $publication=NULL - string the target publication date, if any
- $expiry=NULL - string the target expiration date, if any
- $publisher=NULL - array attributes of the publisher, if any
- returns string either a null string, or some text describing an error to be inserted into the html response
* If a publication date is provided, it is saved along the article. An optional expiry date will be saved as well.
* If only an expiry date is provided, it is saved along the article.
* If no date is provided, the review field is updated to the current date and time.
If a publication date is provided, it is assumed to be in the time zone of the surfer, and it is adjusted to the server time zone automatically.
The name of the surfer is registered as the official publisher. As an alternative, publisher attributes ('name', 'id' and 'address') can be provided in parameters.
If an expiration date is provided, it is assumed to be in the time zone of the surfer, and it is adjusted to the server time zone automatically.
Voir aussi:
stat() - Get some statistics
function &stat()
- returns the resulting ($count, $min_date, $max_date) array
- related section is visible (active='Y')
- related section is restricted (active='R'), but the surfer is an authenticated member,
- article is visible (active='Y')
- article is restricted (active='R'), but the surfer is an authenticated member,
- article is protected (active='N'), but surfer is an associate, and we are not feeding someone
- article has been officially published
- an expiry date has not been defined, or is not yet passed
- related section is regularly displayed at the front page
- article is allowed to be displayed at the front page of the server (home_panel != 'none')
Voir aussi:
stat_for_anchor() - Get some statistics for one anchor
function &stat_for_anchor($anchor, $capability='?')
- $anchor - the selected anchor (e.g., 'section:12')
- $capability='?' - string actual surfer capability ('?', 'M', or 'A')
- returns the resulting ($count, $min_date, $max_date) array
- article is visible (active='Y')
- article is restricted (active='R'), but the surfer is an authenticated member,
- article is protected (active='N'), but surfer is an associate, and we are not feeding someone
- surfer is anonymous or the variant is 'boxes', and article has been officially published
- logged surfers are restricted to their own articles, plus published articles
- an expiry date has not been defined, or is not yet passed
Voir aussi:
stat_for_author() - Get some statistics for one author
function &stat_for_author($author_id)
- $author_id - the selected author (e.g., '12')
- returns the resulting ($count, $min_date, $max_date) array
- related section is visible (active='Y')
- article is visible (active='Y')
- article is restricted (active='R'), but surfer is a logged user
- article is not visible (active='N'), but surfer is an associate
- article has been officially published, or the surfer is a logged user
- an expiry date has not been defined, or is not yet passed
Voir aussi:
unpublish() - Unpublish an article
function unpublish($id)
- $id - int the id of the item to unpublish
- returns string either a null string, or some text describing an error to be inserted into the html response
Voir aussi: