mgd_update_article_replyto

(Midgard 1.4.2 'Bifrost')

mgd_update_article_replyto -- Link one article to another

Description

bool mgd_update_replyto (int id, int replyto)

Minimum version: Midgard 1.2.6

Links one article to another by setting the up field of the article with id id to be replyto. Reply articles can be accessed with functions like mgd_list_reply_articles(). Setting the replyto field to 0 clears the up field. Only owners of an article are allowed to modify the up field.

Returns TRUE on success, FALSE on failure.


<?php
  $article = 123;
  $replyto = 17;
  $update = mgd_update_replyto( $article, $replyto );
  if( ! $update ) {
    echo "Update of replyto field failed.<br>\n";
    echo "reason: " . mgd_errstr();
  } else {
    echo "Updated replyto field for article $article to be $replyto.";
  }
?>