mgd_approve_article

(Midgard 1.4.2 'Bifrost')

mgd_approve_article -- Approve/unapprove an article

Description

bool mgd_approve_article (int id, bool [approve])

Minimum version: Midgard 1.2.5 (Mad King)

Approves/unapproves the article id. The optional boolean parameter approve, which defaults to TRUE, specifies wether to approve or unapprove the article. The group of the user must be the owner of the article. Upon approval, the function sets the date of approval to the current date and the approver to the user calling the function. Unapproval clears both fields.

Returns TRUE on success, FALSE on failure.


<?php
 $article = mgd_get_article(123); // article with id 123 must exist.
   if(! mgd_approve_article( $id )) {
     echo "Could not approve article $id.<br>\n";
     echo "Reason: " . mgd_errstr(); . "<br>\n";
   } else {
    echo "Approved article $id.<br>\n";
   }
 }
?>