Jump to content

Download: (SOS31) Avoid Deleting of Attachments v1.0.0

Featured Replies

Posted

File Name: (SOS31) Avoid Deleting of Attachments v1.0.0
File Submitter: Adriano Faria
File Submitted: 09 Nov 2010
File Updated: 10 Nov 2010
File 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
  • 8 months later...

Is compatible whit ipb 3.2.x?

Regards

  • Author

Probably not. Already started to update my hooks. This one will be updated asap.

cool, any eta for this?

  • Author

Nope... I'm updating most wanted hooks first.

  • 4 weeks later...

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

Following this topic, would love to see this hook updated to 3.2 please.

Thanks

I have Update ad improvement this hook... I publish on market place... coming soon avaiable..

Regards

  • Author

Updated to 3.2:

Archived

This topic is now archived and is closed to further replies.

Recently Browsing 0

  • No registered users viewing this page.