Adriano Faria Posted November 10, 2010 Share Posted November 10, 2010 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:IP.Board 3.1.3+Click here to download this file Link to comment
Deltafox Posted July 23, 2011 Share Posted July 23, 2011 Is compatible whit ipb 3.2.x? Regards Link to comment
Adriano Faria Posted July 23, 2011 Author Share Posted July 23, 2011 Probably not. Already started to update my hooks. This one will be updated asap. Link to comment
Adriano Faria Posted July 28, 2011 Author Share Posted July 28, 2011 Nope... I'm updating most wanted hooks first. Link to comment
Deltafox Posted August 25, 2011 Share Posted August 25, 2011 Hi Adriano .. I need this mod and I have try to compile my first hook... I have try to extend another class :public_core_attach_attach.attachmentUploadRemove() Remove an upload public Returns: void In this way : class dfx32_attachremoval extends public_core_attach_attach { protected $registry; protected $DB; protected $memberData; protected $settings; 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; $this->class_attach->init(); /* 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 ) ); } else { $this->ajax->returnHtml( $this->attachmentUploadShow( 'remove_failed', 1 ) ); } } } If I manually edit the attach.php work... but whit hook not work.. where I worng? Regard Link to comment
burm Posted August 30, 2011 Share Posted August 30, 2011 Following this topic, would love to see this hook updated to 3.2 please. Thanks Link to comment
Deltafox Posted August 31, 2011 Share Posted August 31, 2011 I have Update ad improvement this hook... I publish on market place... coming soon avaiable.. Regards Link to comment
Adriano Faria Posted September 1, 2011 Author Share Posted September 1, 2011 Updated to 3.2: Link to comment
Recommended Posts
Archived
This topic is now archived and is closed to further replies.