mgd_update_article

(Midgard 1.4.2 'Bifrost')

mgd_update_article -- Modify an article

Description

int mgd_update_article (int id, int topic, string name, string title, string abstract, string content, int author, string url, string calstart, int caldays, int icon, int view, int print, string extra1, string extra2, string extra3)

Minimum version: Midgard 1.0

Modifies the article record with the given id number. Only owners of the topic the article is located in or authors of the article are allowed to modify the record.

Returns TRUE on success, FALSE on failure.


<?php
 $id      = 123;
 if(! $article = mgd_get_article( $id )) {
   echo "Could not get article $id.<br>\n";
   echo "reason: " . mgd_errstr();
 } else {
   $article->name = "A new name for this article";
   mgd_update_article($article->id, $article->topic, $article->name,
                      $article->title, $article->abstract, $article->content,
                      $article->author, $article->url, $article->calstart,
                      $article->caldays, $article->icon, $article->view,
                      $article->print, $article->extra1, $article->extra2,
                      $article->extra3);
   $err = mgd_errno();
   if( $err ) {
     echo "Could not update article $id.<br>\n";
     echo "reason: " . mgd_errstr( $err );
   } else {
     echo "Updated article $id.<br>";
   }
 }
?>