Overview  Package PHPDoctor

client

Class client_articles

client.client_entity
|
+--client.client_articles

class client_articles
extends client_entity

Client part support for Article System.
Functions to handle articles on the client side.


Field Summary
public var$a_articles
public var$a_images
public var$article
public var$error
Fields inherited from client.client_entity
$a_entity $a_images $recent
Method Summary
public voidclient_articles
public associativeget

Return detailed article data of given article.

public stringget_adata

Return specified part of last loaded (with get_article) article.

public arrayget_related

Return list of related articles.

public arrayget_next

Return next article in an issue from given article, if any.

public arrayget_previous

Return previous article in an issue from given article, if any.

public stringis_current

Test if given article id is from current issue.

public associativeget_special

Return detailed article data of given article.

public voidget_by_rating

Return articles according to rating (with non-zero rating), sorted from best to worst.

public voidget_by_counter

Return articles according to counter, sorted from most visited to least.

public numberincrease_counter

Article display counter advancing.

public voidupdate_rating

Update article rating.

public voidget_num_comments

Get number of comments for given article.

public boolean,insert_comment

Insert article comment.

public voidget_comments

Get comments for given article.

public voidget_comment

Get specific comment data for given article.

public voiddelete_comment

Delete specific comment.

public voidget_all_groups

Returns all groups of given article.

Methods inherited from client.client_entity
client_entity, get_by, get_image, get_image_assignment, get_image_tag, get_image_link, select_box
Field Detail

a_articles

public var $a_articles

a_images

public var $a_images

article

public var $article

error

public var $error
Method Detail

client_articles()

public void client_articles(var $art,
                            var $ima)
Parameters:
$art
$ima

get()

public associative get(var $id,
                       var $flags = VISIBLE,
                       var $what = 'A.id, A.title, A.subtitle, A.menu_title, A.preview, 
		A.content, A.sources, A.signature, A.counter, A.rating, A.num_rated, 
		A.display_extras')

Return detailed article data of given article.

Depending on the flags, it returns articles from ISSUE_CURRENT issue only, ISSUE_ARCHIVED issues, or both .. ISSUE_VISIBLE.
To request even the articles published in groups, GROUP_VISIBLE should be used.
TO get any published article, either from issues or from groups, use VISIBLE. Following are valid:
ISSUE_ARCHIVED | ISSUE_CURRENT == ISSUE_VISIBLE
ISSUE_VISIBLE | GROUP_VISIBLE == VISIBLE
Usage of INVISIBLE parameter should require active session, it does not check article state.

Parameters:
$id
$flags
$what
Returns:
array

get_adata()

public string get_adata(var $what)

Return specified part of last loaded (with get_article) article.

Parameters:
$what

get_related()

public array get_related(var $id = '')

Return list of related articles.

The list is for article returned by the last get_article() call.

Parameters:
$id

get_next()

public array get_next(var $id = '',
                      var $what = 'id, title')

Return next article in an issue from given article, if any.

Parameters:
$id
$what

get_previous()

public array get_previous(var $id = '',
                          var $what = 'id, title')

Return previous article in an issue from given article, if any.

Parameters:
$id
$what

is_current()

public string is_current(var $id)

Test if given article id is from current issue.

Use to prevent displaying of non-public articles.

Parameters:
$id

get_special()

public associative get_special(var $id,
                               var $restrict,
                               var $what = 'A.id, A.title, A.subtitle, A.preview, A.content, A.sources, A.signature')

Return detailed article data of given article.

Restriction to articles is specified as parameter.

Parameters:
$id
$restrict
$what
Returns:
array

get_by_rating()

public void get_by_rating(var $limit,
                          var $what = "A.id, A.title, A.rating, A.num_rated",
                          var $where = "")

Return articles according to rating (with non-zero rating), sorted from best to worst.

Parameters:
$limit
$what
$where

get_by_counter()

public void get_by_counter(var $limit,
                           var $what = "A.id, A.title, A.counter",
                           var $where = "")

Return articles according to counter, sorted from most visited to least.

Parameters:
$limit
$what
$where

increase_counter()

public number increase_counter(var $id)

Article display counter advancing.

Parameters:
$id
Returns:
of affected rows

update_rating()

public void update_rating(var $id,
                          var $rating)

Update article rating.

Returns number of affected rows (should be 1), or false in case of db error or disabled rating (display_extras == 0).

Parameters:
$id
$rating

get_num_comments()

public void get_num_comments(var $id)

Get number of comments for given article.

Parameters:
$id

insert_comment()

public boolean, insert_comment(var $comment)

Insert article comment.

Parameters:
$comment
Returns:
or insert id

get_comments()

public void get_comments(var $id)

Get comments for given article.

Parameters:
$id

get_comment()

public void get_comment(var $article,
                        var $comment,
                        var $data = "*")

Get specific comment data for given article.

Parameters:
$article
$comment
$data

delete_comment()

public void delete_comment(var $id)

Delete specific comment.

Parameters:
$id

get_all_groups()

public void get_all_groups(var $aid,
                           var $what = 'G.id, G.name',
                           var $where = '')

Returns all groups of given article.

Parameters:
$aid
$what
$where

Overview  Package PHPDoctor