mgd_update_article_score

Name

mgd_update_article_score -- Set the score of an article

Synopsis

bool mgd_update_article_score(int id, int score);

Description

Minimum version: Midgard 1.2 (Mad King)

Sets the score field of an article. The score field is used in functions like mgd_list_topic_articles to control the order of the returned articles. Only owners of an article are allowed to modify the score.

Returns true if successfull. Returns false on failure.

Example

<?php
 $id      = 123;
 $score = 13;
 $update = mgd_update_article_score( $id, $score );
 if(! $update ) {
   echo "Update score of article $id failed.<br>\n";
     echo "reason: " . mgd_errstr();
   } else {
     echo "Updated score of article $id.";
   }
?>