mgd_delete_topic

Name

mgd_delete_topic -- Delete a topic

Synopsis

bool mgd_delete_topic(int id);

Description

Minimum version: Midgard 1.1.1 (Iron River)

Deletes the topic record with the given id number. Returns true on success and false on failure. Only owners of the parent topic are allowed to remove a topic. Note that an owner of a topic may remove any of the subtopics of the topic but not the root topic he owns.

Returns true if successfull. Returns false on failure.

Also available as method delete() for topic objects starting from Midgard 1.4 (Bifrost)

Example

<?php
  mgd_errno();
  if ( !mgd_delete_topic(13) ) {
     echo "failed to delete topic 13";
     echo "reason: " . mgd_errstr(mgd_errno());
  }
?>
<?php
  if(!mgd_delete_topic(13)) {
    echo "failed to delete topic 13";
    echo "reason: " . mgd_errstr();
  }
?>
<?php
  mgd_errno();
  $del = mgd_get_topic(13);
  if (!$del) {
     echo "could not get topic 13";
     echo "reason: " . mgd_errstr(mgd_errno());
  } else {
     mgd_errno();
     $del->delete();
  }
?>