November 10, 2010 in Marketplace
File Name: (SOS31) Avoid Deleting of Attachments v1.0.0File Submitter: Adriano FariaFile Submitted: 09 Nov 2010File Updated: 10 Nov 2010File Category: Hooks and Plugins
This hook will protected your board's information by avoiding that users delete their attachments! Only SUPERMODERATORS and ADMINISTRATORS can remove attachments from now on.Compatibility:
Is compatible whit ipb 3.2.x?
Probably not. Already started to update my hooks. This one will be updated asap.
cool, any eta for this?
Nope... I'm updating most wanted hooks first.
Hi Adriano ..
I need this mod and I have try to compile my first hook... I have try to extend another class :
Remove an upload
Remove an upload
class dfx32_attachremoval extends public_core_attach_attach
public function __construct()
/* Make registry objects */
$this->registry = ipsRegistry::instance();
$this->DB = $this->registry->DB();
$this->memberData =& $this->registry->member()->fetchMemberData();
$this->settings =& $this->registry->fetchSettings();
* Remove an upload
* @return @e void
public function attachmentUploadRemove()
/* INIT */
$attach_post_key = trim( IPSText::alphanumericalClean( $this->request['attach_post_key'] ) );
$attach_rel_module = trim( IPSText::alphanumericalClean( $this->request['attach_rel_module'] ) );
$attach_rel_id = intval( $this->request['attach_rel_id'] );
$attach_id = intval( $this->request['attach_id'] );
/* Setup Module */
$this->class_attach->type = $attach_rel_module;
$this->class_attach->attach_post_key = $attach_post_key;
$this->class_attach->attach_rel_id = $attach_rel_id;
$this->class_attach->attach_id = $attach_id;
/* Remove the attachment */
if ($this->memberData['g_is_supmod']) $removed = $this->class_attach->removeAttachment();
/* Show the form */
if( $removed )
$this->ajax->returnHtml( $this->attachmentUploadShow( 'attach_removed', 0 ) );
$this->ajax->returnHtml( $this->attachmentUploadShow( 'remove_failed', 1 ) );
If I manually edit the attach.php work... but whit hook not work.. where I worng?
Following this topic, would love to see this hook updated to 3.2 please.
I have Update ad improvement this hook... I publish on market place... coming soon avaiable..
Updated to 3.2:
This topic is now archived and is closed to further replies.
403 - Forbiddeen
Started 19 minutes ago
Started 56 minutes ago
Started 3 hours ago