Class client_articles

client_entity
  |
  +--client_articles

public class client_articles
extends client_entity

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


Constructor Summary
client_articles(var $art, var $ima)
           
 
Method Summary
 unknown delete_comment(var $id)
          Delete specific comment.
 unknown get_adata(var $what)
          Return specified part of last loaded (with get_article) article.
 array get_all_groups(var $aid, var $what, var $where)
          Returns all groups of given article.
 unknown get_by_counter(var $limit, var $what, var $where)
          Return articles according to counter, sorted from most visited to least.
 unknown get_by_rating(var $limit, var $what, var $where)
          Return articles according to rating (with non-zero rating), sorted from best to worst.
 unknown get_comment(var $article, var $comment, var $data)
          Get specific comment data for given article.
 unknown get_comments(var $id)
          Get comments for given article.
 unknown get_next(var $id, var $what)
          Return next article in an issue from given article, if any.
 unknown get_num_comments(var $id)
          Get number of comments for given article.
 unknown get_previous(var $id, var $what)
          Return previous article in an issue from given article, if any.
 unknown get_related(var $id)
          Return list of related articles.
 unknown get_special(var $id, var $restrict, var $what)
          Return detailed article data of given article.
 unknown increase_counter(var $id)
          Article display counter advancing.
 unknown insert_comment(var $comment)
          Insert article comment.
 unknown is_current(var $id)
          Test if given article id is from current issue.
 unknown update_rating(var $id, var $rating)
          Update article rating.
 
Methods inherited from class client_entity
get_by, get_image_assignment, get_image_link, get_image_tag, get_image, select_box
 

Constructor Detail

client_articles

public client_articles(var $art,
                       var $ima)
Parameters:
$art - is passed by reference
$ima - is passed by reference
Method Detail

get_adata

public unknown get_adata(var $what)
Return specified part of last loaded (with get_article) article.
Parameters:
$what - Column name from Articles.
Returns:
string

get_related

public unknown get_related(var $id)
Return list of related articles. The list is for article returned by the last get_article() call.
Parameters:
$id - Default Value: ''
Returns:
array

get_next

public unknown get_next(var $id,
                        var $what)
Return next article in an issue from given article, if any.
Parameters:
$id - Default Value: ''
$what - Default Value: 'id
Returns:
array

get_previous

public unknown get_previous(var $id,
                            var $what)
Return previous article in an issue from given article, if any.
Parameters:
$id - Default Value: ''
$what - Default Value: 'id
Returns:
array

is_current

public unknown is_current(var $id)
Test if given article id is from current issue. Use to prevent displaying of non-public articles.
Parameters:
$id - Id of an article
Returns:
string

get_special

public unknown get_special(var $id,
                           var $restrict,
                           var $what)
Return detailed article data of given article. Restriction to articles is specified as parameter.
Parameters:
$id - Id of an article
$restrict - Restrictions to apply.
$what - Columns to return: select from { Articles A, Users U, Issues I }. Comma separated.
$what - Default Value: 'A.id
Returns:
associative array

get_by_rating

public unknown get_by_rating(var $limit,
                             var $what,
                             var $where)
Return articles according to rating (with non-zero rating), sorted from best to worst.
Parameters:
$limit - Number of articles to return.
$what - Properties to get.
$what - Default Value: "A.id
$where - Default Value: ""

get_by_counter

public unknown get_by_counter(var $limit,
                              var $what,
                              var $where)
Return articles according to counter, sorted from most visited to least.
Parameters:
$limit - Number of articles to return.
$what - Properties to get.
$what - Default Value: "A.id
$where - Default Value: ""

increase_counter

public unknown increase_counter(var $id)
Article display counter advancing.
Parameters:
$id - Article id.
Returns:
number of affected rows

update_rating

public unknown 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 - Article id.
$rating - Rating to add.

get_num_comments

public unknown get_num_comments(var $id)
Get number of comments for given article.
Parameters:
$id - Article id.
Returns:
integer

insert_comment

public unknown insert_comment(var $comment)
Insert article comment.
Parameters:
$comment - Array ("article_id", "name", "subject", "email", "www", "text") with comment data. Its keys must correspond to columns in db.
Returns:
boolean, or insert id

get_comments

public unknown get_comments(var $id)
Get comments for given article.
Parameters:
$id - Article id.
Returns:
integer

get_comment

public unknown get_comment(var $article,
                           var $comment,
                           var $data)
Get specific comment data for given article.
Parameters:
$article - Article id.
$comment - Comment id.
$data - String with comma separated values of requested comment data.
$data - Default Value: "*"
Returns:
integer

delete_comment

public unknown delete_comment(var $id)
Delete specific comment.
Parameters:
$id - Comment id.
Returns:
integer

get_all_groups

public array get_all_groups(var $aid,
                            var $what,
                            var $where)
Returns all groups of given article.
Parameters:
$aid - int The 'id' value of an article.
$what - Default Value: 'G.id
$where - Default Value: ''