Invision Community 4: SEO, prepare for v5 and dormant account notifications Matt November 11, 2024Nov 11
Posted February 4, 20196 yr It's possible to create a plugin which the member need to react, on Download App, to download the file? For example, the guests can download just ONE file without react, but when they register, they need to react the file to download it!. I suggest to create the permissions to select the group which need to react to download the file! Similar to hide link and codes (they need to react or reply to see the hidden content), on the Download App, but just react it! Thanks. ❤️
February 4, 20196 yr 3 minutes ago, 403 - Forbideen said: It's possible to create a plugin which the member need to react, on Download App, to download the file? For example, the guests can download just ONE file without react, but when they register, they need to react the file to download it!. Similar to hide link and codes (they need to react or reply to see the hidden content), on the Download App, but just react it! Thanks. ❤️ Sure - it'd be a simple hook on \IPS\downloads\File: public function downloadCheck( array $record = NULL, \IPS\Member $member = NULL ) { $member = $member ?: \IPS\Member::loggedIn(); if ( $member->member_id AND !$this->reacted( $member ) ) { throw new \DomainException( 'download_no_react' ); } return parent::downloadCheck( $record, $member ); } For guests, you could either track if they've downloaded via cookie (which has limitations), or just use the built-in limit settings:
February 4, 20196 yr Author 13 minutes ago, Ryan Ashbrook said: Sure - it'd be a simple hook on \IPS\downloads\File: public function downloadCheck( array $record = NULL, \IPS\Member $member = NULL ) { $member = $member ?: \IPS\Member::loggedIn(); if ( $member->member_id AND !$this->reacted( $member ) ) { throw new \DomainException( 'download_no_react' ); } return parent::downloadCheck( $record, $member ); } thank you <3, but how can i select the group needs to react to download?
February 4, 20196 yr Author if someone can help me, i don't know how to create a plugin, anyway, thanks for any help.
February 4, 20196 yr We have a great documentation section https://invisioncommunity.com/developers/docs/development/plugins/overview-of-plugins-in-ips4-r41/ with a complete example plugin
February 4, 20196 yr Author 37 minutes ago, Daniel F said: We have a great documentation section https://invisioncommunity.com/developers/docs/development/plugins/overview-of-plugins-in-ips4-r41/ with a complete example plugin wooah, thank you, try to make one ❤️
February 5, 20196 yr Author 5 hours ago, Daniel F said: We have a great documentation section https://invisioncommunity.com/developers/docs/development/plugins/overview-of-plugins-in-ips4-r41/ with a complete example plugin i cant create, i really don't know how to do this, if anyone helps, but anyway, thanks for helping Daniel.
Archived
This topic is now archived and is closed to further replies.