/**
* Delete Media
* @since 1.4
* @version 1.0
*/
public function delete_media($media_id)
{
// Get media details from id
$model = new RTMediaModel();
$media = $model->get_media(array('id' => $media_id), 0, 1);
if (!isset($media->media_type)) {
return;
}
// If this media type awards zero, bail
if ($this->prefs['delete_media'][$media->media_type] == $this->core->zero()) {
return;
}
// Check for exclusion
if ($this->core->exclude_user($media->media_author) === true) {
return;
}
// Only deduct if user gained points for this
if ($this->core->has_entry($media->media_type . '_upload', $media->media_author, $media_id)) {
// Execute
$this->core->add_creds($media->media_type . '_deletion', $media->media_author, $this->prefs['delete_media'][$media->media_type], $this->prefs['delete_media'][$media->media_type . '_log'], $media_id, array('ref_type' => 'media', 'attachment_id' => $media->media_id), $this->mycred_type);
}
}